LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when executing VI with "Invoke Node" in loop

Hello,
please check if this is possible what i am doing here or if there is a better way to do it.

The goal is to have a VI that i can start in TestStand which is then running in a loop until i set a global variable.
I do this currently with:
1.) Starting the VI with "Invoke Node" (see screenshot 01)

2.)  This Vi is then running all the time in a loop until the global for exiting is True (screenshot 02)

3.) Then i have another VO to set the Quit-variable to true

 

Normally this works as it should, but sometimes i get the error-message:

         
Invoke Node in NameOfTheViCalledInTestStand.vi
Method Name: Run VI

VI Path: NameOfTheViThatContainsTheInvokeNode.vi
LabVIEW:  Das VI befindet sich in einem für  diese Operation unzulässigen Zustand.

 

The question is: what does this error mean and what better ways are there to do what i want to.

 

Perhaps for better understanding, the VI which runs in a loop executes dll-functions to enable and disable an ample-tower to make a light blinking.

And because there is no function "blink", i have to make it on off on off on off....

So the vi loops and makes on off until i say "quit" then blinking stops.

 

Thanks for any ideas

Download All
0 Kudos
Message 1 of 7
(3,605 Views)

Hi OnlyOne,

 

Re: LabVIEW:  Das VI befindet sich in einem für  diese Operation unzulässigen Zustand.

 

      I think this error is telling you that the the VI is still running when invoke is called again.  Try changing the "Run" node to "Wait Until Done" = True.

 

Cheers!

Message Edited by tbd on 11-04-2008 03:57 AM
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 7
(3,597 Views)

I cant´t do this "Try changing the "Run" node to "Wait Until Done" = True." because then the TestStand-Step is hanging until the loop is finished.

I only want to start the "blinking" and the continue normally in the sequence.

 

To avoid that the vi with the "Invoke Node" is started twice a have a vi above it whick checks with the globalVariable "IsCurrentlyBlinking" if the start is allowed.

If  IsCurrentlyBlinking= True then nothing happens.

So normally it can´t happen  that it starts twice. Only if the GlobalVariables are not correct.

The variable "IsCurrentlyBlinking"is set to TRUE in the subvi before the loop starts and after the loop is finished its set to FALSE in the subvi.

0 Kudos
Message 3 of 7
(3,588 Views)

Hi OnlyOne,

      If the error is occurring at the invoke-node, then, regardless of the logic that should prevent it, the error (i believe) indicates the VI is still running.

I can't see the whole system, so can only suggest that you employ another scheme to prevent calling the SubVI if it's not ready.  Perhaps by:

 - testing the "State" property of the VI after Opening, but before invoking "Run", or by

 - using semaphores to prevent "Run"ning until a short time after the SubVI releases the Semaphore(?)

 

Sorry if this doesn't help!

 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 4 of 7
(3,581 Views)

Hello tbd.

i think you gave me the solution.

Currently i first run a step that makes the loop exiting which currently blinks in green. This should stop theVI whichis running parallel in background

And direct after this i execute a step that starts the blinking in red.

I think the problem is that the first loop is not completely finished when i try to start it again.

The solution is to set a short delay between the two steps so that the first InvokeNode is finished.

I can´t test it currently but it think this sound very good.

0 Kudos
Message 5 of 7
(3,565 Views)

I encountered the same error several times. It was not necessary to have the vi running, but sometimes even when it was loaded the Run Invoke failed (e.g. have it placed in a never executing case to have it displayed in the hierarchy tree). Propably the invalid mode would mean 'edit mode'.

I guess this also has something to do with the options of the Open VI Reference (reentrant?). But never fully explored this issue...

 

Felix

0 Kudos
Message 6 of 7
(3,561 Views)
Why not set Quit to make it stop. Then wait at least one iteration time or check the VI state using a property node as tbd suggested and start it after. In that case you start it always, but only after it has quit.
Regards,
André (CLA, CLED)
0 Kudos
Message 7 of 7
(3,555 Views)