Chapter 3
Analog Output Timing/Control
©
National Instruments Corporation
3-43
DAQ-STC Technical Reference Manual
new_ticks
,
/*Holds the number of clocks between updates*/
ao2_shut_down_isr
;
/*Indicates the last UI2_TC in the sequence and the
next-to-the-last UI2_TC in the sequence, as follows:
2 the last UI2_TC
1 the next-to-the-last UI2_TC
0 otherwise*/
If (
ao2_shut_down_isr
is 2) then
AO_UI2_Arm_Disarm = 0;
Else
{
new_ticks =
ui2_ticks
[
ao2_tick_count_to_use
];
If (new_ticks is 0)
ao2_shut_down_isr
=
ao2_shut_down_isr
+ 1;
Else
ao2_tick_count_to_use
=
ao2_tick_count_to_use
+ 1;
If (
ao2_last_load_register
is A) then
{
If (new_ticks is not 0) then
{
AO_UI2_Load_B =
new_ticks
- 1;
Σ
AO_UI2_Switch_Load_Next_TC = 1;
}
Else
{
/*Load maximal count in an attempt to avoid getting an unnecessary UI2
TC error*/
AO_UI2_Load_B = 0xFFFF;
Σ
AO_UI2_Switch_Load_Next_TC = 1;
}
ao2_last_load_register
= B;
}
Else
{
If (
new_ticks
is not 0) then
{
AO_UI2_Load_A
new_ticks
- 1;
Σ
AO_UI2_Switch_Load_Next_TC = 1;
}
Else
{
AO_UI2_Load_A = 0xFFFF;
Σ
AO_UI2_Switch_Load_Next_TC = 1;
}