LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to realise a TestStand PostStep UIMessage Handler in LabWindows/CVI 8.1 ?

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(3,913 Views)

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 

0 Kudos
Message 2 of 5
(3,904 Views)
Solution
Accepted by topic author johnbob
Hello Nick,

Thank you for your quick response !
Yes, you are right. That works, I've tried it now, but...
this is not that convenient as I want it to be. The programmer of a sequence (not me) must care for the correct implementation of a PostStep Callback to get it work, allthough he just wants to raise a popup. It's not a real problem, but if you use a TestStand MessagePopup command, you wouldn't expect to implement another command somewwhere to get it work. Don't misunderstand me, it's just that I don't think it to be a clean solution. And... at least, it's slower.
In a NI Tutorial, I found a LabView solution for that and two people were asking for a LabWindows version. Obviously, some are
interested in that solution. Those 2 functions I've mentioned in my post should work somehow, otherwise they are senseless.
I really like to know how.

Thanks again anyway. I will use your suggestion, if I don't get the problem solved at the root.

Regards,
Tom
0 Kudos
Message 3 of 5
(3,887 Views)

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 

0 Kudos
Message 4 of 5
(3,864 Views)
Hello Nick,

Thanks for coming back.
Yes, I've seen the warning, too. I was not sure about the mentioned case where it shouldn't be used.
It says "This method should only be used inside of the sequence editor or operator interface". What is inside ? I mean, I've used it inside.
Ok, anyway - obviously, there is no way to get it work in the given environment.
So, I will take your PostStep suggestion as a solution for my problem. As I mentioned it works, but is slow.
Slow means for example:
- a panel with a simple text string object
- updated in a PostStep Callback
- running a for loop counting to 50 which includes an if-statement which sets the text string to something, if counter is 10
-> takes 21.7 sec with update, without 1.2 sec

Now some words, why I don't use TestStand 4...
- I don't like the new interface, it's not that intuitive and build to practice as 3.5.
  It looks like someone said: hey every software company is making in cosmetics, we should do the same. Let's make it a bit more "clickable".
  Users will like to spend their time on "designing" their user interface.
- sequence file format has changed from text to bin. We have build an automated modification procedure for sequences which wouldn't work anymore.
- our company decided not to make anymore updates, because new updates always brought new problems we haven't had before.

Thank you again for your investigation.

Best regards,
Thomas
0 Kudos
Message 5 of 5
(3,853 Views)