Logic Machine Forum
Hadling TAG change via script - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Hadling TAG change via script (/showthread.php?tid=5305)



Hadling TAG change via script - emme - 16.03.2024

Hi to all

I've seen tha using localbus library in scripting you can monitor and handling telegrams eventĀ 

I'm wondering if there is a way to trigger a code in case a tag has been added/removed (a specific tag in my intentions)


is there a way to know if a tag has been changed to an object and trigger a code?
thanks
ciao
M


RE: Hadling TAG change via script - Erwin van der Zwart - 16.03.2024

You could write current tags of an object into the storage and compare it every x period, but i wonder what use case it would serve..


RE: Hadling TAG change via script - emme - 16.03.2024

thanks...

I'm working on a "my way" to mqtt in whitch the reference table is dinamically generated using tags (and using object comment field with some more configuration JSON)

In my intention... by simply add and remove tag, the script will autoadapt.

I achieved this, but got issues with the subscriptions of topics, I do need to stop and restart the script to subscrition to take effect...

I'll try the way to run a job that would compare with a storage... will see what would happend Big Grin

thanks
ciao
M


RE: Hadling TAG change via script - admin - 18.03.2024

localbus has a reload event that is triggered when object properties are modified, either from UI or from scripts.