Chapter 4
Programming
©
National Instruments Corporation
4-9
pseudo-code for each example. The PCI E Series Register Level
Programmer Manual Companion Disk contains the complete programs.
The following pseudo-code examples and the programs on the Companion
Disk follow the flowchart structure presented in the DAQ-STC Technical
Reference Manual.
Example 1
This example acquires one sample from channel 0.
Connect a voltage source to ACH0 on the I/O connector. Configure
channel 0 for bipolar RSE with no dithering. No external multiplexers are
present. Sample analog input channel 0 at a gain of 1 and read the unscaled
result. Compare the unscaled value to the input voltage.
The first two steps set up the E Series board, and the subsequent steps
configure the DAQ-STC.
1.
Set up the PCI board resources. Use the function
Setup_Mite
provided on the Companion Disk.
2.
Configure the analog channel for the given settings.
The function
Configure_Board
clears the configuration memory,
clears the ADC FIFO, and then sets channel 0 to the given settings.
(Clearing the configuration memory and ADC FIFO require windowed
mode writes as well as board writes.)
Write_Strobe_0_Register
Write strobe 0 = 1;
Write_Strobe_1_Register
Write strobe 1 = 1;
Configuraton_Memory_High_Register
Channel number = 0;
Channel type = 3;
Configuration_Memory_Low_Register
Last channel = 1;
Gain = 1;
Polarity = 0;
Dither enable = 0;
3.
The programming of the DAQ-STC begins with the clock
configuration.
The function
MSC_Clock_Configure
selects the timebase for the
DAQ-STC.