NI TestStand

Showing results for 
Search instead for 
Did you mean: 

Using Pre-step Callback in Batch Process

So far, I've used the SequenceFilePreStep callback to do some action for particular steps in the sequetial model. Now, I am trying to run the sequence in the batch model for multiple UUTs but I began to get errors from the callback. Do I have to replace the SequenceFilePreStep callback with the ProcessModelPreStep callback to run callbacks for multple threads?


It seems I have to modify the BatchModel.seq but isn't this sequence used for all batch processes in general? In some other project, I may want to use the default BatchModel.seq. I can delete the modified callback or save the seq file in a different name but this doesn't seem right. How do you usually manage multiple modified process model sequences?

0 Kudos
Message 1 of 3

I found an answer for the second question and I tried using the ProcessModelPreStep callback to no avail. I get the same type of errors.


It seems multiple threads are accessing the same properties as described here.


The pre-step callback I use doesn't just read properties but also remove and insert variables to the step's custom additional results. I use statements such as the following.


RunState.CallingStep.AdditionalResults.CustomResul​ts.Item(Locals.LoopIndex).Name == "\"Temperature\""



I don't get why RunState.CallingStep in different threads refer to the same object (shared object). How can I make each thread deal with its own unique CallingStep?



0 Kudos
Message 2 of 3

I'm not sure if this is the best way but using Lock steps solved the problem.

0 Kudos
Message 3 of 3