National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference CTR_Simul_Op
©
National Instruments Corporation 2-109 NI-DAQ FRM for PC Compatibles
Note It is not necessary to call CTR_Simul_Op with mode set to 1 before calling
CTR_Simul_Op with mode set to 4. That is, it is permissible to start two or more
counters at different times and still latch their counts at the same time.
Using This Function
You can start multiple counters simultaneously for any combination of event counting, square
wave generation, or pulse generation. The following sequence is an example of using
CTR_Simul_Op:
1. Specify the counters to use by putting their counter numbers into the ctrList array.
2. Call
CTR_Simul_Op with mode = 1 to reserve these counters.
3. Set up the counters by calling
CTR_EvCount, CTR_Period, CTR_Square, or
CTR_Pulse for each reserved counter. Because these counters are reserved, they will not
start immediately by those calls.
4. Call
CTR_Simul_Op with mode = 2 to start these counters.
5. Call
CTR_Simul_Op with mode = 3 to stop these counters.
6. Call
CTR_Simul_Op with mode = 0 to free counters for non-simultaneous operations.
You can stop counters from performing
CTR_EvCount, CTR_Period, CTR_Square, or
CTR_Pulse simultaneously, regardless of whether they were started by CTR_Simul_Op.
Trying to start unreserved counters simultaneously causes this function to return an error.
Call
CTR_Simul_Op with mode = 0 to cancel the reserved status of counters specified in
ctrList.
Note On the PC-TIO-10, the 10 counters are included on two counter/timer chips.
These counter/timer chips are programmed sequentially. Simultaneous
start-and-stop operations that specify counters from both chips experience a delay
between the counters on the first chip (counters 1 through 5) and those on the
second chip (counters 6 through 10). NI-DAQ returns a warning condition.