LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform graph losing history

Solved!
Go to solution

Chris (sorry for the last-naming, I was looking at your username ;-)),

 

I am putting waveforms into my chart, by way of the Build Waveform VI, using "Get Date/Time in Seconds" VI minus (dt * #points) for t0, and 0.02 as dt.

 

Your example worked exactly as you described.  When I changed to using Build Waveform (in the outer For loop), with t0 being calculated outside of both For loops, and using a dt of 0.1, my results were more confusing.  If I used 2 or 3 channels, and 1 point, and turned on autoscale X, my chart history built up as I would expect.  When I increased to 2 points, I started losing my chart history every couple seconds.  I even turned up the chart history to 40000 points just to verify that wouldn't have an impact.  When I increased to 3 or more points, I started seeing only one update's worth of points per plot on the chart at any one time.  No history was being recorded at all.  Can you try using waveforms and see if you get the same results?

 

I am using waveforms to get automatic association with a timestamp on the x-axis.  If they are inherantly less useful in some way, I could attempt to do something else instead...

 

I agree that it makes perfect sense that the history should be discarded when you change the number of plots, but not when you change the number of points per update.  I do not understand why it would not be working that way with the waveforms.

 

Thanks,

 

-Joe

0 Kudos
Message 11 of 18
(1,665 Views)

Ben,

 

Thanks for the input!

 

I was not able to find in the documentation or forums how to use the "Attributes" cluster member when using the Build Waveform VI, so I'm clearly not changing that.

 

Your time theory was interesting, and it made me wonder whether because I am back-dating t0 to account for the time taken to acquire each data point, whether I am accidentally backing up over the previous last timestamp.  However, in my test VI I just created based off of Chris's posted example, I removed the back-dating, such that each new t0 is just the result of the "Get Date/Time" VI outside of both For loops, so there is no chance of overlapping timestamps.  The same issue is still happening with more than 1 or 2 points not accumulating any chart history.

 

Any ideas why that might be happening?

 

-Joe

0 Kudos
Message 12 of 18
(1,663 Views)

@jmorris wrote:

Chris (sorry for the last-naming, I was looking at your username ;-)),

 

I am putting waveforms into my chart, by way of the Build Waveform VI, using "Get Date/Time in Seconds" VI minus (dt * #points) for t0, and 0.02 as dt.

 

Your example worked exactly as you described.  When I changed to using Build Waveform (in the outer For loop), with t0 being calculated outside of both For loops, and using a dt of 0.1, my results were more confusing.  If I used 2 or 3 channels, and 1 point, and turned on autoscale X, my chart history built up as I would expect.  When I increased to 2 points, I started losing my chart history every couple seconds.  I even turned up the chart history to 40000 points just to verify that wouldn't have an impact.  When I increased to 3 or more points, I started seeing only one update's worth of points per plot on the chart at any one time.  No history was being recorded at all.  Can you try using waveforms and see if you get the same results?

 

I am using waveforms to get automatic association with a timestamp on the x-axis.  If they are inherantly less useful in some way, I could attempt to do something else instead...

 

I agree that it makes perfect sense that the history should be discarded when you change the number of plots, but not when you change the number of points per update.  I do not understand why it would not be working that way with the waveforms.

 

Thanks,

 

-Joe


 

again, check the timing info you are using for the update to ensure it is consistant with what is already in the chart.

 

Example.

 

Chart has data where the last point plotted is for 13:00. If the next update says it has data from prior to 13:00... RESET!

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 13 of 18
(1,663 Views)

Ah, I just got where I was misunderstanding your explanation, Ben.  Since every time I increase the number of points, I am increasing the "duration" of the previous update, I obviously can't just keep adding points unless my dt is extremely small compared to the while loop time.

 

In other words, when I was adding a new set of points to the chart appx. every 100ms, and my dt was 0.1, of course if I added more than 1 point at a time I would be overlapping my time periods.

 

I think this explains my original problem, too, as I was trying to hit the timing of that exactly with the dt also, so whenever it was slightly off I would have a problem.  That means I can probably solve the problem in my original code by just keeping a local wire with the value of the next t0, rather than trying to use the local computer time in my chart update loop.

 

Thanks for the insight!  I really appreciate it.  And I wish that was covered in the documentation somewhere.  😉  (or if it is already, that I hadn't missed it)

 

I'm calling this thread solved on Ben's post.

 

Cheers,

 

-Joe

Message 14 of 18
(1,661 Views)

@jmorris wrote:

...

 

Thanks for the insight!  I really appreciate it.  And I wish that was covered in the documentation somewhere.  😉  (or if it is already, that I hadn't missed it)

 

I'm calling this thread solved on Ben's post.

 

Cheers,

 

-Joe



I suspect a scarce few of us use WF for the chart so few have run into that issue.

 

I like them because so many of my applications deal with non-periodic measurements.

 

Thanks for the update,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 15 of 18
(1,658 Views)

@Ben wrote:

 

I suspect a scarce few of us use WF for the chart so few have run into that issue.

 

I like them because so many of my applications deal with non-periodic measurements.

 


Ironically my application is completely periodic.  If there was an easy way to setup my x-axis as time using just a 2D array of doubles for the chart type, I would probably do that instead (or at least I would have before I finally got this worked out).

-Joe

0 Kudos
Message 16 of 18
(1,655 Views)

Joe, I'm glad you got this worked out. I hadn't thought about the impact of the timestamp on the history before. Thanks Ben! To me, this leads to another good argument for using my own history instead of a chart. I often work with data where the acquisition rates/sampling periods are not consistant from channel to channel. I very frequenty use XY graphs so I can plot this data with time, irrespective of the unsynchronized sampling times.

 

Nice followup on your problem. Thanks.

Chris

Message 17 of 18
(1,641 Views)

Sorry to everyone who is subscribed to this topic, but I need to test whether my IT department has successfully changed their policy to allow uploading to these forums again.  So you finally get to see the screenshots I wanted to post back when I first started this thread.  😉

 

Update chart loop:

ChartUpdateLoop.PNG

 

CreateWaveforms VI:

CreateWaveforms.PNG

 

Updated CreateWaveforms VI:

StripChart - Generate Waveforms_BD.png

 

Cases you cannot see just pass the existing data through and output an empty waveform array.

 

Thanks again for all the help!  🙂

 

-Joe

Message 18 of 18
(1,628 Views)