LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

not clear waveform chart but clear X axis after resume

Hi,

 

I am running Labview 8.2 to collect tempratures from 4 usb pico units and output all 32 channels to a single waveform chart.  I'got the pause/resume button working and the waveform displays real system date time on the X axis. 

 

When started the first time the waveform displays data and the X axis system/date time work correctly, but the problem happens only after the pause and resume: when I pause the chart, the data on the chart stays and when I press resume the chart continues on nicely - but one thing, the system/date time on the X axis is now incorrect.  

 

I have property nodes for XScale.Offset and XScale.Multiplier setup correctly, if I clear the chart by adding the "History" to the property node then the X axis works correctly after a resume but the chart is cleared (old data disappeared and populated with new data) - which I don't want.  And if I don't clear "History" then the X axis time is incorrect.

 

What I really want is after the resume only to reset the X axis time to correct date/time but not clearing the chart.

 

Thanks,

Victor.

 

0 Kudos
Message 1 of 6
(4,095 Views)

It would be easier to help if you posted actual code.

 

If you are using a waveform chart, you have essentially 3 pieces of data.  1.  The start time (T0) , the time interval between samples (dT), and a 1-D array of samples (Y) that assumes that they are evenly spaced in time.  You can add 1 more data items to the chart at a time, and that data just gets appended to the end of the Y array (also known as the history).

 

If you set T0 and dT right, then it will look like you have your real time progressing along the X axis.  But if you are putting in items at 1 per second, but then skip a minute before putting in a new item, that new item will look like it is 1 second more recent on the chart rather than 1 minute more recent.  Your times will fall behind.

 

You should use an XY graph.  It allows you to put in data where the X values are not evenly spaced.  You feed it a 1-D array of X values and a 1-D array of Y values.  (Check the examples for XY graphs because there are other ways to build the data to feed to the graph using clusters.) The disadvantage is that you will have to maintain your own history by storing the data arrays in shift registers and appending the new data yourself using build array.

 

One other alternative using a waveform chart is that during your pause time, you feed the constant NaN to the chart at the same rate you would have been feeding actual data.  It will essential create blank points in the chart, but the time intervals between points will remain consistent.

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

Hi Victor,

 

I'm not sure that you can do what you want with a waveform chart, as the X axis really isn't specified separately.  You can do it with an XY graph, though...see attached.  I just sort of scribbled this up, so I'm sure that there are improvements you can make, but it does do what I think you want.

 

Diane

0 Kudos
Message 3 of 6
(4,075 Views)

Thank you Raven and Diane.  Yes I am now thinking of using the XY graph as it probably gives control, Diane, I am using 8.2, and can't open your sample code, do you think you can cook it up using 8.2 or repost it using an image?

Thanks,

Victor.

0 Kudos
Message 4 of 6
(4,060 Views)

Sorry...overlooked that part of your first post.

 

Try this.

 

d

0 Kudos
Message 5 of 6
(4,045 Views)

Thanks so much Diane.  I was able to open and I will learn it from here...  Thanks again.

Victor.

0 Kudos
Message 6 of 6
(4,035 Views)