Jump to content

Chart history in subpanel disappears


Banjo

Recommended Posts

I have a GUI that allows the user to display one of three front panels by swapping the front panels of three asynchronous VI's into a subpanel in the main front panel. All three VI's are launched asynchronously at startup and continue to run in the background.

 

On one of three VI's there is a strip chart that updates at about 1 Hz. It has a history length of 1024 and is showing 200 points. It works as expected on first display.

 

When I swap into the subpanel one of the other VI's, the first one continues to update in the background, i.e. the data points continue to tick up. However, when I swap the first VI back into the subpanel, the history is not displayed. It is blank. The chart continues to update and display the new data in the correct locations on the chart, but there is no drawing of the history data on the screen.

 

To make this even more confusing, there is a similar chart on the second VI, and it appears to work properly. I can switch back and forth between the displays and the history always shows up on the chart in the second VI. As far as I can tell, the two charts are set up the same way. I bundle dome doubles and wire the bundle into the chart. I have done no fancy customization. One chart works; the other does not.

 

Sorry, but I cannot post the code because it is embedded in a sytem that requires the installation of in-house developed packages in order to even view it. It is way too huge to pull out one piece.

 

I am relatively new to LabVIEW (two years now) so I suspect that I am missing something simple on how the charts work. Anybody have any ideas about what I can do to troublshoot this?

 

Thanks.

 

 

Link to comment

I have seen some weird things happen with charts before (not even embedded in a sub-panel). Occasionally if you minimise the LabVIEW application and then restore it the chart has screwey data. Similar happens if you cover the chart with another window.

 

NI will probably blame my graphics card drivers (which I think is nonsense), and these issues are very difficult to recreate.

 

You are probably using the charts correctly and I would say this is a LabVIEW bug. What version of LabVIEW are you using?

Link to comment

I was having a similar issue however mine were due to having the gui vi's i put into subpanels be reentrant.  In general i've found strip charts behave kind of strangely and you can't really rely on them to update properly.  

 

In the end i ended up moving away from the strip chart and instead moving to a x-y graph.  Basically i would maintain an array of points and redraw the graph whenever needed with new points.  

 

I have attached a quick example of how i did it. 

 

Hope it helps its in lab view 2013 SP1

 

 

Also, depending on how you are doing things you could simplify your array handling into an action engine and just call it every time you wanted to update.  

 

Since i was using shared clones, i had to handle my arrays differently in my class and outside of an action engine.  

GraphTest.vi

GraphUpdate.vi

Link to comment

Thanks for the replies. I am still stuck with LabVIEW 2012. Don't even have 2012 SP1 installed yet.

 

I do not know whether the VI's are re-entrant or not. I inherited this infrastructure. I will see if I can find out.

 

I have read on the forum that X-Y graphs are CPU hogs. I have not tried them myself, so that is only rumor for me.

 

This is not a show stopper problem for this project. If push comes to shove I will drop the chart or live with it kike it is. But it would be nice to make it work properly.

 

Thanks again.

Link to comment

Thanks for the examples. I cranked up the speed in your example by a factor of 20, and it does not appear to hit the CPU all that hard. I would have to figure out how to drop older points off the left side, but that can be viewed as an interesting challenge.

 

Given the low rate of update in my VI I might be able to get away with updating the X-Y with every data point and see what that does to the resources. That would simplify the code somewhat.

 

Testing this idea inside my GUI environment will take a bit of time.

 

Thanks for the ideas.

Link to comment

The history data is probably not lost. It's just that LabVIEW forgets to retrieve it. If you force a change of scale (for example modify the autoscale property of the X scale), then the whole history data should be retrieved.

 

But long story short, a consensus is that charts are nice quick way to view some data while you're analyzing a certain part of your code during development, but they are not suited for a permanent solution in an application. In the latter case, you want to switch to graphs (either waveform or XY based on your needs).

  • Thanks 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.