Super Systems 9130 Series User Manual

Page 59

Advertising
background image

Series 9130 Operations Manual Rev -

58

The 9220’s Modbus registers can be used as input variables in the equations without restriction. To protect
the instrument, Modbus registers are restricted as output registers.
Modbus registers are designated by an upper or lower case “M” followed by a number.

Note – The standard Modbus routine is called to retrieve the Modbus variable, therefore a 0x8000 (-32768)
will be returned for an invalid register

.

Note – Modbus registers are stored with integer values, so adjustments will need to be made for decimal
values

.

If the instrument can have external analog input boards, or the instrument is a Video Recorder or DAQ,
these inputs can be accessed directly as A1 through A40. By using the “A” designation, the Modbus register
number is not needed and the variable is scaled to the correct value (decimals included) based on the input
type specified.
In a Video Recorder, the slave instrument data slots can be defined as variables D1 through D32. D31 and
D32 are extra slots and have no restrictions as output variables. D1 through D30 are shared with the first
ten (10) slave instruments in groups of three (3) – PV, SP, PO – and caution should be used when assigning
as outputs.
A line in the program of the instrument calculation must start with a variable or a keyword.
Variables must be followed by an equal sign (=) and then an expression. The expression can be a simple
assignment (V1 = 3) or a variable operation variable as described below (V1 = M225 * 0.1).
Keywords

MUST

be entered in capital letters only.

The list of valid keywords is: IF, ELSE, ENDIF, QUE, RLY, and END.
“IF” must be followed by an expression which is a variable, relationship operator, then variable.
The list of valid relationship operators is: > (Greater Than), < (Less Than). = (Equals), >= (Greater Than or
Equal To), <= (Less Than or Equal To), != (Not Equal To), and == (Equal To).

Note – The “=” and “==”

relationship operators are identical

.

The list of valid bitwise operators is: & (AND), | (OR), ^ (XOR), << (Left Shift), and >> (Right Shift).
The result of the “IF” relationship test determines if the lines following the “IF” statement will be executed
or not.
The “ELSE” and “ENDIF” must be on a line by themselves. “ELSE” will toggle the program based on the
result of the “IF” test. “ENDIF” will close out the “IF”.
Example:
IF V1 >= 30
V3 = V2 * 1.5
ELSE
V3 = 5
ENDIF
In this example, if the value in V1 is greater than or equal to 30, then the value of V3 will be the value of V2
multiplied by 1.5. If the value in V1 is less than 30, the value of V3 will be 5.

EVERY

“IF” must have a closing “ENDIF”. However, the “ELSE” is optional.

The “QUE” is used to send data to a slave instrument and must have three (3) variables separated by
spaces. The first is the slave instrument number, the second is the register number, and the third is the
data to send.
Example:
QUE 3 1129 V1
This example will send the value of V1 to register 1129 on instrument 3.
The “RLY” is used to control a relay if the relay assignment is 999. The “RLY” must be followed by a
variable which is the relay number (1 – 8) and a relationship expression.
Example:
RLY 5 M554 < 2
This example would turn Relay 5 ON if the communication status for instrument 5 was bad.
The “END” keyword will stop the lines from running, and start over from line 1.
There are a few functions that are available as well. The list of valid functions is: FSIN (Sine), FCOS
(Cosine), FEXP (Exponent), FLOG (Logarithm), FLN (Natural Logarithm), FSQRT (Square Root), FABS
(Absolute Value), and FPOW (Power). The Sine and Cosine functions need to have the parameter in radians.
A function must be in all caps and begin with an “F” and have a pair of parenthesis. An undefined function

Advertising