A structure reporting a percentage level or load value and a discrete on/off state. Separate fields report the percentage value and state. This type should be used for both discrete (on/off) and analog control.
The value field is used to control the load's value, i.e. position, speed, or intensity, the state field being used to control whether the load is on or off (enabled or disabled).
When used as the output of a discrete sensor device, the OFF state is represented by a SNVT_switch network variable with state = FALSE and value = 0. The other discrete states are represented by state = TRUE and value > 0. When used as the output of a two-state sensor device, the ON state is represented by state = TRUE and value = 200 (meaning 100%).
When used as the input of a two-state discrete actuator, a SNVT_switch network variable with state = TRUE will be interpreted as the ON state if value > 0, and as the OFF state if value = 0. Additionally, a SNVT_switch input network variable with state = FALSE should be interpreted as the OFF state, whether or not value = 0. A state value of 0xFF indicates the switch value is undefined.
Input Network Variable
value (raw)
|
state
|
2-state interpretation
|
any
|
0
|
off (0; 0)
|
0
|
1
|
off (0; 1)
|
>
0
|
1
|
on (200; 1)
|
any
|
-1 (0xFF)
|
invalid (no action)
|
Output Network Variable
value (raw)
|
state
|
2-state interpretation
|
0
|
0
|
off
|
200 (0xC8)
|
1
|
on
|
0 .. 200 (0 .. 0xC8)
(any valid value)
|
-1 (0xFF)
|
invalid (no action)
|