LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6501 digital IO output datatype

Solved!
Go to solution

Hi, I am new to this software.

 

watdo.JPG

 

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?

0 Kudos
Message 1 of 6
(3,790 Views)

Attached the VI.

 

Also: is my block placement reasonable and good practice?

0 Kudos
Message 2 of 6
(3,788 Views)
Solution
Accepted by topic author DrOnline

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 6
(3,776 Views)
Your code does not make any sense. You can't change the output values as the VI runs and you can't read anything until it stops but you cannot stop it.

Please look at the DAQmx examples that come with LabVIEW. They don't use the assistant or the evil dynamic data.
Message 4 of 6
(3,772 Views)

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!!

0 Kudos
Message 5 of 6
(3,762 Views)

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.

 

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 6 of 6
(3,724 Views)