PDA

View Full Version : Disable Groups Until .....


damok
10 Jun 08, 06:35 PM
Hi all,


I have a situation where I need to disable some channels or groups on a relay after a power failure to prevent overloading a backup power supply. I was wondering if there is any way of writing logic to prevent groups turning on until a condition is met. At the moment I can turn groups off upon power failure, however I can't nut out a way to keep them off until the mains power is present. For instance, I would like the logic to prevent switches and touch screens from turning certain groups on / off whilst in ups mode. I can't use an area address as I still require some channels to operate. At the moment any logic I've written goes into a continuous loop and fails to compile. Does anyone know of a way of writing logic with the following idea?


once (GetLightingState("Mains Power Present") = OFF) then
begin;
SetLightingState("Alfresco - 2 x wall lights", OFF); UNTIL MAINS POWER PRESENT
SetLightingState("Alfresco - 3 x downlights (2)", OFF); UNTIL MAINS POWER PRESENT
SetLightingState("Alfresco - 3 x downlights (1)", OFF); UNTIL MAINS POWER PRESENT
end;

If anyone could please throw me some ideas I'd be very greatfull.

Regards,
Damon

Mr Mark
10 Jun 08, 08:00 PM
Hello Damon.

Try using the logic on the output channels of the relay or dimmer.
On the logic tab of the relay use "MAINS POWER PRESENT" in one of the logic groups and tick the "And" radio button down the bottom.

This way you need "MAINS POWER PRESENT" plus "Alfresco 1", "Alfresco 2" and "Alfresco 3" for these channels to come on. When there is no "MAINS POWER PRESENT" these channels won't come on. Note: the other channels will operate as per normal.

A picture is worth a thousand words, so have a look at the attached...

Regards,

Mark

brett_lynn
10 Jun 08, 09:28 PM
Hello Damon.

Try using the logic on the output channels of the relay or dimmer.
On the logic tab of the relay use "MAINS POWER PRESENT" in one of the logic groups and tick the "And" radio button down the bottom.

This way you need "MAINS POWER PRESENT" plus "Alfresco 1", "Alfresco 2" and "Alfresco 3" for these channels to come on. When there is no "MAINS POWER PRESENT" these channels won't come on. Note: the other channels will operate as per normal.

A picture is worth a thousand words, so have a look at the attached...

Regards,

Mark


Love the 'KISS' theory - always works best

Just one note to add to the above...
the group address "mains power present" will need to reside in an input unit, i.e 4 ch bus coupler (5104bcl) etc
connect this input unit to a VOLTAGE FREE contact from a standard SPST relay (use the N/C contact) which when the mains fails the relay will open circuit, breaking the contact and setting group address "mains power fail" to off...

Once normal mains resume... the relay will close, making the circuit and setting the G/A "Mains Power Fail" to on...



Cheers

damok
11 Jun 08, 10:58 PM
Hi All,

Thankyou for your suggestions. I was trying to see if it was possible to write code in logic rather than using relay logic. As it stands, the suggestions posted is what I already have in place using a GI unit to monitor the mains power. I was trying to replicate the same functionality in logic, to teach myself other ways of programming. If anyone knows of a way of doing this without sending commands every loop cycle I would be pleased to hear from you.

Regards,
Damon

NickD
12 Jun 08, 10:32 AM
At the moment any logic I've written goes into a continuous loop and fails to compile. Does anyone know of a way of writing logic with the following idea?

once (GetLightingState("Mains Power Present") = OFF) then
begin;
SetLightingState("Alfresco - 2 x wall lights", OFF); UNTIL MAINS POWER PRESENT
SetLightingState("Alfresco - 3 x downlights (2)", OFF); UNTIL MAINS POWER PRESENT
SetLightingState("Alfresco - 3 x downlights (1)", OFF); UNTIL MAINS POWER PRESENT
end;

Perhaps I'm missing something..

You say it goes into an endless loop, but also that it fails to compile... I don't think it can do both?

The above wouldn't compile because you have a semicolon after the first "begin".

I don't see why something like :


once (GetLightingState("Mains Power Present") = OFF)
begin
{turn things off}
end;

once (GetLightingState("Mains Power Present") = ON)
begin
{turn them on again}
end;

wouldn't work.

Nick

PS : brett_lynn : you stole my avatar!