Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR10X - Barometric Sensor


tahoang88 Jul 6, 2011 05:57 PM

According to Dana[1], using the CR10X (and also other dataloggers), immediate sensor measurements are stored in input locations and get over-written after each scan. And after some intervals, the processed results (minimum, average, maximum) are stored into final storage. So this piece of code (from CR10X, converted to CR100):

Public Loc9

BeginProg
Scan (60, Sec, 3, 0)
PulseCount(Loc9, 1, 2, 2, 0, 0.1, 0)
NextScan

SlowSequence

DataTable (Table100, true, -1)
OpenInterval
DataInterval(9, 60, Min, 10)
Totalize(1, Loc9, FP2, 0)
EndTable

Scan(60, sec, 3, 0)
CallTable Table100
If TimeInToInterval(0, 60, Min) Then PortSet(2, 1)
If TimeInToInterval(45, 60, Min) Then PortSet(2, 0)
NextScan
EndProg

would measure the precipitation every minute, store that measurement in input location #9 and also perform the totalize function? So where would the result of the accumulative sum be stored? (since based on the principle, new scan will over-write Loc9 so the totalize must be performed before new scan begins, and Table100 will only be updated every 60 minutes (?) so accumulative sum wouldn't be stored in there either (?)).

Thank you!

[1]: http://www.campbellsci.com/forum/messages.cfm?threadid=2EB67D33-F12E-9053-96F972C7FCF8B2B3

* Last updated by: tahoang88 on 7/6/2011 @ 6:35 PM *


Dana Jul 7, 2011 08:18 PM

Based on your program the datalogger will:

* Measure the pulse count every 60 seconds
* Store a total of that measurement into a data table 9 minutes after every hour (e.g., your DataInterval instruction is 9 minutes into a 60 minute interval).

All dataloggers have storage for the measurement during the scan (the variable, or as we called it in Edlog dataloggers, the input location), a place to keep intermediate values, and output storage (or final storage). The 60 second values will be kept track of in intermediate storage until output, and you can have multiple outputs of the same value. For instance, you can have a one hour table and a 24 hour table, each tracking Loc9 and the datalogger will keep track of both.

Also, I don't think you want the data table in a SlowSequence scan unless there's some driving reason to do so. I would rewrite the program as:

Public Loc9

DataTable (Table100, true, -1)
OpenInterval
DataInterval(9, 60, Min, 10)
Totalize(1, Loc9, FP2, 0)
EndTable

BeginProg
Scan (60, Sec, 3, 0)
PulseCount(Loc9, 1, 2, 2, 0, 0.1, 0)
CallTable Table100
If TimeIntoInterval(0, 60, Min) Then PortSet(2, 1)
If TimeIntoInterval(45, 60, Min) Then PortSet(2, 0)
NextScan
EndProg

Log in or register to post/reply in the forum.