LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reinitializing Chart Values

I am trying to create a chart that displays incrementing values every one second. I can get it to work, however every time i stop and restart the program it puts the data from the previous run and continues from where it left off. Currently I have a property node that is supposed to reinitialize the chart to its default values, which it seems clear the chart but then seconds later just puts all the data back giving me the same issue. Is there a way to fix this? I am uploading the file (the chart in question is in the third tab of the tab structure).

Message 1 of 6
(2,361 Views)

Reinit to Default doesn't seem to clear the chart history.

 

Get rid of that and create a property node of the chart for "History".  Change that to Write Mode, right click, and create constant.  That will create an empty array which will clear the history of the chart.

0 Kudos
Message 2 of 6
(2,331 Views)

Thanks for the reply!

 

I have attempted that as well and it has the same issue....

0 Kudos
Message 3 of 6
(2,326 Views)

Attach that attempt as a VI.

 

Because when I wire an empty array to the History property node, it works just fine for me.  See my attachment.

 

Your VI structure has a few oddities.  It is very rare for a tab control to be wired to anything, especially a case structure.  A tab control is more of organizer of front panel controls for the user interface as opposed to something that would control data flow.

 

Your VI seems inside out.  Usually a while loop would be the outer most structure, and a case structure inside of that.  As it is now, along with the point just mentioned, you need to have your tab control set to a specific tab before you start running it.  Then when you are done running it, it is done.  If you need other code that is somehow associated with other tabs, you are forced to change the tab and restart it.

 

You probably really want to look at a state machine architecture.

0 Kudos
Message 4 of 6
(2,318 Views)

RavensFan,

 

Thank you for the advice, I will look into this. As for the initial problem, I ended up using a multiple plot xy plot since it makes more sense for what I am trying to do with the data. This ran into the same issue and I was able to fix it by initializing my shift registers.

 

Thought I would post my solution in case anybody else runs into this issue.

0 Kudos
Message 5 of 6
(2,286 Views)

I would have suggested that also, but your VI didn't have any uninitialized shift registers.

0 Kudos
Message 6 of 6
(2,280 Views)