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 logger data overlapping.


Vincent4896 Mar 1, 2018 10:16 AM

My AVW200 keep shifting between 1-32 in multiplexer. heres the result i've captured.

The highlighted ones is the correct sensor on the correct spot.

I've set the scan rate to 4 minutes. Is there anything i can do to fix this?

https://drive.google.com/file/d/15VuF98BjMiFMELRTtHFyd5OvToinraPe/view?usp=sharing


ariklee Mar 1, 2018 06:45 PM

Looking at your data file, couple questions: (1) Were you resetting the program, or was the logger resetting due to low power? What is your battery voltages here? The logger comes on steady after 16:56, but given that your scan interval is 4 minutes, you are missing scans. Please post your code.


Vincent4896 Mar 2, 2018 02:12 AM

(1) Were you resetting the program, or was the logger resetting due to low power?

Yes i've reset it, since the result keep on shifting.

(2)What is your battery voltages here?

Battery is 12 .7volts

Kindly guide me or advice me. thanks.

'Declare Variables and Units
Dim Count
Public BattV
Public FCLoaded
Public PTemp_C
Public AVWRC
Public VW(10,6)
Public CReps
Public ZMode
Public CIndex
Public CAvg
Public Freq(10)
Public Amp(10)
Public SNRat(10)
Public NFreq(10)
Public DRat(10)
Public TR(10)
Public BPCopy(10)
Public TT(10)
Public TT0(10)
Public Digits(10)
Public Digits0(10)
Public Lvl(10)
Public G_Factor(10)={-0.02541,-0.02496,-0.02657,-0.02538,-0.02591,-0.02531,-0.02413,-0.02545,-0.02631,-0.02517}
Public T_Factor(10)={-0.007726,-0.003345,0.003590,-0.01335,-0.006987,-0.004778,-0.01081,-0.002966,-0.0006420,-0.001114}
Public F0Digits(10)={8862,8891,8702,8841,8756,8910,8880,8680,8632,8682}
Public F0Temp(10)={20.5,20.8,21.4,19.1,19.9,20.8,18.8,20.5,20.4,20.4}
Public F0BP(10)={1000.6,1000.6,1000.6,1000.6,1000.6,1000.6,1000.6,1000.6,1000.6,1000.6}
Public Result
Dim x(), y()
Public DST(16,6),
Public VWHz(16)

Public ErrorCode 'Error Code sent back from ModBus Command
Public A_Axis_Degrees(14) 'A Axis Degree Output
Public A2(14),B2(14)
Public B_Axis_Degrees(14) 'B Axis Degree Output
Public Celsius(14) 'Temperature Celsius

Dim Socket As Long

Units BattV=Volts
Units PTemp_C=Deg C
Units Freq=Hz
Units Amp=mV RMS
Units NFreq=Hz
Units TR=ohms
Units BPCopy=mbar
Units TT=deg C
Units TT0=deg C
Units Digits=digits
Units Digits0=digits
Units Lvl=m

