# Condition Scripts similiar to what Wonderware InTouch offers

**URL:** <https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094>\
**Category:** Ignition\
**Created:** [August 1, 2010, 7:23pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094 "2010-08-01T19:23:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![RRNut](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@RRNut](https://forum.inductiveautomation.com/u/RRNut)\
**Post date:** [August 1, 2010, 7:23pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/1 "2010-08-01T19:23:51Z")

</div>

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!!!

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [August 2, 2010, 8:59pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/2 "2010-08-02T20:59:55Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![RRNut](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@RRNut](https://forum.inductiveautomation.com/u/RRNut)\
**Post date:** [August 4, 2010, 9:09pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/3 "2010-08-04T21:09:29Z")

</div>

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

Keep up the good work guys!!!

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [August 4, 2010, 9:39pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/4 "2010-08-04T21:39:33Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [August 5, 2010, 5:30pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/5 "2010-08-05T17:30:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AutomationNC](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@AutomationNC](https://forum.inductiveautomation.com/u/AutomationNC)\
**Post date:** [December 3, 2010, 9:25pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/6 "2010-12-03T21:25:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [December 3, 2010, 10:54pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/7 "2010-12-03T22:54:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AutomationNC](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@AutomationNC](https://forum.inductiveautomation.com/u/AutomationNC)\
**Post date:** [December 7, 2010, 4:00pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/8 "2010-12-07T16:00:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [December 7, 2010, 4:16pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/9 "2010-12-07T16:16:20Z")

</div>

Sure, take a look at this following page in the user manual [http://www.inductiveautomation.com/support/usermanuals/ignition/event\_types.htm](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.

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [December 7, 2010, 7:43pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/10 "2010-12-07T19:43:21Z")

</div>

[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.

---

<div class="post-metadata">

**Author:** ![AutomationNC](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@AutomationNC](https://forum.inductiveautomation.com/u/AutomationNC)\
**Post date:** [December 10, 2010, 3:39pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/11 "2010-12-10T15:39:44Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![dep05d](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@dep05d](https://forum.inductiveautomation.com/u/dep05d)\
**Post date:** [December 10, 2010, 3:48pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/12 "2010-12-10T15:48:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AutomationNC](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@AutomationNC](https://forum.inductiveautomation.com/u/AutomationNC)\
**Post date:** [December 10, 2010, 9:26pm UTC](https://forum.inductiveautomation.com/t/condition-scripts-similiar-to-what-wonderware-intouch-offers/2094/13 "2010-12-10T21:26:22Z")

</div>

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.
