ST-node-ethernet-ip icon indicating copy to clipboard operation
ST-node-ethernet-ip copied to clipboard

Append data to getAttributeSingle

Open greg9504 opened this issue 1 year ago • 1 comments

For explicit messages sent using getAttributeSingle it would be useful to add an optional parameter with a buffer. This buffer is appended to the message. Some ethernet/IP devices require additional information beyond the class/instance/attribute. See this issue for a description for such a case for a SEW drive https://github.com/SerafinTech/ST-node-ethernet-ip/issues/62 Code/documentation change for PR is here: https://github.com/greg9504/ST-node-ethernet-ip/tree/ExplicitMsgWithData

greg9504 avatar May 05 '24 13:05 greg9504

for connecting to a device for explicit messaging that is not a PLC I put Buffer.alloc(0) as the slot number. This will blank out the slot part of the path.

controller.connect('192.168.1.1', Buffer.alloc(0), false)

The devices I have tested will throw a error if you put a 0 for slot number

and I pushed your PR with a little change. I didn't add any documentation yet.

SerafinTech avatar Jun 13 '24 03:06 SerafinTech