Write Analog Outputs

FieldPoint Optomux Programming

Write Analog Outputs

[cmdchars] = J

Recommended Extended Commands

National Instruments recommends that you use the Write 16-Bit Data (!H) extended command or the Write 16-Bit Data with Status (!I) extended command instead of the Write Analog Outputs command. The extended commands provide more flexibility. For example, they enable you to write to some channels and leave other channels unaffected.

Description

The Write Analog Outputs command sets the targeted channels on the addressed module to a single specified output level. The output level is a 12-bit value, and all targeted output channels are set to that level. If the targeted module has 16-bit resolution, use the extended commands.

Syntax

J[positions][data]

[positions]Four ASCII-hex characters specify the channels. A "1" in any bit means that the command sets the corresponding channel to a level specified by [data]. A zero in any bit means that the corresponding channel is unaffected.

This command does not affect input channels.
[data]Three ASCII-hex characters specify a 12-bit value for all targeted output channels. The range of values is from 0x000 (0 decimal) to 0xFFF (4095 decimal). 0x000 represents the zero output level (or the full-scale negative value for bipolar ranges), and 0xFFF represents the full-scale output level.

Success Response

A

Error Responses

E_INVALID_CMDUndefined command.
E_INV_LIMS_GOTSpecified limits invalid for the command.

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

Example

For this example, channels 0 and 1 of the FieldPoint module at address 51 (0x33) are configured for the 0–5 V range. The command sets the output of the channels to 1.25 V. Calculate the [data] field as follows:

(1.25 V – 0 V)/5 V * 4095 = 1024 decimal = 400 hex

The following command sets the output level of channels 0 and 1 to 1.25 V:

>33J0003400[checksum][cr]