User`s guide
Numeric Expressions
In almost all situations where a numeric value of a variable can be used, a numeric
expression can also be used. The following examples all result in x having the same value.
x = 3
x = 6/2
x = SQRT(9)
x = SQR(2) - 1
x = 9 MOD 6
Logical Expressions
V+ does not have a specific logical (Boolean) data type. Any numeric value, variable, or
expression can be used as a logical data type. V+ considers 0 to be false and any other value
to be true.
Logical Constants
There are four logical constants, TRUE and ON that will resolve to -1, and FALSE and OFF
that will resolve to 0. These constants can be used anywhere that a Boolean expression is
expected.
A logical value, variable, or expression can be used anywhere that a decision is required. In
this example, an input signal is tested. If the signal is on (high) the variable dio.sample is
given the value true, and the IF clause executes. Otherwise, the ELSE clause executes:
dio.sample = SIG(1001)
IF dio.sample THEN
; Steps to take when signal is on (high)
ELSE
; Steps to take when signal is off (low)
END
Since a logical expression can be used in place of a logical variable, the first two lines of this
example could be combined to
IF SIG(1001) THEN
Functions That Operate on Numeric Data
For a summary of V+ functions that operate on numeric data, see the section Numeric Value
Functions on page 147.
Real and Integer Data Types
(Undefined variable: Primary.Product_Name_V)Language User's Guide, version
17.x
Page 103










