cpppo icon indicating copy to clipboard operation
cpppo copied to clipboard

Open a persistent connector to fanuc robot

Open kdorsel opened this issue 5 years ago • 3 comments

I have a Fanuc Robot R30iB+ which I'm trying to connect to using:

from cpppo.server.enip.get_attribute import proxy as fanuc

host = "192.168.0.10"
param = "@0x6c/0x01/0x01"
fanuc = plc(host=host)

try:
    with fanuc:
        result = fanuc.read(param, checking=True)
        print(list(result))
except Exception as e:
    print(param, e)

This give me a return status 4 which is path segment error. The fanuc robot has eth/ip error that says the adapter is idle and thus not connected. So to me it seems that the problem is that there is no connection being opened to the robot or the connection is not maintained.

If I do I successfully get the information of the robot, but the controller still shows adapter not connected.

fanuc.open_gateway()
fanuc.identity

list_identity() seems to work, but I cannot open a persistent connection. Is there a way to do this? How do I correctly open a connection to read values?

kdorsel avatar Apr 28 '20 15:04 kdorsel

I've recently pushed up a new version 4.1.0, which now supports persistent "Forward Open" connections. There is now a proxy_connected class in cpppo.server.enip.get_attribute. Perhaps try that? It will open up a persistent connection to a specific Object, and issue subsequent get_attribute_single requests to that CIP Object...

pjkundert avatar Sep 16 '20 15:09 pjkundert

@kdorsel did you succeed in establishing a persistent connection? If so: how did you do it ? I am facing the same problem.

robin-gdwl avatar Oct 13 '20 07:10 robin-gdwl

@kdorsel did you succeed in establishing a persistent connection? If so: how did you do it ? I am facing the same problem.

I found this other EIP code which I used. https://codeberg.org/paperwork/pyenip

kdorsel avatar Oct 13 '20 13:10 kdorsel