Is there any way to have the timestamp of a record in a DataTable reflect the timeframe of the data in the record?
For example, we collect maximums and minimums of various sensors, and call a datatable to record these at:
DataInterval(0,1,Day) .. etc.
This means that the data for yesterday is timestamped with today - similarly for monthly records - the data for December is timestamped January.
Unless there's a more elegant way to collect data like this?
Currently the only methods I know of are
a) post processing the data
and
b) with a 1 second scan, calling the table with a DataInterval() of
DataInterval(86399,86400,Sec) 'one second before midnight
I believe we have this as a wish list item for our PC software (Loggernet for one). An extra option may (no promises yet) be implemented in the next release which should be released some time later this year (not soon). We should be implementing the equivalent function we supported in our older loggers where midnight can optionally be stored as 24.00 hours (in the previous day) which solves many peoples issues with what happens now.
The other way of circumventing this issue is to store a second timestamp value within the data which you manipulate to create the fake time before storing it.
Sam's solution is much simpler, although from a theoretical (or some might say pedantic) stance the timestamp for a daily statistic should probably be mid-day rather than one second to midnight.
* Last updated by: aps on 1/25/2012 @ 8:30 AM *
excuseme sam
what about averages daily?..
instead of DataInterval(0,1,Day,10)
is like this DataInterval(0,86400,sec,10)?
DataInterval(0,1,Day,10)
and
DataInterval(0,86400,sec,10)
are equivalent
also i believe
DataInterval(86399,86400,Sec)
and
DataInterval(-1,86400,Sec)
are equivalent
ok
my situation with 60 second of scan how can i call the table?
like this?: datainterval(1439,1440,min,10)
The two numbers both need to be evenly divisible by the scan rate of the scan calling the table.
ok
i am gonna try with
datainterval(1439,1440,min,10)
for a averages daily for a previous day
with a scan of 60 sec