From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Restart a Sequence Execution without Terminating it

Hello,

I am currently developing an application using TestStand and I would like to restart a sequence without terminating it.

 

Here are the details from my system.

 

I am currently using TestStand 2014 SP1 on Batch Mode with 4 sockets. I have modified both the PreBatch and PreUUT Callbacks in order to fit my needs.

 

During the PreBatch CallBack, my customized VI just asks the operator if they want to Disable any socket. If they select to disable any sockets I use the function "Parameters.ModelData.TestSockets[n].Disabled" to disable the socket for that specific run, where "n" is the number of the socket. This is working perfectly, since let's say that the operator disables socket 1 for the current run, after the execution is complete, the PreBatch VI will allow the operator to enable back the socket 1 for the following execution.

 

After this step, the PreUUT CallBack uses another customized VI that will open to the operator an UI where he can insert the SN for the enabled slots. Any slots that were disabled in the previous step won't be shown here, which is working fine. So in this step the operator inserts the SN and the VI verifies if the SN is available on a specific Database. 

 

So looking to the perfect scenario, all 4 UUTs will be found in the Database and the test can execute normally.

 

But sometimes, the operator may have exactly 4 UUTs and let's say that one of them is not found in the Database. That means the test can't be done for that UUT and if the operator had all 4 Sockets enabled from the previous step he won't be able to proceed since he does not have 4 UUTs ready for test, but only 3. That's why this VI will have a "Cancel" button.

 

That said, I would like to be able to do any of the two options bellow when the operator hits the "Cancel" button during the PreUUT step:

 

1) The Execution Restarts. This way, the PreBatch customized VI will appear again and since the operator knows that one of the UUTs can't be tested, he will disable one of the sockets and proceed to the PreUUT step where he will have to insert the SN for 3 UUTs, instead of 4.

(I prefer this one).

 

Or 

 

2) The Socket is disabled only for that run. The problem with this one, is that I understand that is not safe to disable a socket at this stage, that's why I can do that successfully on the PreBatch step, but it does not work here. I have even tried some commands such as "RunState.Execution.RestartEx" but the problem with this command is that it terminates all the sockets and even after enabling them at the PreBatch Step, they all get disabled so the PreUUT customized VI does not even show up again.

 

So to summarize, my PreBatch step is working perfectly since I can disable any number of sockets for the current execution, and on the next execution I can enable or disable any sockets and they will be reflected in the PreUUT step. My problem is that I don't know how to restart or disable a socket only for the current execution while I am at the PreUUT step.

 

Could someone give me some help here?

 

Thank you so much.

 

Regards,

Luciano Borges
Test Development Engineer
0 Kudos
Message 1 of 10
(3,955 Views)

Hey Lucianogob,

 

Does it matter if the test finishes running? I can think of a couple of options, but it depends on if it matters if there is post test sequences to call, reports that will be generated. etc

Chase
NI Technical Support Engineer
0 Kudos
Message 2 of 10
(3,873 Views)
Hey Lucianogob, Does it matter if the test finishes running? I can think of a couple of options, but it depends on if it matters if there is post test sequences to call, reports that will be generated. etc

Chase
NI Technical Support Engineer
0 Kudos
Message 3 of 10
(3,871 Views)

Hello,

The Test could finish right away. I just would like to know if there's a way to restart it from the beginning after that, so the PreBatch step would be executed again since the sequence restarted.

I don't need to run any other callback or sequence after this step in case the operator press Cancel.

Thanks.

Luciano Borges
Test Development Engineer
0 Kudos
Message 4 of 10
(3,868 Views)

Does this article help explain things anymore?

 

http://www.ni.com/white-paper/4823/en/

Chase
NI Technical Support Engineer
0 Kudos
Message 5 of 10
(3,848 Views)

Hey Luciano,

 

This answer depends on where you are trying to get back to when you say PreBatch step. Are you wanting to go back to the Setup TestStand.PNG

 

Or do you want to go back to the ProcessSetup sequence file callback? If you want to go back to the Setup inside the sequence, you can call a Goto step inside of the Flow Control pallet and set it to go to the first step inside Setup.

 

If you want to go back to the ProcessSetup callback, you will need to make an edit to the process model to be able to start from there again. The default batch model's entry point is configured to only call ProcessSetup once at the start

 

Ben H.
Systems Engineer
National Instruments
0 Kudos
Message 6 of 10
(3,822 Views)

Hello,

First of all thanks a lot for the responses.

I imagined that to restart the whole sequence again from the ProcessSetup callback I should actually have to change the Process Model. I don't want to change the Process Model for such a simple task.

Since I am taking this decision even before starting the Main Sequence, using a callback to go to the Setup on the Main Sequence won't solve my problem since this is actually the next step it's going to call.

Maybe the best way to do it is to simply stop the whole sequence so it can be restarted again and finally the operator can select only the slots he is able to use.

Thanks for the help

Luciano Borges
Test Development Engineer
0 Kudos
Message 7 of 10
(3,792 Views)

Hi Luciano,

 

I read a little fast and misunderstood where you are trying to restart the execution. I was under the impression you were inside the Main Sequence, but I see you are still in presteps. 

 

My question is did you change the PreBatch callback for the dialog to enter the SN? If you are waiting till the PreUUT step, then everything is loaded and it proves more difficult. If you disable and load the socket in PreBatch, you can potentially just rerun the PreBatch sequence when the operator selects a Cancel button. Is there a reason you want to wait till PreUUT for the SN dialog? 

Ben H.
Systems Engineer
National Instruments
0 Kudos
Message 8 of 10
(3,787 Views)

Hello,

 

The particular reasons are very specific, but they happened in the past, so I was just looking for something to avoid it.

 

In the PreBatch step, the operator has the chance to disable the slots that are not going to be used. So this is OK.

 

In the PreUUT step, the operator has to Scan the UUTs and the customized VI will check if the UUTs are present in the Database. Eventually, the UUT is not present in the Database so the operator has to use a different UUT for the test. Sometimes, what happens is that they don't have more UUTs available, so they can't start the test since for instance, they have to insert the 4th UUT but they only have 3 remaining to test. So the only way to be able to test 3 UUTs would be to disable one of the sockets during the PreBatch step. Also, the same situation applies when they realized that one or more of the UUTs are physically damaged and again they don't have more UUTs to test. Last but not least, they may realize, there's something wrong with a specific socket only at this stage.

 

I agree this is a very specific situation, but since it happened a few times in the past I was wondering if there's an easy way to return to the PreBatch step. But, this is not exactly a problem, since in case I can not do it I'll just stop the Execution completely, so the operator can restart the Sequence and disable the sockets as needed.

 

Thanks for your time on this by the way. I believe the best is to stop the execution since I don't want to spend too much time on this by changing the Process Model itself.

 

Regards.

Luciano Borges
Test Development Engineer
0 Kudos
Message 9 of 10
(3,781 Views)

Please check Is there something to do with Execution Entry (Test UUT's and Single Pass) ?

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 10 of 10
(3,762 Views)