Line: if (u8query > 2) u8query = 0; Should be: if (u8query >= 2) u8query = 0; This prevents an uninitialized telegram to be sent on the modbus as a third (0,1,2) message.
Line: if (u8query > 2) u8query = 0;
Should be: if (u8query >= 2) u8query = 0;
This prevents an uninitialized telegram to be sent on the modbus as a third (0,1,2) message.