Download DAQ-STC Technical Reference Manual

Transcript
Chapter 2
Analog Input Timing/Control
Else
AI_SI_Switch_Load_On_SC_TC = 1;
}
Else
Scan rate change cannot be performed;
}
}
}
2.6.6 Staged Acquisition
In a staged acquisition, software implements more than one posttrigger acquisition sequence,
each having unique timing parameters. The number of scans to be executed in each stage is
contained in an array named sc_ticks. The variable sc_ticks_pointer is a pointer into
the array and should be initialized to 1. The number of scans for the first two posttrigger
acquisition sequences is programmed in the AI_Number_Of_Scans function.
The number of clocks between START in each stage is contained in an array named
si_ticks. The variable si_ticks_pointer is a pointer into the array and should be
initialized to 1. The number of clocks for the first two posttrigger acquisition sequences is
programmed in the AI_Scan_Start function.
The variable si_last_load_register indicates which load register was accessed most
recently and is initialized in the AI_Scan_Start function.
The SC_TC interrupt notifies the CPU that the current acquisition sequence is complete so
that the ISR can program the parameters for the next acquisition sequence. After the
parameters are loaded, the ISR checks for an SC_TC error. An SC_TC error occurs if the
parameters for the next acquisition sequence are not written before the end of the current
acquisition sequence.
Use the following function as an ISR for staged acquisitions.
Function AI_Staged_ISR
{
/*If the last load was from the last load register written to, it is all right to change the */
/*rate. Otherwise, you cannot change the rate*/
If (si_last_load_register is 0) then
{
AI_SI_Load_B = si_ticks[si_ticks_pointer] - 1;
If (sc_ticks[sc_ticks_pointer] is 0) then
{
AI_End_On_SC_TC = 1;
AI_SC_TC_Interrupt_Enable = 0;
}
Else
{
DAQ-STC Technical Reference Manual
2-44
© National Instruments Corporation