IEC60870-5-104 protocol parameters

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

The behaviour of the controlling station can be adapted to the requirements of the slave 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 and configure the IP address and port number of the slave station.

IF init THEN
    init := FALSE;
...

    client.protPara.sRemoteHost := '127.0.0.1';
    client.protPara.nRemotePort := 2404;
    client.protPara.iK := 12;       
    client.protPara.iW := 8;
    client.protPara.bThrottleMode := TRUE;
    client.protPara.bPackFrames := TRUE;


ELSE
    client( 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.