LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Assistant Channels

Hello,

 

I have a DAQ with 4 channels with analog inputs. Right now, I am only using ai0, the first analog input channel which I configured by going directly into the DAQ Assistant block and choosing the channel. I am soon going to have to use multiple channels, and I would like to make a user-friendly interface in which they choose which channels to make active. My thinking was making 4 toggle/switches for each channel which the user can easily make active/inactive and plug in the appropriate wires to the physical channels. 

 

How do I go about doing this; how and where do I connect these booleans to do what I described? Thank you.

0 Kudos
Message 1 of 17
(3,584 Views)

Hi laps,

 

your task will become easier once you get rid of the DAQAssistent and use plain DAQmx functions!

 

You still can use 4 buttons then (or an array with 4 button elements): with each enabled button you can add/append another channel to your channel string…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(3,581 Views)

I'm just going to redirect you to a recent thread: https://forums.ni.com/t5/LabVIEW/Selecting-channels-with-a-Boolean-control/m-p/3819305


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
0 Kudos
Message 3 of 17
(3,577 Views)

First, don't go with the bool or four bools  Use a listbox with the output as array and selection mode 0 or more (auto index the indices to build the channels from the array of selections)

Ala Kazam!

Capture.png

Nicely SCALEABLE!

 

Second, DON'T DO THAT!

So, You got 4 AI Channels.  Read them ALL ALL THE TIME!  Use The Plot Visible Property to display only what is interesting and (Just saying here) Read the plot visible property to stor only the channel data of interest *(to TDMS of course)

 

Capture1.png

NOTE: The For loop should auto-index on all AI, My device has more than 4 AI.Capture2.png

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 17
(3,549 Views)

Hi Jeff,

 

Nicely SCALEABLE! Second, DON'T DO THAT!

There are cases where you don't want to read all available channels. In such cases you only put the channels in the task that you really need!

 

Example: using a multiplexing ADC DAQ card and you want/need to minimze the (timing) delay between the samples…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 17
(3,532 Views)

@GerdW wrote:

Hi Jeff,

 

Nicely SCALEABLE! Second, DON'T DO THAT!

There are cases where you don't want to read all available channels. In such cases you only put the channels in the task that you really need!

 

Example: using a multiplexing ADC DAQ card and you want/need to minimze the (timing) delay between the samples…


With 4 AI channels it's a safe bet that the device is in a C DAQ or C RIO and hence is simultaneously sampled.:D.  Option second in that case.  

 

I did post the other method too.

 

Of course, for the  high speed sequentially sampled...  reading them all all the time highlights ghosting setup issues and trains the techs to watch for that.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 17
(3,523 Views)

Hi Jeff, I wanted to try your latest code but I don't think it is saved as a snippet somehow or I am just not importing it correctly? I tried dragging your image directly onto my block diagram but just a blue hyperlink appeared instead. I saved your image as a .png and dragged the file from windows explorer onto my block diagram page and your image appeared but it wasn't code; it is just an uneditable image... How would you advise?

0 Kudos
Message 7 of 17
(3,502 Views)

@laps682 wrote:

I saved your image as a .png and dragged the file from windows explorer onto my block diagram page and your image appeared but it wasn't code; it is just an uneditable image.


What version of LabVIEW are you using?  Do notice that the snippet was saved with LabVIEW 2017.


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
0 Kudos
Message 8 of 17
(3,495 Views)

Ah I'm sorry, I have 2018... Is there any way to convert or make it compatible or should I just replicate from scratch?

0 Kudos
Message 9 of 17
(3,492 Views)

Hi laps,

 

1. click the snippet image to start the forum's image viewer.

2. Download the image from that image viewer using it's download button.

3. Create a new VI, open its block diagram window.

4. Drag the saved image from your download folder into the block diagram.

Ready!

(That's how snippets work!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 17
(3,484 Views)