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.

CR1000 stop logging with GETVARIABLES instruction


LeonardoOliveira Nov 12, 2015 07:37 PM

Hi everyone, I work in ATTO project here in Amazon Forest, Brazil.

So, I'm having some issues with the communication between two CR1000 dataloggers.

What I want to do is to get some values of temperature and humidity from one Cr1000 to the other one with GetVariables instrution. In this way I can complement my vertical temp/humd table without use a long cable for my CS215 termohigrometers (the loggers are separate from each other 60 meters).

For this I am using two NL115 at each datalogger and creating a port over TCPOpen instruction. The dataloggers are connected through an ethernet switch and I can put my computer in this switch too to connect and see the data when I am in the tower.

In the first time it worked just fine, but with time I realized that I have some static data in the logger that is collecting the variables from the another one, and sometimes (when the one of the loggers are disconnected or unplugged of the network) the scan freezes and the datatable just skip some logs. This is not good if, for example, one of my loggers stops.The other one will not work fine too.

I am attaching the two CR1000 programs and it will be very nice if you could look at them for me.

---------------------PROGRAM THAT SEND THE DATA---------

'Main Program
BeginProg
Scan (60,Sec,0,0)

PanelTemp (PTemp,250)
Battery (batt_volt)

PortSet(2,1)

CS616 (P_ms_1,1,1,1,1,1.0,0)
Uso_01 = a0 + (a1*P_ms_1) + (a2*P_ms_1^2)

CS616 (P_ms_2,1,2,1,1,1.0,0)
Uso_02 = a0 + (a1*P_ms_2) + (a2*P_ms_2^2)

CS616 (P_ms_3,1,3,1,1,1.0,0)
Uso_03 = a0 + (a1*P_ms_3) + (a2*P_ms_3^2)

CS616 (P_ms_4,1,4,1,1,1.0,0)
Uso_04 = a0 + (a1*P_ms_4) + (a2*P_ms_4^2)

PeriodAvg(P_ms_5,1,mV250,5,0,0,10,50,0.001,0)
Uso_05=-0.187+(0.037*P_ms_5)+(0.335*P_ms_5^2)

CS616 (P_ms_6,1,6,1,1,1.0,0)
Uso_06 = a0 + (a1*P_ms_6) + (a2*P_ms_6^2)

Therm107 (TSO(1),5,7,Vx1,0,250,1.0,0)
VoltSe (Pressao2m,1,mV2500,12,1,0,250,0.184,600)
VoltDiff (shf(1),2,mV25C,7,True ,0,250,1.0,0)
shf(1) = shf(1) * hfp01cal01
shf(2) = shf(2) * hfp01cal02

For x = 1 To 5 Step 1
SDI12Recorder (CS215_4(),5,4,"M!",1.0,0)
If CS215_4(1) <> NAN Then ExitFor
Next x

For x = 1 To 5 Step 1
SDI12Recorder (CS215_5(),5,5,"M!",1.0,0)
If CS215_5(1) <> NAN Then ExitFor
Next x

For x = 1 To 5 Step 1
SDI12Recorder (CS215_6(),5,6,"M!",1.0,0)
If CS215_6(1) <> NAN Then ExitFor
Next x
'Nao utilizado em primeiro momento o envio de dados para o topo. Somente a coleta de dados do solo pelo topo
'
' SendVariables (R1,socket_1,-1,1,0000,50,"Public","Tar_16m",Tar_16m,1)
' SendVariables (R2,socket_1,-1,1,0000,50,"Public","Tar_08m",Tar_08m,1)
' SendVariables (R3,socket_1,-1,1,0000,50,"Public","Tar_01m",Tar_01m,1)
' SendVariables (R4,socket_1,-1,1,0000,50,"Public","Uar_16m",Uar_16m,1)
' SendVariables (R5,socket_1,-1,1,0000,50,"Public","Uar_08m",Uar_08m,1)
' SendVariables (R6,socket_1,-1,1,0000,50,"Public","Uar_01m",Uar_01m,1)
'

CallTable (table444)
CallTable (table445)
CallTable (table446)
CallTable (WCR_Control)

NextScan
EndProg

---------------------PROGRAM THAT GET THE DATA---------

'Main Program

BeginProg


flag = 0

Scan (100,mSec,0,0)

