Comments (17)
So multi-read doesn't work with the Micro8xx because they don't support that feature. Keep in mind, there is a limit to how many tags you can read at once. This limit is packet size so the data type matters. I usually suggest reading 10 tags at a time.
Since we rule out the Micro8xx, let's discuss the L18. Can you share some details about the tags you are reading, how many, types, etc? Maybe a snippet of your code?
Also, I was going to remove .MultiRead() at some point since .Read() will now do the same thing if you pass it a list.
from pylogix.
Thank you for the fast reply!
It's good to be sure that Micro8xx really doesn't suport multi-read.
So, about the CompactLogix, I was trying to read 4 tags at the same time ["bool01", "int01", "float01", "string01"], and the string has 82 characters. My connection code looks like this:
from pylogix.eip import PLC
class PLCMonitor:
def __init__(self):
self.pylogixPLC = PLC()
self.pylogixPLC.IPAddress = "192.168.1.1"
self.pylogixPLC.ProcessorSlot = 1
self.pylogixPLC.Micro800 = False
self.multiread = True
And my reading code looks like this:
if self.multiread:
connected = False
try:
values = self.pylogixPLC.Read(["bool01", "int01", "float01", "string01"])
connected = True
except Exception as err:
print("ERROR [" + self.pylogixPLC.IPAddress + "]: " + str(err))
if "Multi-read failed" in str(err):
self.multiread = False
elif str(err) == "timed out":
self.connected = False
if not self.multiread or not values:
# Read tags individually
Whenever I run the code, multi-read fails and my code falls back to individual reading.
from pylogix.
I just did a quick test and it does in fact work. My test looked like this:
from eip import PLC
tags = ['bool01', 'int01', 'float01', 'string01']
p = PLC()
p.IPAddress = '192.168.1.9'
values = p.Read(tags)
print(values)
Now when you say your string is 82 characters, I assume you mean the default STRING data type, not a custom created string with 82 characters right?
from pylogix.
Exactly. The default size is 82 characters, but it actually have something about 20 characters written.
So, most likely the problem is some configuration on the PLC itself and not the code?
from pylogix.
Are you running the latest pylogix code form github? Back in June, I had a few problems reading multiple tags of mixed data types.
I ran your code exactly (from your other opened issue) and it works fine.
from pylogix.
Yes, I'm running the latest code, and the last commit shown by git log
is from Jan 31st 2019, which matches with github's commits page.
I'm wondering what are the odds of been some misconfiguration on the PLC...
from pylogix.
Since you say that you can read the tags individually, I don't think there is any kind of configuration issue. Could you capture this problem with wireshark and email it to me?
from pylogix.
Sure thing, I will schedule a visit with the company that owns the CompactLogix so I can capture the problem with wireshark. As soon as I get it, I'll send it to you.
What is your email, please?
from pylogix.
Thanks,
We'll discuss your other issue once we work through this one, I think they are going to end up being related.
from pylogix.
About the Micro8xx, do you have any documentation that shows that the PLC itself really doesn't support multi-reading?
from pylogix.
OK, thank you for your help!
from pylogix.
The PLC is telling you that the multi-read service is not supported, not my code. I just translate the error code into text.
from pylogix.
Got it, that's all I needed to know. Thank you once again!
from pylogix.
Did you happen to ever get this working, or get any details?
from pylogix.
No, the company that owns the PLC hasn't schedule a visit for me yet. I'm still waiting for theirs disponibility. But, probably, it will take place next month.
from pylogix.
Ok, sounds good, I didn't want to leave you hanging.
from pylogix.
Closing as per #38 details.
from pylogix.
Related Issues (20)
- 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
- Return data gets jumbled up on a multi write when the tags don't exist. HOT 13
- 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
- PLC connection best practice HOT 8
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.