NI TestStand

cancel
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
(2,206 Views)

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.

 

http://zone.ni.com/reference/en-XX/help/370052K-01/tsfundamentals/infotopics/process_models_modify/

 

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

 

http://forums.ni.com/t5/NI-TestStand/TestStand-Shared-Object-in-show-step-in-variable-tab/td-p/11984...

 

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\""

RunState.CallingStep.AdditionalResults.CustomResul​ts.Remove(Locals.LoopIndex)

 

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
(2,196 Views)

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

0 Kudos
Message 3 of 3
(2,186 Views)