PartTimePlcProg
Member
Hallo,
could someone describe best practises, typical pitfalls etc. of implementing communication over network, in a scenario with many PLCs and a HMI?
It appears I'm not doing it right currently.
Used are 5 Siemens SIMATIC S7 1200 series PLCs (all 1212C AC/DC/RLY), a Siemens HMI box, and we have TIA portal V11 SP2.
Currently I'm doing something like this, with only partial success:
There is one main PLC, "to rule them all".
It has a cyclic interrupt, in which a request flag is set to HI periodically, for reading a small DB with some status bools, 1..2 bytes of size, from a sub-SPS. Which sub-PLC's DB is read currently is cycled through, one after another. The interrupt fires with some 100ms timing.
This uses the GET function, with the ID which TIA created automatically for each PLC, in the list of connections, after I connected all PLCs in a graphical network view.
Now, when someone presses a button on HMI --> a byte is set in master PLC, the master PLC will use the PUT function to send just this byte flag to a DB inside a sub-PLC.
Up to that, it seemed to work ok, with 3 PLCs.
Then I added a sub-PLC, tried to use PUT from the main PLC to regularly, not just on request, write a whole, small (1..2 bytes) DB to the new sub-PLC.
This did not work at all, for no immediately apparent reason.
I was short on time, so I just tried remove this PUT, and instead, use a GET from the new sub-PLC, to read from the main PLC. I.e., same direction of data, but active/passive roles switched. The timing is again done by a cyclic interrupt.
This worked. But the communication seems troubled sometimes.
And now, as I added the 5th PLC, tried to use the same scheme as in the 4th, i.e. interrupt triggered reading of a small DB from main PLC into the sub-PLC DB, does not work at all. I even copied the source code from PLC#4, it doesn't work. I.e., not one single GET call ever ends successfully, although some timeouts occurred which reset the IN parameter. (I inserted a counter which counts successful GET calls, i.e. when NDR is true)
I am doing a timeout in this GET attempt, of some seconds, after that, I reset the input of the GET function even if was not successful, just to be sure it recovers from a "hiccup".
Also, the DBs I'm using all do *not* have the "optimized access" attribute, yeah, I walked into the trap before...
The main PLC has the same status DBs as are in the sub-PLCs, so they can be copied over 1:1.
I intended to some day change the older implementation from twiddling with single flags, to also just periodically send one small DB with some bools combined, to have a consistent way of doing things.
But now that things aren't working so great, I'm not sure what to do.
--------
Btw, what's the topology view for? Didn't really understand that from what I read, but currently there are all PLCs displayed, but only between one of the sub-PLCs and the main PLC there is a connection in topology view, that's how I received the project from who worked on it before. TIA won't let me drag connections between any other PLCs it appears.
Ah, btw, is using a special PROFINET switch strongly advisable for some reasons, or is using a 100MBit/s ethernet switch ok?
could someone describe best practises, typical pitfalls etc. of implementing communication over network, in a scenario with many PLCs and a HMI?
It appears I'm not doing it right currently.
Used are 5 Siemens SIMATIC S7 1200 series PLCs (all 1212C AC/DC/RLY), a Siemens HMI box, and we have TIA portal V11 SP2.
Currently I'm doing something like this, with only partial success:
There is one main PLC, "to rule them all".
It has a cyclic interrupt, in which a request flag is set to HI periodically, for reading a small DB with some status bools, 1..2 bytes of size, from a sub-SPS. Which sub-PLC's DB is read currently is cycled through, one after another. The interrupt fires with some 100ms timing.
This uses the GET function, with the ID which TIA created automatically for each PLC, in the list of connections, after I connected all PLCs in a graphical network view.
Now, when someone presses a button on HMI --> a byte is set in master PLC, the master PLC will use the PUT function to send just this byte flag to a DB inside a sub-PLC.
Up to that, it seemed to work ok, with 3 PLCs.
Then I added a sub-PLC, tried to use PUT from the main PLC to regularly, not just on request, write a whole, small (1..2 bytes) DB to the new sub-PLC.
This did not work at all, for no immediately apparent reason.
I was short on time, so I just tried remove this PUT, and instead, use a GET from the new sub-PLC, to read from the main PLC. I.e., same direction of data, but active/passive roles switched. The timing is again done by a cyclic interrupt.
This worked. But the communication seems troubled sometimes.
And now, as I added the 5th PLC, tried to use the same scheme as in the 4th, i.e. interrupt triggered reading of a small DB from main PLC into the sub-PLC DB, does not work at all. I even copied the source code from PLC#4, it doesn't work. I.e., not one single GET call ever ends successfully, although some timeouts occurred which reset the IN parameter. (I inserted a counter which counts successful GET calls, i.e. when NDR is true)
I am doing a timeout in this GET attempt, of some seconds, after that, I reset the input of the GET function even if was not successful, just to be sure it recovers from a "hiccup".
Also, the DBs I'm using all do *not* have the "optimized access" attribute, yeah, I walked into the trap before...
The main PLC has the same status DBs as are in the sub-PLCs, so they can be copied over 1:1.
I intended to some day change the older implementation from twiddling with single flags, to also just periodically send one small DB with some bools combined, to have a consistent way of doing things.
But now that things aren't working so great, I'm not sure what to do.
--------
Btw, what's the topology view for? Didn't really understand that from what I read, but currently there are all PLCs displayed, but only between one of the sub-PLCs and the main PLC there is a connection in topology view, that's how I received the project from who worked on it before. TIA won't let me drag connections between any other PLCs it appears.
Ah, btw, is using a special PROFINET switch strongly advisable for some reasons, or is using a 100MBit/s ethernet switch ok?