Parse Data

You are currently viewing the documentation for the latest version (2.2.0). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

Description

Use this Step to parse the input 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 0x78 can 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:

  1. Connect the input port for the data to be parsed, and select the required input data.

  2. 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).

  3. Adjust the parameters according to actual requirements to ensure that the fields do not overlap and that the data types are configured correctly.

  4. 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:

  • Text parsing: Splits the input string data into multiple fields using a delimiter and parse according to rules. This value is applicable when input is a string.

  • Byte parsing: Parses the input byte stream by segmenting according to byte order. This value is applicable when input is a byte stream.

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:

  • , : Separate the fields with commas.

  • ;: Separate the fields with semicolons.

  • _: Separate the fields with underscores.

  • Spaces: Separate the fields with spaces.

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:

  • String: Parses the field as a text string.

  • Number value: Parses the field as a numeric value.

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:

  • ABCD (big endian): The data is arranged from the most significant byte to the least significant byte.

  • DCBA (little endian): The data is arranged from the least significant byte to the most significant byte.

  • CDAB: The bytes are arranged in CDAB order.

  • BADC: The bytes are arranged in BADC order.

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:

  • Float32: Parses every 4 bytes as a 32-bit floating-point number.

  • Int16: Parses every 2 bytes as a 16-bit signed integer.

  • Int32: Parses every 4 bytes as a 32-bit signed integer.

  • Char8: Parse every 1 byte as a character (ASCII).

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

  • For common errors, see Error Code List.

  • If the error code is inconsistent with the error message, please contact Technical Support for help.

Is this page helpful?

You can give a feedback in any of the following ways:

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.