Assemble 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 assemble input data as a string or data stream. This Step is applicable for custom communication scenarios.

Usage Scenario

This Step is intended for scenarios that require stitching or packaging multiple data sources according to specific rules, especially when working with custom communication protocols, data transmission, or packaging data for downstream processes. This Step is usually used between data acquisition, data processing, and communication interfaces as an intermediate assembly step, and can be connected to Steps such as Parse Data and Send Data.

Basic Concepts

  • String assembly

    This Step concatenates the contents of multiple texts or data ports into a single string using specific delimiters, and is typically used for text protocol construction or message body assembly.

  • Byte stream assembly

    This Step packs input data into a byte stream according to a specified byte order, and is widely used in communication and low-level data exchange scenarios.

  • Custom input ports

    These are the data input ports of this Step to be assembled. Each port can be configured with attributes such as name, data type, and position, enabling flexible control over the order and format of data assembly.

Workflow

The process of configuring this Step is shown below:

  1. Select the assembly method based on your requirements: text assembly or byte assembly.

  2. Configure input ports: Add data ports to be assembled through custom input parameters, and specify the port name and data type for each port.

    • If text assembly is selected, configure additional text-related parameters such as delimiters.

    • If Byte Assembly is selected, configure additional byte stream assembly parameters such as byte order, start position, and byte length.

  3. After confirming the configuration, run the Step to output the assembled data.

Input Description

No fixed input items. This Step dynamically adds input ports using the “Custom Input” parameter, allowing you to configure multiple input ports based on your requirements.

Parameter Description

Parameter Description

Assembly Method

This parameter specifies the method of data assembly.

Value list:

  • Text Assembly: Assembles data from multiple input ports into a string, with elements separated by a delimiter, and is intended for text protocols.

  • Byte assembly: Assembles data from multiple input ports into a byte stream, and is intended for binary communication protocols.

The default value is text assembly.

It is recommended to select the assembly method based on the required data output type. For example, select Byte Assembly when binary packing is required for the communication protocol, and select Text Assembly for text concatenation scenarios.

Text Assembly

Parameter Description

Delimiter

This parameter is used to separate data from multiple input ports during assembly.

Value list:

  • , : Separate the text data with commas.

  • ;: Separate the text data with semicolons.

  • _: Separate text data with underscores.

  • Space: Separate the text data with spaces.

The default value is the comma (,).

It is recommended to select the delimiter based on the actual application scenario.

Custom input

This parameter is used to add a new input port for configuring the data assembly rules.

It is recommended to add ports based on the number and type of data to be assembled and name them properly for subsequent processing and recognition.

Port name

This parameter specifies the name of the custom input port.

It is recommended to name the port with a descriptive name that reflects the data content, based on your business requirements.

Data type

This parameter specifies the data type of the input port.

Value list:

  • String: The input port is of the string type.

  • Value: The input port is of the numeric type.

The default value is String.

It is recommended to select the data type according to the actual input, with the string type preferred for text stitching scenarios.

Byte Assembly

Parameter Description

Byte order

This parameter is used to specify the arrangement order of multi-byte data in the byte stream.

Value list:

  • ABCD (big-endian): The most significant byte is stored first, and is intended for big endian communication protocols.

  • DCBA (little Endian): The least significant byte is stored first, and is intended for little endian communication protocols.

  • CDAB: This mode uses a custom byte order and is intended for specific communication scenarios.

  • BADC: This mode uses a custom byte order and is intended for specific communication scenarios.

The default value is ABCD (big endian).

Select the Byte Order based on the requirements of downstream communication devices or software. If uncertain, refer to the protocol documentation or contact an engineer.

Custom Input

This parameter is used to add a new input port for configuring the data assembly rules. Data from each input port is assembled based on the configured assembly rules.

It is recommended to add objects based on the number and content of byte assemblies, and configure port attributes carefully to ensure consistent byte structures.

Port name

This parameter specifies the name of the custom input port.

It is recommended to set a port name based on the data content to facilitate recognition and subsequent parsing.

Data type

This parameter specifies the data type of the input port.

Value list:

  • Float32: a 4-byte floating-point number.

  • Int16: a 2-byte integer.

  • Int32: a 4-byte integer.

  • Char8: 1 byte character.

The default value is Char8.

Select the data type based on your requirements and configure it carefully; otherwise, the assembly output and parsing results may contain discrepancies.

Start position

This parameter specifies the starting byte position of the current input port’s data in the byte stream. Start position and byte length together determine the byte range occupied by the data during assembly.

It is recommended to plan the byte structure in advance to ensure that the start position and byte length of each port do not overlap and cover the entire byte stream data.

Byte Length

This parameter specifies the number of bytes occupied by the current data field in the byte stream.

It is recommended to automatically match the length based on the data type. Ensure that the data does not go out of bounds or result in data loss when manually modifying the byte length.

Output Description

Output item Description

Assembled data

Data formed by assembling inputs according to the specified method.

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.