Read Analog Inputs
[cmdchars] = L
Recommended Extended Commands
National Instruments recommends that you use the Read 16-Bit Data (!F) extended command or the Read 16-Bit Data with Status (!G) extended command instead of the Read Analog Inputs command.
Description
The Read Analog Inputs command reads the levels of the targeted channels on the addressed FieldPoint module. The command returns a 12-bit value for each output. The command reads the most significant 12 bits of channels that have greater than 12-bit resolution. For 16-bit resolution, you must use the extended commands.
Syntax
L[positions]
[positions] | Zero to four ASCII-hex characters specify the 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. If [positions] contains one to three characters, the command does not read channels corresponding to missing bits. If [positions] is empty, the command supplies "FFFF" for the value. |
Success Response
A[data]
[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. The first character in each set of four characters is a "1". The next three characters specify a 12-bit value between 0x000 (0 decimal) and 0xFFF (4095 decimal). 0x000 represents the zero level (or the full-scale negative value for bipolar ranges), and 0xFFF represents the full-scale level. This command returns "????" for targeted output channels. |
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
>33L5[checksum][cr]
This command reads the values for channels 0 and 2 of the FieldPoint module at address 51 (0x33). The response is as follows:
A10001888[checksum][cr]
The response indicates that the value on is 0x1000 and the value on channel 0 is 0x1888. Discount the 0x1000 offset for each value to determine the actual input values: 0x000 (0 decimal) for channel 2 and 0x0888 (2184 decimal) for channel 0.