With the newly released WinScript Live 5.10.0, both a new “If” event and a new sequence trigger type have been added that allow you to evaluate multiple variables at the same time, and gain access to new boolean logic operators. Let’s take a look at both of these new features in more detail:
Trigger Type “when an expression becomes true”: A logical expression that uses variables and i/o resources to determine if the trigger should activate.
To use this new trigger type, simply add it as you would any other trigger. Double click the Triggers column in the sequence you want to add it to. The Sequence Triggers dialogue will appear, then select Start a Sequence “when an expression becomes true”.
Once that has been selected, you will see the Expression dialog box appear. Here, you can enter your expression. In our example, we want our sequence only to be triggered when the V16X.seconds variable is equal to 30, and when Output1 is in the ‘on’ state. At the end of this blog post, we will list which boolean operators you may use, along with their syntax.
To test your logical expression, click the “Test” button in the lower right hand corner. Here, without connection to a controller, you’ll be able to test your logic out. In the screenshot below, you can see that although Output 1 is in the on/true state, the expression is still False because the V16X.seconds variable is equal to 29, not 30.
Once V16X.seconds is equal to 30 (and Output1 is still in the on/true state) then you will see the expression becomes true, and the sequence will be triggered! If you are in Live Mode, the variables listed in this Test dialogue will update in real time.
The new “If” Event
We can bring the powerful logic mentioned above directly into sequences now as well using the new “If” Event.
The new “If” event conditionally executes events based on an expression… If an “Else” or “End If” event is used, events are executed inside the area between the “If” and the “End If” when the condition is true.
Multiple conditions can be tested by a single expression using any combination of variables and I/O resources. The expression must be a string wrapped in quotes. Your expression must be 255 characters or less (excluding quotes), may contain unlimited literals and constants, and up to 8 variables of any type (show, device, etc). However, all variables must be numerical (Integer, Decimal, Boolean, etc.) String variables are not supported.
In this example, we have written an expression that if output1 and output2 are both in the on state, output3 will be turned on:
Below is a list of the operators that can be used in the new trigger and If statement:
< Less Than
<= Less Than or Equal To
> Greater Than
>= Greater Than or Equal To
== Equal To
!= NOT Equal To
If you have any additional questions, please contact [email protected]