ts-7000
[Top] [All Lists]

[ts-7000] Re: TS-Linux difftime

To:
Subject: [ts-7000] Re: TS-Linux difftime
From: Mike Dodd <>
Date: Mon, 05 Dec 2011 10:05:25 -0500
Ken Lu wrote:
> 
> 
> As my experience, TS-LINUX does not accept seconds setting.  If you 
> need to set time, have to set at 0 second of per minute.  So my program 
> needs to wait for less than one minute(count down to zero, depends on 
> start time) to set time.

I think you misunderstood what I need to do. I'm not setting the time. 
Instead, my program monitors our HVAC system and records the time the 
compressor (stage 1 and stage 2), fan, backup strip heat, and ERV 
(energy-recovery ventilator) run. It also records whether the system is 
heating or cooling.

The program loops continuously, and checks the DIO inputs each time 
through the loop. If something is running, it adds the elapsed time (~6 
seconds, with a sleep() at the bottom of the loop) to that item's "on" 
time for the current hour (I have an array of 24 structures to store the 
"on" times).

Thus, the program must subtract the previous time from the current time 
to get the actual number of seconds spent in the loop. Hence, I need 
difftime(), which does exactly this.

At the start of each hour, the program adds a row to an HTML table, with 
the previous hour's run-times. Here's a screen shot of a typical HTML 
page: <http://mdodd.com/files/hvac.jpg>. The program also produces a 
corresponding CSV file, so I can load the data into a spreadsheet.

At midnight, the program creates daily-totals HTML and CSV files.

The program has been completely tested, and works great. This difftime() 
glitch popped up when I began running the program under TS-Linux instead 
of Debian.

It's once again running fine with my own difftime() function.
-- 
Mike

Mike Dodd
Louisa County, VA USA

http://mdodd.com


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU