F_iecApdu101ToAsduLen

F_iecApdu101ToAsduLen 1:

The function calculates the maximum available ASDU octet length for the IEC 60870-5-101 protocol by means of the configured APDU telegram length and the address field length of the link layer. The maximum available ASDU length is required for the configuration of the ST_IEC870_5_101TBuffer variable, for example. This data structure (TX/RX data buffer) is used for the data exchange via the IEC60870-5-101 low-level interface.

Syntax

FUNCTION F_iecApdu101ToAsduLen: BYTE
VAR_INPUT
    FRAMELength   : BYTE;
    eLinkAddrSize : E_IEC870_5_101LinkAddrSize;
END_VAR

F_iecApdu101ToAsduLen 2: Inputs

FRAMELength: The max. available APDU telegram length (see compatibility list).

eLinkAddrSize: Address field length of the link layer.

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)
Tc2_SerialCom (Communication->Serial)
Tc2_TcpIp (Communication->TcpIp)
Tc2_Utilities (System)