LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tab Control: Chart data resets when changing in between tabs

Solved!
Go to solution

Hey!

 

I've been having some issues with a pair of waveform charts that I'm using as part of a front panel that'll act as an HMI for an application that I'm developing. 

 

As of right now, I have 8 different waveforms built as an array that is connected to a waveform chart (with t0 being the current timestamp of the program and dt being a 1000 ms constant) in one of the tabs:

AdrianDav_0-1584471532627.png

And in another one of the tabs I have a similar arrangement for a chart, except that I have 5 waveforms in it.

 

The thing is, with this arrangement, when there is a change of tabs, the history data of the waveform chart resets and I know that if I don't use waveforms and just bundle the data straight up into the chart, I could see all the plots separately and the data doesn't reset. But the thing is that with that approach, the X-Axis doesn't show the current date/time and I need to have that in the X-Axis.

 

I also know that with an XY Graph, things could be done in a simpler way, but I can't use a Graph because I'm working with properties of the plots of the chart in another part of the code. 

 

Do you guys know about any way that I could still use the arrangement from above and prevent the data reset that I'm experiencing?

0 Kudos
Message 1 of 8
(3,070 Views)

Hi Adrian,

 

so there is a problem in your VI, but you hesitate to attach your VI.

While there may be reasons to do so it does not help us to help you…

 

Why do you need to build waveforms consisting of just one sample?

Why do you need 2 indicators for each SharedVariable item?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,065 Views)

Hi and thanks for the quick response,

 

I'll attach the vi, but I have a lot of other subVi's inside it and I don't think that it might run without them. 

 

The two indicators are used to display the value that is read from the shared variable in different objects located in the front panel (a filler and a numeric indicator). This value, which is a temperature measurement, is also the one that is plotted into the chart.

 

I am building waveforms consisting on one sample to individually plot each one of them with the same x-axis properties. I've tried plotting only an array of all of them, but I need them to be plotted individually.

 

If I don't use that build array, I'm not able to build the waveforms. 

0 Kudos
Message 3 of 8
(3,053 Views)
Solution
Accepted by AdrianDav

HI Adrian,

 

is there no way to read those SharedVariables as an array of values (using one SharedVariable) instead of >50 scalar variables?

Do you really need to set a huge amount of property nodes each iteration?

Do you need to do this in a loop with a "zero millisecond" wait statement?

 

When you make the digital display of the fillers visible then you don't need any additional indicators!

Charts take more datatypes than array of waveforms:

check.png

You really need to cleanup the whole VI - and rethink the overall design if possible…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(3,028 Views)

Hi GerdW,

 

As of right now, no. I can't read those shared variables as an array, because the values that they contain are coming from another subvi which establishes communication with a PLC. 

 

The property nodes each iteration are set for different functions that the vi should have when operating, so I have to set them this way.

 

That zero milisecond wait is something that I've forgotten to erase, it has no effect in the execution of the vi whatsoever now. I'll remove it.

 

I know that the filler has a digital display also and that a numeric indicator might me redundant and pretty much memory consuming because of this option, but it was a thing that was solicited by the client so I had to comply.

 

Would that data arrangement (using the arrays of data) let me see the Current Time/Date in the X-Axis of the chart?

 

Thanks for the answers!

0 Kudos
Message 5 of 8
(3,017 Views)

Hi Adrian,

 


@AdrianDav wrote:

I can't read those shared variables as an array, because the values that they contain are coming from another subvi which establishes communication with a PLC.


You might change that other subVI to put all those scalar values into arrays.

Why do you need SharedVariables to transfer data from a subVI? There are easier/better (aka more performant) ways to transfer data!

 


@AdrianDav wrote:

I know that the filler has a digital display also and that a numeric indicator might me redundant and pretty much memory consuming because of this option, but it was a thing that was solicited by the client so I had to comply.


The customer will not see a difference wether you use the digital display of the filler bar or a separate additional indicator…

 


@AdrianDav wrote:

Would that data arrangement (using the arrays of data) let me see the Current Time/Date in the X-Axis of the chart?


When you need this feature I would use graphs instead of charts, they are much more powerful…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(2,982 Views)

Hi GerdW,

 

I'll try to change the subVi as much as possible to simplify the data arrangement. It was done this way because of the used communication protocol's characteristics.

 

I'll make some changes to my front panel, mostly to replace that extra indicator.

 

I'll give it a try to the graph, the only issue that I have with using it right now is that I have a part of code in which I use properties of the plots of the chart to hide or show them, depending of a certain selection that the user makes. If I recall correctly, in a graph there is no such thing as active plots, or am I making a mistake?

 

Best regards and thank you for your answers.

0 Kudos
Message 7 of 8
(2,966 Views)

Hi Adrian,

 


@AdrianDav wrote:

If I recall correctly, in a graph there is no such thing as active plots, or am I making a mistake?


You make a mistake: graphs also support an ActivePlot property along with several plot properties…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(2,940 Views)