03-02-2016 09:54 AM
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?
03-02-2016 12:39 PM
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.
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.CustomResults.Item(Locals.LoopIndex).Name == "\"Temperature\""
RunState.CallingStep.AdditionalResults.CustomResults.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?
03-02-2016 02:25 PM
I'm not sure if this is the best way but using Lock steps solved the problem.