处理“100. 0/100. 1 ” 这种类型的数据类型,如果要读或者写最后一位开关量,组点可以参考上图的配置。组成pv点。数据地址:1,数据类型 byte.
如果要取此开关量的“100. 0”中的100,组成pv点。数据地址:0,数据类型 byte.这个时候的实际显示值并不一定是100,但是一个对应关系,需要用户自己参考说明书来了解。 用户可以反向推断如果100对应200,0对应0,那么可以下置200来将该值改成100。
处理“ST_ON/ST_OFF”这种开关量,组成pv点。数据地址:0,数据类型 byte.。一般写4对应ST_ON,写0表示ST_OFF,这是一般情况,很多情况,需要用户自己参考说明书。
以下是我参考过的说明“100. 0/100. 1 ” 这种数据类型的一种说明
Version 12 June 2003 SNVT Master List
LONMARK ®
SNVT Master List
SNVT_switch (95)
Switch
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 (NULL)
因篇幅问题不能全部显示,请点此查看更多更全内容