LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ProcessDrawEvents Help

I am building an application that has a lot of tabs and controls. These controls are updated at a rate of 10 Hz.

All my application interface are controlled by the thread 1. Also, all the controls that I desire to add in tab panels are created by this thread.

The thread 2 are responsible to receive and print data.

I am trying to use the SetCtrlAttribute (setting the ATTR_CTRL_VAL) in order to user the command ProcessDrawEvent later, so I think my application will not use too much of the computer processor. The fact is that, even if I use the ATTR_CTRL_VAL to update the controls value, the application updates the screen automatically.

Using the command ProcessDrawEvents, I would like to update all controls at the same time. Is it correct what I think?

Some of my controls are written in ActiveX, I use some of Measurement Studio controls, such as CWGraph.

In CVI help file (ATTR_CTRL_VAL chapter) is written the following note:

"Note: If the control in which you are setting the value is the active control in the panel, the control nevertheless displays the value immediately."

I think I am missing something. Could someone help me?

Thank you in advance.


0 Kudos
Message 1 of 4
(4,531 Views)

Hi Oliveira,

The function ProcessDrawEvents is one which I would use within a callback function
to update the screen controls.
The reason is, the callback takes so long to execute that the screen controls would not
normally be  updated until the callback finishes.

Creating a callback of 10 seconds or more, and using ProcessDrawEvents to achieve simultaneous
update is, I think not going to be practical.

Because your screen controls are updating automatically without problems, why not fetch the new data
at 10 second intervals.
For example, use a 10 second Timer control to initiate a callback which fetches the new data from a
suitably defined struct within the code and then updates the screen controls.
Your original code which fetches the new data could be used to update the struct.

regards,

 

Gary.

  

0 Kudos
Message 2 of 4
(4,513 Views)
Gary,

the problem that I am, so I look for a function like ProcessDrawEvents is that when my screen is full of controls, the user of CPU of my application is 40%. I am afraid that it is too high.

When I minimize my application, the CPU use drops to 4%. So, it is clear to me that there is a high demand of CPU to update the screen. The machine that runs the application has 256 MB video memory, and also, 1.5 GB memory RAM.

Do you know how can I solve this "problem" of high CPU consumption?

Does someone else have another advice?

Thank you very much.
Gustavo
0 Kudos
Message 3 of 4
(4,500 Views)

It seems that the problem was resolved here.

0 Kudos
Message 4 of 4
(4,423 Views)