01-26-2009 12:29 PM
I am calling a custom callback from TestStand which is kicked off by the user clicking on a User Interface button. I am running in Batch Mode and would like to get the index of the execution the user is viewing at the time he/she clicked on the button. I have tried it seems like every RunState variable and TestStand API with no success. How are you supposed to get information from parallel threads in TestStand?
01-26-2009 12:54 PM
Is there a reason you cannot use a StationGlobals? This seems like a pretty good use case. The other option is UIMessages. But those are generally for the User Interface.
Regards,
01-26-2009 01:08 PM
I am using StationGlobals to store information about each TestSocket. The problem is I would like to know from a UI point of view what Test Socket he/she is currently on when the callback is invoked. I haven't found any good way to do that. As far as UIMessages, I havn't look,into that feature yet.
01-26-2009 01:42 PM
You should use a UIMessage then. Here is a doc on it: http://zone.ni.com/devzone/cda/tut/p/id/4532
There is a bunch of other info on NIs website if you search for it. Basically, when you go into the custom callback you can post a UIMessage and then catch it in your UI. You can pass information along with the message (i.e. the testsocket info). Then you can display it on your UI or do whatever you need to with it.
Hope this helps you some. Let me know if you have any questions.
Regards,
01-27-2009 11:06 AM
I have discovered that I was doing an execution entry point instead of a normal callback. This would explain why I could not access other variables from other threads.
I would like to abandon this aproach and try a normal callback in TestStand as a result of the user clicking on Terminate.
The problem with this is with callbacks like PostUUT. It dosn't seem to be called immediatly. I need immediately because I want to immediatly shut off power to that particular UUT in batch mode. Alternatively experimenting with the <Cleanup> of the sequence. It seems this does not get called at all during a Terminate.
Can anyone offer any suggestions?
01-29-2009 10:54 AM
01-29-2009 01:29 PM
TestStand Already provides a Terminate function. This is what you get when you Left mouse click on the TestSocket Execution Icon them immediately right-mouse click and select Terminate. I tie into this fuctionality with my customized Operator Interface in C# I put a call back on the Terminate button click.
I would like for this event to notify me on the specific TestSocket Thread that is being executed for some critical things to take place before the Thread is actually terminated.
This is the events I would like to take place:
1) User runs test sequence in batch mode.
2) Thread run normally.
3) User decides he/she wishes to stop testing on 1 or all UUTs.
4) User Clicks on either Terminate single or Terminate all.
5) Software point of view a Callback occurs allowing for critical processing to occur before actual thread is stopped.
6) Thread or Threads is/are stopped.
All this takes place in TestStand 4.0 now except for step 5. I customized the Operators User Interface to do an execution callback into the model before the thread is fully terminated. This call works asynchronously as desired. It calls the execution entry point into my BatchModel as desired. If I present a popup asking for the TestSocket he/she is wishing to terminate then I can do this processing to the UUT as desired. However is his/her response does not agree with what was selected on the Operator Interface GUI then my stuff runs on 1 TestSocket and yet another TestSocket is actually stopped.
02-02-2009 11:50 AM