Type
| Function |
Description
| Converts the value connected to IN from Big Endian format into the internal endianness of the controller. Only in this format received data can be processed further on the controller. |
Notes
|
- The function can operate on various input data types.
- The data types of the input and the output shall be of the same type. The data type of the output can be larger than the input data type.
- If an array or structure is converted, the byte order is reversed for each individual component.
- Input data that is contained in the array or structure but cannot be converted (for example, data type STRING) is copied as is.
- The function supports structures up to a nested level of 10.
|
Parameters
| Input
IN
Data type: | The function is available for the following input data types:
- ANY_INT
- ANY_BIT
- ANY_REAL
- ANY_DURATION
- Arrays (ARRAY) of the above data types
- Structures (STRUCT) with components of the above data types
|
Description: | Input data with Big Endian byte order. |
Output
OUT
Data type: | Same as input data type |
Description: | Output data with endianness used on the controller. |
|
Example
| Example in ST
out := FROM_BIG_ENDIAN(INT13330); (* results in 4660, or INT#16#1234*)
|
Additional information
| Endianness conversion functions
The endiannesss conversion functions convert to and from the internally used endianness of the controller. They can be used in communication processes to convert incoming and outgoing data into the format that is specified in the communication protocol:
-
TO_BIG_ENDIAN and TO_LITTLE_ENDIAN - preparing data for sendingThese functions convert the input value from the endianness used on the controller to the endianness stated in the function name. This data can then be passed on to a communication protocol.
-
FROM_BIG_ENDIAN and FROM_LITTLE_ENDIAN - converting received dataThese functions convert the input value from the endianness stated in the function name to that of the controller. They are used to prepare the data received by communication partners for further processing on the controller.
EN/ENO behavior
The POU is only executed if TRUE is applied to the EN input. If EN = FALSE, the POU is not executed and ENO = FALSE indicates the inactivity.
|