Reputation: 5310
In CODESYS FBD, is it possible to connect outputs from two separate boxes to different inputs on one box, like in the image? If so, how?
The reason I wish to do this is to not repeat the logic that outputs some_output
which may depend on many input signals.
Upvotes: 0
Views: 127
Reputation: 11
This is (partially) possible. Start with the AND function. Get the 2nd OR function and connect this to the AND function
Now get the 1st OR function and connect it FIRST to the 2nd connector of the 2nd OR function. Then you will see the '+' sign and it add's as desired.
And connect the 'some_output' variable to both inputs.
But creating it as in your example is a 'challenge'. I tried adding a branch in front, but then I can not connect it anymore, or only via a intermediate variable.
So when you have a output from a previous block, consider to devide it into two branches. The desired functionality is possible in a PLC, but I think that the editor is not 'smart' enough to handle this.
But as already mentioned. If there is no reason that you 'HAVE TO' use FBD, try the code in Structured Text (ST) language. It is much easier to monitor and you can add inline comments.Here an example:
Upvotes: 0