Closed MichaelMS91 closed 4 years ago
What is your 'mId' in new EtherNetIP(mIp,mId)
?
Also add something like Logger.getLogger("").setLevel(Level.ALL);
to get a complete output of everything read and written to better see where it fails.
What is your 'mId' in
new EtherNetIP(mIp,mId)
?
It was the Id that I assigned to the PLC. It was wrong, its value was 1 instead of 0. When I changed it, the program started to run normally.
Thanks a lot!
Yeah, 'slot' needs to be the slot number, counting from 0, of the controller on the backplane.
Hello!
I am using an Allen-Bradley CompactLogix 5380. I am able to connect with this device but when I try to read tags with readTag function, it happens an exception.
My connection is established just like:
EtherNetIP plc = new EtherNetIP(mIp,mId); try { plc.connectTcp(); } catch (CipException cipe){
And my reading code is like:
String message = "var1"; CIPData data = null; try { data = plc.readTag(message); } catch (CipException cipe){ ...
I am trying to read var1 variable which is its name in my PLC. I have declared it as Local Tag in my MainRoutine and later as Output Parameter and Public Parameter with Producer Type. I declared it also as a Tag in Controller Tags but always I receive the same error:
etherip.data.CipException: Status: 0x01 [Connection failure, A connection related service failed along the connection path.] - Extended: 0x312 [LINK ADDRESS NOT VALID, Link Address specified in Port Segment Not Valid This extended status code is the result of a port segment that specifies a link address that is not valid for the target network type. This extended status code shall not be used for link addresses that are valid for the target network type but do not respond.]
Could someone tell me how to read that tag? Must I do anything more before trying to read it?
Thanks in advance