Tracking Groups [CIS Example]

Discussion in 'Pascal Logic Code Examples' started by Darren, Jul 8, 2011.

  1. Darren

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    There are two logic functions to make one group address "track" another:
    • TrackGroup
    • TrackGroup2

    The logic help file topics "TrackGroup Procedure", "TrackGroup2 Procedure" and "Tracking a Group Address" explain how these work.

    The TrackGroup2 procedure is not currently supported in C-Touch, PAC or Wiser. It is in HomeGate, Schedule Plus and Colour C-Touch.

    If you want to make your own version of TrackGroup2 for use in a device that does not support it, you can do it with logic like this:

    Code:
    { Global Variables }
    Level1, Level2, Rate : integer;
    
    { Module }
    Level1 := GetCBusTargetLevel("Network 1", "Lighting", "Group 1");
    Level2 := GetCBusTargetLevel("Network 3", "Lighting", "Group 2");
    
    if HasChanged(Level1) then
    begin
      Rate := GetCBusRampRate("Network 1", "Lighting", "Group 1");
      SetCBusLevel("Network 3", "Lighting", "Group 2", Level1, Rate);
    end
    else
    if HasChanged(Level2) then
    begin
      Rate := GetCBusRampRate("Network 3", "Lighting", "Group 2");
      SetCBusLevel("Network 1", "Lighting", "Group 1", Level2, Rate);
    end;
     
    Darren, Jul 8, 2011
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.