NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Operator Interface for parallel process model

Solved!
Go to solution
I am creating a Custom Operator Interface that is being desinged to run with the parallel process model.  What I want is to "combine" the default parallel model support dialoge that handles the execution and serial number entry and also show the exectution steps in one window.  My operator interface will only support two testsockets and will have two exectution view managers with with two sequenceview controls viewing the executions. 
 
What I have so far is a hacked up version of the simple OI provided by NI.  I am running a simple sequence that just has some wait steps.  I have the sequence set the "Parameters.ModelOptions.ParallelModel_ShowUUTDlg" to false so it doesn't pop-up.  I also have modified the simple OI to have the second exectuion viewer and I progmaticly set one viewer to one testsocket exectuion and the other viewer to the second testsocket execution.  I have been working with using the UIMessages to generate callbacks.  Specifically the ModelState (event range 30 to 36).  I think they will come in handy for updating the state of the OI. 
 
The biggest issue I am trying to work around is entering the serial number, and setting the continuetesting boolean (normaly set in the PreUUT callback).  I don't want to have a pop-up window if at all possible.  I would like the serial number to be entered in a control on the OI window.  Also, I can get an idea of when the sequence is ready for new loop to begin with the UIMsg_ModelState_Waiting event.
 
One thing that I tried was to pause the exectuion using the break method in the OI when the UIMsg_ModelState_Waiting event occured in the specific execution.  Then when a button was pressed on the OI front panel I grabbed the value of the serial number (also on the OI front panel) and programaticly entered it into the serial number using a sequencecontext property.  Then I restarted the execution.
 
The bad thing about this is that the break usualy pauses the exectuion before it enters the PreUUT callback.  Then the continuetesting variable will get over written after I resume exectuion.
 
What would work better is to operate similar to how the default parallel process model works with a wait on notification in the PreUUT callback.  I just don't know how I can do this.
 
Any help or other ideas would be appreciated,
Thanks
Paul
0 Kudos
Message 1 of 6
(4,727 Views)
Is there a way to send a notification to a sequence step that is waiting for a notification from a custom OI?
Paul
0 Kudos
Message 2 of 6
(4,716 Views)
Solution
Accepted by topic author paulmw

Yes, you can use NI TestStand Synchronization server. It lets you programmatically perform all the operations that the synchronization step types offer. The type library for it is already registered on your system.

Refer to the SyncManager topic in the API online help (this help topic is in 3.5, I'm not sure about earlier versions).

I'm guessing you would do something like the following, but I've never tried it:

ISyncManager mgr = Engine.GetSyncManager("MyNotificationName")

mgr.GetNotification("MyNotificationName").Pulse(dataObject, byRef, applyToAllWaiters)

or

mgr.GetNotification("MyNotificationName").Set(dataObject, byRef, autoClear)

Message 3 of 6
(4,710 Views)

I started to get a Debug Warning in my OI and can not figure out how to stop getting the warning when I exit the OI.  The debug warning happens fast and then the windows closes before I can read the whole thing.  If I restart the OI I get errors and labview crashes. (I am running from the Labview development)

I am attaching the Operator interface in a zip file that I am working on.  Use the example sequence, OverrideSerialNumForParallelModel.seq, in the "\Examples\ProcessModels\ParallelModel" folder that shipped with teststand to run with this OI. 

I tried this on two machines and I get the same problem.  The OI is modified from the default simple OI from NI.  I added a second execution view manager and exection viewer.  I also modified the callback to "Simple OI - DisplayExecution Event Callback.vi".  In this VI, if I swap the "diagram disable structure" to the origional code the problem seems to go away.  So I don't understand why my modifications are causing problems.

Also, I am running LV 8.0.1 and Teststand 3.5

Could someone take a look at this and see if they get the same problem,

Thanks,

Paul

0 Kudos
Message 4 of 6
(4,704 Views)
I was able to capture the Debug warning by adding a break point right before the top level VI finishes.  I'll attach the screen capture and text in the zip file.
 
Apparently "References to PropertyObjects were not released properly."  Don't know why not.
Any ideas?
0 Kudos
Message 5 of 6
(4,702 Views)
Hi Paul,

The main issue that we were hitting with those debug warnings was not closing down all the executions created in the "Display Execution Event" callback. Each time a new Execution object is created, it needs to be closed.

We normally don't debug code, but I've attached a modified version of your Display Execution Event Callback that takes care of the problem. Basically I just added three close reference VIs in the appropriate places.

Thanks Paul, have a good one!
Dan Weiland
Message 6 of 6
(4,668 Views)