Read Discrete with Status

FieldPoint Optomux Programming

Read Discrete with Status

[cmdchars] = !K

Description

The Read Discrete with Status command reads all discrete input and output channels of the addressed FieldPoint module. Additionally, the command reports the status of channels to enable error checking.

Use the Read Module Status command or the Read Channel Status command for details about an error condition of a bad channel.

Syntax

!K (!o!K for modules with up to 32 channels)

Success Response

A[status][data]

[status]Four ASCII-hex characters specify the status of all channels. The most significant bit represents channel 15 and the least significant bit represents channel 0. A "1" in any bit means that the status of the corresponding channel is bad, and a zero in any bit means either that the status of the corresponding channel is good, that the corresponding channel is analog, or that there is no channel corresponding to that bit.

If you send !o!K, [status] contains eight ASCII-hex characters in the response.
[data]Four ASCII-hex characters specify the channel levels. A "1" in any bit means that the corresponding channel is ON. A zero in any bit means either that the corresponding channel is OFF, that the corresponding channel is analog, or that there is no channel corresponding to that bit.

If you send !o!K, [data] contains eight ASCII-hex characters in the response.
Note  This command returns data values for channels with bad status.

Error Responses

E_INVALID_CMDUndefined command.
E_INV_LIMS_GOTSpecified limits invalid for the command.
E_INV_LIMS_GOTE_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 reads all channels of the FieldPoint module at address 51 (0x33):

>33!K[checksum][cr]

The response is as follows:

A000000FF[checksum][cr]

The response indicates that all channels have good status; channels 0 to 7 are ON; and channels 8 to 15 are OFF, or the module has only eight discrete channels.

The following command reads all 32 channels of the FieldPoint module at address 34 (0x22):

>22!o!K[checksum][cr]

The response is as follows:

A00000000FF0000FF[checksum][cr]

The response indicates that all channels have good status; channels 0 to 7 and 24 to 31 are ON; and channels 8 to 23 are OFF.