Mike Jones
22 Nov 10, 05:24 PM
Hi i am having some difficulty with this code it seems to work on the test page but has some trouble with the load chasing at non consistant times on site i have also attached .CTA and .CBZ file could some one give a a set of fresh eyes PLEASE!!
Once (GetLightingState("E&D PE Disable/Enable")= ON) Then {PE Disable/Enable}
begin
If (GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON) Then {Control Group in PE Cell 2}
SetLightingState("E&D Work Stations NW Perimeter", ON) {Actual Lighting Group}
end;
Once (GetLightingState("E&D PE Disable/Enable")= OFF)Then {PE Disable/Enable}
begin
SetLightingState("E&D Work Stations NW Perimeter", OFF) {Actual Lighting Group}
end;
{PE ON Control Switch}
Once (GetLightingState("E & D Perimeter NW 1")= ON) Then {Control Group in PE Cell 1}
begin
If (GetLightingState("E&D PE Disable/Enable")= ON) And {PE Disable/Enable}
((GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON)) Then {Control Group in PE Cell 2}
TimerSet(1,-1); {Timer Set to Stop}
SetLightingState("E&D Work Stations NW Perimeter", ON) {Actual Lighting Group}
end;
Once (GetLightingState("E & D Perimeter NW 2")= ON) Then {Control Group in PE Cell 2}
begin
If (GetLightingState("E&D PE Disable/Enable")= ON) And {PE Disable/Enable}
((GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON)) Then {Control Group in PE Cell 2}
TimerSet(1,-1); {Timer Set to Stop}
SetLightingState("E&D Work Stations NW Perimeter", ON) {Actual Lighting Group}
end;
Once (GetLightingState("E & D Perimeter NW 1")= ON) Then {Control Group in PE Cell 1}
begin
If (GetLightingState("E&D PE Disable/Enable")= OFF) And {PE Disable/Enable}
((GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON)) Then {Control Group in PE Cell 2}
SetLightingState("E&D Work Stations NW Perimeter", OFF) {Actual Lighting Group}
end;
Once (GetLightingState("E & D Perimeter NW 2")= ON) Then {Control Group in PE Cell 2}
begin
If (GetLightingState("E&D PE Disable/Enable")= OFF) And {PE Disable/Enable}
((GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON)) Then {Control Group in PE Cell 2}
SetLightingState("E&D Work Stations NW Perimeter", OFF) {Actual Lighting Group}
end;
{PE OFF Control Switch}
Once (GetLightingState("E & D Perimeter NW 1")= OFF) Then {Control Group in PE Cell 1}
begin
If (GetLightingState("E & D Perimeter NW 2")= OFF) Then {Control Group in PE Cell 2}
TimerStart(1) ; {Start Timer}
end;
Once (GetLightingState("E & D Perimeter NW 2")= OFF) Then {Control Group in PE Cell 2}
begin
If (GetLightingState("E & D Perimeter NW 1")= OFF) Then {Control Group in PE Cell 1}
TimerStart(1) ; {Start Timer}
end;
{PE Dealy OFF Timer}
If ( TimerTime(1)=(10) ) Then {15 Minute OFF Timer} {Set to 10 seconds for testing purposes}
SetLightingState("E&D Work Stations NW Perimeter", OFF); {Actual Lighting Group}
Once (GetLightingState("E&D PE Disable/Enable")= ON) Then {PE Disable/Enable}
begin
If (GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON) Then {Control Group in PE Cell 2}
SetLightingState("E&D Work Stations NW Perimeter", ON) {Actual Lighting Group}
end;
Once (GetLightingState("E&D PE Disable/Enable")= OFF)Then {PE Disable/Enable}
begin
SetLightingState("E&D Work Stations NW Perimeter", OFF) {Actual Lighting Group}
end;
{PE ON Control Switch}
Once (GetLightingState("E & D Perimeter NW 1")= ON) Then {Control Group in PE Cell 1}
begin
If (GetLightingState("E&D PE Disable/Enable")= ON) And {PE Disable/Enable}
((GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON)) Then {Control Group in PE Cell 2}
TimerSet(1,-1); {Timer Set to Stop}
SetLightingState("E&D Work Stations NW Perimeter", ON) {Actual Lighting Group}
end;
Once (GetLightingState("E & D Perimeter NW 2")= ON) Then {Control Group in PE Cell 2}
begin
If (GetLightingState("E&D PE Disable/Enable")= ON) And {PE Disable/Enable}
((GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON)) Then {Control Group in PE Cell 2}
TimerSet(1,-1); {Timer Set to Stop}
SetLightingState("E&D Work Stations NW Perimeter", ON) {Actual Lighting Group}
end;
Once (GetLightingState("E & D Perimeter NW 1")= ON) Then {Control Group in PE Cell 1}
begin
If (GetLightingState("E&D PE Disable/Enable")= OFF) And {PE Disable/Enable}
((GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON)) Then {Control Group in PE Cell 2}
SetLightingState("E&D Work Stations NW Perimeter", OFF) {Actual Lighting Group}
end;
Once (GetLightingState("E & D Perimeter NW 2")= ON) Then {Control Group in PE Cell 2}
begin
If (GetLightingState("E&D PE Disable/Enable")= OFF) And {PE Disable/Enable}
((GetLightingState("E & D Perimeter NW 1")= ON) Or {Control Group in PE Cell 1}
(GetLightingState("E & D Perimeter NW 2")= ON)) Then {Control Group in PE Cell 2}
SetLightingState("E&D Work Stations NW Perimeter", OFF) {Actual Lighting Group}
end;
{PE OFF Control Switch}
Once (GetLightingState("E & D Perimeter NW 1")= OFF) Then {Control Group in PE Cell 1}
begin
If (GetLightingState("E & D Perimeter NW 2")= OFF) Then {Control Group in PE Cell 2}
TimerStart(1) ; {Start Timer}
end;
Once (GetLightingState("E & D Perimeter NW 2")= OFF) Then {Control Group in PE Cell 2}
begin
If (GetLightingState("E & D Perimeter NW 1")= OFF) Then {Control Group in PE Cell 1}
TimerStart(1) ; {Start Timer}
end;
{PE Dealy OFF Timer}
If ( TimerTime(1)=(10) ) Then {15 Minute OFF Timer} {Set to 10 seconds for testing purposes}
SetLightingState("E&D Work Stations NW Perimeter", OFF); {Actual Lighting Group}