LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Select from an NIDAQmx physical channel control programmatically

Solved!
Go to solution

Does anyone know how to select from a NIDAQmx physical channel control programmatically.  Specifically if the user has filled out an array table column with 1,3,4 for example, I want to select WLS-9163/ai0, WLS-9163/ai2, and WLS-9163/ai3 from the physical channel control, place these choices into an array and start my acquisition task with said array.

 

Thanks much.

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

You can put the desired channels in an array and use a For Loop around the Create Channels function.

 

daq1.png

 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 6
(3,669 Views)

Thanks Steve,

 

This looks close to a solution!  I can hard code the list of "Actual Device Channels", but it would be nice to programmatically acquire this list.  Maybe I don't need to use a physical channel control... but this control is finding out which device(s) and which channels are available, so I had hoped I could access it programatically.  Any further ideas?

Response1.jpg

 

I am modifying what used to be an acquisition system based on an ASIO sound driver and sound recording equipment.  The system will now be based on the WLS-9163.  The users are used to thinking of things in terms of channel 1,2,3 etc.  While I could modify their interface, I would rather it stayed identical for them, hence my need to map "1" to WLS-9163/ai0.

 

Thanks much

Terry

 

0 Kudos
Message 3 of 6
(3,663 Views)
Solution
Accepted by topic author acfkt

Terry,

 

This will give you an array of the Analog Input channels (AI.PhysicalChans):

 

AI Channels.png

And the product name (Type).

 

Is this what you were looking for?

 

steve

 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 4 of 6
(3,658 Views)

Yes that would be exactly what I was looking for.  Thanks Steve.

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

With Terry's example, is it possible to use a function that will pass different configurations with the User's selections rather than typing them manually. 

 

What I really mean is: 

 

1: ON 

3: OFF 

0: OFF

 

1: OFF 

3: ON 

0: OFF

1: OFF

3: OFF

0: ON 

 

etc etc... 

 

Many Thanks

 

0 Kudos
Message 6 of 6
(3,213 Views)