Announcement

Collapse
No announcement yet.

Realtime Alarms programing question for Cmax

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Realtime Alarms programing question for Cmax

    I am trying to program some real time alarm functions in my Leopard. I want to be able to
    set an alarm via the touch screen and have some events happen when the time is reached. I also want to be able to monitor the count down or count up to that event via variable on the display.

    My first observation was that timers could not be displayed on the screen. So I have to load the timer values to variables to display them. I got that one figured out.

    I also want to be able to have an event happen in say 3hours 20 mins and 40secs. To do this
    I setup 3 variables to store the alarm hours, minutes, and seconds. I start a timer that in turn starts three other variables counting the seconds , minutes and hour. When they are equal my event happens. I got this coded up but it is not tested yet.

    Method 2:
    Another way to do this would be to load the current hour minute and second into a variable and add the 3:20:40 to the current time and trigger the alarm at that calculated time.

    The only problem is how do I get the present time loaded in three variables.


    Here come the questions:

    Anyone know how to do that?

    Anyone want to comment on how else to program this?

    Anyone know how to get the current time loaded
    into a variable? This way I can use method 2.


    I will post my code on the forum for all to use.
    I am using Dave Alden's Ocelot complier to write my code in Version 2.10b1.

    Thanks

    Scott

    #2
    Scott,
    We had this same question via a phone call today.
    I have passed the request onto the programmer.
    I should have an answer posted sometime Saturday.
    Dan Boone, ADI

    Comment


      #3
      Dan,

      I am still waiting for a reply from this post!

      I got the count down and count up alarms working
      but it would be really nice to use method 2 as described in my initial post.

      Thanks
      Scott

      Comment


        #4
        I passed the question onto our programmer, we'll see iif he has any ideas.
        Dan Boone, ADI

        Comment


          #5
          Scott..
          The next program line AFTER a time test line has variable 62 automatically loaded with "minutes since midnight" The seconds, however are not available from the real time clock...so..your events would have to start at seconds "0". Hope this helps, Dan Smith

          Comment


            #6
            Thanks Dan Smith,

            I thought Variable 62 was the beep duration.

            Are you saying all I have to do to get minutes
            in the day to a variable is do a check:

            if Time of Day > 0:00 // always do the check
            then load variable#10 = Variable#62;
            .
            .
            .
            Variable 10 now has the munutes since midnight.
            Then do some math on varable 10 to
            to get hours and minute??

            ie. divide by 60 and store in variable 9 to get
            hours. Subtract remainder to get minutes.

            How do I get Day? Month? and Year? Are these loaded into another variable?

            Thanks

            Scott

            Comment


              #7
              Most data values are loaded to variable 62 after a test...the exception seems to be the Month value...I will look into that.
              Dan

              Comment

              Working...
              X