05-02-2015 06:49 AM
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
Solved! Go to Solution.
05-02-2015 09:11 AM
Can you please give more details or post your program?
Steve
05-02-2015 12:59 PM
What Steve meant to say is "Can you please give us more details and post your program".
BS
05-02-2015 01:06 PM
is it helpful ?
05-02-2015 01:53 PM
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
05-02-2015 02:53 PM
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...
05-02-2015 03:08 PM
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.
05-02-2015 03:15 PM
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.
05-02-2015 03:16 PM
no I have new pc with i7-4790k, 8GB
05-02-2015 03:43 PM
tnx Bob i ll try it !