XL2OL
4.72.5
1/7/2021

A customer complained that they would be missing gags on the first part when entering Run Mode. The gags were Expanded Gags that get sent to a PLC via MODBUS.

The customer had PLC strip data records that showed the gag would come on briefly at the appropriate time and then briefly at the end of the press cycle. Rewiring one of the affected gags to use a hardwired gag eliminated the problem for that gag.

The diagnostic data screen on the XL showed no blips on the affected gags.

A code review showed that there was a race condition when sending the Expanded Gags to the PLC. There was no Mutex protecting the time when the data was copied into the command buffer and when it was sent. This allowed a lower priority task (B) make a copy of the data but get interrupted by a higher priority task (A) before it could send it. Task A was able to modify the master data and send its copy. When task B was allowed to send its copy, task A's edits were overwritten in the PLC. If a third task (C, A or B) needed to send gags, since the master data was correct, it would fix the issue caused by the race condition. This led to the affected gags to flicker on and off at the beginning and the end of the press cycle.

We have no way to duplicate the timing of the customers machine. Something about the timing is making this race condition occur on the first part after entering run. This bug fix will most likely fix it but there is no way to absolutely know for sure until it is tried on that machine.