Condition Scripts similiar to what Wonderware InTouch offers

Wonderware InTouch offered “CONDITION” scripts. Each CONDITION script had 4 components:

  1. On True - a one shot on a false to true transition
  2. On False - a one shot on a true to false transition
  3. While True - a script that ran at a specified interval while a condition was true
  4. While False - a script that ran at a specified interval while a condition was false

These were used extensively in most projects. Your feedback would be appreciated on the possibility of implementing a feature similiar to this.

Keep up the outstanding work guys!!!

I like this idea… I suppose this could be implemented as options on the “tag change scripts” that currently exist for both the gateway and clients.

Regards,

I forgot to mention that the above scripts were based on an expression, not just a single tag.

Keep up the good work guys!!!

For what it’s worth, you could (kind of) work something up like this right now- create an expression tag, and then use a tag change script. If the first thing you do is check that the value is true or false, you can determine your rising or falling edge, more or less. I say “kind of” and “more or less”, because there are other things like changing qualities that might trigger these events. This feature would do a bit more work to make sure it was triggering only at the correct time. Still, with a little bit of ingenuity in either your expression or script, you might be able to get really close.

Regards,

This is a good idea. The while true / while false scripts would be easy to write using a timer script, but the on true / on false scripts might be tricky to get correct right now, as transitions may be cumbersome to detect reliably. I’ve added this to the feature request system.

Another thing that wonderware offers is scripts based on a window opening, closing, and periodic scripts based on the window being open. Is there any way to fire a script when a window opens or closes?

Yes, windows have an activated, closed, closing, deactivated and opened event handlers that you can respond to.

Travis,
Thats good to know! Can you point me to the best way to make use of these events?

Sure, take a look at this following page in the user manual http://www.inductiveautomation.com/support/usermanuals/ignition/event_types.htm. Basically, you just select the window in the project browser you want to add the script to and press Ctrl-J which brings up the event handlers window. There you can select one of the internalFrame events to write a script for. Hope this helps. I can help more if I had an idea of what you are trying to accomplish.

[quote=“RRNut”]Wonderware InTouch offered “CONDITION” scripts. Each CONDITION script had 4 components:

  1. On True - a one shot on a false to true transition
  2. On False - a one shot on a true to false transition
  3. While True - a script that ran at a specified interval while a condition was true
  4. While False - a script that ran at a specified interval while a condition was false

These were used extensively in most projects. Your feedback would be appreciated on the possibility of implementing a feature similiar to this.

Keep up the outstanding work guys!!![/quote]

Id love to see this. This was very very very useful in wonderware.

Travis - Wow! I just saw your reply and checked it out. My question was more academic than immediate need. Now I have to ask, and as we are in the wish list area, why Ctrl-J? Why not have it show up with a right click like other components? I would have stumbled on this long ago if it had been a right click. Thanks for pointing me to it!

Hi Russell,

You can also get to the window event handlers by right clicking on the titlebar of that window while it’s open in the designer.

Dan

Yeah I went to talk with someone else here about accessing the events and by doing that saw all the many and wonderful ways to access the window events. I had my right-click blinders on and did not even think to look at one of the other ways to access the events. I still think it would be worth adding to the right click menu.