LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wire non-empty waveform array to chart history

I'm having two issues when writing to the wveform chart history that I cant seem to figure out.

1) when writing a blank waveform array to the history, it is supposed to clear the chart, which it seems to do, but when writing begins again, it does not begin drawing to the beginning of the chart, but rather where it left off, or at the end once it has filled at least one full screen.

2) When writing a non empty array to the history, The X scale seems to get reset to 2 seconds if i have set it to any value below 1 second. Above one second it seems to work fine, but anything below makes the scale change automatically, which is rather frustrating.

Attached is a VI i've made where you can see these problems in action

Has anyone come across these problems? Are there any ways to get around them?

Thanks in advance,
-Jorge
0 Kudos
Message 1 of 6
(2,844 Views)
Since you are plotting the waveform, the waveform time is used for the x-axis.  EVery time you restart the VI, the simulate signal starts at time 0 (7PM, 12/31/1903), and starts counting up.  So, even though you clear the chart history, the time value is still >0 and therefore plots at the corresponding place along the x-axis.

When you set it to a fixed array, you are specifying the time.  So it plots that point, then goes back to the time coming from the simulated signal.
0 Kudos
Message 2 of 6
(2,841 Views)
I don't think that it has to do with time since once the plot area is filled up once, sending the blank array makes it start plotting at the same position every time in scope mode (try clicking wildly on the blank array trigger, it starts plotting again at the same exact position near the end of the chart every time). If it were plotting it at a particular time, then it's starting position should be much more random.

For the fixed array, where it plots the point is not my main concern so much as the fact that, for a certain condition (chart start to finish time <1 second) the scale gets reset when an arbitrary array is sent to history. If I have not set the chart to autoscale X, the scale should not change regardless of what waveform i send at it (note, I dont care about the actual times shown on the chart, just the ammount of time represented by the chart)

(edited for spelling)


Message Edited by AKA me on 05-21-2008 02:57 PM
0 Kudos
Message 3 of 6
(2,834 Views)
1.  When you empty the array, the chart goes back to zero because there is no data.  However, the next plot point coming from your simulated signal has a timestamp embedded in it.  When you plot a signal with a timestamp, LabVIEW uses the timestamp.  If you probe the signal wired to the plot, you will see it starts counting up from 7PM 12/31/1903 (which is zero for LabVIEW).  When you clear the chart, the timestamp is not reset, so the next point is 0+x, and the first point that gets sent to the chart will cause the chart to jump to point x on the x-axis to plot the data. That x value will be very close to the last data point you plotted.  If you probe the signal, you will see that the x value is always related to the number of seconds in the timestamp.  If you want it to restart at time 0, then you can't use the timestamp.

If you click wildly on the empty array button, you will see the x max value is changing to plot the next data point.  It then adjusts the x min value to have the time window displayed.  It is always over at the right because it doesn't start at time 0 except for the very first time the loop executes.

2.  LabVIEW automatically changes the x axis max and min when you write new history to it.  If you reapply your X Min and Max after setting the history, I believe the chart will behave how you expect it.
0 Kudos
Message 4 of 6
(2,824 Views)
I appreciate your time and effort, I hope im not comming accross as argumentative.


@Matthew Kelton wrote:
It then adjusts the x min value to have the time window displayed.  It is always over at the right because it doesn't start at time 0 except for the very first time the loop executes.


The autoadjustign of the scale to put hte new waveform at the end woudl account for the behavior, but it seems rather strange that it woudl be set up to do it that way. It also gives the impression that there is no way to make it start charting on the left again without restarting my loop, which would be a much less than ideal solution. Is there no way to work around this automatic adjustment?

As for the scale issue with the arbitrary waveform, I would believe that what you say is true if it were not for the fact that it does not reset the scale for any time window above 1 second. It actually works perfectly above that limit. This inconsistency is what is causing me so much confusion.
0 Kudos
Message 5 of 6
(2,816 Views)
If you break the y values out of the waveform, or overwrite the timestamp with a timestamp relative to the last time you reset your history, then your charts will reset to 0 time.

All I can say is I put a XScale max/min setting to reapply your desired settings after the history update and it worked.
0 Kudos
Message 6 of 6
(2,805 Views)