LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Different timing & number of threads when executing under CVI vs. stand-alone

To All,

The timing of my application seems to run differently when launched from
the CVI IDE compared to when its launched by Windows Explorer. It runs fine
in the former case but the timing of events is erratic in the latter case.
The only difference between the runtime processes that I can see with
TaskInfo is that when the app is launched by Explorer, there are 3 threads
running instead of one thread. My app is single-threaded, so I don't
understand why there is more than one thread running in its process space
when it gets launched by Explorer.

Does anyone have an idea why the number of threads vary or what else might
be causing the timing differences?

I'm using CVI 7.1 under W2K.

PG





0 Kudos
Message 1 of 3
(2,972 Views)
After doing a little more investigation, I found out the number of threads
has nothing to do with the timing problem (evidently, CVI and/or Windows
spawns threads in the background, depending on what a user is doing in the
GUI).

The issue is this: When I run my app from CVI, it works fine but if I run
that same debug version of the executable with Windows Explorer, the timing
is erratic. However, if I exit the CVI IDE before running my app from
Explorer, then the executable works fine!

Does the CVI runtime engine that the executable depends on behave
differently somehow when the CVI IDE is active? And when the IDE is active,
why would the executable work fine when launced by it but run erratically
when launched by Explorer?

PG


0 Kudos
Message 2 of 3
(2,971 Views)
I don't know if is relevant or not but instead of calling
RunUserInterface() my app calls ProcessSystemEvents() and
ProcessDrawEvents(). The CVI help cautions the ProcessSystemEvents()
doesn't return when its handling a "tracking loop" such as a pull-down
menu, which does not apply in my app's case. Also, the fact that my app
runs fine when launched by the CVI IDE tells me that the problem is not due
to how I'm using ProcessSystemEvents().

Its very puzzling -- why would my app's event timers behave differently
when launched by Windows Explorer and only when the CVI IDE is also active?

PG


0 Kudos
Message 3 of 3
(2,952 Views)