System parameters

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

 

The common ASDU address and the user functions of the substation are configured via the system parameters.

In our introduction we configure the following system parameters:

Add the following PLC code to your PLC project:

IF init THEN
    init := FALSE;
...


    server.sysPara.asduAddr := 7;
    server.sysPara.bUsePCTime := TRUE;
    server.sysPara.bSyncTime := TRUE;
    server.sysPara.bSyncPCTime := FALSE;
    server.sysPara.bEndOfInit := TRUE;
    server.sysPara.bPerCyclic := FALSE;
    server.sysPara.tPerCyclicBase := T#5s;
    server.sysPara.bBackScan := FALSE;
    server.sysPara.tBackScanCycle := T#30s;
    server.sysPara.bPerFRZ := TRUE;
    server.sysPara.tPerFRZCycle := T#15s;
    server.sysPara.dbgMode := (*IEC870_DEBUGMODE_ASDU OR*) IEC870_DEBUGMODE_DEVSTATE;

...

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