Error 1000 When Aborting a VI Using VI Server

Updated Oct 19, 2018

Reported In

Software

  • LabVIEW Base
  • LabVIEW Full
  • LabVIEW Professional

Issue Details

I have a top-level VI that calls a subVI, and due to how the subVI works, the only way to stop it is abort it. When I open a reference to the subVI and use the Invoke node with the Abort VI method, I get the following error:

Error 1000 occurred at Open VI Reference
Possible Reason(s): LabVIEW: The VI is not in a state compatible with this operation.




How can I abort a subVI from my top-level VI?

 

Solution

This occurs because the executions of the top-level VI and the subVI are tied together. 

In order to abort a subVI from another VI, it needs to be running as a VI, not as a subVI. To do this, you'll need to start the subVI through VI Server, using an Invoke node with the Run method. You also need to set the Wait until done option to FALSE to eliminate the data dependencies of the VI. 

Additional Information

This happens because while the subVI that you called is running, it is not running under its own execution, rather, it is part of the execution of the top-level VI. Though two parts of the main VI may be running in parallel (the subVI and the VI Server Abort command), the subVI is not executing on it's own. It is a part of the caller VI. 

The major drawback to using this method is the greater difficulty of passing data values to the called VI. You would need to use the Set Control Value and Get Control Value methods to pass data to and from the called VI.

 

WAS THIS ARTICLE HELPFUL?

Not Helpful