Logic Machine Forum
Multiple GA send on 3 times - 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: Multiple GA send on 3 times (/showthread.php?tid=5835)



Multiple GA send on 3 times - BMSimon - 13.01.2025

If I have 700 1-bit GA, when they switch state I need it to happen 3 times, with 1 sec delay, what is the easiest way of doing this?
We have some KNX relays that is partially defective, and this is a quick workaround to get this working before the manufacture and the customer finds out if all the relays needs to be exchanged.

Best regards

Simon


RE: Multiple GA send on 3 times - Daniel - 13.01.2025

Try this, Tag all your bit objects with a TAG and then create event based script triggered by your TAG.
As execution mode select Last instance and use this script

Code:
if event.sender ~= "se" then
    value = event.getvalue()
    os.sleep(1)
    grp.write(event.dst, value)
    os.sleep(1)
    grp.write(event.dst, value)
    os.sleep(1)
    grp.write(event.dst, value)
end



RE: Multiple GA send on 3 times - PolymorphedCust - 17.01.2025

I'm working with Simon on the project.
We've come to the solution that we want to make a script for each switch to make a script to check, whether the feedback is updated or not.

Something like this:
Code:
value = event.getvalue()


if value == false then
  revalue = true
elseif value == true then
  revalue = false
end

os.sleep(0.5)

FB = grp.getvalue('1/0/1')

if FB ~= value then
  grp.write('1/0/0', revalue)
  os.sleep(0.5)
  grp.write('1/0/0', value)
end

We do have 750 switch objects that we need to apply this script to. Is there a relative easy workaround with this?

And sorry for my straight forward scripting... Still learning Smile

Thanks!


RE: Multiple GA send on 3 times - Daniel - 17.01.2025

To use a global script on many objects you need some sort of repetitive relation between this group of objects, it can be by group address or by group name. In other word by knowing the input object (address or name) we need to create output object
What is the event object and what is the output.


RE: Multiple GA send on 3 times - PolymorphedCust - 17.01.2025

Like this, and it just keeps going for 750 pairs

T/S is switch and FB is feedback Smile


RE: Multiple GA send on 3 times - Daniel - 17.01.2025

Are you trying to flick over the switch if status is different or the other way around?


RE: Multiple GA send on 3 times - PolymorphedCust - 17.01.2025

In the case of:
- There is sent 1 to the switch.
- The feedback doesn't change from off to on
- I want to send 0 to the switch, then 1 to the switch, since that makes the feedback follow ( usually ).

Does that make sence?


RE: Multiple GA send on 3 times - Daniel - 17.01.2025

do you want to write it to the bus or just update object in LM?


RE: Multiple GA send on 3 times - Daniel - 17.01.2025

Tag all your switch (T/S) objects but not the status FB and create event script triggered by your tag.
Execution mode - Fist instance only
Code:
if event.sender ~= "se" then

value = event.getvalue()
status, found = string.gsub(grp.alias(event.dst), 'T/S', 'FB')


if grp.find(status) then
   
    if value ~= grp.getvalue(status) then
 
          os.sleep(0.5)
 
            grp.write(event.dst, not value) 
 
          os.sleep(0.5)
 
            grp.write(event.dst, value)
     
    end 
 
else
 
alert('Group address '..status ..' does not exist' )   
 
end 
 
end 
 



RE: Multiple GA send on 3 times - PolymorphedCust - 20.01.2025

Works like a charm! Thank you very much! Smile