11-25-2022 07:02 AM
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.
11-26-2022 01:34 PM
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).
11-28-2022 12:35 AM
11-28-2022 08:00 AM
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.