Is there a Practical Limitation to the Number of PLCs I can Connect To? And - Does the PLC connection work through Network IP Translation? #244
Replies: 3 comments 1 reply
-
Beyond any limits of Python and the Python network stack and Python processing speed, there are some fundamental limits in most operating systems. For instance, in most Linux systems, you have a baseline of up to 1024 open file handles per process. Every socket (TCP or UDP) takes up a file handle. On macOS it is lower. Maybe 256? Windows also has limits. Then there are limits in the C libraries that underlie most of the Python code. Those depend on how the networking is implemented. As an example on Windows, if you use Windows' version of select() you end up using the Windows version of FD_SET which limits the total number of sockets in a select() call to 64 (IIRC). If you use the Windows "native" network functions or something like IO completion ports, then you can have a lot more sockets. The operating systems themselves have limits but those are usually in the 100s of thousands of open sockets. That's a lot of PLCs. Things like NAT (Network Address Translation) and reverse NAT are transparent to the services using the connection. So if your network is set up to present a public IP for a PLC via some translation, it will just work. That said, it is an EXTREMELY bad idea to put a PLC on a public IP address. You'll probably have a few minutes before someone takes it over. |
Beta Was this translation helpful? Give feedback.
-
The answer is: it depends. What operating system are you using? Pylogix does support multiple connections. I do not know what underlying C code the Python network libraries use on each platform, so I cannot say what the limits are. Unless you are reading tags very infrequently, I think you should probably keep the number of connected PLCs in a process to 64 or lower. Python just isn't that fast. If you read tags frequently, then the processing speed of Python and the fact that it is basically single threaded will start to impact performance. Hopefully @dmroeder will have some insights. |
Beta Was this translation helpful? Give feedback.
-
I don't have much more to add to Kyle's reply, I'd suspect that the limit comes from python's socket module, the operating system and maybe the network hardware. I suspect python would be first. In my microcosm, I only have one or two PLC's at a time that I'm working with. I don't work in a factory where I have many PLC's to work with. I just don't have the resources available to give a good answer. I'd love it if someone could do that testing. If I had access to a facility where I could do it, I would. That sort of project would be fun. One user (issue #198) was planning on connecting to 80 PLC's, not sure where that ended up. You could ask around in my discord how many PLC's people are connecting to simultaneous from one machine. |
Beta Was this translation helpful? Give feedback.
-
Two questions I'm not finding answers for.
Is there a limitation to the number of PLCs that I can poll data from concurrently? Can I have multiple With PLC As Comm blocks for different PLC's - and if so, how many can I have before I might have issues.
Secondly, Does the Protocol this uses to connect to Compact/ControlLogix support Network IP Translation - E.G. using a CISCO translator to connect to a PLC from a public IP?
Beta Was this translation helpful? Give feedback.
All reactions