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.

(Urgent) Incomplete collected data


XavierP Jul 5, 2014 07:56 PM

Hello,

First, sorry for my bad english.

I am experiencing a critical problem with my CR800 : sometime, some of the collected data are missing. Missing data are always the old ones. I suspect a memory saturation but the "data tables fill time" says tables should be full after 30 days of acquisition...(I retrieve data two times a week).


It is connected to :
- a pressure sensor monitoring water level in a venturi flume ("hcanal")
- a pressure sensor monitoring water level in a piezometer ("hA2"),
- a rain gauge with a tipping bucket ("pluie"),
- another tipping bucket measuring a water flow ("subsurf").

The problem used to occur mostly on the datatable "pluvio" (rain gauge), but today I missed the measure of a really important runoff event because it occurred also on druck_evenement and auget.

I also experiment several "Skipped Record" on "auget", "pluvio" and "druck_evenement", I don't know if it is linked (and I don't know how to solve this problem neither).

I either retrieve data with direct wire connection or modem.

I am a beginner with datalogger...I hope the code will be readable for you

In advance, thank you a lot for your help !


Xavier


'--------------------------------------------------------- Declaration des variables et des unites -----------------------------------------------------
Public hcanal
Public pluie
Public batterie
Public temperature
Public hA2
Public subsurf

Public Qcanal_i
Public Vcanal_i
Public Vcanal_sum
Public num_ech_canal

Public Vsub_i
Public Vsub_sum
Public num_ech_sub
Public Temps_5_tic
Public Vol_5_tic
Public Q_5_tic

Public SMS_canal_result
Public SMS_canal_Sent As Boolean
Public SMS_canal_critere As Boolean

Public SMS_sub_result
Public SMS_sub_Sent As Boolean
Public SMS_sub_critere As Boolean

Units hcanal = cm
Units hA2 = cm
Units Qcanal_i = L/s
Units Vcanal_i = L
Units Temps_5_tic = h
Units Vol_5_tic = L
Units Q_5_tic = L/h


'--------------------------------------------------------- Declaration des constantes -----------------------------------------------------
Const hcanal_min = 1
Const num_ech_canal_max = 24
Const Vcanal_max = 600 '(L)

Const Q_seuil_sub = 0.1
Const num_ech_sub_max = 24
Const Vsub_max = 5

Const SMSPhone = "XXXXXXXXX"
Const CR=CHR(13)
Const SMSPORT = ComME

'--------------------------------------------------------- Declaration des tables -----------------------------------------------------
DataTable(druck_base,hcanal<0,-1)
DataInterval(0,15,Min,10)
Average(1,hcanal,IEEE4,False)
EndTable

DataTable(druck_evenement,hcanal>0,-1)
DataInterval(0,15,Sec,10)
Average(1,hcanal,IEEE4,False)
Sample(1,Vcanal_sum,IEEE4)
EndTable

DataTable(pluvio,pluie>0,-1)
DataInterval(0,15,Sec,10)
Totalize(1,pluie,FP2,False)
EndTable

DataTable(centrale,true,-1)
DataInterval(0,1,Hr,0)
Minimum (1,batterie,FP2,0,False)
Sample (1,temperature,FP2)
EndTable

DataTable(druck_A2,true,-1)
DataInterval(0,15,Min,1)
Sample(1,hA2,IEEE4)
EndTable

DataTable(auget,subsurf>0,-1)
DataInterval(0,15,Sec,10)
Totalize(1,subsurf,FP2,False)
Sample(1,Vsub_sum,FP2)
EndTable

DataTable(prelev_canal,true,-1)
DataInterval(0,15,Sec,10)
Sample(1,num_ech_canal,IEEE4)
EndTable

DataTable(prelev_sub,true,-1)
DataInterval(0,15,Sec,10)
Sample(1,num_ech_sub,IEEE4)
EndTable

'--------------------------------------------------------- Declaration des fonctions d'envoi de SMS -----------------------------------------------------
'Subroutine qui gere l envoie du SMS d alerte pour le canal :
Sub SMS_canal_Alarm

SerialOpen (SMSPORT,9600,3,10000,100)
SMS_canal_result=SerialOut (SMSPORT,"AT+CMGS="+SMSPhone+CR,"> ",1,100)
If SMS_canal_result<>0 Then
SerialOut (ComME,"subsurface num " + num_ech_sub +" ruissellement num "+ num_ech_canal,"",1,10)
SMS_canal_result=SerialOut (SMSPORT,CHR(26),CHR(26)+"+CMGS:",1,10000)
SMS_canal_Sent=SMS_canal_result<>0
EndIf
SerialClose (ComME)
EndSub


Sub SMS_sub_Alarm
SerialOpen (SMSPORT,9600,3,10000,100)
SMS_sub_result=SerialOut (SMSPORT,"AT+CMGS="+SMSPhone+CR,"> ",1,100)
If SMS_sub_result<>0 Then
SerialOut (ComME,"subsurface num " + num_ech_sub +" ruissellement num "+ num_ech_canal,"",1,10)
SMS_sub_result=SerialOut (SMSPORT,CHR(26),CHR(26)+"+CMGS:",1,10000)
SMS_sub_Sent=SMS_sub_result<>0
EndIf

