45
10.10.2
Script Sensors
A Script Sensor can be setup by entering a script type in the sensor ID field. The following types are currently
supported:
~count
- The equation will be evaluated continuously. If the evaluation changes at any point, the sensor's value
increases by an increment of 1. This mode can be useful for counting the number of times a discrete input
toggles.
Evaluation Sensor; every tenth of a minute (6 seconds).
~evalMt
- The equation is evaluated every 6 seconds and its result becomes the sensor's value.
Evaluation Sensor; every minute.
~evalMn
- The equation is evaluated every 60 seconds and its result becomes the sensor's value.
Interval counter.
Interval Sensor
~intCnt
- Sensor value will increment when the associated input's pulse length (high or low) is within a set
interval. Example: D5 V1 0 0 0 > V6 0 0 0 0 < means the sensor value will increment when a 1ms to 60ms pulse
is detected on Discrete Input 5. This is useful for frequency detection/tracking.
A Script Sensor is configured to evaluate Reverse Polish Notation equations. A data token in an equation can
represent a discrete alarm, analog reading, sensor reading, relay status, system alarm status, or a constant value.
The format for a token in an equation must be a data type followed by an index (for example: Discrete Input 1 in an
equation would be represented as "d1", Analog Channel 3 would be "a3", etc.). Each token is typically followed by
another token or an operator. The equations are entered in the description field for the Script Sensor.
Valid data types:
d
Discrete Input
a
Analog Channel
r
Relay State
n
Sensor
v
Positive Integer Constant
s
System Alarm
p
Point Index
Valid operations:
+
Addition
1
-
Subtraction
*
Multiplication
1
/
Division
2
>
Greater than
<
Less than
|
Conditional Halt
3
=
Assignment
1. Can be used as OR (+) operator / AND (*) operator when used with assignment (=) operator.
2. Division is NOT executed if the denominator's absolute value is less than 1!
3. An equation is evaluated until it reaches the Conditional Halt. If the running value at that point is zero, then the
evaluation stops, otherwise the evaluation continues as a new equation.
Summary of Contents for D-PK-NG224-12003
Page 9: ...5...
Page 11: ...7 Optional Shipping Items Available by Request 3 1 Small WAGO connector 2 802 01020 00...
Page 16: ...12 66Block diagrams 6 3 66 block pinout for Amphenol 1 TTL Discretes 1 24...
Page 17: ...13 66 block pinout for Amphenol 2 Controls 1 2...
Page 77: ...73...
Page 78: ......