From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-21-2011 12:44 PM
I have a simple application that runs in a loop some number of times. Inside the loop data needs to be updated to numeric indicators. I can't get the indicators to change. The code that is calling the SetCtrlVal functions is inside a while loop. I'm calling ProccessDrawEvents having a vague memory that it is related.
Solved! Go to Solution.
07-21-2011 01:22 PM - edited 07-21-2011 01:25 PM
This is a fequent question - searching the forum certainly would have shown the solution, e.g. here: the answer is to use ProcessDrawEvents() So if you do it should do the trick, if not, something probably is wrong: could you post the relevant section of your code?
07-21-2011 01:54 PM
I actually did search and read that thread. I've always had success with ProcessDrawEvents but it isn't working in this case. I'll look at it some more.
07-21-2011 02:10 PM
Okay I'm a moron. I'm reading some data from an instrument and the problem is in the looping code that's reading the ASCII string from the serial port. It was only getting it once so the numerics never changed.
07-21-2011 02:26 PM
Working properly now.
07-21-2011 02:28 PM
I'm relieved
07-24-2011 11:45 PM
Thanks! "ProcessDrawEvents()" solved my problem!
07-17-2014 03:16 PM
I'm seeing a similar issue. A callback function is running a long loop that is sending file data on a serial port. I'm updating a numeric slider (progress indicator) within the loop, and calling ProcessDrawEvents right after the control is updated. In my case, however, adding the call to ProcessDrawEvents did not solve the problem.
The issue goes away if I run the code from within the LabWindows IDE - everything works fine. However, if I simply launch the executable outside the IDE, the slider updates correctly for maybe 15 or 20 seconds, then the cursor changes to the busy indication, and the control does not update again until all of the data has been sent.
Any thoughts?
07-17-2014 05:54 PM
When I passed progress valuse to a slider I used ProcessSystemEvents() to update the GUI. I don't remember using ProcessDrawEvents()
07-22-2014 07:23 PM
ProcessSystemEvents() does the trick for me, too, whereas ProcessDrawEvents() does not. I did discover that ProcessSystemEvents apparently has a pretty high execution cost, as it was slowing the loop down when I used it after each update to the slider. So I now call it on every 50th update. It still keeps the slider from stalling, but allows the loop to run much faster.
Thank you for the assistance!