This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Writing multiple group adresses with same value
#1
I am starting an project with loads of SIemens GD181 VAVs. 

Vnom, Vmin and Vmax needs to be written to group addresses. But lots of the Vavs have same values.
So before i write every value manually in ETS.

But is there a way to write this more easier from Lm5. For example if i add all with same Vnom and add them with same tag "Vnom315", could i then via an script write same value to all GA with this tag?
Reply
#2
(04.04.2021, 20:29)Tokatubs Wrote: I am starting an project with loads of SIemens GD181 VAVs. 

Vnom, Vmin and Vmax needs to be written to group addresses. But lots of the Vavs have same values.
So before i write every value manually in ETS.

But is there a way to write this more easier from Lm5. For example if i add all with same Vnom and add them with same tag "Vnom315", could i then via an script write same value to all GA with this tag?

Hi,
Yes this is very possible. If you need an example let me know and I'll dig one up Smile

(04.04.2021, 21:02)Seijboldt Wrote:
(04.04.2021, 20:29)Tokatubs Wrote: I am starting an project with loads of SIemens GD181 VAVs. 

Vnom, Vmin and Vmax needs to be written to group addresses. But lots of the Vavs have same values.
So before i write every value manually in ETS.

But is there a way to write this more easier from Lm5. For example if i add all with same Vnom and add them with same tag "Vnom315", could i then via an script write same value to all GA with this tag?

Hi,
Yes this is very possible. If you need an example let me know and I'll dig one up Smile


Here you go, you need to name your objects correctly though.
The code below searches for the name Vnom in any group object and writes the Value to it.

Code:
obj = db:getall('SELECT name FROM objects WHERE name LIKE "%Vnom%"')
Value=69
for _, addr in ipairs(obj) do
    grp.checkwrite(addr.name, Value, 1)
end
Reply
#3
Wow thanks alot. Whats the correct script to post this in, event, resident or ?
Reply
#4
(04.04.2021, 21:21)Tokatubs Wrote: Wow thanks alot. Whats the correct script to post this in, event, resident or ?

Event, you only want to run it when you need to.
Reply
#5
It's recommended to use tags instead of DB queries. You can attach an event script to an object that will write to all objects with Vnom tag. Make sure that this object does not have this tag otherwise you will get an infinite loop.
Code:
value = event.getvalue()
objects = grp.tag('Vnom')
objects:checkwrite(value)
Reply


Forum Jump: