02-12-2009 07:40 AM
How to realise a TestStand PostStep UIMessage Handler in LabWindows/CVI 8.1 ?
Hi All,
I have a problem catching UIMessages from TestStand engine in a DLL called from a Sequence.
A search in the forum resulted in 2 posts concerning this or similar problem, but with LV and unfortunately, they were not solved.
TestStand Event 13 - UIMsg_StartInteractiveExecution is not captured by LV Operator Interface
Problems with ActiveX Callbacks in LabVIEW 7
In detail, I want to enable a DLL to access TestStand SequenceContext (variables) in sync to step execution.
A popup panel could then display variables like the watch window does, but more flexible as a user defined panel.
Currently this is working with a periodic timer which causes race conditions with TestStand while monitoring variables.
It works for 99%, but I want to get it working 100%.
I have found the
TS_ExecutionAddPostStepCustomUIMessage()
to tell the engine, that I want to be informed about step-end with my private UIMessage.
Next is to implement a Callback with
TS_EngineRegisterUIMessageCallback()
to fetch all the UIMessages and filter my private one.
Sounds good - works for catching events, but TestStand locks and doesn't continue execution and doesn't proceed handling
any UI operations. I have tried 4 solutions (please see code), no difference in result.
I have to kill TestStand to get out of this.
Attached you can find a stripped down simple example to reproduce the problem.
I would appreciate any help.
Thanks in advance.
Regards,
Tom
TestStand 3.5.0
LabWindows/CVI 8.1.0
Solved! Go to Solution.
02-12-2009 09:41 AM
Hello Tom,
One possibility that may be a little cleaner and easier to implement ( I say this without fully understanding your needs, so I may certainly be missing something ) would be to add the SequenceFilePostStep Sequence File Callback to your TestStand sequence file. Then, from within this callback, you could call your code module, passing in the sequence context to update your variables view.
NickB
National Instruments
02-13-2009 03:50 AM
02-18-2009 03:08 PM
Hello Tom,
I'm sorry it's taken me so long to get back to you. I'm nervous about using the TS_EngineRegisterUIMessageCallback() in a code module because of the explicit warning against it in the help, but I'm afraid I'm a little too far removed from my TestStand days to give you more specifics about that warning. Someone in the TestStand forum should be able to give you more insight.
Having said that, this is implemented very easily if you would be able to upgrade to TestStand version 4 or later. In these later versions, the application manager is used to handle the UI messages. However, in TestStand 3.5 there is not an application manager to pass to your code module. Take a look at this example code for an example that is very similar to what you are trying to achieve - but uses a later version of TestStand.
NickB
National Instruments
02-19-2009 02:54 AM