ST_IEC870_5_101AcquisitionParams
Configuration parameters for cyclic data acquisition. In most cases, an initialization sequence should be executed once by the central station. This sequence contains some commands which are executed after the communication link was established and/or after receipt of ASDU: M_EI_NA_1 (end of initialization). Such commands include, for example, the clock synchronization command. Then the central station should, for example, continuously send cyclic interrogation commands to the substation. On an IEC 60870-5-104 central station, data exchange is activated after the communication link is established and "STARTDT" (Start Data Transfer) is received. In the case of an IEC 60870-5-101 central station after the Reset Of Link.
From Tc2_IEC60870_5_10x.compiled-library v3.0.7.0, the time of processing the initialization sequence and the cyclic interrogation commands can be configured. The application can choose whether the initialization sequence is to be executed after the STARTDT or after receiving M_EI_NA_1.
The structure component arrInitSeq is used to configure the initialization sequence. There you can preconfigure some different commands.
The structural component eMode determines when these commands are to be executed. The initialization sequence can be executed, for example, after the connection has been established (after STARTDT or Reset Of Link) or after receipt of ASDU: M_EI_NA_1 (end of initialization).
The cyclic interrogation commands are configured via the structure components testCmd, clockSync, arrGenro, arrCoro or genCmd.
Syntax
TYPE ST_IEC870_5_101AcquisitionParams :
STRUCT
eMode : E_IEC870_5_101AcquisitionMode := E_IEC870_5_101AcquisitionMode.InitSeq_CyclicPoll;
arrInitSeq : ARRAY[IEC870_MIN_ISTEP..IEC870_MAX_ISTEP] OF E_IEC870_5_101InitSeqStep :=
[eIEC870_ISTEP_TEST,
eIEC870_ISTEP_CLOCK,
eIEC870_ISTEP_GENRO,
eIEC870_ISTEP_CORO,
eIEC870_ISTEP_UNUSED,
eIEC870_ISTEP_UNUSED,
eIEC870_ISTEP_UNUSED];
testCmd : ST_IEC870_5_101TestPollParams :=
(asduAddr := IEC870_ASDUADDR_SYSPARA, tPollCycle := T#60S, bEnable := TRUE);
clockSync : ST_IEC870_5_101ClockPollParams :=
(asduAddr := IEC870_ASDUADDR_SYSPARA, tPollCycle := T#60S, bEnable := TRUE);
arrGenro : ARRAY[0..16] OF ST_IEC870_5_101GenroPollParams :=
[(eQOI := eIEC870_QOI_INROGEN, tPollCycle := T#60S, bEnable := TRUE),
(eQOI := eIEC870_QOI_INRO1),
(eQOI := eIEC870_QOI_INRO2),
(eQOI := eIEC870_QOI_INRO3),
(eQOI := eIEC870_QOI_INRO4),
(eQOI := eIEC870_QOI_INRO5),
(eQOI := eIEC870_QOI_INRO6),
(eQOI := eIEC870_QOI_INRO7),
(eQOI := eIEC870_QOI_INRO8),
(eQOI := eIEC870_QOI_INRO9),
(eQOI := eIEC870_QOI_INRO10),
(eQOI := eIEC870_QOI_INRO11),
(eQOI := eIEC870_QOI_INRO12),
(eQOI := eIEC870_QOI_INRO13),
(eQOI := eIEC870_QOI_INRO14),
(eQOI := eIEC870_QOI_INRO15),
(eQOI := eIEC870_QOI_INRO16)];
arrCoro : ARRAY[0..4] OF ST_IEC870_5_101CoroPollParams :=
[(eRQT := eIEC870_RQT_REQCOGEN, eFRZ := eIEC870_FRZ_READ, tPollCycle := T#60S, bEnable := TRUE),
(eRQT := eIEC870_RQT_REQCO1),
(eRQT := eIEC870_RQT_REQCO2),
(eRQT := eIEC870_RQT_REQCO3),
(eRQT := eIEC870_RQT_REQCO4)];
genCmd : ST_IEC870_5_101GenCmdPollParams :=
(tPollCycle := T#1H, bEnable := FALSE);
delayCmd : ST_IEC870_5_101DelayPollParams := (tDelay := T#5S);
eAODBType : E_IEC870_5_101AODBType := eIEC870_AODB_STATIC;
END_STRUCT
END_TYPE
eMode: Configuration of the trigger for processing the initialization sequence (arrInitSeq) and the cyclic interrogation commands. Since not every server always sends the ASDU: M_EI_NA_1 (end of initialization), the following standard setting was selected: E_IEC870_5_101AcquisitionMode.InitSeq_CyclicPoll.
In the standard setting, after the start of the data transfer (IEC 60870-5-104, STARTDT) or the reset of the connection (IEC 60870-5-101), first all commands of the initialization sequence are executed once, then the cyclic interrogation commands are executed continuously. The ASDU: M_EI_NA_1 is not evaluated and ignored.
If the initialization sequence is to be executed when M_EI_NA_1 is received, another setting must be selected, e.g: E_IEC870_5_101AcquisitionMode.CyclicPoll_OnEndOfInit_InitSeq_CyclicPoll or E_IEC870_5_101AcquisitionMode.OnEndOfInit_InitSeq_CyclicPoll.
arrInitSeq: Initialization sequence. The standard configuration of the initialization sequence executes the following commands:
- Test command (eIEC870_ISTEP_TEST);
- Clock synchronization command (eIEC870_ISTEP_CLOCK);
- General interrogation (eIEC870_ISTEP_GENRO, General group);
- Counter interrogation (eIEC870_ISTEP_CORO, Counter group General, Read counter);
testCmd: Parameter for cyclic test commands. Default: Active; test command every 60 seconds.
clockSync: Parameter for cyclic clock synchronization commands. Default: Active; clock synchronization every 60 seconds.
arrGenro: Parameter for cyclic station interrogation commands. Station interrogations for up to 17 data point groups may be configured. Default: Active; station interrogation for group 'General' every 60 seconds.
arrCoro: Parameter for cyclic counter interrogation commands. Counter interrogations for up to 5 counter groups may be configured. Default: Active; counter interrogation of the group General every 60 seconds.
genCmd: Parameter for cyclic transfer of the data points in control direction (single command, double command, setpoints etc.). Default: Not active; the commands are transferred every 60 minutes.
delayCmd: Parameter for delaying the next initialization step during execution of the initialization sequence. Default: The next initialization step is delayed by 5 seconds.
eAODBType: Application database type. This parameter determines how the data points are stored in the application database.
Sample in ST
In the following program section cyclic data acquisition is configured as follows: All initialization steps are deactivated. The cyclic test command and time synchronization command are also deactivated. In addition to the standard station interrogation a further station interrogation from group 1 is configured (every 100 s). In addition to the standard counter interrogation, a counter interrogation (freezing) from counter group 1 is configured (every 200 s).
PROGRAM P_AcquisitionConfig
VAR_IN_OUT
acqPara : ST_IEC870_5_101AcquisitionParams;
END_VAR
acqPara.arrInitSeq[0] := eIEC870_ISTEP_UNUSED;
acqPara.arrInitSeq[1] := eIEC870_ISTEP_UNUSED;
acqPara.arrInitSeq[2] := eIEC870_ISTEP_UNUSED;
acqPara.arrInitSeq[3] := eIEC870_ISTEP_UNUSED;
acqPara.arrInitSeq[4] := eIEC870_ISTEP_UNUSED;
acqPara.testCmd.bEnable := FALSE;
acqPara.clockSync.bEnable := FALSE;
acqPara.arrGenro[1].asduAddr := IEC870_ASDUADDR_SYSPARA;
acqPara.arrGenro[1].eQOI := eIEC870_QOI_INRO1;
acqPara.arrGenro[1].tPollCycle:= T#100s;
acqPara.arrGenro[1].bEnable := TRUE;
acqPara.arrCoro[1].asduAddr := IEC870_ASDUADDR_SYSPARA;
acqPara.arrCoro[1].eFRZ := eIEC870_FRZ_FREEZE;
acqPara.arrCoro[1].eRQT := eIEC870_RQT_REQCO1;
acqpara.arrCoro[1].tPollCycle := T#200s;
acqPara.arrCoro[1].bEnable := TRUE;
Requirements
Development environment |
Target system type |
PLC libraries to be linked (category group) |
---|---|---|
TwinCAT v3.1.4012.0 |
PC oder CX (x86, x64, ARM) |
Tc2_IEC60870_5_10x (Communication->IEC60870) |