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.

Intermittent data from temperature probe


Lumox Sep 13, 2011 12:44 PM

I have a RDI ADCP instrument and Campbell 107 temperature probe, sending data to a CR1000 datalogger. The temperature probe is attached directly to the CR1000 whereas the ADCP sends the data to the CR1000 on Com1 via acoustic modems (the ADCP is anchored on the sea floor and everything else is in a surface buoy).

The problem I have is that the temperature probes data does not always get saved in the datatable and yet the value is in the Public file. Is this possibly a timing problem? Any help would be appreciated. Following is the CR1000 datalogger program.

'CR1000 Series Datalogger
' Program to capture data from:
' ADCP NEMO (CRNT and WAVES strings) - Com1. Note that NEMO must be configured to send

'Declare Public Variables
Public c1string As String * 2000
Public datastring As String * 2000
public nstring as string * 2000
Public y

Dim Min_hr, Min_ten, Flag_pwr
Public RTime(9)
Public Batt_Volt
Public PTemp

Public indate As String * 10
Public intime As String * 10
Public h As String * 10
Public p As String * 10
Public r As String * 10
Public t As String * 10
Public u(18) As String * 10
Public v(18) As String * 10
Public w(18) As String * 10
Public e(18) As String * 10
Public si
Public fi

Public SST
Units SST = °C

'Declare Constants
CONST PI = 3.141592654

'Define Data Tables
DataTable(ADCP,1,-1)
Minimum(1,Batt_Volt,FP2,0,False)
Sample(1,PTemp,FP2)
Sample(1,indate,String)
Sample(1,intime,String)
Sample(1,t,FP2)
Sample(1,h,FP2)
Sample(1,p,FP2)
Sample(1,r,FP2)
Sample(18,u(),IEEE4)
Sample(18,v(),IEEE4)
Sample(18,w(),IEEE4)
Sample(18,e(),IEEE4)
EndTable

DataTable(Temp_Probe,True,5000)
DataInterval(1,30,Min,10)
Average(1,SST,FP2,False)
EndTable

'Main Program
SequentialMode
BeginProg
SerialClose (Com1)
SerialOpen (Com1,9600,0,0,2000)
SerialFlush (Com1)
SerialClose (Com2)
SerialOpen (Com2,4800,0,0,2000)
SerialFlush (Com2)

Scan (5,Sec,0,0)
RealTime(RTime)
PanelTemp(PTemp,250)
Battery(Batt_Volt)

'** reading the ADCP string
c1string = ""
If SerialInChk(Com1) > 10 Then
Delay(1,10,mSec)
EndIf
SerialIn(c1string,Com1,500,-1,2000)
SerialFlush(Com1)
'now check for the wave string
si = InStr(1,c1string,"Hdg",2) 'the index where the WAVES is
If si > 0 Then
'Now parsing the strings of data date and time first
indate = Mid(c1string,1,10)
intime = Mid(c1string,12,8)
'first the heading
si = InStr(1, c1string, "Hdg:",2) + 4 'the index where the : is
fi = InStr(si, c1string, "Pitch",2) - 1
h = Mid(c1string,si,fi-si)
'next the pitch
si = InStr(1, c1string, "Pitch:",2) + 6
fi = InStr(si, c1string, "Roll",2) - 1
p = Mid(c1string,si,fi-si)
'next the roll
si = InStr(1, c1string, "Roll:",2) + 5
fi = InStr(si, c1string, "Temp:",2) - 1
r = Mid(c1string,si,fi-si)
'next the temperature
si = InStr(1, c1string, "Temp:",2) + 5
fi = InStr(si, c1string, "SoS",2) - 1
t = Mid(c1string,si,fi-si)

y = 1
si = InStr(1, c1string, "Echo4",2)
si= si + 9
For y = 1 To 18
u(y) = Mid(c1string,si+17,6)
v(y) = Mid(c1string,si+25,6)
w(y) = Mid(c1string,si+33,6)
e(y) = Mid(c1string,si+41,6)
si = si + 79
Next y
CallTable(ADCP)
EndIf

'** Water temperature measurement
Therm107(SST,1,1,Vx1,0,_60Hz,1.0,0.0)

'** some code for switching the 12v power supply
Min_hr=RTime(5)
If Min_hr>=50 AND Min_hr<55 Then 'switch off power between 50 + 55th mins
Flag_pwr=0
Else
Flag_pwr=1
EndIf
If Batt_Volt<9.0 Then Flag_pwr=0
PortSet(9,Flag_pwr)

CallTable(Temp_Probe)
NextScan
EndProg


GTProdMgr Sep 13, 2011 03:40 PM

Your scan rate and table call rate is every 5 seconds. The value of SST should be updated every 5 seconds in the Public table. However, since you have a DataInterval instruction
in your data table, you will only see values written
to this final storage table every 30 minutes (at 1 minute
and 31 minutes after the hour).

DataTable(Temp_Probe,True,5000)
DataInterval(1,30,Min,10)
Average(1,SST,FP2,False)
EndTable

Are you seeing missing data from the table writes that should occur at the 1st and 31st minutes during the hour?


Lumox Sep 13, 2011 07:33 PM

Yes, there is missing data at the 1st and 31st minutes. Here is some of the data collected over the same period. As you can see, data is missing from the "Temp_Probe" table between 04:31:00 and 09:31:00 but not from the "ADCP" table. I changed the offset to 1 minute past each half hour from having no offset, but this has not made a difference. The ADCP instrument is set to push data through to the datalogger every half hour.

