A common logic requirement is where you have a conference/meeting room with a removable divider. When the divider is separating the room into two small rooms, the room lights operate independently. When the divider is open, the lights need to be linked together. The example code below assumes a switch is activated by the divider (ON = open) and there is one group address in each room. If you have more complex requirements, the relevant sections of code can just be duplicated. [CODE] { constants } ControlGroup = 1; { this controls whether the loads are linked } Room1Group = 2; { group address for room 1 } Room2Group = 3; { group address for room 2 } { variables } Room1Level : integer; { last known level in room 1 } Room2Level : integer; { last known level in room 2 } { initialisation } Room1Level := GetLightingLevel(Room1Group); Room2Level := GetLightingLevel(Room2Group); { module code } { if the rooms are linked ... } if GetLightingState(ControlGroup) = ON then begin { if Room 1 has changed, make Room 2 the same } if Room1Level <> GetLightingLevel(Room1Group) then begin Room1Level := GetLightingLevel(Room1Group); SetLightingLevel(Room2Group, Room1Level, "0s"); Room2Level := Room1Level; { this prevents the other bit of logic sending an extra command } end; { if Room 2 has changed, make Room 1 the same } if Room2Level <> GetLightingLevel(Room2Group) then begin Room2Level := GetLightingLevel(Room2Group); SetLightingLevel(Room1Group, Room2Level, "0s"); Room1Level := Room2Level; { this prevents the other bit of logic sending an extra command } end; end; [/CODE]