10-27-2015 02:06 PM
Hello everyone!
I'm currently faced with the problem of repeatedly generating N-pulses (N-cycles of a pulse train) using the counter output of my NI USB-6211 device. What I basically want to do is to generate N-pulses at some specified frequency f, wait for a certain amount of time t (in the order of 1-2ms), and then generate the same N-pulses again. This process should continue indefinitely! I know how to generate a counter output of N-pulses. But, simply inserting this into a while loop will not solve the problem as the associated loop-delay is in the order of 70ms.
Thank you in advance.
10-27-2015 02:15 PM - edited 10-27-2015 02:15 PM
Have you tried using your device's pulse generation functionality using the Frequency and Duty Cycle? Set up a DAQmx task to generate the frequency and duty cycle that you require.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-27-2015 02:15 PM
Hello,
Are you saying that it takes 70ms to generate your pulse train? If so, add a wait delay at the end of the pulse train inside the while loop. You can use a flat sequence.
10-27-2015 03:11 PM
Hello!
I'm currently using the pulse generation functionality to generate an 8-cycle pulse of frequency f = 40kHz with a 50% duty cycle. However, when the finite signal has been generated, I want to wait on a zero idle-state for about 1-2ms and then generate the same signal again automatically.
10-27-2015 03:18 PM
Hello,
No, I'm generating a pulse of 8-cycles at the f = 40kHz (or T = 25us) with a duty cycle of 50%. So the total length of the signal is 8*25us = 0.2ms. Once the signal has been generated I want to hold the output on an zero idle-state for about 1-2ms and then generate the same sequence again. Hope this clarifies things!
10-27-2015 03:30 PM
Can you set up a second pulse train, on a second channel, that will act as a trigger for the first pulse train? I'm pretty sure the hardware allows this, and that's how I'd do it.
10-27-2015 04:55 PM
Not able to simultaneously generate two counter outputs in which one channel acts as a trigger for the first channel but I understand your idea! Can you possibly attach some example VI? Is this even possible with the USB 6211?
10-27-2015 06:56 PM
I don't know the exact capabilities of the USB-6211 and don't have a similar device for testing, but I set up a DAQmx simulated device and don't get any errors. When you set up your finite pulse train, set the start trigger to be the other counter output. Set the trigger channel so it has a rising edge as frequently as you need to retrigger the finite pulse train. Does this work? If not, what error do you get, and can you share your VI? Again, sorry I can't confirm that this definitely works, but I don't see why it wouldn't. Another option might be to use the Pause trigger instead of the Start trigger, if you want to use the second channel to pause generation of the first channel's pulse train, which would have a similar output and effect.
10-28-2015 06:03 AM
Hello again!
Below is an example of the functionality that I want to ahcieve except for the modification that you purposed in which my counter output CTR1 (PFI5) is triggered by another counter CTR0 (PFI4). So far I'm able to generate a finite pulse consisting of 8-cycles at the desired frequency (the analog input channel reads the data continuously) but don't know how to add a second counter in my code as to repeatedly regenerate the sequence. My experience with LabVIEW i pretty limited so I hope that you bare with me.
10-28-2015 08:09 AM