Skip to content

Feature request: Send CIP Reset command (Class 0x01, Instance 1, Service 0x05) #16

Description

@stormyweathers

I'm trying to use this library to build a resilient EEIP network that can handle network dropouts, cable unplugs, etc.
Sometimes my devices will throw a 0x01 (connection failure) because it already has maximum connections. The advice on the deepwiki docs suggest calling forward_close() to kill existing connection, but that might hang (as decribed in Issue 15 )

I see that Reset is listed as supported in the readme, but I dont see it anywhere actually in the source code.

I can try constructing the reset message following the templates in the source for get_attribute_single, set_attribute_single, forward_open, and forward_close. But I notice that these functions each construct their packets entirely from scratch, and use like 90% repeated code.

Ideally, it would be nice to have a function like pycomm3's CIPDriver.generic_message, which takes a service, class, instance, and attribute code, and data buffer. (I was using pycomm3 until I needed to use implicit messaging).

generic_message(service, class_code, instance, attribute=b'', request_data=b'', data_type=None, name='generic', connected=True, unconnected_send=False, route_path=True, **kwargs)

It would save a few hundred lines of repeated code, and make it easier to extend the library to send more flexible messages.
I'm happy to try this out and see if I can make it work, but before I get too deep I wonder:
Is there a good reason for explicitly constructing each packet separately like this?
Anything else in particular I should look out for?

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