Instructions for Packaging File Data Frames

555

# Instructions for Packaging File Data Frames

The data frame sent by the control PC consists of various data areas with the following sizes:
Start of Text: <STX> 02 1 byte
Flag: <FLAG> 11 1 byte
Command: 36 32 30 3 bytes
File Name Length: 30 38 2 bytes
File Name: As per actual length
File Block Number: 30 30 30 30 31 Block numbers 1 ~ 99999 5 bytes; Supports a maximum file transfer size of 195MB
File Data: As per actual length, 0 to 2048 bytes
End of Text: 03 1 byte
Checksum: 1 byte

  • Successful Response:
    Start of Text: 02 1 byte
    Flag: 11 1 byte
    Response Data: 06 Success response 1 byte
    End of Text: 03 1 byte
    Checksum: 1 byte

  • Failure Response:
    Start of Text: 02 1 byte
    Flag: 11 1 byte
    Response Data: 15 Failure response + INFO (multiple bytes) or 15 Failure response 1 byte
    End of Text: 03 1 byte
    Checksum: 1 byte

Description: For files (vsn files, image materials, video materials) using the control PC, if the file size is less than 2048 bytes, the sender converts the file into byte data and directly sends the command by packaging it into the data content of the frame data. If the file size is larger than 2048 bytes, the sender needs to convert the file into byte data, escape it (refer to section 4.3 Rules for Escaping Characters), and then package it into blocks for transmission. The block numbers are transmitted sequentially from 00000 to 99999. (In case of transferring a file in blocks, each frame of data must have consistent data areas, except for the block number and file data. Specifically, the Command, vsnFileName.length, and vsnFileName must be the same for each block of data.) When the length of the received file data for a certain block number is less than 2048 bytes, it indicates that the file transfer is complete. (If the file size is exactly a multiple of 2048, an additional frame data with a file data length of zero needs to be sent.) The following diagrams illustrates examples of data frames for sending files smaller than 2048 bytes and for sending files larger than 2048 bytes in blocks.
img
Data frame for sending files smaller than 2048 bytes
img
Data frame for sending files larger than 2048 bytes in blocks

Note: The vsn file uploaded for the program is not used for playback but for inserting request data (in JSON format) into the vsn file and then publishing the program in that vsn file.