Skip to content

While using sync.client, _recv() too early after _send() #21

@Edke

Description

@Edke

Hello.

Spent two days figuring this, but this helped an issue. I'm querying a device, that is a bit slow in response via Modbus. Using sync.client and TCP Server ICS-10X from Planet gave me a headache. Was not able to get result of ReadHoldingRegistersRequest():

DEBUG:pymodbus.transaction:Running transaction 1
DEBUG:pymodbus.transaction:getting transaction 1
DEBUG:pymodbus.transaction:Running transaction 2
DEBUG:pymodbus.transaction:getting transaction 2

After modifying of ModbusTransactionManager's execute() and putting delay between _send() and _recv() everything works great:

DEBUG:pymodbus.transaction:Running transaction 1
DEBUG:pymodbus.factory:Factory Response[3]
DEBUG:pymodbus.transaction:adding transaction 0
DEBUG:pymodbus.transaction:getting transaction 1
Slave: 3, register 23: 0x4041
DEBUG:pymodbus.transaction:Running transaction 2
DEBUG:pymodbus.factory:Factory Response[3]
DEBUG:pymodbus.transaction:adding transaction 0
DEBUG:pymodbus.transaction:getting transaction 2
Slave: 3, register 24: 0x5268

Don't know if this can be achieved with some more elegant approach but this works for me so far. Would be great if such a delay would be configurable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions