Basic settings: Protocol parameters
The behavior of the central station can be adapted to the requirements of the substation 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 substation to which the connection is to be established.
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 of all transmission protocol parameters can be found under ST_IEC870_5_104ProtocolParams.
The associated PLC example tutorial can be downloaded here.