English
English
简体中文
Contact Us
Register
Log In
Language
English
English
简体中文
Contact Us
Log In
Register
Go to main website
App Develop

App Development Platform

App development platform provides multiple development methods such as no-code or IoT App SDK development to maximize the monetization of IoT apps.
layoutIndex

MES Proction Test API

Last Updated on : 2021-08-24 13:06:39download

Integration plan

The connection scheme between Tuya solution production test platform and MES is shown in the figure below.
MES Proction Test API

Production test data interface

The production test data interface is realized by the TCP protocol Socket, and the production test platform serves as the Server side. Through this production test data interface, the production test platform outputs production test data to third-party tools and software.

Open the data interface by configuring the interface of the solution production and testing platform.

Adapter connected with production test data API

Customized adapter

Since the production test platform needs to connect to different customer MESs, there are various ways of connecting customer MESs and data reporting formats. It cannot be directly compatible. For different MES systems, it is necessary to customize and develop different adapters separately. Through this middle layer, the adaptation of the MES system for reporting the production test data is completed.

Data interface

After opening the production test data interface in the interface, the production test platform acts as the Server side and waits for the connection of the Client side (customized adapter). The specific implementation needs to use Socket to connect with the production test platform, please refer to Demo.

Use the solution production testing platform for production testing

Solution The production and test platform provides an integrated solution for equipment production and test. For specific instructions and operations, please refer to Solution Production and Test Platform Operation Document.

Life cycle of production test data

It is stipulated that after a production test of the device is performed (all test items are tested), the data of the production test will be sent to all clients that have established connections with the Server through the production test data interface.

Production test frame format

In order to prevent sticking and unpacking when using TCP to transmit data, each production test record is sent using the specified frame format, and the receiving end processes the data according to the frame format during processing. The frame format is as follows:

Field Field Length Description Remarks
Frame header 2 Mark the start of each frame/each production test record Specify as 0x55 0xaa
Data length 2 The length of the data field The specific value is calculated based on the data length
Data N Production test data Production test data, see Production test data format for specific format
Checksum 1 Check Digit The result of summing all data in the frame header, data length, and data field in bytes is the remainder of 256

Production test data format

Solution The production test platform will output the production test data in a fixed JSON format through the production test data interface, the format is as follows:

{
  "StartTime": "2020-02-24T11:12:25.2241205+08:00",
  "EndTime": "2020-02-24T11:12:48.3301532+08:00",
  "Result": "Fail",
  "Info": {
    "SN": "RFAK29RNB00001"
  },
  "TestItemLog": [
    {
      "Index": 0,
      "TestItem": {
        "Name": "CHECK_STATION",
        "Text": "Station check information",
        "Paras": null
      },
      "StartTime": "2020-02-24T11:12:25.2321323+08:00",
      "EndTime": "2020-02-24T11:12:25.6340444+08:00",
      "Result": "Pass",
      "Data": "",
      "InfoCode": ""
    },
    {
      "Index": 1,
      "TestItem": {
        "Name": "CONNECT",
        "Text": "Connection established",
        "Paras": { "ConnectType": "SerialPort" }
      },
      "StartTime": "2020-02-24T11:12:25.638034+08:00",
      "EndTime": "2020-02-24T11:12:25.7665804+08:00",
      "Result": "Pass",
      "Data": "",
      "InfoCode": ""
    },
    {
      "Index": 2,
      "TestItem": {
        "Name": "ENTER_TESTMODE",
        "Text": "Enter production test mode",
        "Paras": { "Mode": "TestMode" }
      },
      "StartTime": "2020-02-24T11:12:25.7665804+08:00",
      "EndTime": "2020-02-24T11:12:47.9249408+08:00",
      "Result": "Fail",
      "Data": "",
      "InfoCode": "110011"
    }
  ]
}

Customized adapter for production test data processing

After the customized adapter receives the data, it processes the data so that it conforms to the data reporting format of the customer’s MES system. For data processing, please refer to Demo.

Adapter and MES system integration

According to the customer’s MES system integration document, confirm the integration method (such as TCP and HTTP). Please customize and develop this part according to the relevant documents of the customer’s MES system.

MES system for production test data processing

The processing of production test data on the MES system is determined by the MES system itself. The data provided by the solution production test platform is as follows. If you need other data provided by the solution production test platform, please contact Tuya support staff.

Field Description Remarks
StartTime Test start time None
EndTime Test end time None
Result Test result Pass: success, Fail: failure
Info Test information object Contains some important production test information
Info.SN Device serial number None
TestItemLog All test items test log collection Contains multiple test item logs
TestItemLog.Index Test Item Index According to the execution order of test items, starting from 0 and executing from small to large
TestItemLog.TestItem Test item information object Contains test item related information
TestItemLog.TestItem.Name Test Item Identification Name None
TestItemLog.TestItem.Text Test item display name Test item display name configured in the test sequence
TestItemLog.TestItem.Paras Test item parameters Test item parameter values ​​configured in the test sequence
TestItemLog.StartTime Test item start time None
TestItemLog.EndTime Test item end time None
TestItemLog.Result Test Item Test Result Pass: Success, Fail: Failure
TestItemLog.Data Test item test data Some test items will output data and values ​​after the test
TestItemLog.InfoCode Test item information code Some test items will give test information in the form of information code after the test, such as the reason for failure, etc.

Production test data flow completed

After the MES system has processed the production test data reported this time, it notifies the adapter to complete the data processing, indicating the end of a production test data stream, and waits for the next production test data.