I'm trying to create an FB which can complete work on an interface that can be implemented in many FINAL FBs.
INTERFACE IBaseInterface
FUNCTION_BLOCK Base IMPLEMENTS IBaseInterface
FUNCTION_BLOCK SYSTEM // the function block that will do the work
METHOD GetMax : REAL
VAR_IN_OUT
arrData : ARRAY[*] OF IBaseInterface;
END_VAR
//then in PLC_PRG
PROGRAM PLC_PRG
VAR
BaseArray : ARRAY [1..50] OF Base;
result: REAL;
boolResult : BOOL;
System : SYSTEM;
END_VAR
result := System.GetMax(BaseArray);
I'm getting an error that Base can't be converted to IBaseInterface. Can someone let me know what I'm doing wrong? how can I program to an interface, and then pass a dynamic array of a final FB that implements the interface?