LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem when modify the plot name

I had a problem to modify plot names. I am trying to assign a string array to plot name, for example assign the first element 'data 1' to plot 1, assign 'data 2' to plot2... The problem is the plot names displayed in the plot lengend is not like what I expected, the first one 'data 1' always shows up at the bottom not at the top. Is there anything wrong?
0 Kudos
Message 1 of 8
(2,866 Views)
You need to assign active plot before you make any modifications. Reverse the order of your property node and it should work.
Message 2 of 8
(2,857 Views)
It works! Thank you!
0 Kudos
Message 3 of 8
(2,851 Views)
I could not open your VI but I did a quick test on this and can confirm what you see. i do not know why this is. first i took and populated one at a time with a while loop manaully incrementing the active plot and changing the name and everything was fine. then i decided to automate it with a for loop and used the string array as the input to the for loop and let the for loop increment the active plot and it works like you said it puts the first (0) element in the array on the bottom everytime. This seems like a bug to me. the work around that found and seems to work (tested only a couple of times) is to rotate the arrray before the for loop. WEIRD Behavior. I'm glad you brought this up.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 8
(2,850 Views)
Dennis I do not ubderstand why you have to reverse the order. It should work the same as if you did it manually.Look at the two pics #1 does not do it correctly it puts 0 on the bottom pic 2 does it correctly.Am I missing something or should it work the same both ways



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 8
(2,849 Views)
Since in your examples, there's no data flow between the two separate property nodes, which one gets written to is a matter of chance. Modifying one or the other and forcing a recompile, you have a chance of changing which gets written first. The actual active plot can be changed by many things (i.e. just clicking on one of the plots) so when modifying a plot property, you need to initialize it to some known value first.
Message 6 of 8
(2,845 Views)
I see now my stupidity reins again. The attached pic works time after time. Thanks dennis for pointing out my error.



Joe.
"NOTHING IS EVER EASY"
Message 7 of 8
(2,842 Views)
Joe,

I hope no one ever counts the number of brain farts I get every day.;)
0 Kudos
Message 8 of 8
(2,835 Views)