NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting property "RunState.Engine.AppMainHwnd" fails from Labview

Solved!
Go to solution

Hi all,

 

Using TestStand 4.1.1 and Labview 8.5

 

Short story:

 

I need to pass the handle of the TestStand window to a labview vi. Providing the property "RunState.Engine.AppMainHwnd" as input for the vi works. Getting the property inside the vi using  the "TestStand - Get Property Value.vi" vi fails with error:

 

Unknown variable or property name 'AppMainHwnd'.
Error accessing item 'ThisContext.RunState.Engine.AppMainHwnd'.

in TestStand - Get Property Value (Number).vi

->GetTeststandDisplayNumber.vi

->GetTeststandDisplayNumber.vi.ProxyCaller

 

Why is this failing?

 

RunStateEngineAppMainHwnd_teststand.png

RunStateEngineAppMainHwnd_vi.png

Long story:

We use dual monitor setups for our teststands. The operators choose the screen for the TestStand execution window, the labview front panels however allways display on the primary monitor. I was looking for a way to keep the TestStand/Labview windows at the same monitor. This works when retreiving the Hwnd window handles of both windows: when these are different is say the vi to move to the other monitor by setting FP.monitor.

 

Passing the "RunState.Engine.AppMainHwnd" as separate input parameter to the front panel vi works, but getting the handle via the sequencecontext would be a nicer solution as this parameter is allready available in our existing front panel vis. If i can get the handle via the sequencecontext i don't have to add a parameter to all existing vis, keeping the interface to the TestStand sequences.

0 Kudos
Message 1 of 3
(3,319 Views)
Solution
Accepted by topic author svh

Hello,

 

Did you try to first get the Engine reference, to retrieve the property AppMainHwnd ?

 

This works for me (LV 2015 SP1 / TS 2014 SP1) :

AppMainHwnd.png

 

Best regards,

Message 2 of 3
(3,311 Views)

HI Mathieu,

 

Your approach worked for me, thank you very much.

 

0 Kudos
Message 3 of 3
(3,252 Views)