LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

enabling disabling several DAQ channels

Hello. I'm just about to start my first 'biggish' project with labview using a Compact DAQ system. 🙂

 

I am using a 16 channel thermocouple module. On the front panel, I want the user to be able to select which channels on the TC module

they want to aquire data from.

 

Once the channel selection is complete I need to be able to send the channels which are to be aquired to the create channel VI to start the aquisition from the required channels.

 

I know how to use the create channel VI to aquire multiple channels but i need to work out this selection method somehow?

 

I want the channels to be selected on the front panel by using a checkbox.

 

I know that i will have to use a DAQmx Global Channel to input the channels.

 

Thank you in advance,

Rhys

0 Kudos
Message 1 of 2
(2,430 Views)

Below is a way to create a channel list that you can send to the Create Channel vi.

 

1) Create a string array constant and enter the channel names

2) Create array with your checkbox booleans

3) Use a for loop with a shift register to build channel string

 

Note that if no channel is selected the string would be empty which will give an error if you wire it to the Create Channel vi.

So you have to check for this and prompt the user to select at least one channel.

create channel list.PNG

But ... I probably would not do it this way. 

 

Instead of selecting the channels to be acquired as you have proposed, I would acquire all of the channels all of the time.

Once you get the "all" channel data - you can then choose which channel data to use based on your checkboxes.

 

Benefits:

 

1) Your acquisition code never changes

2) The array of data returned from the DAQ will always have the channels in the same place - making life easier for you

 

steve 

 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 2 of 2
(2,416 Views)