simplified join room example

Discussion in 'Pascal Logic Code Examples' started by coppo, Feb 2, 2006.

  1. coppo

    coppo

    Joined:
    Sep 7, 2004
    Messages:
    221
    Likes Received:
    10
    Location:
    Adelaide
    Join Room example with very minimal code.

    based upon example code supplied in online piced software
    "logic" help manual.

    Supplied in archived "CTA" format.

    Download the zip file,
    then use the "import archive" function in piced.

    you WILL need to shutdown piced and cgate after the import ,
    then restart piced ( cgate starts up auto ) other wise the new
    megabuxx toolkit project will not be accessible, causing piced
    to give you an error message.

    code is

    Code:
    
    [Initialisation] 
    DisableModule("Joined Room"); 
    
    -----------------------------
    
    [RUN MODULE]
    {this module runs 24/7, and controls when the joined room module
    code is used.}
    
    {Depending upon your hardware setup
    ( as whether the "door switch" contact is N/O or N/C ),
    you may need to invert the on/off states for "door switch" = ??}
    
    once (GetLightingState("door switch") = OFF) then
    begin
      EnableModule("Joined Room");
    end;
    
    once (GetLightingState("door switch") = ON) then
    begin
      DisableModule("Joined Room");
    end;
    
    ----------------------------
    
    [Joined room module ]
    
    {Code is sourced and based upon the Online "Logic" help manual,
      under index listing of "Group address" >> "Track Level". }
    
    if GetCBusTargetLevel("Local Network", "Lighting", "meet 1") <>
       GetCBusTargetLevel("Local Network", "Lighting", "meet 2") then
       SetLightingLevel("meet 2", GetCBusTargetLevel("Local Network", "Lighting", "meet 1"),
       GetCBusRampRate("Local Network", "Lighting", "meet 1"));
    
    
     

    Attached Files:

    Last edited by a moderator: Feb 6, 2006
    coppo, Feb 2, 2006
    #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.