Open johanfforsberg opened 7 years ago
I ran into exactly this issue this week, and began working on a solution. Through much research I found that the cpppo server you (and I) are running is a generic CIP device, so it will not work with the AllenBradley drivers included with pycomm. From the examples and comments included I can only assume that it would work as advertised with those AB devices named, but I do not have one available to test with.
I am working on a fork to support CIP Generic Messaging, and have gotten it working with cpppo and an off-brand PLC with an EtherNet/IP interface. https://github.com/tyoungNIO/pycomm/blob/generic/pycomm/cip/cip_generic.py
As of today the generic
branch still does not work with any sort of symbolic addressing, but if you supply a full path for the tags to your cpppo.server.enip
, such as a@1/2/3=DINT
, then a call to c.get_attribute_single(1, 2, 3)
will return 4 bytes.
A PLC's IO data (including AB, I believe) will also be available from standard Class IDs, for example 10 for Analog Input. In my case, I can read the first four analog inputs from 10, 1, 3
through 10, 4, 3
, each input is an instance of the AI class from 1 to 4, with the measured value stored in attribute 3. The second AI module begins at 10, 65, 3
, and so forth, according to the manufacturer's documentation.
Hi, Can we get and set attribute for any CIP generic objects using Pycomm and CPPPO? Can Explicit and Implicit both supported by Pycomm and CPPPO? If one to select for the automation then which would you prefer?
Please reply, it's urgent.
Hi,
"cpppo" (https://github.com/pjkundert/cpppo) is a very cool python library that among other things can simulate a PLC locally. This is quite useful for testing without needing PLC hardware, and I've used it with other client libraries in the past with success. But somehow it does not play well with pycomm.
Here's the output of running a cpppo server and then connecting locally with pycomm from another process. The corresponding pycomm code is below.
Now I can't tell if this is an issue with pycomm or with cpppo, but to me it looks like something is missing in the client connection. Maybe I'm just not doing it right?
IPython:
Doing something else at this point, like reading a tag, results in a "CommError: socket connection broken.".