NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Method for terminating test socket executions from a custom LabVIEW based OI

TestStand 2014 64bit

LabVIEW 2014 64bit

Win 7 64 bit

PROCESS MODEL = Parallel

 

Hi,

 

I'm seeking after methods for terminating/ending test socket's executions from a custom built LabVIEW based OI. I have succesfully created a functionality which starts selected socket's exection (A LabVIEW based VI checks which sockets are active, then Initialize TestSocket Sequence (Parallel model) sends a UImessage which CallBack VI on OI's side registers and sets Parameters.ModelData.TestSockets[].ContinueTesting TRUE/FALSE depending if the UUT persists.)

 

Now I would like to terminate/end selected socket's exection when I press a "STOP" button on OI (The sockets are listed in a 1D-cluster array (every socket have individual STOP-button).  In ParallelModel.seq  is a FileGlobal called  "TestSocketExecutions" (array of Object references) and as I know this reference array could be used with Execution.Terminate -method for terminating executions? The problem is now that I do not know where I should insert this functionality inside the model file.

 

Short explanation about the functionality:

1.) Sequence sends a UImessage to OI (object ref. to a numeric array (name: "Sockets_to_be_terminated")

2.) CallBack VI updates socket numbers/IDs which executions needs to be terminated into the array (numeric)

3.) TestStand iterates the array (uses a FOR step) and inside the FOR an ActiveX step calls Exection.Terminate -method. The object reference is FileGlobals.TestSocketExecutions[Sockets_to_be_terminated]

 

ContinueTesting -parameter could also be used?--> The main purpose is to end sockets exections/STOP execting sequence.

 

NOTE: Parameters.ModelOptions.ParallelModel_ShowUUTDlg = False    --> This parameter seems to be a precondition for some sequence calls inside the parallel model

 

Does anyone know how I could implement this or perhaps knows better solution?

 

Many Thanks in Advance!

-Henry

 

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

Are you working with a default parallel model in TS or a customized one?  I guess the thing to remember is the operator interface never really 'leads the dance' when interacting with TS. The usual method of UI interaction with a running process is to use the TS API to 'ask nicely' for TS to do something for you, and then wait for TS to acknowledge. Luckily the API is pretty comprehensive!

.

Is it safe to assume you've already explored the logic for 'Engine.TerminateAll()' methods that exist within TestStand or the Execution.Terminate() method? and that this is not what you want to do? i.e. you want to some how tell 1 or more sockets to end, without a termination flag beings set? Otherwise I would start here, as these methods are the usual way folks do what you're trying to accomplish...

.

Since terminateAll() requires few, if any parameters other than an engine reference, it should be pretty easy to invoke from any OI (and I think may even be a preset button on some shiping example programs), terminating some, but not all executions requires access to that 1D array of execution pointers, but it sounds like you already have that.

.

if you can share a little more context maybe I can help you further.

.

-Elaine

0 Kudos
Message 2 of 3
(5,618 Views)

Hi Elaine,

 

Thanks to the information!

 

Yep, I am using a custom process model. I'v crated a LabVIEW based module which is responsible for executing selected sequence files parallel (two files). In this module I have created an user event handler and I can command this handler using OI buttons (I do not have any "TestStand buttons" on my OI). In this handler I have used Execution.Terminate method and is seems to work Ok for a TS execution launched from LabVIEW.

 

Now the question is that I have a 1D-cluster array (couple string controls + STOP-button) <-- This is a OI control. The purpose for individual STOP buttons (every test socket have own button, about 100 testsockets 😉 is that Operator can terminate specific socket's execution at any time he/she want. LabVIEW OI will pass a 1D(I32) array to TestStand using a CallBack VI which a UImessage from TestStand's side invokes.

 

My problem is that I cannot locate right place in parallel process model where I should send this UImessage to OI and get socket infromation back. I tried to insert a sequence call (new thread) and added needed  Execution.Terminate (ActiveX) -method  inside subsequence before "Wait for TestSockets" step (Test UUTs Entrypoint), did not work...

 

So actually what I'm doing/trying to accomplish is that I have created a LabVIEW based UUT dialog (I have disabled TestStand's own) and I'm trying to do the same thing as this dialog does when user presses "Terminate" button for a single test socket.

 

Br,

-Henry

0 Kudos
Message 3 of 3
(5,601 Views)