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.

Flagging data based on time of day


gwatson Mar 18, 2009 01:44 PM

Hi.

We currently have a CR1000 logging measurements from a Thermo 43i SO2 analyzer at a remote site. The analyzer is programmed to perform daily calibrations: a zero check from 22:45 to 22:55, a span check from 22:55 to 23:10, and an auto-purge from 23:10 to 23:15.

I'd like to edit the CR1000's program so that it will flag the SO2 data during this half-hour calibration timeframe. I would like to exclude these calibration data from the 15-minute, 60-minute, and 24-hour data tables. However, I would still like for the calibration data to show up in the 5-minute data table.

Since the calibrations run at the same time every day, would it be feasible to flag the data based on the time? I poked around CRBasic a little, and it looks like the RealTime or TimeIntoInterval instructions are possibilities.

Anyone have any suggestions?

Thanks in advance.

-gw


Dana Mar 18, 2009 04:12 PM

Hello GW,

The code below should work. IfTime is the same function as TimeIntoInterval -- you can use either (the code worked on my bench):

Public TrigVar As Boolean, BattVolt

'TrigVar controls storage to table
DataTable (Table,TrigVar,1000)
Sample (1,BattVolt,FP2)
EndTable

BeginProg
'Initialize TrigVar to true
TrigVar=True
Scan (1,Sec,3,0)
Battery (BattVolt)
'Stop storing data
If IfTime (1365,1440,Min)Then
TrigVar = False
EndIf
'Start Storing Data
If IfTime (1395,1440,Min)Then
TrigVar = True
EndIf
CallTable (Table)
NextScan
EndProg

Hope this helps,

Dana


gwatson Mar 19, 2009 12:48 PM

Thanks, Dana. I'll give this code a shot.

Glenn

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