Basic settings: System parameters
The common ASDU address and the user functions of the central station are configured via the system parameters. In our introduction we configure the following system parameters:
The common ASDU address is set to 7. (asduAddr)
The logging of the debug messages in the application log is activated (dbgMode). Changes in the device status are logged.
Add the following PLC code to your PLC project:
IF init THEN
init := FALSE;
...
client.sysPara.asduAddr := 7;
client.sysPara.dbgMode := IEC870_DEBUGMODE_DEVSTATE(* OR IEC870_DEBUGMODE_LINKERROR OR IEC870_DEBUGMODE_ASDU OR IEC870_DEBUGMODE_LINKLAYER *);
...
ELSE
client( pInputs := ADR( inputs ),
cbInputs := SIZEOF( inputs ),
pOutputs := ADR( outputs ),
...
END_IF
The documentation for all system parameters can be found here: ST_IEC870_5_101SystemParams.
The associated PLC example tutorial can be downloaded here.