LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple devices with daqmx

Solved!
Go to solution

I havent used daqmx much, so I have a very basic question. I want my program to only support a specific usb daq, (6509), and also find the associated device name regardless of how it is enumerated on the PC. 

 

I have a subvi which automatically searches the computer for usb-6509, and outputs the device name. My question is, where do I wire this device name into daq MX? Is it the "name to assign" terminal?  Clearly it's not like a visa resource. 

 

Please see the following and let me know if I"m right.

 

Thanks, gurus! 😄

 

 

0 Kudos
Message 1 of 4
(2,617 Views)
Solution
Accepted by topic author LeroyBogz

That device name can be used as a string.  Meaning if you take your device name and concatenate "/port0/line0" then you have a new string with the name "Dev1/Port0/Line0" this can then be used as the physical channel for a task.  If you need multiple channels then create an array and use the Flatten Channel String to get them all in a scalar data type.

0 Kudos
Message 2 of 4
(2,614 Views)

hey, thanks a lot!

 

Please confirm that the following is correct (and best) whenever you get a sec 

0 Kudos
Message 3 of 4
(2,602 Views)

You understood what I said (which is great) but I do have a suggestion for improvement.  In your for loop you are reading the value of the DAQmx Device.  This value doesn't change but you are reading it each iteration so there is no need to have this in the for loop.  Additionally there is no reason to use the property node at all.  Just wire from your DAQmx Device (the indicator on the outside of the case structure) and wire that into the for loop you have, to the top terminal of the concatenate string and you should be set (bobs your uncle or something)

 

Interestingly enough the constant of your channels (the big I/O constant with port and line) can be a string too.  This could be loaded from a file or the user can enter data in.  You could use an enum, or ring, or combo box to allow them to select these channels too.  Then you are giving them the channel selection, while knowing that the device is always the one you want.  All optional of course.

0 Kudos
Message 4 of 4
(2,587 Views)