Comunicação Modbus TCP instável

Comunicação com 5 PLC’s Emerson e um conversor Modbus TCP.

Fica comunicando e caindo.

11/01/2023 17:25:34.196 (1B40) DRIVER - ModiconModbus.UseSwapAddressDelay = 0
11/01/2023 17:25:34.196 (1B40) DRIVER - ModiconModbus.WaitSilenceOnError = 1
11/01/2023 17:25:34.196 (2F64) IOKIT INITIALIZING…
11/01/2023 17:25:34.196 (2F64) SOCKET Winsock initialized: version=2.2, highVersion=2.2
11/01/2023 17:25:34.196 (2F64) IOKIT INITIALIZED!
11/01/2023 17:25:34.196 (2F64) IOKIT Request handler enabled
11/01/2023 17:25:34.196 (2F64) IOKIT CONNECTING…
11/01/2023 17:25:34.196 (2F64) SOCKET connecting socket to ‘10.25.37.160’ on port 5000…
11/01/2023 17:25:34.196 (1FF8) TAG Tag(1.3.0.256).Validate = SUCCESS (type=10;flags=9)
11/01/2023 17:25:34.196 (1FF8) SUPERBLOCK Tag(1.3.0.256).Normalize = Linear(1:256) (x1,00000403)
11/01/2023 17:25:34.196 (1FF8) TAG Tag(1.3.0.258).Validate = SUCCESS (type=10;flags=9)
11/01/2023 17:25:34.196 (1FF8) SUPERBLOCK Tag(1.3.0.258).Normalize = Linear(1:258) (x1,00000403)
11/01/2023 17:25:34.196 (1FF8) TAG Tag(3.3.0.256).Validate = SUCCESS (type=10;flags=9)
11/01/2023 17:25:34.196 (1FF8) SUPERBLOCK Tag(3.3.0.256).Normalize = Linear(2:256) (x1,00000403)
11/01/2023 17:25:34.196 (1FF8) TAG Tag(4.3.0.256).Validate = SUCCESS (type=10;flags=9)
11/01/2023 17:25:34.196 (1FF8) SUPERBLOCK Tag(4.3.0.256).Normalize = Linear(3:256) (x1,00000403)
11/01/2023 17:25:34.196 (1FF8) TAG Tag(5.3.0.256).Validate = SUCCESS (type=10;flags=9)
11/01/2023 17:25:34.196 (1FF8) SUPERBLOCK Tag(5.3.0.256).Normalize = Linear(4:256) (x1,00000403)
11/01/2023 17:25:34.196 (1FF8) TAG Tag(1.3.0.839).Validate = SUCCESS (type=10;flags=9)
11/01/2023 17:25:34.196 (1FF8) SUPERBLOCK Tag(1.3.0.839).Normalize = Linear(1:839) (x1,00000403)
11/01/2023 17:25:34.196 (1FF8) TAG Tag(2.3.0.256).Validate = SUCCESS (type=10;flags=9)
11/01/2023 17:25:34.196 (1FF8) SUPERBLOCK Tag(2.3.0.256).Normalize = Linear(5:256) (x1,00000403)
11/01/2023 17:25:34.196 (1FF8) TAG Tag(2.3.0.258).Validate = SUCCESS (type=10;flags=9)
11/01/2023 17:25:34.196 (1FF8) SUPERBLOCK Tag(2.3.0.258).Normalize = Linear(5:258) (x1,00000403)
11/01/2023 17:25:34.196 (1B40) SUPERBLOCK Linear(1:256).Unnormalize = Tag(1.0.3.256.Blob:00523B88)
11/01/2023 17:25:34.196 (2F64) SOCKET socket connected to ‘10.25.37.160’ on port 5000 (local port 61279)!
11/01/2023 17:25:34.196 (2F64) IOKIT CONNECTED!
11/01/2023 17:25:34.212 (2F64) IO TX: 00 00 00 00 00 06 01 03 01 00 00 03
11/01/2023 17:25:34.244 (2F64) IO RX: 00 00 00 00 00 03 01 83 03
11/01/2023 17:25:34.244 (1B40) DRIVER MODBUS exception response - type 3(ILLEGAL DATA VALUE)!
11/01/2023 17:25:34.244 (1B40) DRIVER sgets failed, input stream is not available (hr=80004005)!
11/01/2023 17:25:34.244 (1B40) TAG <== (0.050) Tag(1.0.3.256.Blob:00523B88[3]).ReadBlock = ERROR (hr=80004005)
11/01/2023 17:25:34.244 (1B40) SUPERBLOCK Linear(2:256).Unnormalize = Tag(3.0.3.256.Blob:00524138)
11/01/2023 17:25:35.264 (2F64) IO TX: 00 01 00 00 00 06 03 03 01 00 00 01
11/01/2023 17:25:35.295 (2F64) IO RX: 00 01 00 00 00 05 03 03 02 00 D5
11/01/2023 17:25:35.295 (1B40) TAG <== (1.055) Tag(3.0.3.256.Blob:00524138[1]).ReadBlock = (17:25:34.244) 213
11/01/2023 17:25:35.295 (1B40) DRIVER CAST AFTER READ (1*1;00000403[int16,Sz=2,IO=0,SB=0,SW=0,SDW=0,BM=0]) 213 => 213
11/01/2023 17:25:35.295 (1B40) SUPERBLOCK Linear(3:256).Unnormalize = Tag(4.0.3.256.Blob:00523EC8)
11/01/2023 17:25:36.313 (2F64) IO TX: 00 02 00 00 00 06 04 03 01 00 00 01
11/01/2023 17:25:36.346 (2F64) IO RX: 00 02 00 00 00 05 04 03 02 00 D6
11/01/2023 17:25:36.346 (1B40) TAG <== (1.051) Tag(4.0.3.256.Blob:00523EC8[1]).ReadBlock = (17:25:35.295) 214
11/01/2023 17:25:36.346 (1B40) DRIVER CAST AFTER READ (1*1;00000403[int16,Sz=2,IO=0,SB=0,SW=0,SDW=0,BM=0]) 214 => 214
11/01/2023 17:25:36.346 (1B40) SUPERBLOCK Linear(4:256).Unnormalize = Tag(5.0.3.256.Blob:00524478)
11/01/2023 17:25:37.366 (2F64) IO TX: 00 03 00 00 00 06 05 03 01 00 00 01
11/01/2023 17:25:38.400 (2F64) IO RX: 00 03 00 00 00 05 05 03 02 00 DA
11/01/2023 17:25:38.400 (1B40) TAG <== (2.052) Tag(5.0.3.256.Blob:00524478[1]).ReadBlock = (17:25:36.346) 218
11/01/2023 17:25:38.400 (1B40) DRIVER CAST AFTER READ (1*1;00000403[int16,Sz=2,IO=0,SB=0,SW=0,SDW=0,BM=0]) 218 => 218
11/01/2023 17:25:38.400 (1B40) SUPERBLOCK Linear(1:839).Unnormalize = Tag(1.0.3.839.Blob:00523E60)
11/01/2023 17:25:39.418 (2F64) IO TX: 00 04 00 00 00 06 01 03 03 47 00 01
11/01/2023 17:25:39.496 (2F64) IO RX: 00 04 00 00 00 06 0E 03 00
11/01/2023 17:25:39.496 (2F64) DRIVER ERROR: byte count = 0! Received PDU has no data field!
11/01/2023 17:25:39.496 (2F64) IO RX: 01 00 02
11/01/2023 17:25:44.513 (2F64) IO RX: TIMEOUT
11/01/2023 17:25:44.513 (1B40) TAG <== (6.104) Tag(1.0.3.839.Blob:00523E60[1]).ReadBlock = ERROR (hr=80004005)
11/01/2023 17:25:44.513 (1B40) SUPERBLOCK Linear(5:256).Unnormalize = Tag(2.0.3.256.Blob:00524680)
11/01/2023 17:25:45.527 (2F64) IO TX: 00 05 00 00 00 06 02 03 01 00 00 03
11/01/2023 17:25:45.558 (2F64) IO RX: 00 05 00 00 00 03 02 83 03
11/01/2023 17:25:45.558 (1B40) DRIVER MODBUS exception response - type 3(ILLEGAL DATA VALUE)!
11/01/2023 17:25:45.558 (1B40) DRIVER sgets failed, input stream is not available (hr=80004005)!
11/01/2023 17:25:45.558 (1B40) TAG <== (1.054) Tag(2.0.3.256.Blob:00524680[3]).ReadBlock = ERROR (hr=80004005)
11/01/2023 17:25:46.576 (2F64) IO TX: 00 06 00 00 00 06 01 03 01 00 00 03
11/01/2023 17:25:46.639 (2F64) IO RX: 00 06 00 00 00 06 05 03 05

Boa tarde, Fagner.

Já tive uns problemas similares a esse e consegui melhoras no driver da seguinte maneira:

  • limitando o custom pdu size
  • desabilitando na propriedade do driver modbus o “Enablereadgrouping”
  • só fazendo uma conexão por vez ao conversor modbus (se o elipse já estar rodando, não dar play no driver)