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 modeSCHB= set channel B function, trigger level or trigger modeMEASURE=Read single measurement |
<Operation> |
Operation code:FREQ=Sets measurement function to frequencyPERIOD=Sets measurement function to periodTRIG_MODE=Sets the trigger level modeTRIG_LEVEL=Sets the trigger level |
<Mode|Level> |
Trigger mode or level depends on the operation:Mode:0=trigger level set by user1=trigger level set automatically2=trigger level uses the last valueLevel: voltage level (-5.0v to +5.0v) |