11-04-2008 03:40 AM
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
11-04-2008 03:56 AM - edited 11-04-2008 03:57 AM
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!
11-04-2008 04:06 AM
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.
11-04-2008 04:37 AM
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!
11-04-2008 05:17 AM
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.
11-04-2008 05:38 AM
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
11-04-2008 05:59 AM