10-28-2016 10:09 AM
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?
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.
Solved! Go to Solution.
10-28-2016 10:36 AM
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) :
Best regards,
11-02-2016 04:30 AM
HI Mathieu,
Your approach worked for me, thank you very much.