AReSGodOfWar
Member
Let me begin by saying that I am a PLC programming newbie.
Currently I have a multi instance FB, let’s call it Robot, which I am using to control two identical robots. The FB has 28 inputs and 25 outputs, a number of static variables, and consists of 89 networks. What I would like to do is break this large Robot FB into a number of smaller FB or F and then call each one of these smaller function blocks from within the parent Robot FB but avoid passing I/O and static variables around.
Is there a way to read/write to a parent FB I/O and static variables without having to pass them as Input, Output, or In/Out parameters? I know I can load a DB using the OPN instruction but then I’m stuck referencing data using DBX 0.0 instead of descriptive variable names such as “SystemReady”. Perhaps I can pass a UDT around but then in the parent Robot FB I’ll need to copy all the FB I/O to the UDT so it can be passed to child FB calls.
Any help on how to keep this small and tidy would be greatly appreciated. This should be easy to do but I imagine that there something simple that I am overlooking.
Thank you,
AReS
Currently I have a multi instance FB, let’s call it Robot, which I am using to control two identical robots. The FB has 28 inputs and 25 outputs, a number of static variables, and consists of 89 networks. What I would like to do is break this large Robot FB into a number of smaller FB or F and then call each one of these smaller function blocks from within the parent Robot FB but avoid passing I/O and static variables around.
Is there a way to read/write to a parent FB I/O and static variables without having to pass them as Input, Output, or In/Out parameters? I know I can load a DB using the OPN instruction but then I’m stuck referencing data using DBX 0.0 instead of descriptive variable names such as “SystemReady”. Perhaps I can pass a UDT around but then in the parent Robot FB I’ll need to copy all the FB I/O to the UDT so it can be passed to child FB calls.
Any help on how to keep this small and tidy would be greatly appreciated. This should be easy to do but I imagine that there something simple that I am overlooking.
Thank you,
AReS