PDA

View Full Version : Retrig Timer


Memphix
18 Dec 06, 01:14 PM
I need to imitate a retrig timer in logic... am I missing that command or do I need to write logic to imitate it? :confused:

Memphix
18 Dec 06, 01:39 PM
This is the logic I'm using:

once (GetLightingState("XXX") = ON) then
begin
TimerSet(1, 0);
TimerStart(1);
SetLightingLevel("Light", 100%, "0s");
end;

once (TimerTime(1)="0:01:00") then
begin
SetLightingLevel("Light", 0%, "0s");
end;

------------------------------------------
XXX: is the trigger (not an adult shop)
Light: is the light turned on

Darren
18 Dec 06, 04:07 PM
I need to imitate a retrig timer in logic... am I missing that command or do I need to write logic to imitate it? :confused:
A C-Bus component can be a toggle timer or a re-triggerable timer. What are you wanting to do ?

Memphix
19 Dec 06, 12:07 PM
The touch screen logic is triggered from the AUX input unit which needs to turn lights on for 1 minute.

Thought there might of been a simple command in the logic.

There are two inputs, which led me to using this code:

once (GetLightingState("Input1") = ON) then
begin
TimerStop(1);
SetLightingLevel("Light", 100%, "0s");
end;

once (GetLightingState("Input2") = ON) then
begin
TimerStop(1);
SetLightingLevel("Light", 100%, "0s");
end;

once (GetLightingState("Input1") = OFF) and
(GetLightingState("Input2") = OFF) then
begin
TimerStart(1);
end;

once (TimerTime(1)="0:0:10") then
begin
SetLightingLevel("Light", 0%, "0s");
TimerStop(1);
end;

Phil.H
19 Dec 06, 07:17 PM
Thought there might of been a simple command in the logic.


You guys are getting spoilt ;)

PS. You could reduce your code by having your two inputs covered in an "or" statement that would reduce all that code, then again I wonder why Darren hasn't come up with a simple timer utility. And to think I was going to vote for Darren for Prime Minister at one stage... ;)

Darren
20 Dec 06, 09:07 AM
It looks from the code like you are implementing something equivalent to a "corridor linking" function where if any of the controlling lights go on, then the "corridor" light goes on. When they all go off, there is a delay before the corridor light goes off.

I wonder why Darren hasn't come up with a simple timer utility.
If I have understood your requirements properly, you can use the PulseCBusLevel command to do what you want :


once (GetLightingState("Input1") = ON) or (GetLightingState("Input2") = ON) then
begin
SetLightingLevel("Light", 100%, "0s");
end;

once (GetLightingState("Input1") = OFF) and (GetLightingState("Input2") = OFF) then
begin
PulseCBusLevel("Local", "Lighting", "Light", 100%, "0s", "0:00:10", 0%);
end;


And to think I was going to vote for Darren for Prime Minister at one stage... ;)
Do I get your vote again now ? :D

Phil.H
20 Dec 06, 08:03 PM
Do I get your vote again now ? :D

No,,, because politicians are self interested dirtbags. You gave the world Once, stay true timer, and logic wizard arranged the way a couple clowns from NSW asked for (beginners in mind). I think you would be wasted as Prime Minister. :D