MODBUS-RTU COMMREQ:
Modbus RTU order:
Function code: 05 relay output[control relay ON/Off]
Function code: 06 data storage[Customize data storage]
Baud rate: 9600 8 none1
16 system send
16 system receive
Operation steps:
(Communications equipment used address,default is 01)
/*******************************************************************/
Set the address:09
01 10 00 00 00 01 02 00 09 66 56//address 01 modified 09
Set the address:01
01 10 00 00 00 01 02 00 01 66 56// modified 01
read of address
00 03 00 00 00 01 85 db
return:
00 03 02 00 01 44 44 //01 is address
/*******************************************************************/
/*******************************************************************/
Each byte meaning:
[No.1 adress]
//--------------------------------------------
No.1 relay ON : 01 05 00 01 01 00 9d 9a
Byte 1: Address
Byte 2: Funtion code
Byte 3 4:Register address
Byte 5 6:Register data
Byte 7 8:CRC verify
//==============================================================
[No.1 adress]
//--------------------------------------------
No.0 relay ON : 01 05 00 00 FF 00 8C 3A
No.0 relay Off : 01 05 00 00 00 00 CD CA
//--------------------------------------------
No.0 relay ON : 01 05 00 01 FF 00 DD FA
No.0 relay Off : 01 05 00 01 00 00 9C 0A
//-------------------------------------------
No.2 relay ON : 01 05 00 02 FF 00 2D FA
No.2 relay Off : 01 05 00 02 00 00 6C 0A
//-------------------------------------------
No.3 relay ON : 01 05 00 03 FF 00 7C 3A
No.3 relay Off : 01 05 00 03 00 00 3D CA
//-------------------------------------------
No.4 relay ON : 01 05 00 04 FF 00 CD FB
No.4 relay Off : 01 05 00 04 00 00 8C 0B
//--------------------------------------------
No.5 relay ON : 01 05 00 05 FF 00 9C 3B
No.0 relay Off : 01 05 00 05 00 00 DD CB
//-------------------------------------------
No.6 relay ON : 01 05 00 06 FF 00 6C 3B
No.6 relay Off : 01 05 00 06 00 00 2D CB
//-------------------------------------------
No.7 relay ON : 01 05 00 07 FF 00 3D FB
No.6 relay Off : 01 05 00 07 00 00 7C 0B
//-------------------------------------------
//=============================================================
All dark: 01 0F 00 00 00 08 01 00 FE 95
All bright: 01 0F 00 00 00 08 01 FF BE D5
/**********************************************************************/
/*********************************************************************/
read all ports input state
Send:01 02 00 00 00 08 79 CC //read 8 input state
Return:01 02 01 00 A1 88