LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deferring panel updates causes problems to waveform chart

Hello everyone,

I'm facing a problem in my application with the update of a waveform chart combined with the property "defer panel updates"; unfortunately I can't attach code, I'll try to descrive it as clearly as possible: the VI where this happens has a queued state machine that periodically executes an update of the HMI, and another parallel loop that sends to two waveform charts data received from another queue. Since the HMI update requires some property nodes, I considered the idea of deferring panel updates from its beginning to its ending. However, I noticed that this causes my chart to go a bit crazy: if I always leave the "defer panel updates" to false, then everything works fine:

01_clean_chart.png

If I set the property to true before the HMI update starts and write it back to false after it's finished, then the chart looks often like this:

02_dirty_chart.png

The two pictures were taken just a few seconds away from each other, while the graph was receiving always the same data.

There is to say that, being the graph update performed in a different loop from the HMI update, I haven't got the control of the synchronization between these two operation; however, this is a behaviour I didn't expect: in my mind, if a chunk of data arrives to the graph while the panel updates are deferred, the graph should simply stay still and plot all the new data the first time it is updated with the "defer panel updates" written to false.

I made a quick search on the forum, and found this and this threads, but the questions raised seem to be different.

 

Has anyone encountered the same problem?

The application is developed with LabVIEW 2012 and runs on a Windows 7 machine.

0 Kudos
Message 1 of 11
(3,979 Views)
Just something to try, if you re-scale the chart, does it fix it?

I had a similar issue where a chart wasn't visible and when it was made visible again, it displayed old data until more data arrived and it redrew. The fix I found was to make a tiny adjustment to the x-scale and back again to force it to redraw and the problem went away.

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 11
(3,968 Views)

Sam_Sharp ha scritto:
Just something to try, if you re-scale the chart, does it fix it?

Rescaling the chart actually cleans it up just for some seconds, then the problem returns; also, it's not permanent: sometimes the chart gets "normal" for a few time and then starts jamming again.

0 Kudos
Message 3 of 11
(3,948 Views)

A few questions that might help us help you.

First, I don't recognize the chart style, is this a custom control- share the type def.

Share chart properties with us especially update mode and history length.

Is there a Tab control, splitter, or sub-panel involved?

Is the chart object's size scaling with the pane? Is the panel resizeable?

Are there any overlapping controlls? (Run VI Analiser!)

 

And finally, can you demonstrate simillar behavior with a minimun sample code segment that you CAN share?


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 11
(3,936 Views)

Jeff·Þ·Bohrer ha scritto:

A few questions that might help us help you.

First, I don't recognize the chart style, is this a custom control- share the type def.

Share chart properties with us especially update mode and history length.

Is there a Tab control, splitter, or sub-panel involved?

Is the chart object's size scaling with the pane? Is the panel resizeable?

Are there any overlapping controlls? (Run VI Analiser!)

 

And finally, can you demonstrate simillar behavior with a minimun sample code segment that you CAN share?


- It is a modern-style waveform chart with just the colours changed, I didn't make a type def of it;

- 4 plots, two of them hidden programmatically at the beginning of the program; update mode: strip; history length: 10k elements; I send arrays of clusters (of 4 elements, since I have 4 plots - DBL numerics, by the way) to update it;

- There are all of them: the interface runs inside a subpanel and is divided into 4 panes by splitter bars; finally, the chart is contained in a tab control in pane 4;

- The chart is not scaling with the pane, but is resized programmatically when the interface is launched and loaded in a maximized front panel; for the rest of time, the user can't resize the main VI, but can resize the graph by moving the splitter bars; however, this was never done when the problem occurred;

- I haven't got VI analyzer toolkit, I just can say I tried my best to avoid overlapping controls since it seemed to give me problems with programmatic resizing;

- I spent some minutes trying to create something similar but much simpler, but I didn't succeed in reproducing the problem; in my example VI everything works as expected. I'll attach it, anyway. Being at work with lots of other things to do, unfortunately I can't dedicate much time to these attempts.

 

P.S: for some reason I don't get I can't attach the VI - I'll try with a zip.

0 Kudos
Message 5 of 11
(3,925 Views)

- There are all of them: the interface runs inside a subpanel and is divided into 4 panes by splitter bars; finally, the chart is contained in a tab control in pane 4;

 

Tabs and charts don't always play nice (because of all the hidden FP objects on the tab pages)  and you need to defer FP on the subvi in the subpanel.

 

Advice, get rid of the tab in the sub-panel and just insert/remove the contents of the tabs with a radio button 

 

See my tag "IHateTabs" and this thread


"Should be" isn't "Is" -Jay
Message 6 of 11
(3,922 Views)

Jeff·Þ·Bohrer ha scritto:

Tabs and charts don't always play nice (because of all the hidden FP objects on the tab pages)  and you need to defer FP on the subvi in the subpanel.

 

Advice, get rid of the tab in the sub-panel and just insert/remove the contents of the tabs with a radio button 

 

See my tag "IHateTabs" and this thread


Thank you, I didn't know that; I'll have a look and consider it. Does this "bad relationship" between tabs and charts characterize newer versions of LabVIEW, too?

 

Also, I have another question:


Jeff·Þ·Bohrer ha scritto:

and you need to defer FP on the subvi in the subpanel


Does this mean that deferring FP on VIs that run inside a subpanel can give particular problems?

0 Kudos
Message 7 of 11
(3,920 Views)

The vi in a sub panel updates it's own FP.  So to defer updates the method must be run on the vi in the sub panel. Referring updates on the vi containing the sub panel would act oddly.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 11
(3,899 Views)

Jeff·Þ·Bohrer ha scritto:

So to defer updates the method must be run on the vi in the sub panel.


Ok, this is what I did.

0 Kudos
Message 9 of 11
(3,886 Views)

Hey

Please could you tell what you mean by rescale the chart ? Because I am having the same problem.

Thanks

Sinan

CLAD

0 Kudos
Message 10 of 11
(3,745 Views)