LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform data could contaminate x axis display in waveform chart?

Hello

Please take a look at this vi:

 

 

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

 

 

0 Kudos
Message 1 of 9
(3,914 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 9
(3,910 Views)
Hi Ben Thanks for your reply. My IE was breaking down so it only uploaded half of my post... This vi in the attachment is actually working because I used a random number as a source of the waveform chart. The initialization before the loop could make the x axis show correct date and time. But the problem happens when I use a shared variable to pass an array of waveform data to the chart. Then the date and time in x axis goes crazy. My assumption is that the timestamp in the waveform data affects the display. Do we have a solution there? Could you please be more specific about how to check the "ignore attributes"? Is it in the property if I right click the waveform icon, or I have to create a property node? Thanks a lot! Best regards Zzha
0 Kudos
Message 3 of 9
(3,903 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 9
(3,897 Views)

Hi Ben

Here is the image of the code:

x-axis display.JPG

 

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

0 Kudos
Message 5 of 9
(3,890 Views)

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

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 9
(3,886 Views)

@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:

 

modified time based chart.JPG 

 

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

0 Kudos
Message 7 of 9
(3,874 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 9
(3,861 Views)

@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:

x-axis display.JPG

 

 

 

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!

0 Kudos
Message 9 of 9
(3,828 Views)