10-09-2023 04:22 AM
how can i use Counter 0 and Counter 1 to out two different freqency signals at the same time?
Using counter 0 can work
Using counter 1 can work
but counter 0 and counter 1 can not work at the same time
10-09-2023 07:14 AM
Some DAQs tend to use more than one counter for Pulse Generation and hence may have used all available counters and when you try to generate another pulse output there aren't any counters left to use and show the error that the counter is already in use.
What DAQ are you using?
10-09-2023 08:49 AM
My daq is USB 6212. the daq has two counters (Ctr0 and Ctr1).
I certify that there is no other program using the counter 0 or 1 when i using this program.
10-09-2023 08:54 AM
No, you misunderstood my explanation. Your top Ctr0 configuration itself used both the available counters on the card.
Note: ctr0 and ctr1 are terminal and not directly map to the counter resources on the DAQ
Refer to this article. It states that when you configure Finite pulse generation it uses two counters on the board.
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P7eESAS&l=en-US
10-09-2023 01:05 PM
Do you have any other NI DAQ devices available to use (or budget to acquire one)?
What are some typical paramaters for these pulse trains (freq, duty cycle, # pulses)? Are all those parameters crucial, or might "close enough" be "good enough"?
The very simplest thing you might do that gives you precise freq & duty cycle but with some uncertainty about # pulses is to generate 2 *continuous* pulse trains and use software timing methods to decide when to stop each task. Your USB-6212 is capable of running 2 pulse trains simultaneously if neither is configured for finite samples. (Both can be continuous, both can be single pulses by never calling DAQmx Timing, or you could have one of each type.)
When you use software timing methods, you should expect to miss your timing target by at least several msec pretty often, and also plan that you might miss even worse (20-100 msec?) occasionally. How much this affects your # pulses depends on your pulse frequencies.
-Kevin P