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.

Handle 10 bytes data
#1
Hello everyone,

I have to send a 10 bytes value to an object (it's a blumotix access control system) with a W4K, but I can't find a way to write directly on knx bus, is it possible?

I tried to search but I wasn't able to find anything useful

For examble I have to send $12 $34 $56 $00 $00 $00 $00 $00 $00 $80 to the address 5/4/0, how can I?

Many thanks in advance for the help.
Reply
#2
Use dt.raw datatype to send raw data as is:
Code:
value = string.char(0x12, 0x34, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80)
grp.write('5/4/0', value, dt.raw)
Reply
#3
It works, thanks!
Reply
#4
(24.02.2021, 10:42)admin Wrote: Use dt.raw datatype to send raw data as is:
Code:
value = string.char(0x12, 0x34, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80)
grp.write('5/4/0', value, dt.raw)

Thanks
Reply
#5
Good afternoon,

Can you think of a way to give the client a text field (or 6 different fields since the password is 6 digits) to fill in those 10bytes?

This Blumotix device (see attached manufacturer's information for the 10byte object) works with 6 digit keys in 10byte format, the last byte determines whether you write or delete the key.

The idea is to set up a visualisation so that the client can write the key every time he wants to change it and with a button we can write correctly on the device.

Thank you in advance for your help,

Greetings !

   
Reply
#6
Event script for the code object. Use 250 byte string object. Code format is 6 numbers, everything else will be ignored.
Code:
value = event.getvalue()

-- code format is 6 numbers
if #value == 6 and value:match('^%d+$') then
  b1 = tonumber(value:sub(1, 2), 16)
  b2 = tonumber(value:sub(3, 4), 16)
  b3 = tonumber(value:sub(5, 6), 16)

  req = string.char(b1, b2, b3, 0, 0, 0, 0, 0, 0, 0x80)
  grp.write('5/4/0', req, dt.raw)
end
Reply
#7
(03.02.2022, 06:48)admin Wrote: Event script for the code object. Use 250 byte string object. Code format is 6 numbers, everything else will be ignored.
Code:
value = event.getvalue()

-- code format is 6 numbers
if #value == 6 and value:match('^%d+$') then
  b1 = tonumber(value:sub(1, 2), 16)
  b2 = tonumber(value:sub(3, 4), 16)
  b3 = tonumber(value:sub(5, 6), 16)

  req = string.char(b1, b2, b3, 0, 0, 0, 0, 0, 0, 0x80)
  grp.write('5/4/0', req, dt.raw)
end

works great, you are a crack!

thank you very much
Reply


Forum Jump: