11-17-2005 08:41 AM
11-27-2005
07:21 PM
- last edited on
11-14-2025
03:15 PM
by
Content Cleaner
Hi RTyson,
As far as I know, you don't need RunUserInterface() unless you actually display a user interface. In a situation similar to yours, I call ProcessSystemEvents() in a loop. Depending on the functions that your program will call, there will be times when hidden windows will be created. ProcessSystemEvents() gives your program a chance to clear the list of queued events, including windows messages (WM_'s). You may need to do this in each of the threads--again depending on what you want to do.
You may have already seen this: https://www.ni.com/en/support/documentation/supplemental/06/multithreading-in-labwindows--cvi.html There is also: MultithreadingOverview.pdf in your \bin directory where CVI is installed.
Priorities for threads are adjustable via CmtScheduleThreadPoolFunctionAdv(), or they can assume the default priority of the thread pool from which they were spawned from. There may be other methods for doing these directly with the API, but CVI provides these functions natively and they work well. Be mindful of changing thread priorities too much. If the target computer is vastly different from the development computer (in hardware, active programs, with unpredictable user interaction, programs added by the user after deployment, etc.) you program could either run like poo, or drag the computer to its knees. Some testing will be required.
Good luck,
Orlan
11-28-2005 10:08 AM
11-28-2005 02:38 PM