PLUS+1 Hardware > Controllers

POU Input output



I use POU  Structured text function as using in video #21.  It's working.

But my idea it's to use this function many times.  It can be used to calculate any things as simple example: Sum of 2 variables.

Function Sum
     INT1  INT
     INT2  INT
     Out2  INT

   Out2 := INT1 + INT2;

But When I call from call POU I must make the input and output as in function. In my example function are INT1, INT2 and Out2.
If other name variable  as data1,  data2  and Sum1 problem with compilation.

Please have idea how we can use POU structured text call without using the same name as input and output in function.

Thank you very much

Mac bahi

In this case the variable names on the input and output busses for the POU will need to be INT1, INT2, and Out2. 

What you can do is don't connect the input bus and output bus from the POU to your main busses.  Instead, for example, connect your input signal 'Signal1' by itself to the input bus of the POU, and then rename it on that bus as INT1.  So you'll have just the green wires going to the input bus and output bus of the POU.  Does that make sense?

Thank you Tom


[0] Message Index

Go to full version