touble with a time calculation


Closed Thread
Results 1 to 40 of 59

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: touble with a time calculation

    hi richard , the main clock cant be stopped and needs to be a running test

    the rollover from sec to mins is the issue as well as mins to hours

    with the Set_Day= 0, Set_Hour= 0 ,Set_min= 0, Set_sec = 10

    this code has that issue of when the clock roles over

    the OT variables are used to display the OT clock
    Days, Hours, Mins,Secs variables are the main clock
    "Set_" varables are the time allowed

    the OT clock is only enabled after the Set time is = > than the main clock
    Code:
        if  OT_Days => Set_Day and OT_Hours => Set_Hour and OT_Minutes => Set_Min and OT_Seconds => Set_OT_Sec then OT_Enable = 1
     
    
       if OT_Enable = 1 THEN    
            if Days     >  Set_Day   then OT_Days    = Days  - Set_Day   
            if Hours    >  Set_Hour  then OT_Hours    = Hours - Set_Hour
            if Minutes  > Set_Min    then OT_Minutes = Minutes - Set_Min 
            if Seconds > Set_Sec   then OT_Seconds = Seconds - Set_Sec
           
         endif

  2. #2
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: touble with a time calculation

    STEVE , I would like to say yes , but i have not had the time to think it through further , other coding issues have taken time away from this problem.

    I do need to get it to work , i am thinking something along the lines what you applied before for the count up event is a good start.

Similar Threads

  1. Help with calculation
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th August 2012, 17:10
  2. CHECKSUM CALCULATION, Please Help!
    By wasilus in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd August 2012, 07:55
  3. Calculation Problem - value goes to zero after 65
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 12th March 2010, 05:10
  4. calculation
    By lerameur in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 20th May 2008, 16:28
  5. CRC Calculation - Need a little help
    By Steve43 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 13th March 2005, 01:23

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts