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.
03-29-2018 10:23 AM
Hello everyone, I have a configuration file 164 rows and 12 columns, column 4 is the sensor name, each row related to different sensors, I would like to assign the sensor name (column 4 value) to the plot name, I'm using index array function within a for loop, I want to assign column #4 value from row 0 to row 7 to plot 1, row 8 to row 15 to plot 2, etc. The way I did here will assign all the values to one plot. Any suggestions? Thank you very much.
Solved! Go to Solution.
03-29-2018 10:46 AM
Will that code even run? I'm not talking about the property node with unwired inputs, but how does the For loop know how many times to run? You need an autoindexing tunnel or wire the input "N".
03-29-2018 10:56 AM
I connect an array and wiring to the edge of the for loop with indexing enabled, it will run. I would like to programmatically change the plot legend of multiple charts, so there is one property node unwired.
03-29-2018 11:09 AM
Xiao@Gemini wrote:
I'm using index array function within a for loop, I want to assign column #4 value from row 0 to row 7 to plot 1, row 8 to row 15 to plot 2, etc.
Can you explain what you mean by this? Each plot can only have a single name.
Did you try using highlight execution to slow it down and see what is being written to each plot? Using Active plot followed by plot name works fine for me...
03-29-2018 11:11 AM - edited 03-29-2018 11:12 AM
Just a quick test, you can probably optimize it :
EDIT : might be 8 and not 7 as Quotient and Remainder input 😉
03-29-2018 11:16 AM
Use a case structure where the input to the case structure is the iteration number for the FOR loop. Label your cases "0..7", "8..15", and so on. Put the relevant property node in each case.
The case structure can accept numeric integer inputs and can have ranges of values for cases. "0..7" means any input in the range of 0-7 (inclusive) will trigger that case. "8.." means any number >= 8. "..0" means any number <=0.
VI snippet attached, drag and drop this into LabVIEW to see what I mean.
(Note that I only made one plot and multiple property nodes referencing that same plot, you'll need to change that to one node per structure. You will also need to decrement the ActPlot by the first index you're filtering; otherwise, the second plot will start at ActPlot=8 instead of 1.)
Another way to do this would be to use nested Case structures, where each one does a compare on the input number to see if it's within the range of "acceptable" values for that chart.
Yet another way to do this would be to use Get Array Subset with indexes at each "delineation" and wire them all up in parallel. That way is probably the "simplest" to use but is the least expandable since everything happens in parallel.
03-29-2018 11:17 AM
I want to programmatically change plot legend of multiple charts (each chart have 8 plots) with only one reference spreadsheet which has 164 rows.
03-29-2018 11:34 AM
You have a lot of options as explained in the previous posts 🙂
03-29-2018 11:35 AM
Xiao@Gemini wrote:
I want to programmatically change plot legend of multiple charts (each chart have 8 plots) with only one reference spreadsheet which has 164 rows.
I see. Well it looks like others have already given you suggestions down that avenue 🙂
03-29-2018 12:35 PM
Excuse me again, how to decrement the ActPlot by the first index you're filtering. Thank you.