LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

analog in digital in and digital out slow ?

Hi Sandra,
 
Thanks for posting on the NI forums.
 
Unfortunately the 'initial delay' control will only invoke a delay on the first pulse to be generated, and not subsequent pulses. So in this instance what you are seeing is expected behaviour, albeit inconvenient.
 
The reason why you see correct behaviour when you encompass the code with a while loop is because you will be requiring the DAQ card to 'start'; generate a single, triggered & delayed pulse; then the DAQ card to 'stop' on each iteration of the loop. This will work when your triggers are seperated by a fairly large period of time, but, as you have seen, will miss triggers with shorter intervals. This is due to the fact that each iteration of the loop will have to 'start' and 'stop' the DAQ card, which will be a mixture of hardware configuration, and software/driver calls, which take a 'not negligible' period of time when compared to your trigger frequency.
 
There is a way to side-step this issue by using a second counter to gate the counter that is generating the pulse. What can be done here is you use counter0 as a 'master' device to listen for your trigger, then have it generate a pulse which has a low period equal to your desired delay, followed by a high period. Then you may use counter1 as a 'slave' device to listen for counter0's pulse as a trigger, then generate the pulse you wish to output. By making both counter0 and counter1 retriggerable you will have the required delay between your external trigger and the pulse you need to generate.
 
To do this you may simply use two instances of the 'Gen Dig Pulse-Retriggerable.vi' and feed the output of counter0 to the input of counter1. To save you some time I have generated two VIs (master and slave) which I have tested on my NI PCI-6251 here in the lab. You will need to feed your external trigger signal to PFI8 (pin 37) and your output pulse connections to PFI 13 (pin 40). The signal between the counters is routed internally.
Hope this helps. Please let me know how you get along.
Thanks,
 
Rob
National Instruments | Northern California
0 Kudos
Message 11 of 11
(412 Views)