Dúvida com comunicação MODBUS

@Anthoni, boa tarde.

Entendido.

Podemos ver o seguinte:

  1. Nesta parte:

O endereço slave está incorreto. Provavelmente o N1 da tag está em 0. Colocar o endereço slave do clp.

  1. Tenta desabilitando a propriedade EnableReadGrouping do driver. Testar.

  2. Utilizando a comunicação USB/Serial, na aba Modbus, desabilita a função “Reconnect after Timeout (Ethernet Only)”.

  3. Aumentar o Timeout da camada física para 5 segundos (atualmente está em 1s).

Por enquanto, é só.

Por favor, enviar o log novamente para os testes acima.

Sds.

Boa noite, estou tentando fazer uma conexão modbus RTU com um esp32 estou tendo dificuldades, apenas na resposta do Rx preciso de uma ajuda. Obrigado. Segue o log do erro:

24/10/2019 23:18:32.209 (23B0) DRIVER Driver name: Driver Modicon Modbus v4.0.1 (IOKitLib v2.0.100)
24/10/2019 23:18:32.209 (23B0) DRIVER IOKitLib version 2.0.100 of Nov 13 2018 15:39:48
24/10/2019 23:18:32.209 (23B0) DEBUG CModbusHost CREATED
24/10/2019 23:18:32.209 (23B0) DRIVER Selected RTU mode!
24/10/2019 23:18:32.209 (23B0) DRIVER User Types file compiled successfully!
24/10/2019 23:18:32.209 (23B0) DRIVER drvStartComm(0,0,0,0)
24/10/2019 23:18:32.209 (23B0) DRIVER Current configuration (78 parameters):
24/10/2019 23:18:32.209 (23B0) DRIVER - IO.Ethernet.BackupIP = ‘’
24/10/2019 23:18:32.209 (23B0) DRIVER - IO.Ethernet.BackupIP2 = ‘’
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Ethernet.BackupIP3 = ‘’
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Ethernet.IPFilter = ‘’
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Ethernet.ListenIP = ‘’
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Ethernet.MainIP = ‘’
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Ethernet.MainPort = 502
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Ethernet.PingTimeoutMs = 4000
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Ethernet.PingTries = 1
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Ethernet.Transport = ‘TCP’
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.GiveUpTries = 1
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Log.Enable = 1
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Log.Filename = ‘C:\eeLogs\Modbus_%DATE%.log’
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.RAS.ATCommand = ‘’
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.RecoverEnable = 1
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.RecoverPeriodSec = 20
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Serial.Baudrate = 57600
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Serial.DataBits = 8
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Serial.Port = 3
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.TAPI.ModemID = 4294967295
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.TAPI.PhoneNumber = ‘’
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.TimeoutMs = 10000
24/10/2019 23:18:32.213 (23B0) DRIVER - IO.Type = ‘Serial’
24/10/2019 23:18:32.213 (23B0) DRIVER - ModiconModbus.ConfigFile = '[Functions]
Function: 1
Read: 3
Write: 16
Type: word
Size: 2
FrameOrder: 0
ByteOrder: 0
WordOrder: 0
DWordOrder: 0
Function: 2
Read: 3
Write: 16
Type: dword
Size: 4
FrameOrder: 0
ByteOrder: 0
WordOrder: 0
DWordOrder: 0
Function: 3
Read: 3
Write: 16
Type: int16
Size: 2
FrameOrder: 0
ByteOrder: 0
WordOrder: 0
DWordOrder: 0
Function: 4
Read: 3
Write: 16
Type: int32
Size: 4
FrameOrder: 0
ByteOrder: 0
WordOrder: 0
DWordOrder: 0
Function: 5
Read: 3
Write: 16
Type: float
Size: 4
FrameOrder: 0
ByteOrder: 0
WordOrder: 0
DWordOrder: 0
Function: 6
Read: 2
Write: 15
Type: bit
Size: 0
FrameOrder: 0
ByteOrder: 0
WordOrder: 0
DWordOrder: 0
Function: 7
Read: 2
Write: 0
Type: bit
Size: 0
FrameOrder: 0
ByteOrder: 0
WordOrder: 0
DWordOrder: 0
[End]

