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/
|