From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to correspond between execution and UUT socket?

Solved!
Go to solution

    I directly use MS C # Console+Teststand Engine dll (not the ActiveX_UI control) to develop a sequence test tool, which currently works normally under the SequentialModel process model. I can use the UI_ Message gets the test result information as I want.

 

    Now, I want to add the support of BatchModel and ParallelModel process models to this tool, but I have some problems and need your help:

 

        1. In the BatchModel process model, I can already create multiple executions and execute them at the same time, then use the UI_ Message gets all the step result and execution ResultStatus of all executions.

            the question is:  how do I specify the number of executions to start? Through API? Or just pass it through Console arguments?

 

        2. In the ParallelModel process model, when I start multiple executions, they will not be executed immediately. Instead, I tell an execution can be started in some way (for example, if I close the test fixture of UUT socket No. 3, it will start the corresponding execution of UUT socket No. 3). Here, I have two questions:

 

            a. How do I know which execution is corresponding to UUT3 # (runstate. Testsockets. myindex=2 [index base zero] )?

 

            b. How can I operate the execution corresponding to UUT3 # independently in multiple instanced executions? (Through the execution id or the execution display name?)

 

 

Maybe these questions are a little stupid, but because I have transferred from other industries to this industry and don't have much foundation, but I really want to learn more about Teststand, so I am grateful for any answer.

0 Kudos
Message 1 of 6
(755 Views)

Does anyone have a better idea?

0 Kudos
Message 2 of 6
(710 Views)

I don't totally get it... bit it's that time of day 

 

is you intend to launch executions from your tool as an alternative to using a process model?

 

Or are you launching the same seq file using the process models multiple times? Like pressing F5 several times?

 

 

0 Kudos
Message 3 of 6
(701 Views)

HI, Mr Wachno:

 

        Thank you for your friendly reply!

        please forgive me. I may not describe it clearly.

        The thing is, I developed a C # console application, instantiated the Engine class of Teststand API through the following code:

Engine engine = new Engine();
   engine.LoadTypePaletteFilesEx(TypeConflictHandlerTypes.ConflictHandler_Error);
   Console.WriteLine($"Engine is start now...Done");
   string platform = engine.Is64Bit ? "x64" : "x86";
   Console.WriteLine($"TestStand Engine Platform: {platform}");
   Console.WriteLine($"TestStand Engine Version: {engine.VersionString}  \r\n.NET CLR Version: {engine.DotNetCLRVersion}");

   stationOptions = engine.StationOptions;
   ... ...

       then I loaded the test seq file and the sequential process model seq file, started a new execution. Through the customer UI message, I got the following test information:

start Engine...
Engine is start now...Done
TestStand Engine Platform: x86
TestStand Engine Version: 2017 (17.0.0.184) 32-bit
.NET CLR Version: 4.0.30319.42000
Set allow other models...Done
Teststand Sequence File is: D:\TestStand UIMessage OK\UIMessageDemo_mAGIC.seq
Teststand Model File is: C:\Program Files (x86)\National Instruments\TestStand 2017\Components\Models\TestStandModels\BatchModel.seq
execution id = 1 execution name = MainSequence - UIMessageDemo_mAGIC.seq [1]
Execution Socket ID: 0
Event: UIMsg_StartFileExecution (Path: D:\TestStand UIMessage OK\UIMessageDemo_mAGIC.seq)
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = UIMsg_StartExecution
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = 10007  Msg = Get a WELCOME string          Passed     test            test            IgnoreCase
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = 10007  Msg = Numeric Limit Test            Passed     10              10      11      EQ
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = 10007  Msg = Device Initialization         Done
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = 10007  Msg = Voltage Test                  Passed     8.943890709497  Volt    6       11      GELE
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = 10007  Msg = Current Test                  Passed      0.5     A       0.1     1       GELE
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = 10007  Msg = Engine Logic Pass/Fail Test   Passed      True            PASS            EQ
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = 10007  Msg = Voltage Test New              Passed      8.994510152292  Volt    9       11      LTGT
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = 10007  Msg = Current Test New              Passed      1.2     A       0.1     1       LTGE
Event: UIMsg_EndFileExecution (Path: D:\TestStand UIMessage OK\UIMessageDemo_mAGIC.seq)
Event: ID = 1  Name = MainSequence - UIMessageDemo_mAGIC.seq [1]  MsgCode = UIMsg_EndExecution
Test Result: Passed

 

    Now, I want to add support for batch process model and parallel process model for this program. However, I did not understand:

 

           1. In these two models, do I need to create multiple execution instances in the engine through code? If not, how did they build it?

 

           2. In these two models, I can set the number of sockets in the number of Test Sockets in the Configure-Model Options menu dialog box. My understanding is that each socket should correspond to an execution. Who is this number passed to? Accordingly, who manages these executions? How to control these executions individually or completely?

 

           3. I am now looking up BatchModel.seq and ParallelModel.seq to try to make it clear. I learned that there is a batch controller, which seems to be the controller of executions. However, I still can't understand the whole process.

 

    So, I wonder if it can help me figure out these problems and how I need to implement them in code?

0 Kudos
Message 4 of 6
(694 Views)
Solution
Accepted by angus2022

Thanks for the example, this clears things up a little.

 

to answer your questions:

1.) if you use a Batch or Parallel Process Models, the models will take care that the executions for all sockets will be created and managed over execution time. That's basically, one  purpose for the existence of the process models.

 

2.) When you configure the number of sockets in the Sequence editor, you are actually calling a Configuration Entry Point of the corresponding modell. The config is stored in an .ini file automatically, so  it is available for the next start of the process model. This is done by some routines in ModelSupport.seq

 

3.) To learn about the ProcessModels, exploring them is a good idea. Browsing them and trying to understand made me appreciate all the effort, which was needed to set them up

 

Don't try to mimic ProcessModel functionalities in some application. There is no need to. If you need to customize the existing models, the general recommendation is to copy an existing one and modify it. Within TestStand.

 

 

 

Message 5 of 6
(670 Views)

Thank you very much for your patience and clear answer!

This made me understand that TS still has a lot of content to explore and recognize.

WIsh you have a nice day!

0 Kudos
Message 6 of 6
(659 Views)