drbitboy
Lifetime Supporting Member
https://github.com/drbitboy/PLC_Modbus_client_server_50words
That is my test code for the Data Consistency check:
That is my test code for the Data Consistency check:
- S7-1200 is running
- A Modbus server in the Main Program Cycle (OB1)
- The holding registers are mapped to a 100-character string (51 registers, including one additional word at the beginning that appears to be the string length)
- There is a boolean whether to execute a DIS_AIRT/EN_AIRT instruction pair wrapped around the MB_SERVER
- A Modbus server in the Main Program Cycle (OB1)
- CCW/Micro820 Modbus client is reading (Modbus command 15) the 100-character string as 50 holding registers from the S7-1200 at ~10Hz
- For each read, CCW counts by 1 if there is a mismatch between the first word and the fiftieth,
- The mismatch occurs if OB37 interrupts the MB_SERVER in OB1 while data are being transferred.
- For each read, CCW counts by 1 if there is a mismatch between the first word and the fiftieth,
- Bottom line: without the DIS_AIRT/EN_AIRT pair enabled, about one transfer in a thousand shows a mismatch
- I miss any mismatch from a read which immediately follows a read that yielded a mismatch
- At one in a thousand, I am comfortable with the error, but feel free to correct the code.
- I miss any mismatch from a read which immediately follows a read that yielded a mismatch