FB_CltsByteOrderConverterClass

FB_CltsByteOrderConverterClass 1:

The natural byte order of the data on a TwinCAT system is referred to as the host byte order. The byte order of the data transmitted over the network is referred to as the network byte order. The network byte order of IEC 61850 data largely corresponds to the big-endian format, while the TwinCAT system uses the byte order of the little-endian format. This function block implements methods that allow the byte order of the IEC 61850 data to be changed (little-endian <-> big-endian).

The HostToNetXxx methods convert (encode) the data values to be sent from host byte order to network byte order. After encoding, the data values are stored in the network transmission buffer of the sender (e.g., SV-Publisher). The transmitter sends the contents of the network transmission buffer.

The receiver (e.g., SV subscriber) receives the data values into the network receive buffer. The NetToHostXxx methods convert (decode) the data values in the network receive buffer from network byte order to host byte order.

Namespace: Tc3_Collections
Library: Tc3_Collections (Tc3_Collections.compiled-library)

FUNCTION_BLOCK FB_CltsByteOrderConverterClass

FB_CltsByteOrderConverterClass 2: Methods

Name

Description

HostToNetBoolean

Encodes values of type BOOL (IEC 61850 type BOOLEAN) into the network transmission buffer (8 bits as a byte; all bits set to 0 => FALSE, otherwise TRUE).

HostToNetEntryID

Encodes values of type T_OCTET8 (IEC 61850 EntryID type) into the network transmission buffer (byte array with 8 elements).

HostToNetEntryTime

Encodes values of type T_BinaryTime (IEC 61850 type EntryTime) into the network transmission buffer (48-bit timestamp as a byte array with 6 elements).

HostToNetFloat32

Encodes REAL-type values (IEC 61850 type FLOAT32) into the network transmission buffer (32 bits as a byte array with 4 elements).

HostToNetFloat64

Encodes values of type LREAL (IEC 61850 type FLOAT64) into the network transmission buffer (64 bits as a byte array with 8 elements).

HostToNetInt16

Encodes values of type INT (IEC 61850 type INT16) into the network transmission buffer (16 bits as a byte array with 2 elements).

HostToNetInt16U

Encodes values of type UINT (IEC 61850 type INT16U) into the network transmission buffer (16 bits as a byte array with 2 elements).

HostToNetInt24

Encodes values of type T_INT24 (IEC 61850 type INT24) into the network transmission buffer (24 bits as a byte array with 3 elements).

HostToNetInt24U

Encodes values of type T_UINT24 (IEC 61850 type INT24U) into the network transmission buffer (24 bits as a byte array with 3 elements).

HostToNetInt32

Encodes values of type DINT (IEC 61850 type INT32) into the network transmission buffer (32 bits as a byte array with 4 elements).

HostToNetInt32U

Encodes values of type UDINT (IEC 61850 type INT32U) into the network transmission buffer (32 bits as a byte array with 4 elements).

HostToNetInt64

Encodes values of type LINT (IEC 61850 type INT64) into the network transmission buffer (64 bits as a byte array with 8 elements).

HostToNetInt64U

Encodes values of type ULINT (IEC 61850 type INT64U) into the network transmission buffer (64 bits as a byte array with 8 elements).

HostToNetInt8

Encodes values of type SINT (IEC 61850 type INT8) into the network transmission buffer (8 bits as a byte).

HostToNetInt8U

Encodes values of type USINT (IEC 61850 type INT8U) into the network transmission buffer (8 bits as a byte).

HostToNetTimestamp

Encodes values of type T_UtcTime (IEC 61850 timestamp type) into the network transmission buffer (64-bit timestamp as an 8-element byte array).

NetToHostBoolean

Decodes BOOL values (IEC 61850 type BOOLEAN) from the network receive buffer (8 bits as a byte; all bits set to 0 => FALSE, otherwise TRUE).

NetToHostEntryID

Decodes values of type T_OCTET8 (IEC 61850 EntryID type) from the network receive buffer (byte array with 8 elements).

NetToHostEntryTime

Decodes values of type T_BinaryTime (IEC 61850 type EntryTime) from the network receive buffer (48-bit timestamp as a byte array with 6 elements).

NetToHostFloat32

Decodes REAL-type values (IEC 61850 type FLOAT32) from the network receive buffer (32 bits as a byte array with 4 elements).

NetToHostFloat64

Decodes values of type LREAL (IEC 61850 type FLOAT64) from the network receive buffer (64 bits as an 8-element byte array).

NetToHostInt16

Decodes INT-type values (IEC 61850 type INT16) from the network receive buffer (16 bits as a byte array with 2 elements).

NetToHostInt16U

Decodes values of type UINT (IEC 61850 type INT16U) from the network receive buffer (16 bits as a byte array with 2 elements).

NetToHostInt24

Decodes values of type T_INT24 (IEC 61850 type INT24) from the network receive buffer (24 bits as a byte array with 3 elements).

NetToHostInt24U

Decodes values of type T_UINT24 (IEC 61850 type INT24U) from the network receive buffer (24 bits as a byte array with 3 elements).

NetToHostInt32

Decodes values of type DINT (IEC 61850 type INT32) from the network receive buffer (32 bits as a byte array with 4 elements).

NetToHostInt32U

Decodes values of type UDINT (IEC 61850 type INT32U) from the network receive buffer (32 bits as a byte array with 4 elements).

NetToHostInt64

Decodes values of type LINT (IEC 61850 type INT64) from the network receive buffer (64 bits as an 8-element byte array).

NetToHostInt64U

Decodes ULINT-type values (IEC 61850 type INT64U) from the network receive buffer (64 bits as an 8-element byte array).

NetToHostInt8

Decodes SINT-type values (IEC 61850 type INT8) from the network receive buffer (8 bits as a byte).

NetToHostInt8U

Decodes values of type USINT (IEC 61850 type INT8U) from the network receive buffer (8 bits as a byte).

NetToHostTimestamp

Decodes values of type T_UtcTime (IEC 61850 timestamp type) from the network receive buffer (64-bit timestamp as an 8-element byte array).

Example:

See here: SV Publisher/Subscriber according to UCA 61850-9-2 Light Edition.