NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Can anyone explain the odd behaviour of the CVI Operator Interface?

This is probably really related to CVI in general, but I think people should be aware of this behaviour. If tracing is enabled and a program executing, moving the mouse cursor over the Menu bar area of the Operator Interface program increases the execution of the test program dramatically. Anywhere else slows it down! Could this have any effect during critical test runs? Is there a way to force the fast execution. (i.e. to disable whatever message processing is going on when the mouse cursor is over the rest of the window?)
0 Kudos
Message 1 of 5
(3,444 Views)
This is a known isssue that will be fixed in the next version of CVI.

A workaround you could try is to replace

RunUserInterface();

with

while (!gQuitNow)
ProcessSystemEvents();
0 Kudos
Message 2 of 5
(3,443 Views)
James,

Thanks for the answer. I'll give it a try.

However, I've also noticed that occassionally moving the mouse over the menu can stop the test executive completely!! (Or ANY CVI program with a menu!) I think this is a VERY SERIOUS bug within CVI!

I've posted a message on the CVI forum with a simple example program that demonstrates the problem. (To which I've had no reply yet.)

Any idea of when the next version of CVI will be coming out? Or will there be a patch sometime?

Regards,
Brian
0 Kudos
Message 3 of 5
(3,443 Views)
Brian,

You did not mention what is the CVI operator interface that you are using. In the Simple CVI OI, which is located at \Examples\OperatorInterfaces, the behavior you mentioned may occur.

It is mainly because it uses a CVI timer to poll UIMessages, and the Timer Control runs in the same thread as the User Interface (CVI Panels). Because they both run in the same thread, when you move your mouse Windows handles the mouse move and repaint any window if necessary. While doing this, it stops all the other tasks that is running in the same thread, which means, the timer stops to tick and UIMessages are not handled for some time. In addition, the TestStand Engine executes synchronously with UIMessage handling, so if msg
s are not handled the Engine pauses the execution.

Finally, there is an example that ships with CVI under
\Samples\Toolbox\AsyncDem.prj that shows how to use asynchronous timers. In other words, a timer that runs in a different thread different than User Interface. I also modified the Simple CVI OI to use this asynchronous timer, check the attached zip file.

Regards,

Roberto P.
Applications Engineer
National Instruments
www.ni.com/support
0 Kudos
Message 4 of 5
(3,444 Views)
Roberto,

Thanks for the reply. It's the main operator interface that I've modified. I'm not sure how easy it would be to implement your method within it.

The differences in execution speed when the mouse is moved over the menu bar is a curious effect. I'm more worried, however, with the fact that you can STOP ANY CVI application in mid run, that has a menu, just by moving the mouse! (This application halting also occurs with James' fix mentioned earlier. Granted that was for differences in execution speed and not aimed as a fix.)

Could you make sure the CVI guys are aware of this problem? I certainly can't recommend any project using CVI 6.0 in anger, until this is resolved. (And I think NI should warn it's customers of the p
roblem.)

Regards,
Brian
0 Kudos
Message 5 of 5
(3,443 Views)