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.
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.
02-05-2016 07:48 AM
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
Solved! Go to Solution.
02-05-2016 07:50 AM
Can you attach your VI?
Why do you use loops at all to split data? You know there is an "Index Array" function?
Norbert
02-05-2016 07:59 AM
If you want to index specific elements of the waveform array for visualization, you can do this:
02-05-2016 08:18 AM
Thanks guys, I attached vi..Once buttons 2 and 4, the signals appear in the 1st and 2nd indicators.
02-05-2016 08:27 AM
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.
02-05-2016 08:33 AM
14 version Attached.
02-05-2016 08:36 AM
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
02-05-2016 08:37 AM
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.
02-05-2016 08:38 AM
I did not notice your reply Norbert_B...I will check it and get back. Thanks.
02-05-2016 09:45 AM
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?