Chapter 2
Analog Input Timing/Control
©
National Instruments Corporation
2-43
DAQ-STC Technical Reference Manual
After the programming sequence is complete, issue the following commands:
AI_START_Polarity = 1;
∑
AI_START_Polarity = 0;
}
2.6.5 Change Scan Rate during an Acquisition
You can change the scan rate if you do not have special requirements on the timing for the
START1 to START in retriggerable analog input or if the acquisition is not retriggerable. This
will not work in the case of retriggerable analog input with nondefault START1 to START
timing. Assume that the sequence of START rates is stored in the array
si_ticks
, and the
variable
si_ticks_pointer
indicates the current position in the array. You can use the
following function to change the scan rate.
Function
AI_Scan_Rate_Change
{
If (acquisition is not retriggerable) OR (you will change the scan rate during an
acquisition) then
{
If (
si_last_load_register
is 0) then
{
/*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 (AI_SI_Next_Load_Source_St is 0) then
{
AI_SI_Load_B =
si_ticks
[
si_ticks_pointer
] - 1;
si_ticks_pointer
+ = 1;
si_last_load_register
= 1;
If (switch SI load registers on TC) then
AI_SI_Switch_Load_On_TC = 1;
Else
AI_SI_Switch_Load_On_SC_TC = 1;
}
Else
Scan rate change cannot be performed;
}
Else
{
If (AI_SI_Next_Load_Source_St is 1) then
{
AI_SI_Load_A =
si_ticks
[
si_ticks_pointer
] - 1;
si_ticks_pointer
+ = 1;
si_last_load_register
= 0;
If (switch SI load registers on TC) then
AI_SI_Switch_Load_On_TC = 1;