Details
Each bit in the state represents a different indicator. Therefore, multiple indicators can be present
(the OR operation is performed bitwise). All state or state latch commands behave in this manner.
Different channel types support different state information (indicators). The optional state
indicatorMask can be used to return only certain indicators. If there is no indicatorMask, then
all indicators are returned.
The following status indicators are defined:
â–ª channel.IND_CLOSED
â–ª channel.IND_OVERLOAD
â–ª channel.IND_MATCH
â–ª channel.IND_OVERFLOW
Indicators can be latched or unlatched, depending on other system settings. Latched indicators mean
that the condition has occurred since the last reset command (or power cycle). Unlatched indicators
mean that the condition occurred when the channel.getstate() command was issued. The
overflow and overload indicators default to a latched condition.
Although the channel.getstate() command returns a string representing a number, this can be
easily changed to a number and then compared to one of the provided Lua constants.
For switch channels, the only state information is an indicator of relay state
(channel.IND_CLOSED).
For digital I/O channels, the state information includes an indicator for the state of auto protection and
whether the match value has been matched (channel.IND_OVERLOAD and
channel.IND_MATCH).
For totalizer channels, the state information includes an indicator for overflow and whether the match
value has been matched (channel.IND_OVERFLOW and channel.IND_MATCH).
For DAC channels, the state information includes an indicator for the state of auto protection
(channel.IND_OVERLOAD).
For more specific information about the overflow and overload indicators, refer to the documentation
for the specific card on which the specified channel resides.