Read ON/OFF Status
[cmdchars] = M
Recommended Extended Commands
National Instruments recommends that you use the Read Discrete (!J) extended command or the Read Discrete with Status (!K) extended command instead of the Read ON/OFF Status command.
Description
The Read ON/OFF Status command reads the ON/OFF status of all channels of the addressed FieldPoint module.
Syntax
M
Success Response
A[data]
[data] | Four ASCII-hex characters specify the levels of all module channels. A "1" in any bit means that the corresponding channel is ON. A zero in any bit means that the corresponding channel is OFF. This command returns a zero for any bit that does not correspond to a channel. For example, if the command is sent to an eight-channel module, it returns ON/OFF status for the lowest eight bits and only zeros for the highest eight bits. |
Error Responses
E_INVALID_CMD | Undefined command. |
E_INV_LIMS_GOT | Specified limits invalid for the command. |
Refer to FieldPoint Responses for other possible error responses, error numbers, and error descriptions.
Example
>33M[checksum][cr]
This command reads the ON/OFF status of all channels of the FieldPoint module at address 51 (0x33). The response is as follows:
A0AC2[checksum][cr]
The response indicates that channels 1, 6, 7, 9, and 11 are ON and all other channels are OFF.