LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with VI for a DIO 6509 card.

I need to create ONE VI to control different lines on the DIO 6509 card.  I want to be able to input the VI with the port/line i want to control and then also input it with the state, 0 or 1.  How can i do this with / or without the Assistant.   It seems like with the assistant, i have to know the state of every line on the port when i set it.  But sometimes i want to just set one particular line on the port with no regard to what the other lines are set to currently.
 
Thanks for any help,
 
Jason
0 Kudos
Message 1 of 5
(2,681 Views)
It can be done, just use the physical channels a build your tasks on the fly.  Your application sounds like a debug interface, so for an example you can setup your interface to read an Entire port or the entire card or whatever you wish, then choose to write a port out or line out.  All of this is possible through the DAQ MX VIs.  How many of these cards do you have in a single system?  What version of DaqMX do you have?  What version of LabVIEW?  Can you be a little more specific in what you want this application to do? 

Paul
0 Kudos
Message 2 of 5
(2,657 Views)

I have one PXI-6509

I really only need to control 32 of the lines.  So right now i have a case structure with 32 different cases.  Each case has its own DAQ Assistant configured to a particular line.  So depending on the number you input, you get that port/line set on or off....  This works, but its very inefficient...  Its a small simple VI that is now over 3 megs in size (because of the 32 daq assistants).     I wasn't sure exactly how to use the lower level VI's to control the DIO line.  One thing in particular is that i dont know what my device number is...  The help says that it is the number i speciified during the config, but i dont see how to specify that.

 

Thanks,

Jason

0 Kudos
Message 3 of 5
(2,653 Views)
You can dynamically create the channel that you wire to DAQmx Create Channel. The syntax is Dev1/port0/line1 or Dev1/port2/line3. The channel name can be a string so based on a numeric control, you can create the correct one for a single channel. Then, your DAQmx Write should be set to Digital Bool 1Line 1Point. The data input for this is a single Boolean. You should be able to modify Write Dig Chan by changing the line input, the DAQmx Write, and the data from an array to a single Boolean.
0 Kudos
Message 4 of 5
(2,647 Views)
That would be for traditional DAQ.  You should be using DaqMX.  What verison of LabVIEW and NI-DAQ are you using?   I agree, this should be very small and efficient.

Paul
0 Kudos
Message 5 of 5
(2,645 Views)