From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Select specific channels to display for indicators (DAQ)

Solved!
Go to solution

Hi.

 

I have 4 analog input channels connected with a pxi module (0, 1, 2 and 3) in one task. I used a case structure for each one of the input channels.  I used index array to split the graphs and read them in a while loop. If I want to select channel 1 and 3, for instance, the graphs are confused and they are displayed in channels 0 and 1. Is there any way I can fix the channels to be displaced in the right indicators?

 

Regards,

 

StathPOl

0 Kudos
Message 1 of 15
(3,951 Views)

Can you attach your VI?

 

Why do you use loops at all to split data? You know there is an "Index Array" function?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 15
(3,936 Views)

If you want to index specific elements of the waveform array for visualization, you can do this:

 

splitWF.png

 

 

0 Kudos
Message 3 of 15
(3,925 Views)

Thanks guys, I attached vi..Once buttons 2 and 4, the signals appear in the 1st and 2nd indicators.  

0 Kudos
Message 4 of 15
(3,910 Views)

StathPol ha scritto:

Thanks guys, I attached vi..Once buttons 2 and 4, the signals appear in the 1st and 2nd indicators.  


 

Could you save the vi for LabVIEW 14? I cannot open it.

0 Kudos
Message 5 of 15
(3,896 Views)

14 version Attached.

0 Kudos
Message 6 of 15
(3,889 Views)

Ah, the code sheds some light on the issue.

 

First of all, your array handling in "Producer Loop" is hopefully just quick and dirty tesing and will disappear in the final implementation.

 

The issue is that you have an incorrect assumption about the channel assignment in DAQmx:

DAQmx does NOT care about the channel names (or "physical order"). It does only care about the order of the channels as you assign them to the task.

The task will return an array of data which reflects the index-order of channel assignement.

 

So if you assign CH0 and CH1 in this order (dev1/ai0, dev1/ai1), you will get CH0 as index 0 and CH1 as index 1.

If you assign CH1 and CH0 in this order (dev1/ai1, dev1/ai0), you will get CH1 as index 0 and CH0 as index 1!

 

If you want to disable updates in the graph with the buttons, you ALWAYS have to acquire ALL channels and simply suppress graph updates for the individual channels.

Please note that i recommend you a different approach:

Display ALL channels in one graph and display the "Plot Visibility Checkbox" in the plot legend (right-click context menu on the plot legend).

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 7 of 15
(3,886 Views)

Even if you do it with 'index array', my question basically is if I can lock the signals on the boolean buttons. If sensor 2 will be used, this will be displayed in the third indicator. 

0 Kudos
Message 8 of 15
(3,882 Views)

I did not notice your reply 

0 Kudos
Message 9 of 15
(3,880 Views)

so for example, if a sensor (3) breaks, can't i just deactivate the boolean and work? Do I need to re-modify the vi again?

0 Kudos
Message 10 of 15
(3,857 Views)