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

    ok well EL0 is counting up , EL1 and EL3 are copys of EL0
    EL4 is the time left in the event

    Event1_OT = time duration of event
    Event2_OT = Time when to display the timeleft clock
    i
    f EVent1_OT all 0 then disable time left clock
    if Event2_OT all 0 then no timeleft clock

    Event2_OT can not be > Event1_OT set time

    Code:
     if  Event1_OT_Day = 0 and Event1_OT_hour  = 0 and Event1_OT_Min = 0 and _            ' if all values are 0 , then dont enable the overrun timer 
            Event1_OT_sec = 0 and Event1_OT_100th = 0 then 
              EL2_Enable = 0 ' Disable El2 Counter   
              EL2_Allow = 0  ' clear Flag so EL4 wont start   
        else
              EL2_Allow = 1  ' Event1 setting Higher than 0 so allow EL4 to be enabled if Event2 settings are higher than 0 
        endif
        
    
    ' ---------------------
    
     if  Event2_OT_Day = 0 and Event2_OT_hour  = 0 and Event2_OT_Min = 0 and _  
           Event2_OT_sec = 0 and Event2_OT_100th = 0 then 
             EL4_Allow = 0  ' disable Event End Timer - EL4 
       else
             EL4_Allow = 1  ' Allow Event End Timer - EL4 
       endif 
       if EL2_Allow = 1 and EL4_Allow = 1 then                        ' if Event1 times set and Event2 times set then allow EL4_enable to start Event End timer 
          
           if EL1_Days    <= Event2_OT_Day and EL1_Hours   <= Event2_OT_Hour and _
              EL1_Minutes <= Event2_OT_Min and EL1_Seconds <= Event2_OT_Sec  and _
              EL1_100th   <= Event2_OT_100th then EL4_Enable = 1                                ' show clock when time left in event
    all i have so far

  2. #2
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: touble with a time calculation

    Have you got any further?

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