Store Discrete
[cmdchars] = !h
Description
The Store Discrete command stores data in nonvolatile memory for use as powerup settings for specified discrete output channels.
Refer to How to Interpret Data for information about interpreting and converting data.
Syntax
!h[positions][data]
Use !o!h for modules with 32 channels.
[positions] | Four ASCII-hex characters specify the targeted channels. A "1" in any bit means that the command stores a value for the corresponding channel. A zero in any bit means that the corresponding channel is not targeted. If you send !o!h, [positions] must contain eight ASCII-hex characters. Targeting an input channel, an analog 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 stored. A "1" in any bit means ON. A zero in any bit means OFF. If you send !o!h, [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
>33!h0001FFFF[checksum][cr]
This command stores an ON level for channel 0 of the FieldPoint module at address 51 (0x33). Note that all other "1" bits are ignored because the command does not target the corresponding channels.
>22!o!h00010001FFFFFFFF[checksum][cr]
This command stores ON levels for channels 0 and 16 of the FieldPoint module at address 34 (0x22). Note that all other "1" bits are ignored because the command does not target the corresponding channels.