Adding Analogue Output to Current Time...and Display the New Time

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • Tico
    Lox Guru
    • 31.08.2016
    • 1035

    #1

    Adding Analogue Output to Current Time...and Display the New Time

    First time post so please be gentle...

    I'm attempting to build a module to give an expected time that a home solar battery will last until. ie. Based on current discharge rate, check the difference between current battery level and full discharge level, work out the time in minutes and add to current time.

    I've got it all working as far as working out the time remaining in minutes as an analog value. Adding this to current time is the headache. The screenshot shows a successful output at O78 (top-right) of 110 minutes past midnight. But this is hacked together converting current time to minutes, adding the time remaining, then take off 1440 minutes (24hrs x 60mins) from the previous value. It shows a negative value if before midnight and positive value after..... yep, not very pretty.

    A lot of googling hasn't turned up anything. Any suggestions much appreciated.
    Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.
  • duncan
    LoxBus Spammer
    • 28.08.2015
    • 313

    #2
    add the minutes remaining to the time variable 'minutes past midnight'
    link that to an analog memory
    format the memory as v.t or v.u which is time or date/time and enable the memory flag in the visu

    does that do what you want? Klicke auf die Grafik für eine vergrößerte Ansicht

Name: Capture.JPG
Ansichten: 107
Größe: 29,6 KB
ID: 55510

    Kommentar

    • Tico
      Lox Guru
      • 31.08.2016
      • 1035

      #3
      Thanks for your input.

      The desire to reference to midnight is a misnomer.

      The battery may expire well before midnight if discharge is high. Regularly it expires by about 9-10pm. Many times it also expires early morning.

      It's the variable crossing of midnight that is difficult to code.

      I may just leave the output as minutes before complete battery discharge!
      Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

      Kommentar

      Lädt...