Only the NokPartCounter that has an error (and that triggers the mode stop) will reset the OK/NOK counters. For all other instances it looks like a common automatic stop which does not reset any counting.
The NokPartCounter just looks on the process and does not care about the station output. But for each process the NokPartCounter needs to be called for OK and for NOK parts to detect if there are x NOK parts in series or if there are x NOK parts out of y OK parts.
The station outlet without process is not relevant for the NokPartCounter, but it is relevant for the PartCounter to count the station output of OK parts. If you call the NokPartCounter with NokBits=0 AND Process=0 it will just forward the call to the PartCounter. I usually use the NokPartCounter call, but both is possible because these lines have the same effect:
NokPartCounter.Count(NokBits:=0, TypeNo:=TypeNoCur, Process:=0, PartCycleTime:=TypeData.CycleTime); or
PartCounter.Count(NokBits:=0, TypeNo:=TypeNoCur, Process:=X, PartCycleTime:=TypeData.CycleTime);
In your case with subtrees: The easiest solution is one PartCounter with one NokPartCounter. Every work position has a different process number. If you have one PartCounter but two NokPartCounter (e.g. because both work positions have the same process number), you have to be careful about the counting at the station outlet. Either call the PartCounter directly or call only one NokPartCounter like above (and maybe add a comment that this is intended and the second NokPartCounter is not forgotten).
... View more