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: 

Programmatic chart

Solved!
Go to solution

Hi,

 

In Matrix proof vi. I'm trying to plot the rows and the columns of a 2D array of levels in separate charts. I tried to build a tool to activate/deactivate this visualization: when any of the buttons is pressed the corresponding row/column is shown in a chart. This could be helpful to see trends from the moment one presses that button (the chart is cleared when not shown).

Now, it seems to work as I intended however, there's one issue I do not understand. In the sensor chart, the plot 0 changes its color every iteration. I copied the same approach to build the magnitude chart and it does not show this behavior.

Anyone sees what's going on?

 

Thanks for your help.

 

Download All
0 Kudos
Message 1 of 3
(820 Views)
Solution
Accepted by topic author cobayatron

Something is messed up in your chart?  When I take your other chart, make a copy and replace the one that changes colors, it doesn't do that anymore.

 

I'm concerned about your use of local variables in the VI.  You've got a race condition as to whether data is written to Current Values terminal, or read from either or both of the local variables first.  Get rid of those local variables and use a wire.

 

Also, you talk about a Matrix, but in reality, you are working with 2-D arrays.  Except in some of your code, you are using matrix functions.  Matrix functions are pretty rare to use in LabVIEW and usually only in connection with linear algebra.  You should be using array function throughout your code based on what I see you are trying to do.

0 Kudos
Message 2 of 3
(798 Views)

Many thanks! You are right, that works, I must have touched too many things in the chart...

Also, thanks a lot for all the corrections you mentioned, it definitely looks cleaner now.

0 Kudos
Message 3 of 3
(778 Views)