tenWare Software

tenScripting Triggers

The typical way to debug scripts using tenScripting is to select the script and entry point, enter any parameters, and click the Run button.  There are times, however, when you want to test how a script would run from a HS Event that is executed because of a device status or value change (for instance, when someone presses a button).  tenScripting allows you to specify multiple triggers that will run a specific script when a specified device's status or value changes.

To define a trigger, click the Edit Device Triggers button to open the Triggers dialog box.  You must uncheck Enable Triggers for the Edit Device Triggers button to appear. 

Triggers Dialog Box

The dialog box above shows a single trigger defined that triggers when device a5 status changes.  It will run script ComplexSamples.ToggleDeviceSample with a parameter of A1.

Use the dialog box to add additional triggers. To delete a defined trigger, select it and click Delete Selected Trigger. To modify an existing Trigger, first delete it.  The fields will be populated with the values from the deleted trigger so you can modify the fields and re-add it.

Once you have created one or more triggers, you can then check Enable Triggers.  As long as tenScripting is running, the scripts will continue to trigger as devices' status and values change.