Hey Paul,
Lets start by breaking down the application you've described.
A continuous pulse train requires one counter. You can create a counter output task with a set frequency in order to create the 500Hz pulses.
However, a finite pulse train such as the 5kH signal requires two counters. One counter is used to create the pulses, and the other counts the edges of the first in order to gate the output. In other words, in order to ensure that only four pulses are created, the second counter monitors the output and disables the output by setting the gate low when it has finished four.
At this point we've already exceeded the capabilities of the 6034E since it only has two on-board counters. One possible alternative would be to create the 500Hz signal in software and trigger the 5kHz signal off a PFI line, but it will be jittery due to the lack of determinism of an operating system. We don't recommend using software for accurate timing at these rates, but in theory it is possble, though entirely system dependent.
Now, if I understand correctly you want to create an analog output while the 5kHz signal is high. You could create an analog input that triggers off of the ctr0internalOutput, but in order to retrigger it such high frequencies you'll need another counter. Add the fact that you want to divide that width between an analog output and input and you'll need yet another counter!
So, that being said, I think you have a couple options:
- purchase a more advanced hardware solution such as one of the scope cards
- setup a continuous pulse train at 5kHz. Trigger the analog tasks off of the ctr0internaloutput. You won't be able to limit it to four pulses every 500Hz, but you could very easily just acquire the extra samples and throw them out later. With a board like this, you're going to want to just acquire more than you need and figure out how to disregard what you don't need.
Let me know if you have any questions.
Elijah Kerry
NI Director, Software Community