'Define Data Tables
DataTable(VW_Piezometer,True,-1)
DataInterval(0,2,Min,10)
Sample (16,VWHz(),IEEE4)
Sample(1,BattV,FP2)
Sample(1,PTemp_C,FP2)
Sample(1,AVWRC,FP2)
Sample(1,Freq(1),FP2)
Sample(1,Amp(1),FP2)
Sample(1,SNRat(1),FP2)
Sample(1,NFreq(1),FP2)
Sample(1,DRat(1),FP2)
Sample(1,TR(1),FP2)
Sample(1,TT(1),FP2)
Sample(1,Digits(1),IEEE4)
Sample(1,Lvl(1),FP2)
Sample(1,Freq(2),FP2)
Sample(1,Amp(2),FP2)
Sample(1,SNRat(2),FP2)
Sample(1,NFreq(2),FP2)
Sample(1,DRat(2),FP2)
Sample(1,TR(2),FP2)
Sample(1,TT(2),FP2)
Sample(1,Digits(2),IEEE4)
Sample(1,Lvl(2),FP2)
Sample(1,Freq(3),FP2)
Sample(1,Amp(3),FP2)
Sample(1,SNRat(3),FP2)
Sample(1,NFreq(3),FP2)
Sample(1,DRat(3),FP2)
Sample(1,TR(3),FP2)
Sample(1,TT(3),FP2)
Sample(1,Digits(3),IEEE4)
Sample(1,Lvl(3),FP2)
Sample(1,Freq(4),FP2)
Sample(1,Amp(4),FP2)
Sample(1,SNRat(4),FP2)
Sample(1,NFreq(4),FP2)
Sample(1,DRat(4),FP2)
Sample(1,TR(4),FP2)
Sample(1,TT(4),FP2)
Sample(1,Digits(4),IEEE4)
Sample(1,Lvl(4),FP2)
Sample(1,Freq(5),FP2)
Sample(1,Amp(5),FP2)
Sample(1,SNRat(5),FP2)
Sample(1,NFreq(5),FP2)
Sample(1,DRat(5),FP2)
Sample(1,TR(5),FP2)
Sample(1,TT(5),FP2)
Sample(1,Digits(5),IEEE4)
Sample(1,Lvl(5),FP2)
Sample(1,Freq(6),FP2)
Sample(1,Amp(6),FP2)
Sample(1,SNRat(6),FP2)
Sample(1,NFreq(6),FP2)
Sample(1,DRat(6),FP2)
Sample(1,TR(6),FP2)
Sample(1,TT(6),FP2)
Sample(1,Digits(6),IEEE4)
Sample(1,Lvl(6),FP2)
Sample(1,Freq(7),FP2)
Sample(1,Amp(7),FP2)
Sample(1,SNRat(7),FP2)
Sample(1,NFreq(7),FP2)
Sample(1,DRat(7),FP2)
Sample(1,TR(7),FP2)
Sample(1,TT(7),FP2)
Sample(1,Digits(7),IEEE4)
Sample(1,Lvl(7),FP2)
Sample(1,Freq(8),FP2)
Sample(1,Amp(8),FP2)
Sample(1,SNRat(8),FP2)
Sample(1,NFreq(8),FP2)
Sample(1,DRat(8),FP2)
Sample(1,TR(8),FP2)
Sample(1,TT(8),FP2)
Sample(1,Digits(8),IEEE4)
Sample(1,Lvl(8),FP2)
Sample(1,Freq(9),FP2)
Sample(1,Amp(9),FP2)
Sample(1,SNRat(9),FP2)
Sample(1,NFreq(9),FP2)
Sample(1,DRat(9),FP2)
Sample(1,TR(9),FP2)
Sample(1,TT(9),FP2)
Sample(1,Digits(9),IEEE4)
Sample(1,Lvl(9),FP2)
Sample(1,Freq(10),FP2)
Sample(1,Amp(10),FP2)
Sample(1,SNRat(10),FP2)
Sample(1,NFreq(10),FP2)
Sample(1,DRat(10),FP2)
Sample(1,TR(10),FP2)
Sample(1,TT(10),FP2)
Sample(1,Digits(10),IEEE4)
Sample(1,Lvl(10),FP2)

EndTable

DataTable (Inclinometer, 1,-1)
Sample (14,A_Axis_Degrees(),IEEE4) 'Store Degree Reading for A Axis
Sample (14,B_Axis_Degrees(),IEEE4) 'Store Degree Reading for B Axis
Sample (14,Celsius(),IEEE4) 'Store Thermistor C Reading
EndTable

'Calibration history table
'DataTable(CalHist,NewFieldCal,10)
' SampleFieldCal
'EndTable

'Main Program
BeginProg
SerialOpen(Com3,38400,4,0,0)
'Initialize calibration variables for
'Geokon 4500 Series Vibrating Wire Piezometer calculation 'Lvl()'
CReps=10 : CIndex=1 : CAvg=1
For Count = 1 To 14
Digits0(Count)=F0Digits(Count) : TT0(Count)=F0Temp(Count)
Next
'Load the most recent calibration values from the CalHist table
FCLoaded=LoadFieldCal(True)
'Main Scan
Scan(2,Min,1,0)
'Default CR1000 Datalogger Battery Voltage measurement 'BattV'
Battery(BattV)
'Default CR1000 Datalogger Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp(PTemp_C,_60Hz)
'Geokon 4500 Series Vibrating Wire Piezometer measurement 'Freq()'

'Read AM16/32 Multiplexers: 1 and 2
PortSet(3,1) 'Turn on MUX 1 and 2
Delay (1,100,mSec)
For x = 1 To 16
PulsePort (4,2000) 'Advance to the next multiplexer location (Mux 1)
Delay (1,10,mSec)
SDI12Recorder (DST(x,1),1,1,"M1 !",1.0,0)
Next x
PortSet(3,0) 'Turn off power to MUX 1 and 2


For y = 1 To 16
If DST(y,2) < 0.1 Then
VWHz(y) = NAN
Else
VWHz(y) = DST(y,1)
EndIf
Next y

