Как привязать по RS 485 Уровнемер к ПЛК?
Пример протокола :
Example:To device address 01H send data 05H in Addr 00H 00H
Code(HEX):01 10 00 00 00 02 04 40 A0 00 00 E6 4D
Device address(HEX):01
Function Code(HEX):10
Addr(HEX):00 00
Data length(HEX):00 02
Data(HEX):04(Mark),40 A0 00 00(IEEE754)
CRC (HEX): E6 4D
Return Code(HEX):01 13 00 00 00 00 00 09 63
Device address(HEX):01
Function Code(HEX):13
Addr(HEX):--
Data length(HEX):00
Data(HEX):00 00 00 00
CRC (HEX):09 63
Read again code(HEX):01 03 00 00 00 02 C4 0B
Device address(HEX):01
Function Code(HEX):03
Addr(HEX):00 00
Data length(HEX):00 02
Data(HEX):――
CRC (HEX):C4 0B
Return Code(HEX):01 03 02 40 A0 00 00 67 D1
Device address(HEX):01
Function Code(HEX):13
Addr(HEX):--
Data length(HEX):02
Data(HEX):40 A0 00 00
CRC (HEX):HEX 67 D1
Data Format
IEEE754 Standard single-precision floating point, By the a sign-bit and 8-bit code and 23 mantissa order form,Expressed with four hexadecimal. Such as 124.75 as hexadecimal 42 F9 80 00. Calculated:
124.75 to Binary 1111100.11
Scientific notation 1.11110011*2^6
characteristic 6+127=133, And use 0 Express Positive number,and use 1 Express Negative number。Therefore, the binary number 124.75:
0 10000101 11110011000000000000000B=42F98000H
CRC Cyclic Redundancy Check