Logic Machine Forum
Updating multiple group adresses - 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: Updating multiple group adresses (/showthread.php?tid=3055)



Updating multiple group adresses - Tokatubs - 09.12.2020

Hi

I would like when i receive a value in one group address to be able use this value and send it to other group addresses. 
Like for example adress 1/1/1 sends value then i am able to update group 1/1/2 and 1/1/3 with the same value.

Anyone have an idea how to achive this?


RE: Updating multiple group adresses - admin - 10.12.2020

Attach an event script to 1/1/1. Make sure that all objects have the same datatype and check that no loops are produced by these scripts.
Code:
value = event.getvalue()
grp.write('1/1/2', value)
grp.write('1/1/3', value)



RE: Updating multiple group adresses - Tokatubs - 23.12.2020

This works great. But now client want delay in between the telegrams. Could it work to put a os.sleep function between.
Function i want is. Main telegram goes out. Then he want that second group adress gets the value and sends it with a delay og 3 seconds and then the last one with a delay of 10 sec after the main group sends its telegram.

Could this work?

value = event.getvalue()
grp.write('1/1/2', value)
os.sleep(3)

grp.write('1/1/3', value)
os.sleep(10)


RE: Updating multiple group adresses - Daniel - 23.12.2020

The delay should be before grp.write


RE: Updating multiple group adresses - Tokatubs - 23.12.2020

(10.12.2020, 06:27)admin Wrote: Attach an event script to 1/1/1. Make sure that all objects have the same datatype and check that no loops are produced by these scripts.
Code:
value = event.getvalue()
grp.write('1/1/2', value)
grp.write('1/1/3', value)

(23.12.2020, 10:37)Daniel. Wrote: The delay should be before grp.write
Thanks alot.