Comments (13)
Looks good to me, thanks again!
from pylogix.
I have a fix for this.
from pylogix.
@dmroeder Sweet!
from pylogix.
I think this was the issue:
Lines 435 to 436 in 95d6bc9
It should be something like:
if not conn[0]:
return [Response(t[0], None, conn[1]) for t in tags]
from pylogix.
You mind testing the bugfix/multi-write branch when you get time? It works for me, though things weren't quite failing in the same way for me.
from pylogix.
Pretty much sorted, only case where it didn't work was where the tags don't exist and there is no connection to the PLC (i.e. if the IP Address is incorrect):
from pylogix import PLC
with PLC() as comm:
comm.IPAddress = "192.168.133.199"
write_data = [("tag1", 100), ("tag2", 6.45), ("tag3", True)]
# write the values
ret = comm.Write(write_data)
# print the status of the writes
for r in ret:
print(r.TagName, r.Status)
prints:
tag2 Unknown error timed out
6.45 Unknown error timed out
from pylogix.
This fairly niche example isn't quite right either...
write_data = [("myDint", 100), ("myString", "Hello"), ("myDint.1", True)]
# write the values
ret = comm.Write(write_data)
# print the status of the writes
for r in ret:
print(r.TagName, r.Value, r.Status)
prints:
myDint 100 Success
myString Hello Success
myDint.1 (2, -1) Success
from pylogix.
Yeah, that is weird. The latest should fix it.
from pylogix.
Yeah, that is weird. The latest should fix it.
This case is still incorrect:
from pylogix import PLC
with PLC() as comm:
comm.IPAddress = "192.168.133.199" #incorrect IP address
write_data = [("tag1", 100), ("tag2", 6.45), ("tag3", True)]
# write the values
ret = comm.Write(write_data)
# print the status of the writes
for r in ret:
print(r.TagName, r.Status)
prints:
tag2 Unknown error timed out
6.45 Unknown error timed out
from pylogix.
I see, somehow, I missed that comment originally
from pylogix.
Okay, that one should be fixed on that branch too.
I considered whether to return the value that was written or the None. I went with value intended to write because that is what would be returned on a successful write. Though I could be convinced otherwise.
from pylogix.
Okay, that one should be fixed on that branch too.
I considered whether to return the value that was written or the None. I went with value intended to write because that is what would be returned on a successful write. Though I could be convinced otherwise.
I strongly favour returning None because it would make it crystal clear that there was an issue.
Otherwise, it could lead to confusion when a write value is returned despite not being sent successfully.
Thank you for your assistance.
This library is exceptional, and the support provided is truly outstanding!
from pylogix.
Sold! I'll return None. I appreciate your feedback and testing.
from pylogix.
Related Issues (20)
- Unknown Error 255 on Multi-Write when including a string HOT 6
- read tag from 80 sets of plc HOT 22
- Double read packets? HOT 6
- cannot import name 'Adapter' from 'pylogix' HOT 23
- Tag Write falsely reports Success HOT 7
- "Forward open failed" when trying to read tags from Berghof PLC HOT 8
- .GetDeviceProperties always returns DeviceType of "None" HOT 5
- Issues connecting to emulate HOT 7
- micro850 connection HOT 5
- The return value is different when using a multi write compared to a single write for a string. HOT 4
- cannot get a tag list HOT 3
- Is it possible to inhibit a periodic task? HOT 2
- pylogix - returning a tag list as a row of values HOT 7
- PLC REAL values HOT 5
- Pylogix - compare a previously acquired tag list with the current one HOT 5
- Discover does not work while running pylogix in docker HOT 10
- Invalid Continuation Byte HOT 5
- Abnormal code termination. HOT 8
- Do I need to use routing? HOT 20
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 pylogix.