SerialClose (ComME)
EndSub

'--------------------------------------------------------- Programme -----------------------------------------------------
BeginProg
'--------------------------------------------------------- Initialisation des variables -----------------------------------------------------
SMS_sub_Sent = True
SMS_canal_Sent = True

num_ech_sub = 0
num_ech_canal = 0

Vsub_sum = Vsub_max/2
Vcanal_sum = Vcanal_max/2

Q_5_tic = 0

Scan(15,Sec,1,0)
'--------------------------------------------------------- Partie Mesure -----------------------------------------------------
PulseCount(pluie,1,1,2,0,1,0)
PulseCount(subsurf,1,2,2,0,1,0)
subsurf = Round(subsurf,0)
PanelTemp (temperature,250)
Battery (batterie)
BrFull(hcanal,1,mV25,1,1,1,2500,True,True,0,_50Hz,30.70270,-16.75)
BrFull(hA2,1,mV25,2,1,1,2500,True,True,0,_50Hz,71.23574,0)

'--------------------------------------------------------- Partie Calcul et Commande -----------------------------------------------------

Temps_5_tic = (auget.timestamp(2,1)-auget.timestamp(2,6))/3600
Vol_5_tic = (auget.subsurf_Tot(1,1)+auget.subsurf_Tot(1,2)+auget.subsurf_Tot(1,3)+auget.subsurf_Tot(1,4)+auget.subsurf_Tot(1,5))*0.1
If Temps_5_tic <> 0 Then Q_5_tic = Vol_5_tic / Temps_5_tic


If Q_5_tic > Q_seuil_sub
Vsub_i = subsurf * 0.1
Vsub_sum = Vsub_sum + Vsub_i
If (Vsub_sum >= Vsub_max) AND (num_ech_sub <= num_ech_sub_max)
PortSet(2,1)
Delay(0,50, mSec)
PortSet(2,0)
Vsub_sum = 0.35
subsurf = subsurf + 3.5
num_ech_sub = num_ech_sub + 1
CallTable (prelev_sub)
EndIf
EndIf

If hcanal > hcanal_min
Qcanal_i = 0.002929*(hcanal*10)^1.58
Vcanal_i = Qcanal_i*15
Vcanal_sum = Vcanal_sum + Vcanal_i
If ((Vcanal_sum >= Vcanal_max) AND (num_ech_canal <= num_ech_canal_max))
PortSet(1,1)
Delay(0,50, mSec)
PortSet(1,0)
Vcanal_sum = 0
num_ech_canal = num_ech_canal + 1
CallTable (prelev_canal)
EndIf
EndIf

'--------------------------------------------------------- Mise a jour des tables -----------------------------------------------------

CallTable(pluvio)
CallTable(centrale)
CallTable(druck_A2)
CallTable(druck_base)
CallTable(druck_evenement)
CallTable(auget)

NextScan

'--------------------------------------------------------- Sequence non prioritaire qui gere les SMS et la connection GSM -----------------------------------------------------
SlowSequence
Scan (1,Min,2,0)
If TimeIntoInterval(7,24,Hr)
SW12 (1)
EndIf
If TimeIntoInterval(8,24,Hr)
SW12(0)
EndIf
If TimeIntoInterval(16,24,Hr)
SW12 (1)
EndIf
If TimeIntoInterval(17,24,Hr)
SW12(0)
EndIf

SMS_canal_critere = (num_ech_canal = 1 OR num_ech_canal = 12 OR num_ech_canal = 24)
SMS_sub_critere = (num_ech_sub = 1 OR num_ech_sub = 12 OR num_ech_sub = 24)

If (SMS_canal_Sent=False) AND (SMS_canal_critere = True) Then
SW12(1)
Delay (1,35,Sec)
Call SMS_canal_Alarm
Delay (1,15,Sec)
SW12(0)
ElseIf SMS_canal_critere = False Then SMS_canal_Sent=false

If (SMS_sub_Sent=False) AND (SMS_sub_critere = True) Then
SW12(1)
Delay (1,35,Sec)
Call SMS_sub_Alarm
Delay (1,15,Sec)
SW12(0)
ElseIf SMS_sub_critere = False Then SMS_sub_Sent=false

NextScan
EndProg

* Last updated by: XavierP on 7/6/2014 @ 12:30 AM *


Sam Jul 14, 2014 06:22 AM

You run a risk running into issues with storage on


* druck_base
* druck_evenement
* pluvio
* auget
* prelev_sub
* prelev_canal

You have things set up so that multiple conditions have to be true at the same time. For example, for pluvio to store data you will have to have to receive a pulse from the pluvio right on the 15 second mark.

You should reconsider your use of trigger variables parameters and placing calltables within conditional statements.

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