LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selected physical channels to array

I would like that after select several channels of differents devices (with DAQmx Physical Channel component), this selected channels will be put in the array.
I look for forum but I didn't find anything.
If somebody already tried to do this, please send me suggestion.
Thx for all
 
Look in the attached picture.
Leonardo de S. Cavadas
Maintenance Engineer and Inspection - Bureau Veritas do Brasil

Engineer Metallurgist with emphasis in Advanced Materials
Technologist in Computer Science
0 Kudos
Message 1 of 10
(5,587 Views)

Leonardo,

Attached is a simple method to do what u need.  For a better user interface, try making the same thing using an event structure.

 

Chris Co

0 Kudos
Message 2 of 10
(5,580 Views)

I forgot ...my Labview version is 7.1.

Thx

Leonardo de S. Cavadas
Maintenance Engineer and Inspection - Bureau Veritas do Brasil

Engineer Metallurgist with emphasis in Advanced Materials
Technologist in Computer Science
0 Kudos
Message 3 of 10
(5,574 Views)
It is a simple while loop that builds an array of channels whe the add button is pressed.  You may want to add error control so a duplicate name cannot be used
 
Chris Co
0 Kudos
Message 4 of 10
(5,566 Views)

Chris,

Now you will understand what I want. I didn't expressed well. Look for attached VI

Leonardo de S. Cavadas
Maintenance Engineer and Inspection - Bureau Veritas do Brasil

Engineer Metallurgist with emphasis in Advanced Materials
Technologist in Computer Science
0 Kudos
Message 5 of 10
(5,560 Views)

If you build the vi the way the attached document in prev post, it does exactly that.  The only difference is that you want a string array out.  Do you really need/want a string array.  If you need it to be a string, then just type cast the physical channel to a string before building array.

 

Chris Co

Message 6 of 10
(5,549 Views)

You can just use DAQmx Unflatten Channel String. In my version of LabVIEW, its on the DAQmx Advanced>DAQmx Utilities palette.

Message Edited by Dennis Knutson on 12-11-2006 12:49 PM

Message 7 of 10
(5,542 Views)
Yes, that works if the user types multiple channels into a channel control seperated by a comma. Personally I try to avoid the user from typing to avoid mistakes or extra code to check if they did type correctly.  But your method is much simpler.
 
Chris Co
0 Kudos
Message 8 of 10
(5,535 Views)
Actually, the user doesn't have to type in anything. By clicking on the arrow on the right side, the user can select browse and then just use the mouse and either the shift or CTL key. So, a channel list like Dev1/ai0:2 will get translated into an array with Dev1/ai0, Dev1/ai1, and Dev1ai2 as separate elements.
0 Kudos
Message 9 of 10
(5,533 Views)

I did not know that feature worked when you wanted more than one channel.  In the past I had to type them in.

Chris Co.

0 Kudos
Message 10 of 10
(5,521 Views)