Once before, I had data missing for almost 24 hours, and then it began collecting temperature data again.

Temp_Probe table
"2011-09-13 02:01:00",482,21.15
"2011-09-13 02:31:00",483,21.02
"2011-09-13 03:01:00",484,21.06
"2011-09-13 03:31:00",485,21.01
"2011-09-13 04:01:00",486,20.99
"2011-09-13 04:31:00",487,20.94
"2011-09-13 09:31:00",488,20.78
"2011-09-13 10:01:00",489,20.74
"2011-09-13 10:31:00",490,20.75
"2011-09-13 11:01:00",491,21.03
"2011-09-13 11:31:00",492,21.31
"2011-09-13 12:01:00",493,21.26

ADCP table (data truncated)
"2011-09-13 02:00:10",898,11.95,22.33, ......
"2011-09-13 02:30:10",899,11.93,22.33, ......
"2011-09-13 03:00:10",900,11.94,22.28, ......
"2011-09-13 03:30:10",901,11.94,22.19, ......
"2011-09-13 04:00:30",902,11.94,22.03, ......
"2011-09-13 04:30:10",903,11.94,21.92, ......
"2011-09-13 05:00:10",904,11.93,21.78, ......
"2011-09-13 05:30:05",905,11.92,21.62, ......
"2011-09-13 06:00:05",906,11.92,21.45, ......
"2011-09-13 06:30:15",907,11.96,21.29, ......
"2011-09-13 07:00:05",908,11.99,21.26, ......
"2011-09-13 07:30:05",909,12.09,21.45, ......
"2011-09-13 07:59:55",910,12.22,21.78, ......
"2011-09-13 08:29:55",911,12.35,22.28, ......
"2011-09-13 08:59:55",912,12.42,22.9, ......
"2011-09-13 09:29:55",913,12.5,23.58, ......
"2011-09-13 10:00:00",914,12.48,24.16, ......
"2011-09-13 10:30:00",915,12.54,24.57, ......
"2011-09-13 11:00:10",916,12.53,24.81, ......
"2011-09-13 11:30:00",917,12.52,24.95, ......
"2011-09-13 12:00:00",918,12.51,24.98, ......


Lumox Sep 20, 2011 09:54 AM

Anyone have any idea why the temperature probe data is not being stored in the Temp_Probe table but are in the "Public" file?


Dana Sep 20, 2011 07:42 PM

Does the datalogger's status table show any skipped scans or skipped records?

Dana W.


GTProdMgr Sep 21, 2011 03:52 PM

Hello Lumox,

I modified your program slightly to run on my CR1000 without a Therm107 and it ran overnight (19 hours) without skipping any records in the Temp_Probe table (always writing at 1 and 31 minutes past the hour without interruption).

At this point we could suspect something wrong with the particular deployment or configuration of your logger itself.

Can you collect the missing records using Custom Collect
in the Collect Screen ?

What OS is it running ? One thing we may want to do is to make sure you collect all the data and then re-send the program so that it can re-compile and reload. Can you cycle the power on the logger ?

You may want to call in to our support team at this point and open an official support request. 435-227-9100


Dana Sep 21, 2011 05:26 PM

Hello Lumox,

The Status table information you sent directly to CSI highlights several issues.

First, the datalogger has accumulated two "Low 12V" errors, which means the datalogger stopped executing its program because the voltage dropped below ~9.6 V. In the file you sent, look at 6:07:09 on 8/26/11 where the battery is around 9V.

Additionally, you'll notice that your SkippedScan counter increments fairly significantly with every Status table record stored. This means the datalogger was "so busy" executing from the previous scan that it didn't start the subsequent scan.

These skipped scans are likely occurring at times when data should be stored, thus, the skiped records (notice the incrementing count in SkippedRecord(2)).

The MaximumProcTime (maximum processing time) starts off at about 5.6 seconds, but quickly goes up to 12 seconds. Because your program is running is SequentialMode, there is no buffering of the processing (that would normally occur if you were running in PipeLineMode), so this is what is likely causing the skipped scans (thus, leading to skipped records).

I would start by increasing your scan rate to 10 seconds if you can, unless speed is more important than the missed records. Also, you should consider why your battery voltage is dropping to unacceptable levels (need a larger solar panel? battery going bad? looks like it occurs when temps are the coolest).

You can also look at restructuring your program to run in PipelineMode, which will make it run more efficiently, and you also have some buffer space to play with to compensate when processing lags behind.

Dana W.


aps Sep 21, 2011 05:38 PM

Dana's advice is good but the real problem with the long processing time is the Serialin instruction which has a long timeout and a large number of characters potential it could read in.

I would advise reading up on the Serialinrecord instruction as an alternative method of dealing with the serial data, as it does not force any delay in the program apart from some rather fast processing of the data already in the serial buffer. You can only use this is you have distinct pairs of start and end characters around the data you want to extract though.

If you cannot use this move the input from the serial sensors into their own slow sequences as they can run in background no matter whether the logger is running in sequential mode or pipeline mode.


Dana Sep 22, 2011 12:07 AM

Just an FYI, I have been working with Lumox off line, and the use of a variable in PortSet(9,Flag_pwr) was forcing the program into SequentialMode. However, you can "force it back" by using the PipeLineMode instruction at the beginning of the program. No program restructuring was needed.

Andrew also makes a good point about SerialIn, which I missed.

Dana

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