Assemble Data
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:
-
Select the assembly method based on your requirements: text assembly or byte assembly.
-
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.
-
-
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:
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:
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:
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:
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:
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
|