|
Product Details:
Payment & Shipping Terms:
|
High Light: | rs485 rs232 converter,rs485 232 converter |
---|
Protocol Converters , Communication Protocol for Serial Dongle
Description:
1. Command message (control ID code – description of data or action type) and response message (to return ER table).
The first two characters represent its function and also it is the command to be sent. The data after some of the two characters are in decimal system. For details, please refer to the following:
Host send:
No. | 1 | 2 | 3 | 4 | 5 |
Bytes | 1 | 2 | LENGTH | 1 | 1 |
Format | SOH | Receiver | DATA | BCC | EOT |
Client response:
No. | 1 | 2 | 3 | 4 | 5 |
Bytes | 1 | 2 | LENGTH | 1 | 1 |
Format | SOH | Receiver | DATA | BCC | EOT |
<SOH> : Header code of the title when data sending begins. (ASCII HEX 01)
<EOT> : End code when data sending ends. (ASCII HEX 04)
<receiver>: The two ASCII characters (“01-FE”) represent the address information of the receiver.
<BCC> : This is for validation to calculate and validate (chksum) from <receiver> to <DATA>, and BCC is the residue after the total of the characters mod by 128. If the resulted residue is less or equals to 32, then another 32 shall be added for supplement.
VB application sample
UPD$=”01ZWABCD”
OrgBuf$ = Chr(1) + UPD$ + CheckSum(UPD$) + Chr(4) ‘Merge command
MSComm1.Output = OrgBuf$ ‘Send command
Public Function CheckSum(Buf As String) As String
Dim i%, OrgBuf$
Dim CKValue%
CKValue = &H0
OrgBuf = Buf
CKValue = 0
For i = 1 To Len(Buf)
CKValue = CKValue + Asc(Mid(Buf, i, 1)) And &H7F
Next i
If CKValue <= 32 Then
CKValue = CKValue + 32
End If
CheckSum = Chr(CKValue)
End Function
<bps> : for baud rate setting, 1 ASCII character “0-4”.
<type> : device type, 2 ASCII character “00-99”.
<rev> : software version of the client, 2 ASCII character “00-99”.
<data> : command data between <Receiver> and <BCC>.
Specifications:
All the communication commands are included in DATA to be transferred in ASCII format.
Contact Person: Mr. Brandy Xie
Tel: +86-755-27886063 Ext.602
Fax: 86-755-27886083