Hello,
I am using the WAGO Telecontrol Configurator (version 1.7.11.0) in CODESYS 3.5.21.5 to set up an IEC 60870-5-104 server, and I would like to use my own custom function blocks (FBs) to process incoming commands. In these FBs, I have defined generic constants to specify the upper limit of an array for recorded commands. The base FB starts with:
// Base FB for IEC 60870-5 commands from the server's perspective
FUNCTION_BLOCK ABSTRACT SrvCommand
VAR_GENERIC CONSTANT
udiHistoLength : UDINT := 10; // Number of history entries
END_VAR
VAR_INPUT
wCounter : WORD; // The WORD incremented on incoming commands
END_VAR
...
I also have various derived FBs for different command types, for example:
// An IEC 60870-5 single command (TK45 or TK58) from the server's perspective
FUNCTION_BLOCK FINAL SrvSingleCommand
VAR_GENERIC CONSTANT
udiHistoLength2 : UDINT := 10; // Number of history entries
END_VAR
EXTENDS SrvCommand<udiHistoLength2>
VAR_INPUT
xSCS : BOOL; // Single command state
END_VAR
...
I define an instance as follows:
VAR_GLOBAL
sc1 : SrvSingleCommand<10>;
END_VAR
I can successfully map the BOOL GVL.sc1.xSCS to the corresponding field for a TK45. However, when I try to map the WORD GVL.sc1.wCounter to the New IEC Message field (either by entering it directly or using the input help), I receive an error message:
However, if I remove the generic constant from the base FB and only use it in the derived FBs, there are no problems.
My question is whether there is a deeper reason why this mapping cannot work, or if this is a bug. If it is a bug, is there perhaps a workaround?
Thank you in advance!
