Posts: 94
Threads: 29
Joined: Nov 2020
Reputation:
1
24.02.2021, 10:38
(This post was last modified: 24.02.2021, 10:41 by Kilogica.)
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.
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
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)
Posts: 94
Threads: 29
Joined: Nov 2020
Reputation:
1
Posts: 306
Threads: 59
Joined: Dec 2019
Reputation:
13
(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
Posts: 28
Threads: 9
Joined: Nov 2017
Reputation:
0
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 !
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
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
Posts: 28
Threads: 9
Joined: Nov 2017
Reputation:
0
(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
|