LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update 20 panels simultaneous in Labwindows/CVI.?

Hi,
I have to update up to 20 panels simultaneous with a refresh time of 100ms in Labwindows/CVI 7.1.1.
 
My idee, is to load all the panels in the main thread, and for each panel i create a separeted thread. The job of this thread is to update only one panel with a refresh timle of 100. To do that, i created in this separated thread a Windows Timer (SetTimer()) wich is executed in this separeted thread. I created One thread and one timer for each panel.
 
My problem is that the CPU load is always neer of 100%.
 
Please, could you help me to resolve this problem?
Thank you in advance,
SYGPJE
0 Kudos
Message 1 of 4
(3,421 Views)
Is there any specific reason each panel gets its own thread? When it is speed, I don't think this works much faster than one seperate thread handling all the updates. There are only so much operations a computer can do in 0.1 seconds 🙂
 
If every panel has to do some I/O with external instruments I can see why seperate threads are needed (otherwise 19 panels would be waiting for the apparatus of panel 20 to respond), but otherwise... I'm not sure.
 
Have you tried to create on large update-thread, and was the load any different? If you need all the threads, you might want to use the Sleep() function from the Windows SDK to wait 0.1 seconds. That might reduce the load a little.
 
Two general speed issues: SetCtrlAttribute works faster than SetCtrlVal, and with graphs using a thin line instead of connected points works faster as well.
 
Good luck!
 
Erwin Timmerman
Message 2 of 4
(3,399 Views)
make sure you have ProcessSystemEvents() in your non-time critical loop to take care 100% CPU usage.
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 3 of 4
(3,382 Views)

Hi,

Thank you for your answers.

Hi tried an other solution without multithread. I use a TimerAsynchrone for echach panel.  The result is better.

Bye

SYGPJE

0 Kudos
Message 4 of 4
(3,349 Views)