I have an S7 "best practice" question (although maybe this topic is not as cut and dry).
I'm programming in an S7-1500. I'm not programming a batch process, but I'm trying to observe the concepts of S88 in my programming by using Equipment Modules and Control Modules and driving events through an S88-like state machine.
Let's say I have a EM made up of several CMs (some Valves, Analog Inputs, etc.). I want to create modular functions of the EMs and CMs so that I can build a modular library. Inside of an instance of a particular EM I would utilize the instances of the CMs. Therefore everything is (ideally) as modular and self-contained as I can make it.
I'm debating two options:
1) Put the FB instance call to all CMs inside of the EM FB.
From what I can see, this would require passing rather "large" UDTs as InOuts (parameter instances?) that contain all the information of the underlying CM instance.
2) Put the FB calls outside the EM FB, in their own routine.
I could define another FB to handle all CM calls, then pass the corresponding CM instances as InOut UDTs on a select basis to the EMs instances to "use" the CMs.
Option 2 might be easier to troubleshoot and maintain, and also seems to have the benefit of being able to be more flexible if I wanted to put CM logic into a cyclic interrupt (in Rockwell / AB world I believe they recommend putting CM logic in Fast periodic tasks - this might not be as much of an issue with a S7-1500?). But this option does not seem to be as modular to me.
Any info to help point me in the right direction is appreciated. I'm trying not to reinvent the wheel here. Most Siemens examples for S88 are all PCS 7 and the closest example I have downloaded is a PackML example which did not really help.
Thanks.
I'm programming in an S7-1500. I'm not programming a batch process, but I'm trying to observe the concepts of S88 in my programming by using Equipment Modules and Control Modules and driving events through an S88-like state machine.
Let's say I have a EM made up of several CMs (some Valves, Analog Inputs, etc.). I want to create modular functions of the EMs and CMs so that I can build a modular library. Inside of an instance of a particular EM I would utilize the instances of the CMs. Therefore everything is (ideally) as modular and self-contained as I can make it.
I'm debating two options:
1) Put the FB instance call to all CMs inside of the EM FB.
From what I can see, this would require passing rather "large" UDTs as InOuts (parameter instances?) that contain all the information of the underlying CM instance.
2) Put the FB calls outside the EM FB, in their own routine.
I could define another FB to handle all CM calls, then pass the corresponding CM instances as InOut UDTs on a select basis to the EMs instances to "use" the CMs.
Option 2 might be easier to troubleshoot and maintain, and also seems to have the benefit of being able to be more flexible if I wanted to put CM logic into a cyclic interrupt (in Rockwell / AB world I believe they recommend putting CM logic in Fast periodic tasks - this might not be as much of an issue with a S7-1500?). But this option does not seem to be as modular to me.
Any info to help point me in the right direction is appreciated. I'm trying not to reinvent the wheel here. Most Siemens examples for S88 are all PCS 7 and the closest example I have downloaded is a PackML example which did not really help.
Thanks.
Last edited: