15.11.2022, 08:57
Hello,
I need to split a modbus register to control two lamps on one register. i guess i need to put a bitmask on but i'm not sure what it should be. I am attaching the registry table.
I need to split a modbus register to control two lamps on one register. i guess i need to put a bitmask on but i'm not sure what it should be. I am attaching the registry table.
Code:
Address High byte Low byte
00H Channel No.1 output value Channel No.2 output value
01H Channel No.3 output value Channel No.4 output value
02H Channel No.1 control register Channel No.2 control register
03H Channel No.3 control register Channel No.4 control register
200H Device ID Connect register
201H Switch delay register Smooth register
202H Reserve Reserve
203H Reserve Reserve
204H Reserve Reserve
205H Reserve Reserve
206H Switch No.1 click value. Switch No.2 click value.
207H Switch No.3 click value. Switch No.4 click value.
208H Channel No.1 power on value Channel No.2 power on value
209H Channel No.3 power on value Channel No.4 power on value
Set channel No.1 output value is 0(off), channel No.2 output value is 32(50%)
Send: 60 06 00 00 00 20 80 63
Ans: 60 06 00 00 00 20 80 63
Set channel No.1 output value is 63(100%). Channel No.2 output value is unchanged.
Send: 60 06 00 00 3F FF D0 0B
Ans: 60 06 00 00 3F FF D0 0B
Get Channel 1-4 output value
Send: 60 03 00 00 00 02 CC 7A
Ans: 60 03 04 3F 20 00 00 87 2B