socket_2 = TCPOpen ("192.168.1.20",6785,0)

EC100 (Ux,ecsdm,1)

PulseCount (Chuva,1,2,2,1,1.0,0)

'leitura da velocidade
PulseCount(Vel_52m, 1, 1,2,5000,0.799,0.2811)
If (Vel_52m < 0.2811) Then
Vel_52m = 0
EndIf


CallTable fluxo

NextScan

SlowSequence

Scan(60,Sec, 0, 0)



'Canais SE01 a SE04 - CNR4
VoltSe (CNR4(1),4,AutoRange,1,False,0,250,1.0,0)
OC_in = OC_in * 63.21 + 0
OL_in = OL_in * 66.26 + 0
OC_out = OC_out * 122.249 + 0
OL_out = OL_out * 123.762 + 0
'Zera OC se menor que Zero
If (OC_in < 0) Then
OC_in = 0
EndIf
If (OC_out < 0) Then
OC_out = 0
EndIf
' Leitura do Par incidente sn 3134 cte 23.085 SE05
VoltSe(Par_in, 1,mV25, 5, False, 0, 250, parin, 0)
If (Par_in < 0) Then
Par_in = 0
EndIf
' Leitura do Par refletido sn 3144 cte 25.591 SE06
VoltSe(Par_out, 1,mV25, 6, False, 0, 250, parout, 0)
If (Par_out < 0) Then
Par_out = 0
EndIf

' VoltSe (Pressao,1,mV2500,8,1,0,250,0.184,600)

BrHalf (CNR4(5),1,mV2500,7,Vx1,1,2500,True ,0,250,1.0,0)
CNR4(5) = 1000*(CNR4(5)/(1-CNR4(5)))
CNR4(5)= 1/(1.0295e-3+2.391e-4*LN(CNR4(5))+1.568e-7*(LN(CNR4(5)))^3)-273.15

'Leitura da direcao do vento
BrHalf(Dir_vento, 1, mV2500,8, VX2, 1, 2500,True, 20000,250, 712.0, 0)
' zera os valores acima de 360
If (Dir_vento >= 360) Then
Dir_vento = 0
EndIf

For X = 1 To 5 Step 1
SDI12Recorder (CS215_1(),5,1,"M!",1.0,0)
If CS215_1(1) <> NAN Then ExitFor
Next X

For X = 1 To 5 Step 1
SDI12Recorder (CS215_2(),5,2,"M!",1.0,0)
If CS215_2(1) <> NAN Then ExitFor
Next X

For X = 1 To 5 Step 1
SDI12Recorder (CS215_3(),5,3,"M!",1.0,0)
If CS215_3(1) <> NAN Then ExitFor
Next X

'coletar os dados do perfil de temperatura e umidade do datalogger 2 atraves do NL115
GetVariables (R1,socket_2,-1,2,0000,50,"Public","Tar_16m",Tar_16m,1)
GetVariables (R2,socket_2,-1,2,0000,50,"Public","Tar_08m",Tar_08m,1)
GetVariables (R3,socket_2,-1,2,0000,50,"Public","Tar_01m",Tar_01m,1)
GetVariables (R4,socket_2,-1,2,0000,50,"Public","Uar_16m",Uar_16m,1)
GetVariables (R5,socket_2,-1,2,0000,50,"Public","Uar_08m",Uar_08m,1)
GetVariables (R6,socket_2,-1,2,0000,50,"Public","Uar_01m",Uar_01m,1)
GetVariables (R7,socket_2,-1,2,0000,50,"Public","Pressao2m",Pressao2m,1)
'leitura da bateria
Battery(Bat)

'Calculo do Rnet

Rnet_CNR4 = (OC_in - OC_out) + (OL_in - OL_out)

Pressao = sonic_irga(10)


'Grava dados a cada 30 minutos
CallTable table222
'Grava dados diarios
CallTable table223
'grava perfil de TRH
CallTable (table224)
'grava valores instantaneos
CallTable (table225)



NextScan
EndProg


JDavis Nov 12, 2015 09:44 PM

Try removing the TCPOpen from you program and use the Pakbus TCP Client setting on one datalogger to establish and maintain the connection. The -1 for neighbor address will use autodiscover, which includes dataloggers found with Pakbus TCP Client.

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