LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I stop a VI that is running via ActiveX?

I get an error: "VI is currently not idle" when I use the Abort() command on a VI which is running. Is there any other command I can use?
0 Kudos
Message 1 of 6
(3,150 Views)
Can you be more specific?

Does the VI contain an ActiveX control or reference? Or do you mean VI server?

-Joe
0 Kudos
Message 2 of 6
(3,150 Views)
The VI was created, and is communicated with, in Visual Basic, using the Labview Type Library. It is activated as an ActiveX server.
Once created, I use many of the ActiveX commands available in the assembly, such as FPWinBounds, etc. One of the commands available is Abort. I can't find any documentation on it and it doesn't work in the way I would expect.
Thanks
Rachel
0 Kudos
Message 3 of 6
(3,150 Views)
Hi,

There is actually quite a complicated issue with the abort vi call through activex. It does work in many cases, but is failing when there are multiple references of a vi open at the same time.
Abort VI does work via activex, just make sure you are closing un-needed references. Try making a very simple program in VB to do this, I have tried this in LV and can abort any VI thats running, my VB isnt up to much i'm afraid.

The fix for the bug is scheduled for the next version of labview.

One work around that i came up with, is to make use of some of the activex calls you can make. If you have a stop control on the front panel in lv, set the tab order so that it is first in the list. Then in VB, get the property of panel, then of controls
(which is an array of references of all controls & indicators), index the first element of that array, then you can change the value property of that reference. This programatically stops the program rather than aborting it, which is safer when doing any hardware I/O. Obviously the stop control in labview must be programmed to actually stop the VI.

Dont forget to close each reference, that includes the array of control/indicator references.

Hope that helps, even if the bug exists in the current version of LabVIEW.

Anthony Sims
Applications Engineer NI-UK
0 Kudos
Message 4 of 6
(3,150 Views)
Hi Anthony,
Thanks for your reply. It was very helpful.
When you say the bug will be fixed in the next version, do you mean version 7.0? We are about to upgrade to 7.0 in the next few months.
Rachel
0 Kudos
Message 5 of 6
(3,150 Views)
Hey Rachel,

Its not been fixed for LV7.0. Its unclear from the developers notes wether they have fixed this bug in the next release (7.1) or they intend to fix it in 8.0
There are some notes which suggest 8.0 and some 7.1!! I am trying to get clarification of that.

As the moment however, the workaround can be used, or understanding "For the Abort method to work, it should be invoked on the same reference with which you are calling the VI. If you use another reserved reference, it will abort a different chain of execution."

With a complex program, i am sure you can see that sticking to that sentance is a little hard.

Best Regards

Anthony Sims
National Instruments UK
0 Kudos
Message 6 of 6
(3,150 Views)