LogIec60870_Input (FB)

FUNCTION_BLOCK LogIec60870_Input EXTENDS AbbLConCA

The Function Block is used for writing datasets into the SRAM-FIFOin of the Datalogger according to IEC 60870-5-104 protocol.

Write telegram of type M_SP1, M_SP16, M_DP, M_IT1, M_IT16, M_ME1, M_ME16 according to IEC60870-5-104 in the format *.csv into the SRAM-FIFOin of the data logger. According to the corresponding data type up to 16 data points of this data type can be written at the same time. The datasets are written in format *.csv as two-dimensional ARRAY. Every part of each dataset is separated by semicolon. Each dataset is ended with a CR/LF.

Here, the Function Block is used to write the datasets into the SRAM-FIFOin of the PLC CPU and not to be sent directly to the control station. This is done with Function Block LogIEC60870_Output which uses the above mentioned function blocks.

../../../../../_images/LogIEC60870_Input.jpg
InOut:

Scope

Name

Type

Initial

Comment

Inherited from

Input

Enable

BOOL

FALSE

A rising edge (Enable = TRUE) starts the operation, the output Busy goes to TRUE. All other inputs are read and considered continuously. A falling edge (Enable = FALSE) aborts the operation. During Aborting the Busy is still TRUE. Afterward all outputs are reset.

AbbLConCA

Output

Busy

BOOL

FALSE

Operation is running (while output Error is FALSE)

AbbLConCA

Error

BOOL

FALSE

Operation is stopped with error (while output Busy is FALSE). This output is TRUE for at least one cycle or until Enable is set to FALSE. The output ErrorID gives more details about the error.

AbbLConCA

Input

Send

BOOL

2: Start a send request on raising edge

Cycle

BOOL

3: Perform a cyclic send each scandown cycle. At Scandown=0 a dataset is written in each cycle

Auto

BOOL

4: With each change of an input value or exceeding/falling down of Threshold, this input writes a dataset in FIFOin

Scandown

UINT

5: On cyclic send only send in each <scandown< cycle
  • e.g. Scandown=100: every hundredth cycle writes a value in FifoIn

  • e.g. Scandown=0: in every cycle a dataset is written

ThresholdRefresh

BOOL

6: Threshold refresh. FALSE: refresh each thresholds separately // TRUE: refresh all thresholds together when one threshold reached

IecType

BYTE

7: IEC types: 1=SP1, 2=SP16, 3=DP, 4=IT1, 5=IT16, 6=ME1, 7=ME16

IV

BOOL

8: Quality.0: Invalid (SP1, SP16, DP, IT1, IT16, ME1, ME16)

NT

BOOL

9: Quality.1: Not Topical (SP1, SP16, DP, ME1, ME16)

SB

BOOL

10: Quality.2: Substituted (SP1, SP16, DP, ME1, ME16)

BL

BOOL

11: Quality.3: Blocked (SP1, SP16, DP, ME1, ME16)

CA

BOOL

12: Quality.4: With quality carry (IT1, IT16)

CY

BOOL

13: Quality.5: With quality counter adjusted (IT1, IT16)

QOV

BOOL

14: Quality.6: Overflow Quality (ME1, ME16)

SQ

BYTE

15: Sequence number (IT1, IT16). Valid range of values: 0..31/ 16#0..1F

Pingroup

POINTER TO zLogStructPingroup

16: Pointer to Pingroup. On this input the data point is set which should be received by the Function Block. The Pingroup of e.g. the data type IEC60870_MeasuredValue

relates to the one defined by the Control-/substation in the global address list of Automation Builder defined data type. After the declarations in Automation Builder are done, the data type is available in the global variable list(command list, Command(CONSTANT)). IEC 60870 data are send or received to the data point defined by the address in Automation Builder. The sent address data point must be the same as the received data point. As the input is a pointer to it has to be connected to an preceding ADR-Operator, to which any Pingroup can be put

Threshold

POINTER TO DINT

17: Pointer to threshold. When exceeding or falling below a threshold, a writing operation of a dataset into the FIFOin is started.

After this operation, either only the single threshold difference (between input and threshold) is deleted (ThresholdRefresh=FALSE) or all differences (ThresholdRefresh=TRUE). As the input is a pointer to, it has to be connected to an preceding ADR-Operator, to which any available input type can be provided: BOOL, BYTE, INT, WORD, DINT, DINT, REAL or an array of these data types. Make sure that Threshold is always of the same TYPE as the the respective input E.g. if the Input is an ARRAY[0..n] of BYTE, Threshold has to be an ARRAY[0..n] OF BYTE too. This input is only relevant for IEC_TYPE<IecType>’s 4(IT1), 5(IT16), 6(ME1) and 7(ME16), not for bool. For the BOOL type inputs, Threshold is not needed.

Data

POINTER TO DINT

18: Address of Data. Array or Value with ADR to Data

Input value as single value or as array for the possible 0 to 16 values. As the input is a pointer to it has to be connected to a preceding ADR-Operator, to which any available input-type can be provided: BOOL, BYTE, INT, WORD, DINT, DINT, REAL or an array of these data types

Output

ErrorID

ERROR_ID

NO_ERROR

3: Shows error, Refer ERROR_ID enumeration for details of the error

State

zLOG_ENUM_STATE

zLOG_IDLE

4: Actual State of LogInput, enumeration of Type zLOG_ENUM_STATE

InExecution

BOOL

FALSE

5: A command was received when InExecution = TRUE - write Datasets is carried out

Overflow

BOOL

FALSE

6: Overflow, FifoIN is full, datasets are rejected. Output will be TRUE, if an overflow occurs. On this output a rising edge (FALSE -> TRUE) shows that communication/logging request occurred too fast and therefore the SRAM-FIFOin is full

FifoInLevel

DINT

0

7: Output represents the current level of SRAM-FIFOin (0…161)

FifoInNextWrite

DINT

0

8: Shown is the next write position in SRAM-FIFOin

FifoInMaxLimit

DINT

0

9: Maximum limit of FIFOin - Standard value 161

NumberItems

DINT

0

10: Number of items since Enable=TRUE

NumberOverflow

DINT

0

11: Number of overflow items since Enable=TRUE