06-30-2014 09:04 AM
Hi, I am new to this software.
I am using an NI USB-6501 24-line digital IO.
I have physically wired PIN0.7:0 to PIN1.7:0, so the entire PORT0 goes to PORT1
I want to click those boolean array buttons, to set the output levels of PORT0, then have the signal go through the wires to PORT1, which is then set accordingly, and then I want to ouput PORT1 using DAQ Assistant2 into:
1) an LED boolean array
2) a string showing the value of the port in hexadecimal.
THE PROBLEM:
The datatype flowing out of DAQ Assistant2 is "1D array of unsigned long". The input of the array that should receive it is "1D array of boolean"
So there is a datatype mismatch.
How can I make this work? As you can see, I've tried to place converters, I've tried multiple converters, but I don't know what to do. Advice?
Solved! Go to Solution.
06-30-2014 09:05 AM
Attached the VI.
Also: is my block placement reasonable and good practice?
06-30-2014 09:32 AM - edited 06-30-2014 09:33 AM
Stupid DAQ Assistant. I have no clue what it is thinking wanting an array. Personally, I would just use the actual DAQmx API. At least then you can tell what is happening and it has less overhead.
A couple of other things:
You need to move your controls and indicators for the DAQ values inside of the loop. This way they can update with each loop iteration.
You really should add a Stop button. You need some way to cleanly stop your VI and not use the Abort button in the toolbar.
06-30-2014 09:35 AM
06-30-2014 09:41 AM
Thank you a lot. Yes I felt the DAQ assistant was a real nuisance, especially since it doesn't say what it does, visually, I'd rather get into the specific blocks.
I am aware that the code was atrocious, I am a complete novice, and I am taking classes, courses and web seminars and the whole thing, I really like LabView, and I just have some hurdles with how to use it properly, and not some kind of graphical implementation of C.
Thanks a lot for the solution, I am going to create it as well, and check the steps to understand the logic. Appreciate it very much! Kudos for everyone!!
07-01-2014 02:43 AM
Hello DrOnline,
If you're looking for some (getting started) documentation concerning DAQmx VIs, then this page might also prove to be useful:
http://www.ni.com/white-paper/2835/en/
When you are only doing an acquisition or only doing generation from inside a while loop, then the DAQ Assistants can still be useful for people who are new to LabVIEW and Data acquisition.
However, if you are using a combination of generation and acquisition from inside one while loop, I would always advise to got to the DAQmx VIs.
It might take some time in the beginning, but you will generally find this time spent investigating the DAQmx possibilities worthwile in the end.
If you're interested in seeing what happens inside a DAQ Assistant, then you can right-click it and select "Generate NI-DAQmx Code".
This directly brings me to "performance". Do note that the DAQ Assistant can incur some overhead.
While this might not matter for most people starting to use the DAQ Assistant, it does seem to convince people often that taking the time to understand DAQmx VIs can be worthwile.