Comments (6)
Hi all,
A functioning(*) pycomm3 library should now be available at https://github.com/bpaterni/pycomm3
- The changes made are only the bare minimum necessary in order to get this running via python3.5. Most of it is just changing string literals/operations to their 'byte' counterparts in python3. There are likely lingering bugs on a few code paths through the library, but I thought I would publish my work so far in order to jump start migration of pycomm to python3.
Hopefully others find this useful, and if you're able, please help in making pycomm3 more complete.
:)
edit: Instead of a completely new repo (pycomm3), I forked the current ruscito/pycomm to https://github.com/bpaterni/pycomm and created a branch under it (pycomm3) to contain the changes mentioned above
from pycomm.
I believe the Python 3 issues have to do with changes to the struct library, specifically the types of returned variables.
Compare the Python 2 Documentation with the Python 3 Documentation for the struct package. You'll see that in python 2, pack returns a string, but in python 3, pack returns a bytes object. Similarly, unpack in python 2 takes a string as a parameter, but a bytes object in python 3.
I'm going to try to work on a fix for this that will work for both python 2 and python 3. @INTERCEPTOR27 How far have you gotten? It would probably be good to start this on a new branch.
from pycomm.
Actually pack and unpack should be the only problem; I don't recall other
issue when I tried to run the lib under python 3
On Fri, Nov 11, 2016 at 5:27 PM, Patrick McDonagh [email protected]
wrote:
I believe the Python 3 issues have to do with changes to the struct
library, specifically the types of returned variables.Compare the Python 2 Documentation
https://docs.python.org/2/library/struct.html with the Python 3
Documentation https://docs.python.org/3/library/struct.html for the
struct package. You'll see that in python 2, pack returns a string, but in
python 3, pack returns a bytes object. Similarly, unpack in python 2 takes
a string as a parameter, but a bytes object in python 3.I'm going to try to work on a fix for this that will work for both python
2 and python 3. @INTERCEPTOR27 https://github.com/INTERCEPTOR27 How far
have you gotten? It would probably be good to start this on a new branch.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABL5ocDfULS6aiYG68VDs-Ao71hHbIv-ks5q9PnogaJpZM4KcE3E
.
from pycomm.
Yeah, I admittedly don't understand the mechanics of the request/response within CIP yet to understand it all, but it didn't seem to work when I edited the pack/unpack functions. It would only get closer to working when I used encode/decode on the results of the pack/unpack functions. I'll keep investigating on Monday
from pycomm.
@patrickjmcd I've got it working as far as the 2.7 version is working. I was actually talking to a colleague at work about putting the code up here as my first contribution on GitHub.
I'll tidy up the changes I've made and upload it when I'm back in the office this week. What's the best way to do it?
I would then like to take it further and get strings working as per the code previously posted.
from pycomm.
@INTERCEPTOR27 as Patrick pointed the best way will be start a new branch so that we can keep up with the two libraries. How much did you had to change?
from pycomm.
Related Issues (20)
- Implicit Messaging: How to use forward open request for continuous message communication in connected mode on UDP? HOT 1
- Large Array Read and Write Speed
- CommError: must be str, not bytes HOT 1
- Problem to write tags Micrologix 1100
- NameError: name 'defaultdict' is not defined HOT 1
- Pycomm to micro 820 HOT 1
- Should it work with AB Emulator 5000? HOT 1
- check for warnings
- Micrologix 1200 HOT 5
- Reading Hundreds of Tags Fast HOT 2
- Fully connect to a MicroLogix1100 in UBUNTU Py3.6.7, but not on an WINDOWS server.
- Non-AB EthernetIP connections?
- Retrieving IO tags in plc.tags HOT 1
- Multiple Connections to Same PLC HOT 2
- Reading multiple Timers HOT 1
- SLC Driver to Read RTC:0 [YR, MON, DAY...] HOT 1
- Pycomm3 running on Linux Ubuntu. '\x08\x00\x00\x00Galera 1'
- GUI test app for pycomm and python 2 HOT 1
- Reading and Writing to I/O tags
- os.getpid() doesn't fit into word, problem with sequence number
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycomm.