Comments (4)
Can you explain what you mean by "doesn't work" when you try to do what is in your second picture? I tried exactly that and it reads just fine.
Whether you could actually get 1000 reads per second reading individual tags will depend on your controller. If it isn't the newer architecture controllers (5380/5580) with the gigabit ports, you won't be able to get that performance.
Utilizing lists of tags with read will get you better performance since you are packing more data per packet. Of course you have to watch how many tags you attempt to read at a time (as you mentioned).
Providing the data type with the list of tags (tuple/list of list) will get you even better performance since it will pack more tags in a single packet as well as eliminate retrieving the data type of each tag.
For the best performance, map everything into an array of DINT's (for example) and read the entire array.
from pylogix.
I should also add you should move your reads into the "with" indent.
Also, don't print the results
from pylogix.
Even if your controller can handle it, and your network setup I wouldn't recommend reading that many tags per second, you can overload the comms % usage and interrupt communications for important stuff like HMI communications and controls logic. Go on a browser enter controller IP, and go under tasks to see if there is any high percentage on communications. I've actually seen systems with L73 where the cpu can't handle any more comms, and doing something so high performance like you are looking for can have negative effects on the system. It is worth mentioning on old controller version 20 and below there was a Task Monitor tool which was in my opinion much better than web gui info.
from pylogix.
Oops, missed this the first time around.
What @kodaman2 said. Reading that many individual tags is going to kill your PLC if you try to do it one read at a time. I am not sure about pylogix, but I have done it with my library as a stress test. That uses a lot of internal async handling with multiple partial requests in flight and absolutely requires multiple request packing and large packets (AB allows you to negotiate up to 4000-byte packets). I've done up to 1000 DINT tags at a time, but it is really hammering the PLC! Not recommended.
Using boolean arrays is almost always an anti-pattern in AB logic. Reading them is a pain and the code in the PLC is a lot slower. Use single bits in DINTs.
If you are trying to read that many tags individually, I strongly suggest copying them to a DINT array in the PLC itself and reading the whole array as a single tag. Be aware that the network IO and the PLC scan are not synchronized with respect to each other. So if you are writing these bits all out in a row in some PLC program, your tag read can get a partially updated array. We use sentinel values at the beginning and end of each such array to determine if we got a clean read. It breaks far more often than you would think.
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
- 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
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.