Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown Error 255 on Multi-Write when including a string #193

Closed
4 of 7 tasks
Destination2Unknown opened this issue Feb 12, 2022 · 6 comments
Closed
4 of 7 tasks
Labels

Comments

@Destination2Unknown
Copy link

Destination2Unknown commented Feb 12, 2022

Preflight checks

Before you post an issue, ensure you have tried the minimal examples within the repo, or tried the pylogix-tester.

Type of issue

  • Bug
  • Feature Request
  • Question
  • Other

Description of issue

Writing strings individually works perfect but trying to write multiple Strings does not.

Examples:
[("MyString", "This is a String"),("MyDint", 10), ("MyInt", 3)]
MyString - Unknown Error 255
MyDint - Success
MtInt - Success

[("MyString", "This is a String")]
MyString - Success

[("MyString", "This is a String"),("MyString2", "This is a String2")]
MyString - Unknown Error 255
MyString2 - Unknown Error 255

Code

from pylogix import PLC
with PLC("192.168.123.100") as comm:
comm.ProcessorSlot = 2
request = [("MyString", "This is a String"),("MyDint", 10), ("MyInt", 3)]
ret = comm.Write(request)
for r in ret:
print(r.TagName, r.Value, r.Status)

Prints:
Unknown Error 255 for the string but everything else succeeds.

Any Ideas?

@dmroeder dmroeder added the bug label Feb 12, 2022
@dmroeder
Copy link
Owner

Thanks. I have a fix for this.

dmroeder added a commit that referenced this issue Feb 14, 2022
When writing a list of tags that contains a string, the length of data
was being used, which doesn't work for strings because a string is a
list.  The length should the be the nubmer of values (one string), not
the number of characters in the string.

[Issue #193]
@Destination2Unknown
Copy link
Author

So it wasn't just me then...
Sweet, is that good to go then?

@dmroeder
Copy link
Owner

Not just you, legit bug. The latest update fixed it for me. Try it out and let me know if you agree.

@Destination2Unknown
Copy link
Author

When I try to upgrade via "pip install pylogix --upgrade" it is still showing up as 0.7.16, do I need to manually upgrade?

@TheFern2
Copy link
Collaborator

TheFern2 commented Feb 16, 2022

When I try to upgrade via "pip install pylogix --upgrade" it is still showing up as 0.7.16, do I need to manually upgrade?

Instructions are on the readme. See screenshot below, you have two options clone as shown in the picture, or click the download button on the repo, then run the setup cmd:

https://github.com/dmroeder/pylogix
image

@Destination2Unknown
Copy link
Author

I had to Uninstall and then Reinstall to pick up the change for some reason.
Anyway it works a treat, thanks for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants