Logic Machine Forum
Temporary overwrite a scheduler - 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: Temporary overwrite a scheduler (/showthread.php?tid=4978)



Temporary overwrite a scheduler - Joep - 20.09.2023

Hi alll,

I want to overwrite a scheduler temporary with a preferred value for some time. And when my event value return false again the scheduler should work as normal at that given time point. How can i do that?

Code:
value = event.getvalue()

if value == true then
  --overwrite the scheduler object
else
  --switch the object back following the scheduler
end

Thanks in advance for the help.


RE: Temporary overwrite a scheduler - Daniel - 20.09.2023

Why don't you just disable the scheduler by using object, override the output value and enable and write what you want.


RE: Temporary overwrite a scheduler - Joep - 20.09.2023

(20.09.2023, 13:01)Daniel Wrote: Why don't you just disable the scheduler by using object, override the output value and disable and write what you want.

Good idea but does the scheduler send the corresponding value direct after the schedelur is enabled again? Or does it just send when reached the next scheduled time again?


RE: Temporary overwrite a scheduler - Daniel - 20.09.2023

it sends when the event occurs


RE: Temporary overwrite a scheduler - Joep - 20.09.2023

(20.09.2023, 13:06)Daniel Wrote: it sends when the event occurs

Thanks, will do it this way. Much easier Smile


RE: Temporary overwrite a scheduler - Erwin van der Zwart - 20.09.2023

Just use a bit of logic in the middle, create an event script on a TAG that is connected to your scheduler and override..
Code:
schedulerstate = grp.getvalue('10/0/0')
overridestate = grp.getvalue('10/0/1')
if overridestate == true then
  grp.checkwrite('10/0/2', overridestate)
else
  grp.checkwrite('10/0/2', schedulerstate)
end



RE: Temporary overwrite a scheduler - Joep - 20.09.2023

Just to be sure.. On/off object of the scheduler.

ON = scheduler active and OFF = scheduler inactive ?
Or is it ON = scheduler locked and OFF = scheduler unlocked ?


RE: Temporary overwrite a scheduler - Daniel - 20.09.2023

1 is enabled, 0 disabled.


RE: Temporary overwrite a scheduler - Joep - 20.09.2023

(20.09.2023, 13:22)Daniel Wrote: 1 is enabled, 0 disabled.

Huh 1 is scheduler enabled you mean?

my autistic brain gets confused because a time clock without this object attached has the value 0 and still works. Now we need to send the value 1 for this to work..


RE: Temporary overwrite a scheduler - Daniel - 20.09.2023

Yes, nothing will change till you send a value to this object, scheduler will not read it.