NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using SequenceFilePostStepFailure

Hi,

 

I'm trying to understand how SequenceFilePostStepFailure works. I can't seem to understand how the example code is set up. From the attached image, how can you add the error code to the pop up window using Locals.StepDetails, only if the error code is present? I have Error clusters, numeric errors and string errors, and I would like them to show in the pop up window if they have occurred. If all errors occurred then I would like them all to show. My error cluster is in Stationglobals.Errors.

 

Thank you for having a look!

 

SequenceFilePostStepFailure.JPG

0 Kudos
Message 1 of 6
(3,928 Views)

The SequenceFilePostStepFailure only gets invoked if you have a step where the Step.Result.Status gets set to "Failed".  It seems you have made the classic error (no pun intended) of mixing up Failures with Errors.

 

Failures occur when a limit was not met.

 

Errors occur when something broke or went wrong with the execution.

 

Secondly, how are you even populating StationGlobals.Errors?  What is setting the errors in there?

 

There is a callback called SequenceFilePostStepRuntimeError.  It only gets invoked when the Step.Result.Error.Occured is set to True.  It will not check your custom data in StationGlobals. 

 

 

I recommend you have a SequenceFilePostStep callback and check your station globals in there.  If they have an error then set Parameters.Step.Result.Error.Occurred to True.  This will generate an error.  You would also need to set the message and code if you want those displayed to the user.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 6
(3,914 Views)

I figured it out now. I was mixing up failures and errors  like you said Smiley Happy. Also I couldn't understand how the failure messages were created in SewuenceFilePostStepFailure.

 

I have one more question though, but it's really more of a general question:

 

When I hit "Retry" in the SequenceFilePostStepFailure window, the program returns to the previous run step, like I want it to. However, the VI is inside a ForEach loop, feeding the VI with about 20 different sets of parameters. When the program runs it again, the ForEach loop steps one number forward and gives it the next set of parameters, so it's really running the next step. Any tips on how to not re run the actual ForLoop, or how to make it keep it's previous parameters?

 

Thanks for your help!

0 Kudos
Message 3 of 6
(3,904 Views)

By default there is not a popup for the SequenceFilePostStepFailure.  I'm curious if this is something you created?

 

However, for the Error dialog that pops up that is done by the TestStand engine.  When you click retry on the Run-Time Error window you should not have the issue you are describing.  I just tested it out and didn't see the issue. 

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 6
(3,896 Views)

I pretty much copied from the examples folder and changed the code a bit. There's a "Choose action" step that has a retry option, using "RunState.Caller.RunState.NextStepIndex = RunState.Caller.RunState.StepIndex".

 

I simplified a little how my program works. I'm not sure if it makes a difference, but what's really happening is this:

 

Main thread can call a sequence. This sequence has a ForEach loop containing a VI that gives out a bunch of potential failures in a cluster and saves them as a global variable, and a sequence call to "CheckForFailures".

 

The "CheckForFailures" sequence has 4 "none" adapters and checks a few different string arrays and numbers. Depending on which of these steps fail, a different number of steps needs to be retraced in order to end up at VI in the ForEach loop, which I fixed by messing around with the "RunState.Caller.RunState.StepIndex".

 

I don't know if it's all this jumping between sequences that makes it load the next set of parameters, or if I've configured something wrong.

 

Thanks again for your help!

0 Kudos
Message 5 of 6
(3,889 Views)

I figured it out. The multiple sequences were the problem. When I was using "RunState.Caller.RunState" I was actually setting variables in the wrong sequence. I removed the extra sequence and combined it with the sequence with the ForEach loop and VI were in and now it doesn't continue the loop. Thanks for your help!

0 Kudos
Message 6 of 6
(3,884 Views)