AVW200(AVWRC,Com3,0,200,VW(1,1),1,1,10,1000,4000,1,_60Hz,1,0)
For Count=1 To 14
Freq(Count)=VW(Count,1)
Amp(Count)=VW(Count,2)
SNRat(Count)=VW(Count,3)
NFreq(Count)=VW(Count,4)
DRat(Count)=VW(Count,5)
TR(Count)=VW(Count,6)
'Calculate thermistor temperature 'TT()'
TT(Count)=1/(1.4051E-3+2.369E-4*LN(TR(Count))+1.019E-7*LN(TR(Count))^3)-273.15
'Calculate digits 'Digits()'
Digits(Count)=Freq(Count)^2/1000
'Calculate water level 'Lvl()' (PSI)
'The equation and linear gage factor polarity for the Geokon 4500 documented in old and new calibration sheets differ.
'The new equation is used below, with a slight modification replacing the linear gage factor (G) with (ABS(G)*(-1))
'assuring that the linear gage factor entered by the user is always negated before use in the equation.
'The new equation is P=G(R1-R0)+K(T1-T0)-(S1-S0) and requires a negative linear gage factor.
Lvl(Count)=(Digits(Count)-Digits0(Count))*(ABS(G_Factor(Count))*(-1))+(TT(Count)-TT0(Count))*T_Factor(Count)
'Convert water level 'Lvl()' from PSI to m
Lvl(Count)=Lvl(Count)*0.70432

'Zeroing calibration for
'Geokon 4500 Series Vibrating Wire Piezometer calculations 'Digits()' and 'TT()'
'FieldCal(4,Digits(),CReps,0,Digits0(),ZMode,0,CIndex,CAvg)
'FieldCal(4,TT(),CReps,0,TT0(),ZMode,0,CIndex,CAvg)

'Write to register to begin reading MEMS String
'NOTE: ModbusMaster won't send 0x118 unless "&H119" is entered
ModBusMaster (ErrorCode,COMSDC7,115200,Count,6,1,&H119,1,1,50,0)
'Delay after write register
Delay (1,1,Sec)
'Use Modbus command to retrieve A Axis and B Axis Degree Readings
ModBusMaster (ErrorCode,COMSDC7,115200,Count,3,A_Axis_Degrees(Count),&H101,1,1,50,0)
ModBusMaster (ErrorCode,COMSDC7,115200,Count,3,B_Axis_Degrees(Count),&H103,1,1,50,0)

'Use Modbus command to retrieve Thermistor Celsius from string
ModBusMaster (ErrorCode,COMSDC7,115200,Count,3,Celsius(Count),&H107,1,1,550,0)
'Delay before proceeding to next reading
Delay (1,1,Sec)

'IP Call Back. Please enter the IP in ""
If NOT Route(4094) Then Socket = TCPOpen ("",6785,0)
SendVariables (Result,Socket,-1,4094,0000,100,"VW_Piezometer","Callback",Digits(),1)
SendVariables (Result,Socket,-1,4094,0000,100,"Inclinometer","Callback",A_Axis_Degrees(),1)
SendVariables (Result,Socket,-1,4094,0000,100,"Inclinometer","Callback",B_Axis_Degrees(),1)

Next

'Call Data Tables and Store Data
CallTable VW_Piezometer
CallTable Inclinometer
' CallTable CalHist
NextScan
EndProg


ariklee Mar 5, 2018 06:19 PM

Hi Vincent,

You are initializing the array variables to dimension = 10, and your initialization loop goes through 14 reps. This wouldn't give the issue you're describing, but it looks like you may have meant to use:

For Count = 1 to CReps

Public TT0(10)
Public Digits(10)
Public Digits0(10)
Public F0Digits(10)={8862,8891,8702,8841,8756,8910,8880,8680,8632,8682}
Public F0Temp(10)={20.5,20.8,21.4,19.1,19.9,20.8,18.8,20.5,20.4,20.4}
CReps=10 : CIndex=1 : CAvg=1 For Count = 1 To 14 Digits0(Count)=F0Digits(Count) : TT0(Count)=F0Temp(Count) Next

 

Also, within the scan there is a similar loop of 14 reps, with arrays dimensioned to 10. Not sure if that is the issue, but looks like you better comb your code through again. 

Cheers,


ariklee Mar 5, 2018 06:29 PM

Hi Vincent,

Also, the following is a bit confusing. It appears like you are trying to read two AM16/32 multiplexors, but there is only a single SDI12Recorder command:

 

    'Read AM16/32 Multiplexers: 1 and 2
    PortSet(3,1) 'Turn on MUX 1 and 2
    Delay (1,100,mSec)
    For x = 1 To 16
        PulsePort (4,2000) 'Advance to the next multiplexer location (Mux 1)
        Delay (1,10,mSec)
        SDI12Recorder (DST(x,1),1,1,"M1 !",1.0,0)
    Next x
    PortSet(3,0) 'Turn off power to MUX 1 and 2

 

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