06-09-2011 07:53 AM
Hello
Please take a look at this vi:
06-09-2011 07:59 AM
I suspect the seting "Ignore attributes" is NOT checked on your chart.
When that property is NOT checked the Chart will use the "t0" and "dt" of the waveform to plot the data. If the "t0" are goofy or inconsistant with the "dt"s and data sets (i.e. new updates can not over lap old updates in time) or the chart will reset.
If that is wrong please post an image of the code.
Ben
06-09-2011 08:18 AM
06-09-2011 08:36 AM
Quoting Rich Breuggman the first non-NI_CPI who taught me in LV Basisc I about 12 years ago...
"If in doubt, right-click".
Ben
06-09-2011 09:59 AM
Hi Ben
Here is the image of the code:
The initialization does a few things: clear chart history, define xscale format and give current time and date to the offset, set ignore attributes to true.
I am now pretty sure that the x axis display problem is caused by the waveform array - x axis shows the wrong year(2065?) and wrong time. Other data type works fine.
The shared variable "waveform array" passes an array of waveform data, which conains two elements.
Thanks!
Best regards
Zhang Zheng
06-09-2011 10:07 AM
It looks like you are getting bogus time stamps from the SV.
This thread talks about the chart and waveforms.
Try click the Chart on the front panle to find the ignore...
Ben
06-10-2011 12:46 AM
@Ben wrote:
It looks like you are getting bogus time stamps from the SV.
This thread talks about the chart and waveforms.
Try click the Chart on the front panle to find the ignore...
Ben
As far as I understood this example uses "t0" from the waveform data for x axis. I tried this method and it works. The date and time shows correctly. That's great.
But I actually have another request for the chart display, that is to show data in a certain time period, which should be programmable. For example I could let the chart show the data waveform in 10 seconds this time(I mean in one screen without scrollbar), and the next time I execute it, I change the parameter and show the data waveform in 60 seconds.
I tried to modify the initialization like that:
I thought by changing the maximum value of the scale range, I could realize that. This kind of setting didn't really work. before the breakpoint, the time in x axis became chaos again, and after going into the loop it returns to correct value.
Do you have any ideas how to realize that?
Thanks again!
Best regards
zzha
06-10-2011 07:07 AM
If I understand you correctly, it is chaos before the loop and OK inside.
If so...
Then look at the value you are using to init the chart. A "0" time eqwuates to something like Jan 1 1904 (depending on your time zone).
You are getting close!
Keep breaking it down into to smaller steps (like you did with watching with the BP set).
Ben
06-13-2011 02:33 AM
@Ben wrote:
If I understand you correctly, it is chaos before the loop and OK inside.
If so...
Then look at the value you are using to init the chart. A "0" time eqwuates to something like Jan 1 1904 (depending on your time zone).
You are getting close!
Keep breaking it down into to smaller steps (like you did with watching with the BP set).
Ben
Hi Ben
Yes you understood correctly.
Then what I did is to wire a property node inside loop to read the correct value of x-axis range. I got "3390790000" for XScale.Minimum. I assume it is the seconds from Jan 1 1904 to today. I think I miss to set the XScale.Offset to current time and date.
I actually need to use this vi - the waveform date should be passed by a SV:
So I tried to wire offset before going into the loop, with "ignore attributes" checked and unchecked. I got chaos again. the value XScale.Minimum inside the loop is wrong. It is almost doubled.
I guess the timestamp from the waveform data I passed still has a influence of my x-axis display. Is there a reasonable explanation for that?
Thanks a lot!