Modbus protokoll rs485: Difference between revisions

From Chaosdorf Wiki
Jump to navigation Jump to search
Line 124: Line 124:


Baud Rate: 9600 8 NONE 1
Baud Rate: 9600 8 NONE 1
{| class="wikitable"
|-
! Hex Byte  !! Funktion 
|-
| 00 06 40 00 00 01 5c 1b  || Setting address is: 01
|-
| 00 06 40 00 00 02 1c 1a  || Setting address is: 02
|-
| 00 03 40 00 00 01 90 1b  || Read address
|-
|                          || Read the software version
|-
| 00 03 00 04 00 01 c4 1a ||  [month] broadcast read (only by one device to address all practical, easy to test)
|-
|  ||Read the hardware version (PCB version)
|-
| 00 03 00 04 00 01 c4 1a ||  broadcast read (only by one device to address all practical, easy to test)
|-
|}
<br>
https://hacktronics.co.in/4-channel-relay-module/4-channel-relay-module-programmable-w-opto-isolated-rs485-stm8s103f3

Revision as of 22:48, 4 December 2019

Modbus Rtu 2

Hardware Resources:

 *   RS485 communication interface
 *   TTL communication interface
 *   2 optocoupler isolation input
 *   2 way optocoupler isolation output
 *   A user button
 *   A user LED
 *   A power indicator
 *   A STM32F030F4 microcontroller
 *   2 relay status indicators LED lights
 *   Power supply terminal interface (12V power supply)


Modbus RTU Instructions:

Baud rate: 9600 8 NONE 1

Hexadecimal send
hexadecimal receive

Operation steps:
1. Software settings communication baud rate
2. Set the address (communication using the device address, the default address is 01)

Set the address from 01 to 09 or from Broadcast to 09

Hex Byte Funktion
01 10 00 00 00 01 02 00 09 66 56 Current address 01 is changed to 09
00 10 00 00 00 01 02 00 09 6B C6 Broadcast Address Modified to 09



Read Address

Hex Byte Funktion
00 03 00 00 00 01 85 db Send to Device
00 03 02 00 01 44 44 Receive from Device 01 for Address

Meaning of each byte:

Byte 1: address
byte 2: function
byte 3 4: register address
byte 5 6: register data
byte 7 8: CRC check


[address 1]

Hex Byte Funktion
01 05 00 00 FF 00 8C 3A 0 relay ON
01 05 00 00 00 00 CD CA 0 relay off
01 05 00 01 FF 00 DD FA No. 1 relay ON
01 05 00 01 00 00 9C 0A No. 1 relay off
01 05 00 02 FF 00 2D FA No. 2 relay ON
01 05 00 02 00 00 6C 0A No. 2 relay off
01 0F 00 00 00 08 01 00 FE 95 Full off
01 0F 00 00 00 08 01 FF BE D5 all bright
01 01 00 00 00 08 3D CC Send : Read all relay states
01 01 01 00 51 88 Return : Relay fully closed
01 01 01 03 11 89 Return : All relays are on
01 02 00 00 00 08 79 CC Send : Read all input switch status
01 02 01 00 A1 88 Return : 8 input states

Modbus Rtu 4

Specifications:

 *   RS485 communication interface
 *   TTL communication interface
 *   4 optocoupler isolation input
 *   4 way optocoupler isolation output
 *   A user button
 *   A user LED
 *   A power indicator
 *   A STM32F030F4 microcontroller
 *   4 relay status indicators LED lights
 *   Power supply terminal interface (12V power supply)


Modbus RTU command

Baud Rate: 9600 8 NONE 1

Hex Byte Funktion
00 06 40 00 00 01 5c 1b Setting address is: 01
00 06 40 00 00 02 1c 1a Setting address is: 02
00 03 40 00 00 01 90 1b Read address
Read the software version
00 03 00 04 00 01 c4 1a [month] broadcast read (only by one device to address all practical, easy to test)
Read the hardware version (PCB version)
00 03 00 04 00 01 c4 1a broadcast read (only by one device to address all practical, easy to test)



https://hacktronics.co.in/4-channel-relay-module/4-channel-relay-module-programmable-w-opto-isolated-rs485-stm8s103f3