Triggers
Last updated
Last updated
A data tag can be associated with many different triggers. Triggers can be used to trigger an event to be raised (e.g. raise event equipment status starved when rpm value is greater than 250). A trigger will only raise this event when the evaluation script for the trigger is true for the first time. It will not be able to trigger again until the evaluation script is false again.
Navigate to the edge data tag and find the table with the title Edge Trigger. Find the create button on the top right.
Click the +Create button; this will open a new pop-up config window.
In the pop-up window, complete the following:
Event Type - The desired event that should be raised when the trigger is triggered
Evaluation Script - The cause for the trigger to activiate where 'value' is the value of the tag at evaluation (see more here)
e.g. value > 1, 5 < value && value < 20 , value == 8
Active - If you want to include this trigger in the poll cycle. Setting to inactive will cause TilliT Edge to not evaluate the trigger.
Minimum Duration - Specify how long (in minutes) the evaluation script must be true before TilliT Edge triggers the chosen event. Setting to 0 will trigger the event immediately upon the evaluation script being true
Requires Running Order - Will only raise the trigger if the order is running. This is useful in scenarios where the evaluation script is true while an order is not running. WIth this set to true, the event will only raise once the order becomes running.
Click Save and close".
An evaluation script is simply an expression that when true will cause an event to fire. The script support all types of math operators to help define the exact behaviour you require.
There are many TilliT keywords that can be used in your script to substitute an Edge Data Tag value. These are shown below.
value: is replaced with the current value that was read by this tag
lastvalue: is replaced with the previous value that was read by this tag
tag['id']: is replaced with the current value that was read by the specified tag id
now: is replaced with the current unix time in milliseconds
dayOfWeek: is replaced with the current day of the week as a number (0-6)
hours: is replaced with the number of hours into the local day it is
minutes: is replaced with the number of minutes into the local day it is
day: is replaced with the number of days into the month
order.fieldName: is replaced with the corresponding fieldName of the current running order. See the bottom of this page for available fields
orderAttr.attrName: is replaced with the corresponding value of attrName of the current running order.
prevOrder.fieldName: is replaced with the corresponding fieldName of the previous running order.
prevOrderAttr.attrName: is replaced with the corresponding value of attrName of the previous running order.
So how would these be applied? Well for a simple use case where we want the script to evaluate true when the product count exceeds a theshold then we can use
When we need an event to occur every 500 bottles, we can use
But not every order is going to have the same size and it would be better to use a percentage of total bottles produced. To create an event at 50% of produced goods, we use two tags in an evaluation. Here is an example
Here we see value which is the current number of produced goods, we divide by quantityTarget, which is current running order target inside TilliT. This results in a percentage, and will create an event when it exceeds 50%.
To extend this, say we know that a specific equipment tag should always be increasing while the machine is operational, then we can do the following check to ensure an event is created whenever this is not true.
This will give the desired effect where when the machine is running(tag['15'] is true while running) AND the value read was less then the last value, then evaluate true and trigger an event. Use this with minimum duration to evaluate over more then one data point before firing. You can find the ID of a tag inside the edge configuration settings of the datasource. NOTE: The tag id can be from a seperate data source but not from a sperate edge device.
If your use case is quite advanced, take a look at this documentation of all available function and operators that are available to use
batchNumber
defaultRunRate
name
operation
orderDate
orderNumber
quantityTarget
quantityCompleted
quantityRejected
actualChangeoverDuration
currentRate (pass 3 hours)
quality (percentage from 0 - 1)
performance (percentage from 0 - 1)
availability (percentage from 0 - 1)