LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

usb 6501

Hi all:

 

I am using USB 6501 ,, I want to active only port 1 line 7  ,, this is the error that I get

 

What wrong in my vi

 

Thanks

 

Download All
0 Kudos
Message 1 of 3
(3,144 Views)
I didn't open your VI, but it appears that your are defining a task that consists of 1 line. This would always be a single input; not an array. If you want to toggle the eight lines for a port, change the DAQmx input from /Dev1/Port1/Line7 to /Dev1/Port1 (each port is eight bits).

If you want to set just Line 7 based on an array, wire the output of the OR function to the input of the DAQmx Write (instead of the array that you have negated with the NOT operator).
0 Kudos
Message 2 of 3
(3,135 Views)
Hello elyan,

Phillip is correct that you are trying to write an array of values to one line.  In order to write to the whole port, you need to specify the whole port in your lines input (Dev1/port1) and then also change the  "one channel for each line" to "one channel for all lines" as well as making sure the polymorphic instance of your DAQmx Write is Digital»Single Channel»Single Sample»1D Boolean (N lines):



If you want to just write to the one line, then as Phillip says, all you need to do is change the input to the DAQmx Write to a single boolean value and the DAQmx Read to Digital»Single Channel»Single Sample»Boolean (1 line):



A third option you have is to pick and choose the lines you wish to write to, and then write an array of Booleans of that size.  To do this, you need to separate the lines with commas (e.g. "Dev1/port1/line0, Dev1/port1/line0") or for a series of lines, a colon (e.g. "Dev1/port1/line0:7").  Then leaving the input "one channel for each line", pick Digital»Multiple Channels»Single Sample»1D Boolean (1 line per channel). In your case, this would look something like this:



Depending on what you are trying to do, one of these should work for you.  Please post back if you have any questions about the explanation.


Message Edited by Neal M on 12-28-2007 09:50 AM

Message Edited by Neal M on 12-28-2007 09:52 AM
Neal M.
Applications Engineering       National Instruments        www.ni.com/support
Download All
0 Kudos
Message 3 of 3
(3,110 Views)