RTLE

EVALUATE - ANY (See more here)

EVALUATE(EXPRESSION)
  • EXPRESSION - A string expression that can be evaluate to a result. Expressions can reference other tags current or previous value. The result can be of any type(string, number, boolean, null, etc).

e.g. EVALUATE('5 + 5') - the value of this tag will always be 10.

e.g. EVALUATE('tag['5'] * 100') - take the value of whatever the value of tag with id 5 is and multiply by 100.

How to Use

As previously explained for datasource addressing, the Simulator is able to utilise a tag address of EVALUATE() to define simple operations that can act as a completely seperate tag. Here we will discuss how this can be used to achieve a reliable and effective RTLE. This allows you to create simple transformations of raw data, without the need to change PLC programming. This document will start with a basic guide on the options that are available to the EVALUATE tag, then some examples of their usages.

Value

Any tag current value can be referenced using the `value` keyword. TilliT Edge will evaluate all dataTags that are not connected to a simulator first, and then evaluate each simulator tag one by one. What this means is that when referencing values outside of you simulator, they will always be up to date. But any subsequent tags in the simulator cannot be referenced. An example is the following where both tags are in the same simulator datasource

tagId 5 has EVALUATE(value['10'] / 10 == 5) 
tagId 10 has EVALUATE(5 + 5)
Cannot be done because tag id 10 is evaluated after tag id 5

LastValue

Any tag previous value can be reference using the `lastvalue` keyword.

Examples

For a scenario, we have a machine tag of id 67 which represents the state of a machine via an integer. See the below guide

1

Equipment Running

2

Equipment Faulted

3

Equipment Blocked

4

Equipment Stopped

5

Equipment Starved

It is trivial to setup triggers for the events, where an evaluation expression for equipment running would be value = 1. But we need to be able to assign templates to these tags. The EQUIPMENT_STATUS_* template expects a boolean to represent the state of the machine, not an integer. We can utilise the RTLE to create new tags that convert this one integer tag into multiple boolean tags. See below for the configuration.

Here you can see we utilise a Ternary operator to evaluate what the value of our machine state is when converted to a boolean. We have also added extra logic for the Equipment Stopped state, where both the machine faulted and machine stopped state will be processed as a stopped event. Each tag is then hooked up to a trigger of value > 0 with the respective event type.

Last updated