Parse Data
Usage Scenario
This Step is mainly used to perform structured parsing of received raw data. It is applicable for custom communication systems, data format conversion, and protocol parsing. This Step is usually connected after the Receive Data Step. It can also be used with Steps for data processing or result display.
Basic Concepts
-
Data parsing method
This Step supports two data parsing methods:
-
Text parsing: Splits the input string into multiple fields using the specified delimiter. Applicable for scenarios where the protocol data is in a printable string format. For example, if an external device sends the message
SN,001,98.5.\n, it can be split into three fields—SN, 001, and 98.5—using a comma delimiter. -
Byte parsing: Splits the input byte stream into multiple fields based on the specified start position and length, and parses each field according to the specified data type. Applicable to scenarios where the protocol data is in binary format. For example, the byte stream
0x12 0x34 0x56 0x78can be parsed as a decimal value in big-endian order using a data type such as Int32.
-
-
Port and Field Mapping
Custom output ports can be mapped one-to-one to data fields for efficient structured output configuration.
-
Byte order
The byte order used to parse the byte stream (such as big-endian or little-endian) affects the actual meaning of the values and fields, as well as the parsing results.
Workflow
The process of configuring this Step is shown below:
-
Connect the input port for the data to be parsed, and select the required input data.
-
Set the parsing method and select the applicable parsing method (text parsing or byte parsing).
-
If text parsing is selected: configure the delimiter and the custom output ports (port name and data type).
-
If byte parsing is selected: Set the byte order and configure custom output ports (start position, byte length, port name, data type).
-
-
Adjust the parameters according to actual requirements to ensure that the fields do not overlap and that the data types are configured correctly.
-
Execute the Run Step to view the parsing result output to each specified port.
Input Description
| Input item | Description |
|---|---|
Data to parse |
The data input to this port will be parsed into structured fields. |
Parameter Description
| Parameter | Description |
|---|---|
Parsing Method |
This parameter specifies the parsing method. Value list:
Select the appropriate parsing method according to the input data type (string or byte stream) to ensure correct parsing. |
Text Parsing
| Parameter | Description |
|---|---|
Delimiter |
Specifies the delimiter character used to split the string. The data will be split into multiple fields by this delimiter. Value list:
The default value is the comma (,). Select the delimiter that matches the actual data content to ensure that the fields are parsed correctly. |
Custom output |
Configures parsing rules for data fields and assign corresponding output port names for each field. Set them in order according to the field sequence after splitting (Field 1, Field 2, ...). It is recommended to define a clear output port and data type for each field to ensure a consistent parsing structure. |
Port name |
Specifies a name for the custom output port. This name will be used as the identifier of the output field port. It is recommended that the port name reflect the meaning of the field content to improve output readability. |
Data type |
This parameter specifies the parsing type for the current field. Value list:
The default value is String. Select an appropriate type based on the parsed field content to avoid data processing errors caused by incorrect type settings. |
Byte Parsing
| Parameter | Description |
|---|---|
Byte order |
This parameter specifies the byte order for multi-byte data in the byte stream. Different byte orders affect the final parsed value. Value list:
The default value is ABCD (big endian). Set the byte order according to the communication protocol or data source requirements to ensure correct data interpretation. |
Custom output |
Configures parsing rules for data fields and assign corresponding output port names for each field. The system determines the read range based on the start position and byte length, parses according to the specified type, and outputs. Byte ranges of fields must not overlap. It is recommended to configure the fields strictly according to the byte stream structure to avoid overlap and ensure correct parsing. |
Port name |
Specifies the name for the custom output port. This name will be used as the identifier for the output field port. It is recommended that the port name reflect the meaning of the byte data to improve output readability. |
Data type |
This parameter specifies the data parsing type for the current field.. It supports parsing various numeric and character data types. Value list:
The default value is Char8. Select an appropriate data type based on actual requirements and the data structure to prevent overflow or data mismatches. |
Start position |
Specifies the starting byte index (starting from 0) of the current data field in the byte stream. It is recommended to set the start position appropriately and configure each field in byte order to ensure that there is no overlap. |
Byte Length |
Specifies the number of bytes occupied by the current data field. The Start position and byte length together determine the read range. It is recommended to configure the start position together with the size of the required data type to avoid overflow or incomplete field parsing. |
Output Description
The output of this step is generated based on the custom port and field configurations. Specifically, structured field data is output through each specified output port.
Troubleshooting
|