NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

"LabVIEW: The VI is not in a state compatible with this operation." when calling TopLevel VI from a packed library from TestStand

Hello all,

 

I'm trying to control a front panel using TestStand. So I wrote a small VI that get the reference of the front panel`s VI, open the front panel, and return the reference for further manipulations. So let's call this GetUIRef.vi. I then packed this GetUIRef.vi and the Front Panel's VI in a packed library.

 

From the packed library, I try running this GetUIRef.vi, and everything is fine. I could open the Front Panel and get the Ref as I wanted.

 

However, when I run the packed library with TestStand, I get the error: "LabVIEW:  The VI is not in a state compatible with this operation.", which I dont know why. If I only use the GetUIRef.vi normally without packed it, then there is no error at all. The problem is that since its a packed library I cannot run the VI step by step to see what went wrong.

 

My GetUIRef.vi is attached here. 

 

Has anyone already had this problem before, or can give me some direction that could possibly help me understand and solve the problem?

 

Thank you all in advance!

Loc

 

0 Kudos
Message 1 of 4
(2,744 Views)

ok I found a way to solve the problem: Put a Wait(100ms) in between the Run VI and the Set Front Panel Property node.

 

From this, I guess that the problem is that the Run VI is a bit slow and is executed not on the same process/thread (whatever it is) like the rest of the VI => therefore the problem. I just dont understand that why this only happen with TestStand. If anybody knows more about the call chain, please give me a rough diagramm of my problem.

 

Thank you all for reading!

Loc

 

 

 

Thanks.

0 Kudos
Message 2 of 4
(2,707 Views)

Hi Loc, 

 

I am glad you were able to find a solution to your initial problem. 

 

I have found this knowledge based article which may help you in future: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019Kr2SAE

 

I hope this helps.

0 Kudos
Message 3 of 4
(2,690 Views)

Hi Chris,

 

Your suggestion indeed give me some insight about the behavior of VIs. Thank you.

 

Loc

0 Kudos
Message 4 of 4
(2,686 Views)