EasyManua.ls Logo

Waveshare RS232/485 TO WIFI POE ETH (B) - Page 71

Waveshare RS232/485 TO WIFI POE ETH (B)
76 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
RS232/485 TO WIFI POE ETH (B) User Manual
www.waveshare.com
71
The length is variable, and the length of the whole data packet is not more than 4096 bytes.
Checksum:
Starting from the parameter area (including the parameter area), and counting up to the byte
before the checksum byte, calculate the sum and take the last byte as the checksum byte.
The following are specific application examples:
55FDAA00036100CC2D
Hex
Among them,
Length byte 0003: length is 3.
Parameter byte: 6100: Send data to socketA connection.
Data area CC: The data sent is "0xCC".
Checksum calculation: 61+00+CC=2D.
(2) Data format from module to serial port device
When data (n bytes) is sent from the network, the module sends the data packet to the serial
device according to the following format; In addition, when the serial device sends data to the
module, if there is an error in sending, it will also reply to the serial device according to this format.
Table Serial Port Sending Format
Header
Always 0xAA0xFD0x55
Length:
The sum of all bytes from the parameter area (including the parameter area) to the sum check
(excluding the sum check). High byte first
Parameter area:
The first byte: common parameter area, which is the connection serial number (socket or socket
b); The data returned for SocketA is 0x61, and the data returned for SocketB is 0x62.
The second byte: spare parameter area, and the seventh bit indicates whether the reply frame is
data returned by the network or the module. (1: module returns data; 0: network returns data). Data:
If it is network data, copy the data directly to the location; The length is variable, and the length
of the whole data packet is not more than 4096 bytes.
If it is the data replied by the module, the corresponding operation reply code is returned. The
specific operation reply code is as follows:
Table Operation reply code
No.
Return code
Description
Note
1
0x00
Header error
2
0x01
Data length error
3
0x02
Parameter error
4
0x04
Checksum error
5
0x10
Sending failed (parameters correct but sending failed)
Checksum:
Header
Length
Parameter area
Data
Parity bit
3
2(n+2)
2
n
1

Table of Contents