Write Discrete
[cmdchars] = !L
Description
The Write Discrete command drives targeted discrete output channels ON or OFF on the addressed FieldPoint module.
Syntax
!L[positions][data]
Use !o!L for modules with 32 channels.
[positions] | Four ASCII-hex characters specify the targeted channels. A "1" in any bit means that the command writes to the corresponding channel. A zero in any bit means that the corresponding channel is not targeted. If you send !o!L, [positions] must contain eight ASCII-hex characters. Targeting an input channel or a channel that does not exist causes the command to return an error. |
[data] | Four ASCII-hex characters specify all of the output levels to be written. A "1" in any bit means ON. A zero in any bit means OFF. The command ignores bits that correspond to untargeted channels. If you send !o!L, [data] must contain eight ASCII-hex characters. |
Success Response
A
Error Responses
E_INVALID_CMD | Undefined command. |
E_INSUFF_CHARS | Data field error. An insufficient or incorrect number of characters were received for the command. |
E_INV_LIMS_GOT | Specified limits invalid for the command. |
E_ILLEGAL_DIGIT | One or more characters in the command could not be properly converted to a digit (hex or decimal). |
E_INV_CHNL | One or more channels specified in the command either do not exist or do not support the specified operation. |
E_NO_MODULE | There is no module at the specified address. |
Refer to FieldPoint Responses for other possible error responses, error numbers, and error descriptions.
Example
The following command turns channel 0 ON on the FieldPoint module at address 51 (0x33). Note that all the other "1" bits in [data] are ignored.
>33!L0001FFFF[checksum][cr]
The following command turns channel 17 ON on the FieldPoint module at address 51 (0x33). Note that all the other "1" bits in [data] are ignored.
>33!o!L00020000FFFFFFFF[checksum][cr]