Read 16-Bit Data with Status

FieldPoint Optomux Programming

Read 16-Bit Data with Status

[cmdchars] = !G

Description

The Read 16-Bit Data with Status command reads data from targeted analog input and output channels of the addressed FieldPoint module. The command returns data as 16-bit values. Additionally, the command reports the status of targeted channels to enable error checking.

Refer to How to Interpret Data for information about interpreting and converting data.

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

Syntax

!G[positions]

[positions]Four ASCII-hex characters specify the targeted channels. A "1" in any bit means that the command reads the corresponding channel. A zero in any bit means that the corresponding channel is not targeted.

Success Response

A[status][data]

[status]Four ASCII-hex characters specify the status of all targeted 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 or that the corresponding channel was not targeted by the command.

If any channels return "????" in the [data] field, the bits corresponding to those channels in the [status] field are meaningless.
[data]The command returns four ASCII-hex characters for each targeted channel. The first four characters specify the value for the channel corresponding to the most significant "1" in the [positions] field, and so on.

Each set of four characters represents an unsigned 16-bit number.

This command returns "????" for targeted discrete channels.
Note  This command returns data values for channels with bad status.

Error Responses

E_INVALID_CMDUndefined command.
E_INSUFF_CHARSData field error. An insufficient or incorrect number of characters were received for the command.
E_ILLEGAL_DIGITOne or more characters in the command could not be properly converted to a digit (hex or decimal).
E_INV_CHNLOne or more channels specified in the command either do not exist or do not support the specified operation.
E_NO_MODULEThere is no module at the specified address.

Refer to FieldPoint Responses for other possible error responses, error numbers, and error descriptions.

Example

>33!G000B[checksum][cr]

This command reads the data values and status for channels 0 and 1 of the FieldPoint module at address 51 (0x33). The response is as follows:

A000201234567[checksum][cr]

The response indicates that the status of channel 0 is good and the status of channel 1 is bad. The data value of channel 0 is 0x4567 and that of channel 1 is 0x0123.