create a "Toggle" button from LM - 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: create a "Toggle" button from LM (/showthread.php?tid=880) |
create a "Toggle" button from LM - duvelken - 02.07.2017 Hi, i'm trying to get my LM to work together with my PLC. So far, communication and mapping for status works fine. in my plc i got a toggle function for my real life push buttons. now i want to also write to the plc from my LM but the basis touch UI give a 0 or a 1 and does nog toggle so i can't interoperate between smartphone/physical buttons. any ideas how to fix this ? make "toggle" buttons in LM or try something else. thx RE: create a "Toggle" button from LM - Erwin van der Zwart - 02.07.2017 Hi, By default the button is a toggle button, only when you enter a fixed value it will send 0 or 1. BR, Erwin RE: create a "Toggle" button from LM - duvelken - 02.07.2017 hi erwin, i think i might do something wrong, what i did: - map 1 bool for the button, knx address 1/1/1 to modbus - map 1 status for the feedback of the bulb to 2/2/2 in logicmachine i went to visualisation, added 1 new object, main 1/1/1 en status 2/2/2 1/1/1 = type switch 2/2/2 = type bool when i use my phone and click on the button the first time, 1/1/1 goes to "on", the feedback of the bulb works an my icon lits up. but 1/1/1 stays "on" and i can't change it again. any idea whats wrong ? RE: create a "Toggle" button from LM - Erwin van der Zwart - 02.07.2017 Hi, Should work like that.. Can you add a event script to 1/1/1 and add: log(event.getvalue()) to it and switch a few times? I wunder if the value is send like it should and that something on the modbus side goes wrong. BR, Erwin RE: create a "Toggle" button from LM - duvelken - 02.07.2017 Hey Ewin, it goes on the first time and afterwards i only get the "off" value written in the logs to reply on my own post, i think i got the misunderstanding. the visu button is a toggle on its own. while i'm doing the toggle in my PLC. so i just need the "push", not the "toggle" .... RE: create a "Toggle" button from LM - Erwin van der Zwart - 02.07.2017 Hi, You might want to only send 1 by using 'send fixed value' and set it to 1 on the vis object, or if you use the new FW you can now set the button as a 'doorbell' by using the visparams on the object, select type start/stop for sending 1 on press and 0 on release or stop/start for sending a 0 on press and a 1 on release. BR, Erwin |