We found a solution to work only with DWORD in the PLC (as required by PartCounter) but send DINT values to MES (according to OpconXml specification). Until the update is soon released, the only possibility is to use two variables in the PLC (NokBitsPlc:DWORD + NokBitsMes:DINT).
It depends on the customer/Bosch plant which bit is defined as GLOBAL_NOK. In the past it was the highest bit, but nowadays sometimes it is the lowest bit. If there is no definition, assume the highest bit. Only since Control plus Studio V5.3 it is possible to define individual bit numbers and to have gaps. Before CpStudio V5.3 you have to define a constant by your own or you have to create always 32 NOK bits and define all other as "reserve".
The GLOBAL_NOK bit was introduced as a kind of fallback: You set it when processing starts and in case something is canceled, at least the GLOBAL_NOK bit is set. If there is no NOK bit set the rework stations can not handle these NOK parts. The rework client only has access to the NOK bits, not to the result data. Without any NOK bit, the part can not be reworked (because the operator does not know the NOK reason). In the current version of the example project "Digital Machine" I have implemented another usage of the GLOBAL_NOK: Before setting a part "good", it checks that only the GLOBAL_NOK bit is set. If this bit is not set, then the application code did a OpconMemSet on the WpcData/PartData by accident. But this kind of implementation is not standard (maybe not yet 😉).
... View more