plcpeople / nodepccc

Library for node.js to communicate with some Allen-Bradley programmable controllers (PLCs)
MIT License
81 stars 24 forks source link

Inconsistency of how optional routing header should be formed #16

Closed dom-white closed 7 years ago

dom-white commented 7 years ago

Hi,

In the top section of the readme you state

If you are using with a ControlLogix and possibly some CompactLogix, you likely need to specify the {routing: [0x01,0x00,0x01,0x00]} option (meaning path length 1, backplane port 0 of the ENBT module, path length 1, slot 0 of the 1756 backplane).

But further down when you detail the API you state

conn.initiateConnection({port: 44818, host: '192.168.8.106' /* , routing: [0x01,0x00,0x01,0x00] */}, connected); // Either uncomment the routing or uncomment this next line for ControlLogix/CompactLogix or if otherwise using routing // First 0x01, 0x00 = 1 word in the path, second 0x01, 0x00 = Port 0x01 (backplane port of Ethernet module), 0x00 = PLC is in slot 0 in chassis.

So for the same routing input [0x01, 0x00, 0x01, 0x00] you initially state it will get you port 0 and slot 0, then in the second you state it will get you port 1 and slot 0.

Can you clarify which is correct interpretation of how the header should be formed please

Thanks, Dominic

plcpeople commented 7 years ago

The details of the API are correct, I apologize for the error and confusion, thanks for pointing this out.

plcpeople commented 7 years ago

If you or others have used a path other than the default [0x01,0x00,0x01,0x00], successfully or otherwise, I am interested to hear how it went.

dom-white commented 7 years ago

Thanks for clearing this up. I'll try and get you some feedback regarding non default values