LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dig I/O on USB -6211 new user

Solved!
Go to solution

This is simple I'm sure, but just trying to do a simple demonstration of DI/O to turn use a switch on the UI to actuate a DO on my module.

I keep getting a mismatch saying the DI/O output is a 1D Boolean array, and the switch is Boolean?

 

0 Kudos
Message 1 of 9
(3,431 Views)

We are not mind readers. What does the switch on the UI represent? The high/low of a specific DIO line? Some sort of Boolean operation on the lines? Did you intend to read a single line only, but have the read setup to read a port? Please post your code so we can exactly what you're doing. Thanks.

0 Kudos
Message 2 of 9
(3,427 Views)

Sounds like you have your DIO configured for more than one line, so it outputs an array.  The switch is a single switch and cannot accept an array as an input.  you need to reconfigure your DIO to use one line only.  If you did that, and the output is still a 1D array, use Index Array to grab the first (and only) element.  The output of that will be a single boolean and it can be wired to your switch.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 9
(3,421 Views)

I have not had much luck figuring out this problem and have been away from this task for a few weeks. I have called in for help and reinstalled the software, but continue to have troubles configuring my DAQ for a line, boolean input or out put. I will just attach some files that may be helpful. I wanted to avoid another call, but I may have to if I can't figure this out.

I'm attaching a work file with screenshots to describe my steps and a small VI that I was using to try to gain understanding and troubleshoot.

Download All
0 Kudos
Message 4 of 9
(3,356 Views)

If you hover your mouse over the red X, you will see that it tells you what is wrong.  The output of the DAQ Assistant is an array of booleans.  Your indicator is not an array, it is just one boolean.  That is why you have a broken wire.  Use Index Array to get the first value out of the array and wire that to your indicator.

 

This is very basic stuff.  I suggest you should take the free online tutorials on NI's website.  You would have solved your problem yourself and would not have had to make any calls or post messages here.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 9
(3,349 Views)
Solution
Accepted by topic author uberdog57

The DAQ Assistant always uses an array as an output - even when you choose a single line to read. The DAQ Assistant always uses an array as an input - even when you choose a single line to write. For your example, you can use the Index Array function between the data output and your indicator. to get a single Boolean to display. If you want to control an output with a Boolean, use the Build Array function between the control and the data input. You would need a second DAQ Assistant to output a Boolean value - not 'Add Channel'.

 

Look at the shipping examples and see how you can do it without the DAQ Assistant and write scalar controls/indicators directly to a DAQmx Read or DAQmx Write.

0 Kudos
Message 6 of 9
(3,345 Views)

Thx, I got that they were different data types, I just didn't understand the DAQ assistant always configured the in's and out's as arrays.

I have been going over tutorials and downloaded the 3 and 6 hour free classes, unfortunately, I'm trying to do a controls/data aqusition project, and learning LV is anxilary...maybe you could talk to my boss and get him to spring for a two week class up in the Bay area! 🙂

...thanks again.

0 Kudos
Message 7 of 9
(3,327 Views)

Thanks, I was able to get a couple of DO's and DI's working with my UI.

I'm shooting for some pretty basic functionality to get up and going with my project, I will check out DAQmx Read & Write to see if I can understand them as well.

Thanks again.

0 Kudos
Message 8 of 9
(3,325 Views)

You marked your own post as the Accepted Solution.  You should change this and mark the appropriate post as the solution.  Look under the Options menu (I think)

- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 9
(3,317 Views)