Chapter 4
Programming
©
National Instruments Corporation
4-23
Example 6
Example 6 performs 20 scans as in Example 2. Additionally, an external
start and stop trigger control the acquisition.
Acquire 20 scans. The scan list contains channels 5, 4, 1, and 0,
respectively, each at a gain of 1 and in RSE mode. The acquisition should
begin on a start trigger applied to PFI0. Set the sample rate to 100
µ
s.
Connect the stop trigger to PFI1. Acquire 10 scans after the stop trigger,
leaving 10 scans before the stop trigger. Use polled input to read the AI
FIFO data.
1.
Perform Analog Input Example 1 Step 1.
2.
Perform Analog Input Example 1 Step 2 for each channel in the scan
list. Only channel 0 has Last channel set to 1.
3.
Perform Analog Input Example 1 Steps 3 through 8.
4.
Call
AI_Trigger_Signals
to set the triggering options.
Joint_Reset_Register
AI configuration start = 1;
AI_Mode_1_Register
AI trigger once = 1;
AI_Trigger_Select_Register = 0xB161;
Joint_Reset_Register
AI configuration start = 0;
AI configuration end = 1;
5.
Call the function
Number_of_Scans
to load the number of scans.
Joint_Reset_Register
AI configuration start = 1;
AI_Mode_2_Register
AI pretrigger = 1;
AI_SC_Load_B_Registers (24 bits)
Number of pretrigger scans -1 = 9;
AI_Mode_2_Register
AI SC initial load source = 1;
AI SC reload mode = 1;
AI_SC_Load_A_Registers (24 bits)
Number of posttrigger scans -1 = 9;
AI_Command_1_Register
AI SC load = 1;