NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Fail Sequence from PremainsequenceCallback

Hi,

 

In my PreMainSequence Callback I want to check that the entered serialnumber is valid ( Present in Database)

 

If it is not present I want to generate a Failed testreport. (At the start of mainsequence)

But how do I do this?

 

The reason I want to do this in the PreMainSequence instead of the mainsequence is: when you only run mainsequence without processmodel or with single pass the serialnumber check shouldn't be executed.

 

 

0 Kudos
Message 1 of 4
(1,127 Views)

It could be also in the main. Just add precondition checking if it is running with the process model.

 

If it is running with process model then you can check serial number with pass/fail test step (or terminate or set error if serial is missing).

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
0 Kudos
Message 2 of 4
(1,094 Views)
Hi, I understand but what is then the point of using PremainsequenceCallback?
0 Kudos
Message 3 of 4
(1,076 Views)

From help:

PreMainSequence—The Test UUTs and Single Pass sequences call the PreMainSequence callback before the MainSequence executes. The PreMainSequence callback in the process model file is empty. Override this in the client file to perform an action before any code in the MainSequence executes.

In simple terms, it is for global initialization steps. I suggested using a different approach because at first glance I think achieving what you need using this callback would be complicated. If you open the process model file, you will see that you would most probably need to modify it to accomplish your goal.

 

The problem is mainly in creating a "failed" status. If you are OK with the "terminated" status, then the PreMainSequence callback will work, and it will be quite straightforward (just call RunState.Engine.TerminateAll).

 

Another option is to use PreUUT callback. In it, you can set Parameters.ContinueTesting flag to false if your condition is not met. But in that case, you won't have any status, it will skip that DUT.

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
0 Kudos
Message 4 of 4
(1,061 Views)