IEC60870-5-101 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-101 protocol parameters. Most parameters have preallocated default values that do not have to be changed.
In our example we change the link address, link address octet size and the cycle time of polling for class 1 and class 2 data.
IF init THEN
init := FALSE;
...
(*Configure protocol parameter *)
client.protPara.linkAddr := 220;(* link address of remote slave *)
client.protPara.eLinkAddrSize := eIEC870_LinkAddr_TwoOctets; (* link addres octet size *)
client.protPara.tClass1Poll := T#0ms; (* poll class 1 data with max. speed *)
client.protPara.tClass2Poll := T#0ms; (* poll class 2 data with max. speed *)
...
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_101PotocolParams.