LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When I m going to move the front panel or a window for 3d scene instant hang the program.

Solved!
Go to solution

When I m going to move the front panel or a window for 3d scene instant hang the program.

Υou can easily try to "generate sound" in the examples.

Can I overcome this? (without lock movement).

 

tnx

Giannis

0 Kudos
Message 1 of 10
(3,134 Views)

Can you please give more details or post your program?

Steve

0 Kudos
Message 2 of 10
(3,109 Views)

What Steve meant to say is "Can you please give us more details and post your program".

 

BS

0 Kudos
Message 3 of 10
(3,086 Views)

1.jpgis it helpful ?

0 Kudos
Message 4 of 10
(3,082 Views)

Yes, it tells us you are probably doing everything in a single (timed) loop and introducing (yourself) delays, which are accurately reflected on your Front Panel display.

 

So it is time to ask, yet again, for you to post your code (this means we need to see the Block Diagram, and please don't put a JPEG image of it here, either attach the VI or post a Snippet).  While I can predict what you have done (see first paragraph), I might be wrong, and even if I am right, it is hard to explain how you can fix what I can't see.

 

Bob Schor

0 Kudos
Message 5 of 10
(3,074 Views)

I simplify it in order to avoid any confusion .

when you clik on in order to move the front panel the numbers on x axis stop instantly running...

 

 

 

 

Download All
0 Kudos
Message 6 of 10
(3,065 Views)

I don't see any problems when running your VI>

 

One potential problem is that those VI's are running as fast as they possibly can.

 

What kind of PC are you running this on?  If it is an older PC with only a single processor, I see how you could be having problems.

0 Kudos
Message 7 of 10
(3,057 Views)
Solution
Accepted by topic author jflesios

Yes, I was right -- you have a single loop where you generate data points and display them.  Consider the operation of your program if you do not display the data as a Chart, but instead simply display (as an indicator) the most recent value.  The loop will go into your sub-VI, wait the appropriate time to generate a point, return, display, and immediately call the sub-VI again.  Fine, it should run at the speed of the sub-VI.

 

Now add the Chart.  Same thing happens, but now you move the Chart.  The top-level routine, tasked with displaying the Chart, needs to use additional time to repaint the Front Panel, so it take it.  Now when you call the sub-VI again, time has elapsed.

 

What you need to do is to run two loops in parallel, so-called Producer-Consumer Design Pattern.  Have your sub-VI return a Waveform (not a Chart).  This loop becomes the Producer -- all it does is "produce" a Waveform at whatever rate the sub-VI specifies.  Create a Queue of Waveforms outside this loop, and enqueue the Waveform onto it.  In a parallel loop (usually written below the Producer Loop), write the Consumer loop, into which you pass the same Queue.  Here you Dequeue the (latest) Waveform and display it on the Chart.

 

Now, while this runs, move the Chart.  The Consumer loop will be delayed (because you are refreshing its Front Panel), but the Producer loop, running in parallel, just keeps going, putting more points on the Queue.  When the Consumer finishes its Front Panel update, it blithely plots whatever is on the Queue.  If you look carefully at the traces being plotted, you should notice that when you move the Chart, the plotting temporarily stops, then the "missing" points are speedily plotted and plotting resumes at whatever rate it was before you moved things.  This is the power of parallel processing and LabVIEW.

 

Bob Schor

 

P.S. -- there are examples of Producer Consumer patterns -- if you open LabVIEW and go to File, New, you should see some examples under From Template.

0 Kudos
Message 8 of 10
(3,051 Views)

no I have new pc with i7-4790k, 8GB 

 

 

0 Kudos
Message 9 of 10
(3,048 Views)

tnx Bob i ll try it !

0 Kudos
Message 10 of 10
(3,041 Views)