This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus one register to two objects
#1
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.
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
Reply
#2
0xFF00 and 0x00FF, don't forget to add "write_bitmask": true
Reply
#3
(15.11.2022, 09:21)admin Wrote: 0xFF00 and 0x00FF, don't forget to add "write_bitmask": true

The mask 0xFF00 and 0x00FF, what should I write it in?
Reply
#4
See this example of bit-mask use
https://forum.logicmachine.net/showthrea...7#pid28317
------------------------------
Ctrl+F5
Reply
#5
(17.11.2022, 13:01)Daniel Wrote: See this example of bit-mask use
https://forum.logicmachine.net/showthrea...317#pid283
Thanks!
Reply


Forum Jump: