07-29-2010 04:47 PM
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?
Solved! Go to Solution.
07-29-2010 04:50 PM
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.
07-29-2010 05:11 PM
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.
08-16-2010 05:07 PM
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.
08-16-2010 05:18 PM
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.
08-16-2010 05:27 PM - edited 08-16-2010 05:28 PM
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.
08-16-2010 07:03 PM
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.
08-16-2010 07:07 PM
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.
08-16-2010 07:18 PM
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)