SerializeIn
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
BIGENDIAN |
(missing or bad snippet) |
TRUE, FALSE |
|
|
TRUE if the frame is encoded with Big Endian format. |
DATA |
ANY(*) |
N/A |
N/A |
No default |
Destination variable to be copied. |
EN |
(missing or bad snippet) |
0, 1 |
N/A |
No default |
Execute the function. |
FRAME |
USINT |
0,+65535 |
N/A |
N/A |
Source buffer - must be an array. |
POS |
(missing or bad snippet) |
0,+65535 |
N/A |
N/A |
Position in the source buffer. |
(*) DATA cannot be a STRING.
Outputs
Output |
Data Type |
Range |
Unit |
Description |
---|---|---|---|---|
NEXTPOS |
DINT |
|
N/A |
|
OK |
BOOL |
|
N/A |
Returns true when the function successfully executes. |
Remarks
This function is used for extracting data from a communication frame in binary format.
- The DATA input must be directly connected to a variable.
- It cannot be a constant or complex expression.
- This variable is forced with the extracted value.
- The FRAME input must fit the input position and data size.
- If the value cannot be safely extracted, the function returns 0 (zero).
- This function cannot be used to serialize STRING variables.
- The function returns the position in the source frame, after the extracted data.
- The return value can be used as a position for the next serialization.
This function extracts these number of bytes from the source frame:
Bytes | Description |
---|---|
1 byte |
BOOL, BYTE, SINT, and USINT variables. |
2 bytes |
INT, UINT, and WORD variables. |
4 bytes |
DINT, DWORD, REAL, and UDINT variables. |
8 bytes |
LINT and LREAL variables. |
FBD Language
FFLD Language
- In the FFLD language, the operation is executed only if the input rung (EN) is TRUE.
- The output rung (ENO) keeps the same value as the input rung.
IL Language
Not available.
ST Language
Q := SERIALIZEIN (FRAME, DATA, POS, BIGENDIAN);
See Also