||Re: PRG keeps looping back to start
Mervyn Bick <email@example.com>
||Sun, 12 Jul 2020 16:41:57 +0200
On 2020-07-11 23:04, Gaetano De Luisi wrote:
> hmmm, I have re-added the RETURN statement and now it doesn't execute in loops anymore. This is so weird. I did check that the PRO files were getting recompiled and they were.
Most peculiar. For me it works with or without that final RETURN.
There is an implicit return at the end of every program so the RETURN is
Your program works as it stands without repeating itself.
One problem though is that the program flags gaps by logging the
timestamp of the record after the gap no matter how many expected
records are missing. It does not specify the number of missing records
or the missing timestamps.
One way of finding exactly which timestamps are missing is to right JOIN
a table of timestamps with all the potential 5 minute intervals to the
energydata table. The missing timestamps will show as null values in
the combined rowset. Discard non-null values and the job's done. Once
the table of potential timestamps is generated the result is returned
virtually instantly. The trouble is the range of timestamps in the table
of timestamps must match the values in energydata. On my computer it
takes just under 90 seconds to build the table for readings covering
roughly 26 days which is too long to be acceptable.
The description in the level 7 table specification of how a timestamp is
saved is not correct. This means I can't use a direct lowlevel write to
create the table. Many years ago someone actually posted the method to
calculate the value to be saved but I can't for the life of me find it now.
I'm not allowed to spend too much time sitting at the computer (Doctor's
orders :-( ) but I'll see later if I can adapt your existing code to do