<< Click to Display Table of Contents >>
Tag Configuration |
Use the next syntax to configure Tags in Elipse E3, Elipse Power, or Elipse Water:
•Device: Not used
•Item: This field must use the next syntax
<Topic>[;<Template>[;<Param>]]
Or
<Topic>[(Deadband:<Absolute Deadband>)][(Deadband:<Relative Deadband>%)]
The ! (exclamation point) character can be used before the <Topic> to indicate an exception to the Associated Topic Template option.
In which:
•<Topic>: Address of an item or topic on a client's database. According to MQTT standard, each item on a client's database can correspond to a free data set, transmitted in Text format. Topics can be organized in a tree, and in this case users must use a slash mark to separate levels, according to the next example.
"station12/pump01/pressure1"
"station12/pump01/pressure2"
A client can also use a number sign (#) and a plus sign (+) to address topics. In the first case, it must be added to a response's request all items containing in its name the current item or the children of the current item. For example, the value "station12#" returns the next values.
"station12/pump01"
"station12/pump01/pressure1"
"station12/pump01/pressure2"
"station12/pump02"
"station12/pump02/pressure1"
"station12/pump02/pressure2"
In the second case, it must be added to a response's request all items on the same level of the current item. For example, the value "station12/pump01/+" returns the next values.
"station12/pump01/pressure1"
"station12/pump01/pressure2"
•<Template>: Informs the name of a Template used as a model to interpret data from a message, with the purpose of mapping fields in a message for Tags (timestamp, quality, and values). This Template must be registered on the Templates tab
•<Param>: Informs the name of one of the Template's parameters, if this Tag must receive only one of the parameters
•<Absolute Dead Band>: Dead band as an absolute value, applied when writing numerical values
•<Relative Dead Band>: Dead band as a relative value, applied when writing numerical values
The next table contains examples of addressing messages.
Examples of addressing
Item |
Description |
---|---|
"station12/pump01" |
In this case the message read or written for the item is a Text-type Tag (String) without any processing |
"station12/pump01;pumpdata" |
Applies a pumpdata Template to the content of station12/pump01. If that Template describes more than one value, users must use a Block Tag in which each Block Element is a value from that Template |
"station12/pump01;pumpdata;V1" |
Same case as the previous one, but retrieving only the first value of the Template and linking it to a Tag, which does not need to be a Block Tag. In this case the Template must describe the V1 value. For more information, please check the Template tab on topic Driver's Configuration Parameters |
"station12/pump01(Deadband:0.5)" |
If the current value of this topic is a number and a new number value is written to this Tag, then this new value is only published if the difference between the current value and the new value is equal to or greater than 0.5 |
"station12/pump01(Deadband:5%)" |
If the current value of this topic is a number and a new number value is written to this Tag, then this new value is only published if the difference between the current value and the new value is equal to or greater than 5% of the old value |
"station12/pump01(Deadband:0.5)(Deadband:5%)" |
If the current value of this topic is a number and a new number value is written to this Tag, then this new value is only published if the difference between the current value and the new value is equal to or greater than 0.5 or equal to or greater than 5% of the old value |
NOTE |
When a dead band is configured directly in a Tag, this Tag must not be associated to a Template. In this case, the dead band configured on the Publish tab of this Driver's configuration window is ignored for this Tag. |
To overcome an absolute dead band, the next condition must be met.
|(Current Value) - (New Value)| ≥ (Absolute Deadband)
To overcome a relative dead band, the next condition must be met.
|(Current Value) - (New Value)| ≥ |(Current Value)| * (Relative Deadband) / 100%
If a Tag is configured simultaneously with both absolute and relative dead bands, meeting any of the previous conditions triggers the publication of the value.
If an information appears in more than one message and a Tag must receive values from all those messages, users can specify an array of addresses, according to the next syntax.
["Topic1;Template1;Param1","Topic2;Template2;Param2","Topic3;Template3;Param3"]
For example, suppose that a device sends a message 1 that contains values A, B, and C and a message 2 that contains values D, E, F, and B again, in this order. If users want a Tag to receive B values coming from any of the messages, configure the array in the next format.
["device023/msg1;template1;V2","device023/msg2;template2;V4"]
In this case, the second value configured in template1, received in topic device023/msg1, and the fourth value configured in template2, received in topic device023/msg2, are sent to this Tag.
NOTE |
Users can repeat topics, such as two or more Tags using the same topic, but one of the other parameters, template or param, must be different. |
Examples of Tags:
Tag1: "device023/msg1" - OK
Tag2: "device023/msg1;T1" - OK
Tag3: "device023/msg1;T1;V2" - OK
Tag4: "["device023/msg1;T1;V2","device023/msg1;T1;V3"] - Not accepted. The first element repeats Tag3
When this Driver needs to publish messages to other clients, perform a Tag writing. If a Tag does not have a linked Template, then the informed value is sent to the topic. In this case, if it is a number value, this value is converted to text. If it is already a text, it is sent unchanged.
If a Tag contains a linked Template, then the declared variables inside that Template are filled with the values from the Tag and then sent. Notice that, when using a simple Tag, the Template must have only one variable declared. If more than one variable is needed, use a Block Tag, in which each Block Element corresponds to a variable inside the Template, in the same order.
To execute a writing to a Block Tag, the application must write the whole Block Tag, by using the Write method in a script. To do so, first configure the value of each one of the Elements and then write the whole Block Tag. The AllowRead and AllowWrite properties must be configured with the False value. The next code contains an example of writing a Template with 3 (three) variables.
Set Block1 = Application.GetObject("DriverMQTT").Item("Block1")
Block1.Item("Elemento1").Value = 123
Block1.Item("Elemento2").Value = "Abnormal Situation"
Block1.Item("Elemento3").Value = 555
Block1.Write 1 ' synchronous writing, 2 = asynchronous writing