In Built System IO and Logic

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by PeterB, Jun 24, 2012.

  1. PeterB

    PeterB

    Joined:
    Oct 21, 2007
    Messages:
    1
    Likes Received:
    0
    I am using a CTouch for a project and wish the user to be able to adjust two schedule times, one for Sunrise +/- and Sunset + / -.
    These schedules are used to change state of an In Built User System IO ("Night Time Status" where 1 is Night and 0 is Day), in conjunction with an external PE, that has been created for keeping track of Day / Night.
    The reason for using the System IO is that if the CTouch reboots or has lost power for any reason the logic will know what state it was in prior to reboot. Also if the external PE fails then the schedule will change state of this point also.
    The PE is the preferred method of controlling lighting as it is giving true indication of light levels.
    Is it possible to recall a specific schedule time, ie schedule #1 (adjusted Sunset) & #2 (adjusted Sunrise) so that the logic can be in an initialisation module:
    if
    time > schedule #1 time and time < schedule #2 then
    begin
    SetIntSystemIO ("Night Time Status", 1); etc.

    Any help would be greatly appreciated.
     
    PeterB, Jun 24, 2012
    #1
  2. PeterB

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    System IO variables are of two types; "user" and "in-built". There is no such thing as an "In Built User System IO". I assume you mean a user system IO variable.

    Also, why use values of 0 and 1? A boolean system IO variable would be more appropriate.

    It would help a lot if you could explain what you are trying to do.

    You can set the "Schedule Number" in-built system IO variable, then read the "Schedule Time" in-built system IO variable value to get the time the schedule occurs.

    Read the logic help file topic "time function" for examples of how to write correct logic code to detect when it is night time.
     
    Darren, Jun 24, 2012
    #2
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.