Open BobanSpasic opened 2 years ago
Hi Jens, you may close the issue - the PLC is sending weird data. I apologize for the inconvenience.
To explain - the PLC is sending data even if the output registers are not ready, so it is sending "something" that is in the register at the moment. The second problem is the repetition of sending - the PLC sends the Modbus message 1-3 times in one shot, and it happens that the registers do not contain valid data for every repetition.
Yes, I also once had a problem with a client whose PLCs was acting like this. It's good if you're able to tell if you can trust the data you receive.
PS: I cannot close the issue, I am not the repo owner, just a user like you 😉
Hi, I have converted your Delphi Slave demo (Indy10) to Lazarus (Version 2.2.0 64bit on Windows 10). I am sending 32-bit values from PLC to TIdModBusServer by using 16-PresetMultipleRegisters method. For the sake of debugging, I have modified the code of your demo as follows (added logging to mmoErrorLog):
I sent the values 3 and 7993, and this is what I get in the ErrorLog:
As you can see, the event gets triggered twice, where the second one contains a wrong value (0 instead of 3). Any solution to this problem?