24/10/2019 23:18:32.213 (23B0) DRIVER - ModiconModbus.DefaultSlaveAddress = 1
24/10/2019 23:18:32.213 (23B0) DRIVER - ModiconModbus.EnableGenSOERegGrouping = 1
24/10/2019 23:18:32.213 (23B0) DRIVER - ModiconModbus.MaxPDUSize = 253
24/10/2019 23:18:32.213 (23B0) DRIVER - ModiconModbus.Olderaddr = 1
24/10/2019 23:18:32.213 (23B0) DRIVER - ModiconModbus.UserTypesConfigFile = '// USER DEFINED TYPES SAMPLE CONFIG FILE

// The samples below illustrate how to create user defined structs, using the driver built-in types (note the built-in
// types must be entered with the same keywords used in the Data combobox of the operations).
// The new user types can afterwards be used in the same way as the other built-in types in the Data combobox.

/* Sample types entirely commented by default

struct TYPE1 // TYPE 1 - declares struct with elements with no name, and no timestamp
{
int16;
word;
dword;
int32;
}

// TYPE2 declares named elements, and includes a timestamp of GenTime type. The named elements can then be
// loaded to the user application using E3 Tag Browser.

// NOTE: the timestamp value will not be returned on a block element, but rather returned on the timestamp property
// of the block type tag. The order in which the timestamp appears within the structure is related to the order
// in which this field appears within the data area of the received protocol frame (usually the first field).

struct TYPE2
{
timestamp = GenTime; // this time field will be returned in the block’s timestamp field
GenTime timeField; // this time field will be returned in the block’s first element
dword dwordField;
}

struct TYPE3 // this type has a timestamp of type UTC32 and some named elements
{
DefaultAddress = 0x101;
timestamp = UTC32;
float Va;
float Vb;
float Vc;
float Ia;
float Ib;
float Ic;
}

*/’
24/10/2019 23:18:32.213 (23B0) DRIVER - ModiconModbus.WaitSilenceOnError = 1
24/10/2019 23:18:32.213 (23B0) DRIVER - 48 parameters with value = 0 were omitted
24/10/2019 23:18:32.214 (3AD8) IOKIT INITIALIZING…
24/10/2019 23:18:32.214 (3AD8) IOKIT INITIALIZED!
24/10/2019 23:18:32.214 (3AD8) IOKIT Request handler enabled
24/10/2019 23:18:32.214 (3AD8) IOKIT CONNECTING…
24/10/2019 23:18:32.214 (3AD8) SERIAL Opening COM3:57600,8,NONE,1 …
24/10/2019 23:18:32.214 (2538) TAG Tag({1:}'hr1’1.1.0.1).Validate = Tag({1:}'hr1’1.1.0.1.Blob:005F16F0) (type=10;flags=9)
24/10/2019 23:18:32.282 (3AD8) SERIAL Port opened!
24/10/2019 23:18:32.283 (3AD8) IOKIT CONNECTED!
24/10/2019 23:18:32.339 (3AD8) IO TX: 01 03 00 00 00 01 84 0A
24/10/2019 23:18:42.343 (3AD8) IO RX: TIMEOUT
24/10/2019 23:18:42.343 (23B0) TAG <== (10.128) Tag({1:}'hr1’1.1.0.1.Blob:005F16F0).ReadValue = ERROR (hr=8004E000)
24/10/2019 23:18:42.343 (23B0) DRIVER drvStopComm(0,0,0,0)
24/10/2019 23:18:42.343 (23B0) IOKIT Stopping physical layer thread…
24/10/2019 23:18:42.343 (23B0) IOKIT Waiting for termination of physical layer thread…
24/10/2019 23:18:42.350 (3AD8) SERIAL Port closed!
24/10/2019 23:18:42.350 (3AD8) IOKIT Request handler disabled
24/10/2019 23:18:42.350 (3AD8) IOKIT Request handler enabled
24/10/2019 23:18:42.350 (3AD8) IOKIT TERMINATING…
24/10/2019 23:18:42.350 (3AD8) IOKIT TERMINATED! (0 bytes sent, 0 bytes received)
24/10/2019 23:18:42.350 (3AD8) IOKIT Request handler disabled
24/10/2019 23:18:42.351 (23B0) IOKIT Physical layer thread stopped!
24/10/2019 23:18:42.351 (23B0) DEBUG CModbusHost DELETED