ah114088 / enip

EtherNet/IP module for Ruby
3 stars 1 forks source link

ruby opener.rb invocation issues #1

Open shakthimaan opened 10 years ago

shakthimaan commented 10 years ago

1 When I try to run the enip script on Fedora 20 (x86_64), I get the following error:

$ ruby opener.rb '192.168.100.119' /usr/share/ruby/ipaddr.rb:475:in initialize': address family must be specified (IPAddr::AddressFamilyError) from /home/shaks/testing/allen-bradley/enip/enip.rb:171:innew' from /home/shaks/testing/allen-bradley/enip/enip.rb:171:in get_socket_address' from /home/shaks/testing/allen-bradley/enip/enip.rb:310:ininitialize' from /home/shaks/testing/allen-bradley/enip/enip.rb:444:in new' from /home/shaks/testing/allen-bradley/enip/enip.rb:444:inblock in identity' from /home/shaks/testing/allen-bradley/enip/enip.rb:425:in receive' from /home/shaks/testing/allen-bradley/enip/enip.rb:442:inidentity' from opener.rb:59:in `

'

After I change the following in PackBuffer.get_socket_address() in enip.rb: sin_family = 2 # get_int_be

I am able to run it against a SoftLogix500 Chassis Monitor simulator, but, it ends with the error:

$ ruby opener.rb '192.168.100.119' Encapsulation Protocol Version: 1 Socket Address: 1.0.192.168:0 Vendor ID: 16 Device Type: 1 Product Code: 12 Revision: 135.0 Status: 2579 Serial Number: 3942776960 Product Name: pSoftLogix5800 EtherNet/IP State: CIP over TCP CIP over UDP 0 interfaces Encapsulation Protocol Version: 1 Socket Address: 240.140.192.168:46719 Vendor ID: 1 Device Type: 1 Product Code: 12 Revision: 135.0 Status: 2579 Serial Number: 3942776960 Product Name: pSoftLogix5800 EtherNet/IP State: CIP over TCP CIP over UDP 0 interfaces /home/guest/enip/enip.rb:724:in throw_cip_exception': not yet implemented CIP exception with error code 15 (ENIP::NotYetImplemented) from /guest/enip/enip.rb:523:incip_service' from /home/guest/enip/enip.rb:609:in reset' from opener.rb:80:in

'

2 The socket address is incorrect when trying to connect to 192.168.100.119?

3 The serial and revision numbers are also incorrect. Or, what representation are these displayed as?

ah114088 commented 10 years ago

Have you tried to ping 192.168.100.119?

shakthimaan commented 10 years ago

Yes, the ping worked fine. The opener.rb is set up to use the EDS file used in OpENer, but, the PLC that I tested has a different EDS file. Could that be a problem? If I comment out the 'Input Only CIP connection', 'Exclusive Owner CIP connection', and 'Listen Only CIP connection' in opener.rb I don't get any errors.

What will be the minimal set up or code required to be able to read the TAG values from the PLC? Would it be possible to add the same to opener.rb?

Thanks for your prompt response.