09-10-2008 09:07 AM
09-10-2008 09:34 AM
09-11-2008 04:50 PM
Hi morgol,
Since you have a M Series device, you should be able to perform correlated digital outputs. A good place to start would be to take a look at one of our shipping examples in the LabVIEW Example Finder, more particularly the Cont Write Dig Port-Ext Clk.vi which can be found under Hardware Input and Output » DAQmx » Digital Generation. This example uses an external clock as the sample clock to the digital output task. Since you are looking for a clock rate of 2 kHz, you can use a 4 kHz clock source to change the digital inputs from low to high and high to low within that one clock period. I would also like to mention that if you do not wish to use an external clock to source your task, you can always import the sample clock from a dummy analog input/output task. The following link should give you a good idea on how to do this.
Performing Correlated Digital IO with an M Series Device in LabVIEW
Please let us know if you have any questions. I hope this helps.
09-11-2008 05:12 PM
07-01-2010 12:43 AM - edited 07-01-2010 12:44 AM
Hello, another question from a Newbie:
I found the example about digital pulse generation very helpful but I was wondering if I can have a more detailed explanation of what is actually going on inside the loop. For example, is this when the state of the digital output channel is set to high?
What is the best way to set the duty cycle of the digital pulsing (I would like it to be fixed at ~50%)? Also, how could I control the number of times that the pulse is executed?
Thanks in advance for any help.
07-01-2010 02:45 PM
Hi krissy-
If you are looking at Write Software-Timed Dig Chan 1.vi (the example code attached to the second post in this thread - I assume this is what you are looking at), the loop is actually setup to change the digital line from low to high every other loop. For example, the code has True constant wired into the timed loop, which sets the digital line high on the first iteration. There is a "Not" function which changes that boolean to false through the shift register for the next iteration. That false is written to the digital line and then the "Not" switches it back to True and it starts all over again. Its a beautiful thing.
The duty cycle is going to be 50% by default. The toggling of the digital line is set by the iteration of the Timed loop. Since the loop iteration time determines when the True/False is written, as long as the loop is running smoothly, your duty cycle is about 50%. You don't need to change anything.
In this code, you can set the number of times that the pulse is executed by setting the Max Iteration number on the front panel. This will stop the program as soon as the loop iterations exceed the number you specify.
I hope this helps. Best of luck with your application!
07-01-2010 08:59 PM
Thanks so much, that was a really nice explanation