Sample Programs

The following example demonstrates how to program the board using the C programming language under Windows. The example shows how to initialize the counter, set it up for measurement or trigger settings and get the reading.

To run, enter the following command line:

GxCntExample  <Slot> <Channel|Measure> <Operation> <Mode|Level>

Where:

<Slot>
PXI Explorer slot number where the board reside.
<Channel|Measure>
Channel setting or measurement:
SCHA= set channel A function, trigger level or trigger mode
SCHB= set channel B function, trigger level or trigger mode
MEASURE=Read single measurement
<Operation>
Operation code:
FREQ=Sets measurement function to frequency
PERIOD=Sets measurement function to period
TRIG_MODE=Sets the trigger level mode
TRIG_LEVEL=Sets the trigger level
<Mode|Level>
Trigger mode or level depends on the operation:
Mode:
0=trigger level set by user
1=trigger level set automatically
2=trigger level uses the last value
Level: voltage level (-5.0v to +5.0v)