I'm reading watt-hours with a Continental Control Systems WattNode, which gives me a pulse every watt-hour. The code in the CR10x looks like:
; Pulse Input 1 is house power positive consumption (bought from grid)
27: Pulse (P3)
1: 1 Reps
2: 1 -- Pulse Channel 1
3: 2 Switch Closure, All Counts
4: 27 Loc [ HousePlus ]
5: 1.0 Mult
6: 0.0 Offset
[...]
[...every 10 minutes...]
43: Totalize (P72)
1: 1 Reps
2: 27 Loc [ HousePlus ]
Which works fine, and logs the data, and I can harvest it later, and do my analysis.
However, I've also got some Perl code that polls the device for current status (how much water is in the cistern, what the temperature of the freezer is, etc) using something along the lines of:
(Unlock) xxxxL
(FSA) 1A
(Select output for K) 2413J
(send 'J' configuration) \x00\x40\x00\x01\x03\x04\x0B\x13\x18\x19\x1a\x00
(Dump Binary) K
parse the binary, convert to numeric, use the values for alerting, etc.
I'd _like_ to be able to look at the power consumption over (say) the last hour, and when I poll it at midnight, the power consumption for the day, etc.
I can't figure out if I should do something in the CR10X to keep track of total pulses for the day and store them somewhere that won't get zeroed out with the Totalize command, or if I have to pull the data for the day out of the FSA (which is in my SM16 storage module).
Is there an easy way to keep track of pulses for the previous day, the last hour, so far today, etc using code in the datalogger?
I guess I don't understand how the data is stored, when it's reset to zero, and how you can control them outside of the automatic Pulse and Totalize commands.
Any thoughts would be greatly appreciated!
Thanks!
ComputerSmiths Consulting, Inc.


