Logic Machine Forum
Wiser - transfer string over BACnet IP - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Wiser - transfer string over BACnet IP (/showthread.php?tid=1996)



Wiser - transfer string over BACnet IP - ikirilov - 01.04.2019

Hello,
I have project with Wiser and I need to transfer error codes (written in the KNX bus - 14 byte ASCII string) over BACnet IP to the workstation. The problem is that Wiser does not support transfer of string characters over BACnet. The error codes are fixed - about 30, for example "7H-01", "BH-00", etc. I want to make script in the Wiser to code the string in some integer value and then transfer this value over BACnet.
I've tried to use string.match but I had no success. I will appreciate any suggestions how this could be achieved.


RE: Wiser - transfer string over BACnet IP - Erwin van der Zwart - 01.04.2019

Hi,

Just create a event based script on the KNX object and write a value to a virtual object and attach this script to it (now for 6 variable so you need to extend it):
Code:
value = event.getvalue()
if value == '7H-01' then
    grp.update('32/0/0', 1)
elseif value == 'BH-00' then
    grp.update('32/0/0', 2)
elseif value == 'BH-01' then
    grp.update('32/0/0', 3)
elseif value == 'BH-02' then
    grp.update('32/0/0', 4)
elseif value == 'BH-03' then
    grp.update('32/0/0', 5)
elseif value == 'BH-04' then
    grp.update('32/0/0', 6)
end

Inside the ES/AS you can create a trigger based script to decode them back to a string object.

BR,

Erwin