B&B Electronics VFG3000 - Manual User Manual
Page 192

S
IMPLE
M
ATH
V
LINX
F
IELDBUS
G
ATEWAY
M
ANAGER
U
SER
M
ANUAL
P
AGE
176
T
AG
V
ALUES
The value of a tag is represented in an expression by the tag name. Upper-case and lower-case
characters are considered equivalent when finding the required tag. Also, once an expression
has been entered, any changes to the name of the tag will modify all of the expressions that
make reference to it, so there is no need to re-edit the expressions to “fix” the name.
C
OMMUNICATIONS
R
EFERENCES
References to registers in master communications devices can be entered into an expression
by means of a syntax comprising an opening square bracket, the register name, and a closing
square bracket. An optional device name may be prefixed to the register name and separated
by a period. The device name need not be specified for registers in the first (or only) device
within the database. Examples of this syntax are shown below…
E
XAMPLE
M
EANING
[D100]
Register
D100 in first device.
[AB.N7:0]
Register
N7:0 in device AB.
[FX.D100]
Register
D100 in device FX.
S
IMPLE
M
ATH
As mentioned above, expressions often contain more than one data value, with their values
being combined mathematically. The simplest of these expressions may add a pair of values,
while a more complex expression might obtain the average of three values. These operations
are performed using the familiar syntax you will have seen in applications such as Excel. The
examples below show the basic operations that can be performed…
O
PERATOR
P
RIORITY
E
XAMPLE
Addition
Group 4
Tag1 + Tag2
Subtraction
Group 4
Tag1 - Tag2
Multiplication
Group 3
Tag1 * Tag2
Division
Group 3
Tag1 / Tag2
Remainder
Group 3
Tag1 % Tag2
Although the examples show spaces surrounding the operators, these are not required.
O
PERATOR
P
RIORITY
You will have noticed the Priority column in the above table. As you no doubt recall from
your algebra classes, when several operators are used together, they are evaluated in a defined
order. For example, multiplication is always evaluated before addition. Fieldbus Gateway
Manager implements this ordering by means of what are known as operator priorities, with
each operator being put in a group, and with operators being applied in order from the lowest
numbered group to the highest. (Except where noted otherwise in the text, operators within a
group are evaluated left-to-right.) The default order of evaluation can be overridden by using
parentheses.