Skip to content

Modbus occasionly return -1 and errno is 33 or 138 #824

@HEUBITLYJ

Description

@HEUBITLYJ

hello, I‘m using libmodbus-3.1.8 to communication with plc, recently i met some problems with modbus write function:

here is how i create modbus tcp:
auto modbus_ctx_ = modbus_new_tcp(param.ip.c_str(), param.port); modbus_set_slave(modbus_ctx_, 1); modbus_set_response_timeout(modbus_ctx_, 0, 200000);

when i use modbus_write_bit write data to plc,
this func can return -1occasionly, the errno is 33 or 138

can someone help me to solve this problem?
thanks very much

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions