Sample Programs

The following example demonstrates how to program the board using the C programming language under Windows. The example shows how to get or set a group or channel voltage.

To run, enter the following command line:

GxAoExampleC <Slot|Address> <Operation> [<Group> <Channel|Range> <Voltage|Frequency> [<Test Mode>]]

Where:

<Slot|Address>
Board PXI Slot number where the board resides.
<Operation>
Operation code:
GCV=Get channel voltage
SCV=Set channel voltage
SVR=Set group voltage range
GVR=Get group voltage range
SUM=Print board summary
ARB=Output arbitrary waveform
STREAM=Stream waveforms
<Group >
Required for all example operations except SUM.
Group number: 0 to 3
<Channel|Range>
Required for all example operations except SUM.
Channel (SCV, GCV, ARB, STREAM): 0 to 15
Range (SVR, GVR): 0 to 3
<Voltage|Frequency>
Required for SCV, ARB, and STREAM modes.
Voltage (SCV): -5.0 to 5.0
Frequency (ARB, STREAM): Sample rate to be used while outputting waveform.
<Test Mode>
Required for STREAM only.
Valid test modes are:
-POLL: Check streaming buffer by polling the status register.
-INTR: Streaming buffer generates interrupt if half-empty.