+2 votes
213 views
in Modeling by Ioannis Poursanidis (71 points)
Why am I able to use the Control Commands section in the Code Editor with particular SCADA elements and not with others?

e.g., When using a 'Slider macro widget' I can use the Control Commands section, while with the 'Digital display widget' the Control Commands are greyed out?

Thanks

1 Answer

+3 votes
by Dusan Kostic (258 points)
selected by Dimitrije Jelić
 
Best answer

Hi Ioannis,

In the HIL API documentation, next to the each API function, you have the "Availability" section with the three contexts:
1. standalone scripts
2. macro scripts signal
3. monitoring expressions

Depending on the nature of the specific API function, some of the contexts may not be available. 

Regarding your specific question about why are certain API functions available in the Action widgets, and not in the Monitoring widgets: from my experience, this is usually the case for the functions that actively modify the simulation (functions as such as set_scada_input_value()). 

On the other had, functions that only read from the simulation (such as read_analog_signal()) are allowed in all widget types.

In my opinion, this distinction also makes sense in terms of clear SCADA panel organization. For example, If I see that my SCADA panel is periodically sending certain command, I would assume that it is done in the Macro widget, rather than in the Digital Display widget. If any widget is allowed to send commands, it may become tricky to debug complex SCADA panels.

Regards

...