How to reference InputOutputManager in scripting

Discuss issues and ideas you have to configuring displays with PowerVision
cconner_aie
Posts: 93
Joined: Thu Jun 11, 2015 10:12 am

How to reference InputOutputManager in scripting

Post by cconner_aie » Wed Nov 16, 2016 10:02 am

I would like to know the proper way to reference the Input Output Manager in scripting. I know from previous release notes that the only way to manipulate the outputs is through the Input Output Manager but this does not work.

Code: Select all

SendAction(ApplicationIDs.IO, ActionIDs.IO_Digital_Output_High, VariableIDs.IO_DO2_Start);
Where VariableIDs.IO_DO2_Start is my variable assigned to the start signal output on Digital Output 2. I'm using a text widget on the page with a visible condition set as so:

Use Variable: IO_DO2_START
Min: 1, Max: 1
Include Max Value in range check (<= vs <)

Which never comes on, although if I do check 'Show This Item When Data is Invalid' it will show all the time which makes me think I can't look at IO_DO2_START as a visible condition. If I uncheck the 'Allow Invalid' on the variable, the visible condition never shows the text. I'd like this cleared up as well if you would.

I see in another post that there is an undocumented object named PageViewIDs, so I assume there is an object with reference to Digital Output 2 that I'm not aware of.

Code: Select all

SendAction(ApplicationIDs.UIApp, ActionIDs.UIApp_Show_View, PageViewIDs.Menu_Test_Page_4 );
By undocumented, I mean it is not mentioned in the Function Reference tab inside the script or in the 2.8 documentation from this post viewtopic.php?f=3&t=1165. Unless I'm blind, which is entirely possible.

Thanks,
Coleby Conner
Controls Engineer, Anderson Industrial Engines
cconner_aie
Posts: 93
Joined: Thu Jun 11, 2015 10:12 am

Re: How to reference InputOutputManager in scripting

Post by cconner_aie » Wed Nov 16, 2016 10:28 am

Answered my own question but leaving this here in case anyone else stumbles upon this post. I remembered seeing some things under the Applications tabs in the past that hint at more detailed functionality that I hadn't seen in the documentation so I took a look.

Image

Under the Input Output Port Manager Actions, you can see a column for Action Data. So 'IODigitalOutputIDs.Digital_Output_2' is what I was looking for.

I'm slowly learning all the in's and out's of Power Vision, thanks for all the help so far and sorry for all the questions!

Thanks,
Coleby Conner
Controls Engineer, Anderson Industrial Engines
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: How to reference InputOutputManager in scripting

Post by stalley » Wed Nov 16, 2016 11:33 am

Hi,

I think it is great that Coleby was able to find the answer to his question just by going to the Application tab and looking there, good intuition.

I would like to take this opportunity to bring attention to some of the work that has been done in the 2.8 patch releases on the reference manuals and the Function Reference tab in scripting. I doubt we could get everything correct in the reference manuals, but I think the "undocumented" are now documented, for 2.8. To be accurate though, both items mentioned in this post as "undocumented" have been documented in the Function Reference since early 2.7 releases.

The Function Reference has always been organized by application. I'm not sure what order they are in though, since it starts with Modbus followed by CCM. It isn't alphabetic and it doesn't match the order on the Application tab. Minor detail though. The important information should be in the Function Reference now. I agree it would be helpful if the applications were organized in a better order and very nice if we could ctrl-f to search... hmmm.

In particular for this topic, the Input Output Manager section of the Function Reference is in between the Database Manager (NVMgr) and the Data Logging (Datalogger). The Input Output Manager objects are all listed with a brief description of what they represent.

If an application has functions that we can use in a script, there is a section under the application for the functions.

I encourage you to look in the Function Reference at all that scripting has available now, there are a lot of list functions and more!

Thank you all for using and supporting PowerVision Configuration Studio. We are looking forward to new and exciting changes as the company changes, we hope you are also!
Sara Talley
Software Engineer
Enovation Controls
cconner_aie
Posts: 93
Joined: Thu Jun 11, 2015 10:12 am

Re: How to reference InputOutputManager in scripting

Post by cconner_aie » Wed Nov 16, 2016 3:33 pm

Wow, you are right. It's right there.

Image

Thanks for pointing it out, I must of scrolled right past it when I was looking for it. Ctrl+F would be really nice!

Thanks again for you help Sara.
Coleby Conner
Controls Engineer, Anderson Industrial Engines
rivlin_2
Posts: 1
Joined: Wed Mar 08, 2017 6:45 am

Re: How to reference InputOutputManager in scripting

Post by rivlin_2 » Thu Jul 20, 2017 10:00 am

Hi

On the same subject: I would like to reference a text widget by using a script.
What is the line of code required tם hide / show a text widget ?

Thanks,

Yonatan
boyce
Enovation Controls Development
Enovation Controls Development
Posts: 322
Joined: Wed Sep 08, 2010 5:09 pm

Re: How to reference InputOutputManager in scripting

Post by boyce » Thu Jul 20, 2017 10:28 am

The widget must have the included in programming option. Show Advanced will show this option.
hidethewidget.JPG
hidethewidget.JPG (42.16 KiB) Viewed 80 times
Here's the script code. The ScreenProcess action has to be called (only required for iMx displays).

Code: Select all

//---------------------------------------------------------------------------------------------
// Murphy Scripting
// - Leave EventName as $Hide the Widget$ for main script method
//---------------------------------------------------------------------------------------------
void $Hide the Widget$ () 
{
	screenApiHide(ScreenObjectIDs.Text_Widget_ABC);
	SendAction(ApplicationIDs.Screen, ActionIDs.Screen_Process, ActionData.Empty );
}
Boyce Schrack
Enovation Controls