Giter Club home page Giter Club logo

Comments (8)

kyle-github avatar kyle-github commented on June 24, 2024

I did try the same implementation though on windows ( python using anaconda environment) + on a raspberry pi jessie. For those systems the same python module still had errors.

from libplctag.

kyle-github avatar kyle-github commented on June 24, 2024

(above from the email thread on the forum)

from libplctag.

kyle-github avatar kyle-github commented on June 24, 2024

It works on RPi 2B, with the latest 2016-11-25 Raspian image.

from libplctag.

kyle-github avatar kyle-github commented on June 24, 2024

I have to rewrite the wrapper anyway to use the 2.0 API. I will attempt to fix this at that time. As noted, it works on the RPi for me.

from libplctag.

kyle-github avatar kyle-github commented on June 24, 2024

I will be testing on Windows soon.

from libplctag.

kyle-github avatar kyle-github commented on June 24, 2024

Hmm, Windows 10 with Python 3.7.1 does not run. I got it to compile correctly, but I get a similar error to the one above.

return plcTagCreate(attributeString, timeout) ctypes.ArgumentError: argument 1 <class TypeError>: wrong type

Does anyone have experience with ctypes and Python on Windows 10 x64?

from libplctag.

kyle-github avatar kyle-github commented on June 24, 2024

Seems to be a string encoding problem. It seems to work with both Python 2.7 (Linux) and 3.7 (Windows 10). Seems to be fixed. Closing.

from libplctag.

stej2084 avatar stej2084 commented on June 24, 2024

Seem to be getting the same issue that you noted with plcTagCreate returning argument 1:<class 'TypeError'>: wrong type.

This is on windows 10 and python 3.8.10.

Command passed:
python .\tag_rw.py -t uint8 -p 'protocol=ab_eip&gateway=192.168.45.92&path=1,0&cpu=LGX&elem_size=1&name=MySINT'

Tried all the -t variables and always the same traceback:

Traceback (most recent call last):
File ".\tag_rw.py", line 170, in
main()
File ".\tag_rw.py", line 76, in main
tag = libplctag.plc_tag_create(plc_path, CREATE_TIMEOUT)
File "C:\Users\jonathons\Documents\comms_py\plctag\libplctag.py", line 275, in plc_tag_create
return plcTagCreate(attributeString, timeout)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type

EDIT: Added .encode() to the attributeString in libplctag.py and seems to have fixed the above issue will do some further testing and confirm this. plc_tag_create() now looks like the below in libplctag.py:

def plc_tag_create(attributeString, timeout):
return plcTagCreate(attributeString**.encode()**, timeout)

from libplctag.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.