Binary Encoder

117 views
Skip to first unread message

Viktor Granbom

unread,
Jan 2, 2018, 7:10:47 AM1/2/18
to Loxone English
Hi, has anyone written a binary decoder? I have a modbus register where i need to put time and date in different bits of a 16-bit register.

As an example i need to put day in bit 11-8 and month in bit 4-0.

Andrew B

unread,
Jan 2, 2018, 7:36:55 PM1/2/18
to Loxone English
Does it need any validation? How is the data coming in?

Viktor Granbom

unread,
Jan 3, 2018, 9:09:55 AM1/3/18
to loxone-...@googlegroups.com
Data is from Loxone Times and should be output to 4 x 16-bit modus registers.

Andrew B

unread,
Jan 3, 2018, 9:13:47 AM1/3/18
to Loxone English
I do a similar thing to build up 8-bit state bytes from eight binary inputs using the equation function block. A similar technique ought to work here. Failing that picoC can be used, of course.

Viktor Granbom

unread,
Jan 11, 2018, 2:11:09 PM1/11/18
to Loxone English
Hope that % modulo works in picoc. Otherwise I have to find a new code strategy.
Reply all
Reply to author
Forward
0 new messages