This is an upgrade of a normal AC socket outlet, which empowers the user to customize the AC outlet through RS485 series. Serial communication control can include multiple AC sockets, have them serial connected in the same RS485 main bus, can be applied to a typical industrial application scenario. Let's break it down a little bit, start with the bottom part.
Resources | Parameter |
---|---|
Net weight | 120g |
Gross weight | 158g |
Product Size | 52*52*60mm |
Package Size | 72*102*72mm |
EasyLoader is a concise and fast program writer, which has a built-in case program related to the product. It can be burned to the main control by simple steps to perform a series of function verification.
Please click here to download Arduino code
-1. Communication adopts RS485, 1 start bit + 8 data bits + 1 end bit -2. The baud rate is 9600 -3. The Device ID defaults to AAH -4. Address 00H is the broadcast address, and there is no reply from the slave
Host sends:
AA 05 00 00 FF 00 95 E1
(closed coil)
AA 05 00 00 00 00 D4 11
(disconnect coil)
Send content | Number of bytes | Send message | Remarks |
---|---|---|---|
Module address | 1 | AAH | 00H is the broadcast address |
Function code | 1 | 05H | Write a single coil |
Start register address | 2 | 0000H | Coil 0 address |
Write data | 2 | FF00H | FF00H: means the coil is closed |
CRC check | 2 | XXXXH | CRC code (CRC16) of all previous data |
Slave machine answer:
The operation returns the original data successfully:
AA 05 00 00 FF 00 95 E1
Operation failure return:
AA 85 error code CRC_L CRC_H
Host sends:
AA 01 00 00 00 01 E4 11
Send content | Number of bytes | Send message | Remarks |
---|---|---|---|
Module address | 1 | AAH | 00H is the broadcast address |
Function code | 1 | 01H | Reading coil |
Start register address | 2 | 0000H | Coil 0 address |
Read the quantity | 2 | 0001H | Can only be 0001H |
CRC check | 2 | XXXXH | CRC code (CRC16) of all previous data |
Slave machine answer:
Operation returned successfully:
Address | Function code | Return data length | Coil status | CRC_L | CRC_H |
---|---|---|---|---|---|
AA | 01 | 01 | 01 | B0 | 6C |
Coil status: 01H -> coil closed
/ 00H -> coil open
Operation failure return: AA 81 error code CRC_L CRC_H
Host sends:
AA 41 00 00 00 12 A4 13
Send content | Number of bytes | Send message | Remarks |
---|---|---|---|
Module address | 1 | AAH | 00H is the broadcast address |
Function code | 1 | 41H | Set module address |
Start register address | 2 | 0000H | Address |
Module new address | 1 | 12H | 1 byte |
CRC check | 2 | XXXXH | CRC code (CRC16) of all previous data |
Slave machine answer:
The operation returns the original data successfully:
AA 41 00 00 00 12 A4 13
Operation failure return:
AA C1 error code CRC_L CRC_H
Host sends:
00 42 00 00 A0 30
Send content | Number of bytes | Send message | Remarks |
---|---|---|---|
Broadcast address | 1 | 00H | 00H is the broadcast address |
Function code | 1 | 42H | Restore the address as AAH |
Start register address | 2 | 0000H | Address |
CRC check | 2 | XXXXH | CRC code (CRC16) of all previous data |
Slave machine answer: No