ruscito / pycomm

pycomm is a package that includes a collection of modules used to communicate with PLCs
MIT License
142 stars 85 forks source link

Trying to push some commits for Python 3.6 compatibility. #41

Open jmbinette opened 6 years ago

jmbinette commented 6 years ago

Not sure what I am doinhg wrong

patrickjmcd commented 6 years ago

It looks like you created a PR for it. It just needs to be accepted before it can be merged into the master branch. I did a quick test of the code and it looks like reading/writing REALS on a CompactLogix and on a Micro800 using the direct_connection=True parameter of c.open().

There are a few types implemented by the Micro800 that do not work (UDINT, for example) but I will work to test which ones don't work and implement fixes. These just seem to be missing from the PACK_DATA_FUNCTION and UNPACK_DATA_FUNCTION structures and associated functions in cip_base.py.

patrickjmcd commented 6 years ago

Your code, however, does not seem to be backwards compatible with python2

The open() function of cip_base fails with error Unknown format code 'x' for object of type 'str'