<
From version < 33.2 >
edited by Karry Zhuang
on 2024/07/19 16:12
To version < 34.2 >
edited by Karry Zhuang
on 2024/07/19 16:31
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -566,43 +566,80 @@
566 566  
567 567  == 4.6 RS485 Commands ==
568 568  
569 +RS485 signaldefault address 0x14
570 +Standard Modbus-RTU protocol, baud rate: 9600; check bit: none; data bit: 8; stop bit: 1
571 +
569 569  === 4.6.1 Query address ===
570 570  
571 571  send
572 572  
573 573  (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:599.333px" %)
574 -|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Original address|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Function code|=(% style="width: 64px; background-color: rgb(79, 129, 189); color: white;" %)Address high|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Address low|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Quantity high|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Quantity low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
575 -|(% style="width:99px" %)0XFE |(% style="width:72px" %)0X03|(% style="width:64px" %)0X00|(% style="width:68px" %)0X50|(% style="width:70px" %)0X00|(% style="width:72px" %)0X00|(% style="width:56px" %)0X51|(% style="width:56px" %)0XD4
577 +|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Original address|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Function code|=(% style="width: 64px; background-color: rgb(79, 129, 189); color: white;" %)Register address high|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Register address low|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Register length high|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Register length low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
578 +|(% style="width:99px" %)0XFF|(% style="width:72px" %)0X03|(% style="width:64px" %)0X00|(% style="width:68px" %)0X0A|(% style="width:70px" %)0X00|(% style="width:72px" %)0X02|(% style="width:56px" %)0XF1|(% style="width:56px" %)0XD7
576 576  
577 -If you forget the original address of the sensor, you can use the broadcast address 0XFE instead. When using 0XFE, the host can only connect to one slave, which can be used as a method of address query.
580 +If you forget the original address of the sensor, you can use the broadcast address 0XFF instead. When using 0XFE, the host can only connect to one slave, which can be used as a method of address query.
578 578  
579 579  
580 580  response
581 581  
582 -(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:561.333px" %)
583 -|=(% style="width: 50px;background-color:#4F81BD;color:white" %)New address|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Function code|=(% style="width: 106px; background-color: rgb(79, 129, 189); color: white;" %)Data length|=(% style="width: 93px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 104px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
584 -|(% style="width:99px" %)0X01|(% style="width:112px" %)0X03|(% style="width:106px" %)0X00|(% style="width:93px" %)0X20|(% style="width:104px" %)0XF0
585 +Register 0 data high and register 0 data low indicate the actual address of the sensor: 1
586 +Register 1 data high and register 1 data low indicate the sensor version
585 585  
588 +(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:599.333px" %)
589 +|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Function code|=(% style="width: 64px; background-color: rgb(79, 129, 189); color: white;" %)Data length|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Register 0 Data high|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Register 0 Data low|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Register 1 Data high|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Register 1 Data low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
590 +|(% style="width:99px" %)0XFF|(% style="width:72px" %)0X03|(% style="width:64px" %)0X04|(% style="width:68px" %)0X00|(% style="width:70px" %)0X01|(% style="width:72px" %)0X00|(% style="width:56px" %)0X00|(% style="width:56px" %)0XB4|(% style="width:56px" %)0X3C
591 +
586 586  === 4.6.2 Change address ===
587 587  
588 -For example: Change the address of the sensor with address 1 to 2, master → slave
594 +For example: Change the address of the sensor with address 1 to 2(address range: 1-119), master → slave
589 589  
590 590  (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:907.333px" %)
591 591  |=(% style="width: 67px; background-color: rgb(79, 129, 189); color: white;" %)Original address|=(% style="width: 71px; background-color: rgb(79, 129, 189); color: white;" %)Function code|=(% style="width: 65px; background-color: rgb(79, 129, 189); color: white;" %)Starting register address high|=(% style="width: 65px; background-color: rgb(79, 129, 189); color: white;" %)Starting register address low|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Register length high|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Register length low|=(% style="width: 53px; background-color: rgb(79, 129, 189); color: white;" %)Data length|=(% style="width: 53px; background-color: rgb(79, 129, 189); color: white;" %)Start address high|=(% style="width: 53px; background-color: rgb(79, 129, 189); color: white;" %)Start address low|=(% style="width: 53px; background-color: rgb(79, 129, 189); color: white;" %)Sensor version|=(% style="width: 53px; background-color: rgb(79, 129, 189); color: white;" %)Sensor version|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low
592 592  |(% style="width:67px" %)0X01|(% style="width:71px" %)0X10|(% style="width:65px" %)0X00|(% style="width:65px" %)0X0A|(% style="width:70px" %)0X00|(% style="width:72px" %)0X02|(% style="width:53px" %)0X04|(% style="width:53px" %)0X00|(% style="width:72px" %)0X02|(% style="width:53px" %)0X00|(% style="width:53px" %)0X00|(% style="width:56px" %)0XD2|(% style="width:53px" %)0X10
593 593  
594 -=== 4.6.2 Query data ===
600 +response
595 595  
602 +(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:599.333px" %)
603 +|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Function code|=(% style="width: 64px; background-color: rgb(79, 129, 189); color: white;" %)Starting register address high|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Starting register address low|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Register length high|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Register length low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
604 +|(% style="width:99px" %)0X01|(% style="width:72px" %)0X10|(% style="width:64px" %)0X00|(% style="width:68px" %)0X0A|(% style="width:70px" %)0X00|(% style="width:72px" %)0X02|(% style="width:56px" %)0X61|(% style="width:56px" %)0XCA
596 596  
597 -The address of the dissolved oxygen sensor is 14
606 +=== 4.6.3 Query data ===
598 598  
599 -The query data command is 14 03 00 14 00 01 C6 CB
600 600  
609 +Query the data (dissolved oxygen) of the sensor (address 14), host → slave
610 +
611 +(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:599.333px" %)
612 +|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Function code|=(% style="width: 64px; background-color: rgb(79, 129, 189); color: white;" %)Starting register address high|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Starting register address low|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Register length high|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Register length low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
613 +|(% style="width:99px" %)0X14|(% style="width:72px" %)0X03|(% style="width:64px" %)0X00|(% style="width:68px" %)0X14|(% style="width:70px" %)0X00|(% style="width:72px" %)0X01|(% style="width:56px" %)0XC6|(% style="width:56px" %)0XCB
614 +
615 +If the sensor receives correctly, the following data will be returned, slave → host
616 +
617 +(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:599.333px" %)
618 +|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Function code|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Data length|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Register 0 Data high|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Register 0 Data low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
619 +|(% style="width:99px" %)0X14|(% style="width:72px" %)0X03|(% style="width:68px" %)0X02|(% style="width:70px" %)0X03|(% style="width:72px" %)0X78|(% style="width:56px" %)0XB5|(% style="width:56px" %)0X55
620 +
601 601  After the query, 7 bytes will be returned. For example, the returned data is 14 03 02 (% style="color:red" %)**03 78**(%%) B5 55. 03 78 is the value of dissolved oxygen.
602 602  
603 603  Converted to decimal, it is 888. Add two decimal places to get the actual value. 03 78 means the current dissolved oxygen is 8.88mg/L
604 604  
605 605  
626 +Query the data (temperature) of the sensor (address 14), host → slave
627 +
628 +(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:599.333px" %)
629 +|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Function code|=(% style="width: 64px; background-color: rgb(79, 129, 189); color: white;" %)Starting register address high|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Starting register address low|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Register length high|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Register length low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
630 +|(% style="width:99px" %)0X14|(% style="width:72px" %)0X03|(% style="width:64px" %)0X00|(% style="width:68px" %)0X11|(% style="width:70px" %)0X00|(% style="width:72px" %)0X01|(% style="width:56px" %)0XD6|(% style="width:56px" %)0XCA
631 +
632 +If the sensor receives correctly, the following data will be returned, slave → host
633 +
634 +(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:599.333px" %)
635 +|=(% style="width: 50px;background-color:#4F81BD;color:white" %)Address|=(% style="width: 72px; background-color: rgb(79, 129, 189); color: white;" %)Function code|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Data length|=(% style="width: 68px; background-color: rgb(79, 129, 189); color: white;" %)Register 0 Data high|=(% style="width: 70px; background-color: rgb(79, 129, 189); color: white;" %)Register 0 Data low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 low|=(% style="width: 56px; background-color: rgb(79, 129, 189); color: white;" %)CRC16 high
636 +|(% style="width:99px" %)0X14|(% style="width:72px" %)0X03|(% style="width:68px" %)0X02|(% style="width:70px" %)0X09|(% style="width:72px" %)0XA4|(% style="width:56px" %)0XB2|(% style="width:56px" %)0X6C
637 +
638 +After the query, 7 bytes will be returned. For example, the returned data is 14 03 02 (% style="color:red" %)**09 A4**(%%) B2 6C. 03 78 is the value of dissolved oxygen temperature.
639 +
640 +Converted to decimal, it is 2468. Add two decimal places to get the actual value. 09 A4 means the current dissolved oxygen temperature is 24.68℃
641 +
642 +
606 606  = 5. DR-TS1 Water Turbidity Sensor =
607 607  
608 608  
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0