10-25-2006 01:44 PM
10-26-2006 02:16 PM
Hi Steve,
I've taken a look at your VI and made some modifications. I attached it to this post...please take a look. Here are the changes I made:
1. I replaced your "Channel" string control with an I/O selector control. This allows you to choose which port(s) or line(s) you want to write to from a drop down menu. This was accomplished by deleting the string control and then right-clicking on the lines input terminal and selecting Create » Control.
2. I changed the source of your sample clock. It now comes from a counter output on the same board. I used and example program to generate a pulse train on a specific counter, and then I told your program to look at this counter for its sample clock. The example program I used was named "Gen Dig Pulse Train-Continuous.vi" and is located in the NI Example Finder under Hardware Input and Output » DAQmx » Generating Digital Pulses. On the front panel of this example, just choose a counter, a frequency and a duty cycle...then be sure to take your sample clock from the same counter in your VI.
3. I changed the polymorphic instance of the DAQmx Write VI. You had it set for Digital » Multiple Channels » Multiple Samples » 2D U32. Since "one channel for all lines" was chosen for the line grouping input of the DAQmx Create Channel VI, the polymorphic instance should not be specified for Multiple Channels, but rather Single Channel. In the modified VI you will see that I changed the polymorphic instance to Digital » Single Channel » Multiple Samples » 1D U16. In this configuration, the program will write the first element of the array to the digital line, then write the second element of the array to the digital line, then the third element and so on. Thus the line will basically retain the last element in the array.
If you wish to write to multiple lines at the same time, you can take a look at the "Write Dig Chan.vi" (or "Write Dig Port.vi") example VI which performs a continuous acquisition inside a while loop. The polymorphic instance is configured for Digital » Single Channel » Single Sample » 1D Boolean. Also this KB describes the polymorphic instances and when to use them with particular line grouping input selections.
Hope that helps. Please let me know if you have any additional questions...
Regards,
Nicholas B, National Instruments
10-27-2006 04:07 PM
10-30-2006 10:55 AM
Hi Steve,
Attached you will find the VI saved for LabVIEW version 8.0. Please take a look and let me know if (a) it still does not work or (b) you have any additional questions.
Thanks and have a great day!
Regards,
Nicholas B, National Instruments