Hello,
David from France.
I meet a strange problem with my CR3000.
I just want to do a scan at 1Hz, one scan by second.
The scan is running ok. On the "connect" menu on LoggerNet, in my specified table, i can see all values (and time) mooving every second. And i don't have skipped scan or skipped record.
But finally when i go to me hard drive to se my file (schedule copy every 10 minutes) i find datas but not every second at all.
Sometime i miss 200 seconds, or more, sometimes just 2 or 3 second, and somtime (rarely) it's ok.
I put the last OS version (28.02) and stil lthe same problem.
Any idea?
I tried with a simple program like this andstill the same prob.
DataTable (Aerodyne,True,-1)
DataInterval (0,1,Sec,0)
Sample(1,Cycle,String)
Sample(1,Ch,IEEE4)
EndTable
Beginprog
Do
Realtime(rtime)
while rtime(4) = 10 and rtime(5) = 00 ' for example
Do
For Ch = 1 To 8
Scan(1,Sec,1,60)
Cycle=mesure_chambre
CallTable(Aerodyne)
NextScan
Next Ch
Loop
EndProg
Thanks for your help.
David.
If you remove the DataInterval instruction from your data table, you should get all the records.
You should also not place Scan within a Do Loop or For Next statement. I am surprised it compiled. Keep in mind that Scan is a time synched Do Loop. You may be interested in SubScan, which I think is more approriate for what you want to accomplish.
Hey, thank you for your faster answer.
I did it whitout DataInterval and it's the same. For example i started my program at 10h25.00 and the first value in table is at 10h25.06, so i missed 5 seconds. Then it's every 2 or 3 seconds and i miss again 2,3 or more minutes later..
I just use Do Loop for my test, to let run my program indefinitly.
I will join you my real program, actually running.
CR3000
'Autor : David CHANCEL
'20/07/14
'Name : Programme AnaEE - Picarro G2201-i
Public BattV, flag
Public PTemp_C
Public Tref, Temptherm(8), Ch,Tempthermocouple, c , heure, minute
Dim Cycle As String * 1000
Dim file_cmd As Long
'Public P(nbsensor,2)
Public Aerodyne(nbmesures,1)
Alias Aerodyne(1) = iso_546 : Units iso_546 = ppb
Alias Aerodyne(2) = iso_456 : Units iso_456 = ppb
Alias Aerodyne(3) = CO2 : Units CO2 = ppb
Alias Aerodyne(4) = N2O : Units N2O = ppb
'Definition des tempratures et humidits des sondes 5TM
Public i
Public Sonde_5TM(2)
Alias Sonde_5TM(1) = Hr_Sol
Alias Sonde_5TM(2) = Temp_Sol
'Date et heure
Public rTime(9)
Alias rTime(1) = YYYY
Alias rTime(2) = MM
Alias rTime(3) = DD
Alias rTime(4) = H
Alias rTime(5) = M
Alias rTime(6) = S
Alias rTime(7) = uS
Alias rTime(8) = DayofWeek
Alias rTime(9) = DayofYear
'dclaration variables pour relais
Public rly(16)
'sonde CS215
Public CS215(2)
Alias CS215(1)= Temp_Air
Alias CS215(2)= Hr_Air
'CS106
Const Altitude=320
Public CS106
Public Pression 'As Float *0.2
'Public Gaz_Concentration(5)
'Alias Gaz_Concentration(1) = Hr_Delta_iCH4_5min
'Alias Gaz_Concentration(2) = H2O : Units H2O = %
'Alias Gaz_Concentration(3) = C12CO2 : Units C12CO2 = ppm
'Alias Gaz_Concentration(4) = Delta_5min_iCO2 :Units Delta_5min_iCO2 = ‰
'Alias Gaz_Concentration(5) = rr :Units rr = ‰
Dim Concentrations As String * 1000
Units BattV=Volts
Units PTemp_C=Deg c
'Units AirTC=Deg C
'Units RH=%
DataTable (Aerodyne,True,-1)
'DataInterval (0,1,Sec,0)
' Sample(9,rTime,FP2)
Sample(1,PTemp_C,String)
Sample(1,Cycle,String)
Sample(1,Ch,IEEE4)
'Sample (1,iso_546,IEEE4)
'Sample (1,iso_456,IEEE4)
'Sample (1,CO2,IEEE4)
'Sample (1,N2O ,IEEE4)
' Sample(2,Sonde_5TM(),FP2)
EndTable
DataTable (Eddy,1,-1)
'DataInterval (0,100,mSec,1)
Sample(1,Cycle,String)
Sample(1,PTemp_C,String)
' Sample(9,rTime,FP2)
'Sample (1,iso_546,IEEE4)
'Sample (1,iso_456,IEEE4)
'Sample (1,CO2,IEEE4)
'Sample (1,N2O ,IEEE4)
' Sample(2,Sonde_5TM(),FP2)
EndTable
Sub Initialisation
'Ouverture du RS232 pour Aerodyne - doit etre connecte sinon bloque programme
' SerialOpen(ComRS232,57600,0,0,1024)
'port SW1 ON (5TM) - Alimentation sondes / ON capteur pression CS106
PortSet (9,1)
'port C3 ON (CS106) - - Alimentation sonde
' Delay (0,100,mSec)
Cycle = "O"
Ch=0
flag=0
'relais a 0
rly(16)=0
SDMCD16AC(rly(),1,0)
EndSub
'Main Program
BeginProg
Do
Call Initialisation
RealTime (rTime)
Loop Until rTime(4) = 10 AND rTime(5)= 25 AND rTime(6)= 00
Do
For Ch = 1 To 8 'repete les scans pour toutes les chambres
'mise en route ventilos
rly(9) = 1
SDMCD16AC(rly(),1,0)
Scan(1,Sec,1,60)
'purge de la ligne
Cycle = "Purge_Chambre"
flag=1
'Appel des tables
CallTable(Aerodyne)
'CallTable(Dataout)
CallTable(Table2)
NextScan
'Activation verin
'mise a 1 de la variable du relais 1 / Fermeture de la chambre en cours
rly(Ch) = 1
'commande d'activation du relais 1
SDMCD16AC(rly(),1,0)
Scan (1,Sec,1,60) '14min * 60s = 840
'pour indique que les messures sont en court
Cycle = "Mesure_Chambre"
flag=2
'Appel des tables
CallTable (Aerodyne)
' CallTable(Dataout)
CallTable(Table2)
NextScan
'remise zero relais / ouverture de la chambre
rly(Ch)= 0
SDMCD16AC(rly(),1,0)
Next Ch
'relais a 0
rly(16)=0
SDMCD16AC(rly(),1,0)
Ch=0
'eddycovariance
Scan (100,mSec,1,4200) '2h en eddy - 120 * 60 = 7200s - 8 min = 60 * 8 = 4200
Cycle = "EddyCo"
CallTable (Dataout)
CallTable (Eddy)
NextScan
Loop
EndProg
To simplify, i deleted lines with sensors aquisition, serial in from analyzer, etc.
But all the lines that i deleted here are actuall in comments like "'serialin(....)" so they are not the problem of my missing values.* i guess.
Thank you again.
David.
I took your code and added Const nbmesures = 4 so that it would compile. I also reduced the size of the Eddy table so the Aerodyne table would have enough space.
The code ran fine on my datalogger without any missing records. It must be that something in the code you removed is taking too much time to fit within you scan rate. You can confirm this by looking in the Status table. Skipped scans will be counted and the measurment time and processing time will be listed in microseconds. The code is compiling in sequential mode, so the needed time for the scan is the processing time plus the measurement time.