IEC60870-5-104 protocol parameters

Here you can unpack the complete PLC sources: TutorialSample.zip

The behaviour of the substation can be adapted to the requirements of the master via the IEC60870-5-104 protocol parameters. Most parameters have preallocated default values that do not have to be changed.

In our example we change the values of the iK and iW parameters:

IF init THEN
    init := FALSE;
...
    F_CreateServerHnd( '', '127.0.0.1'(* change this! *), 2404, nMode := LISTEN_MODE_CLOSEALL OR CONNECT_MODE_ENABLEDBG, bEnable, hServer );

    server.protPara.iK := 12;
    server.protPara.iW := 8;

ELSE
    server( pInputs := ADR( inputs ),
        cbInputs := SIZEOF( inputs ),
        pOutputs := ADR( outputs ),
...

END_IF

The documentation for all transfer protocol parameters can be found here: ST_IEC870_5_104PotocolParams.