Hi,
So I'm just trying to run a basic setup to take the data from my data logger that has 3 tables and send it to an FTP server I've set up. I compile the code and have followed the guides but am not receiving anything on the server. I'm really new to this equipment and style so be gentle. I've attached the info below minus the FTP credentials. If someone could help me figure out if I have coded this correctly and why it isn't working that would be awesome. Thanks you.
'***********************************************************************************
' Component List
' CR1000 Data Logger
' AM16/32 Multiplexer x 2
' 05103 RM Young Wind Monitor
' T107 Temperature Probe
' T110 Temperature Probe
' 350 Ohm Strain Gages 4WFBS350 x 32
'*****************************VARIABLES*******************************************
' Common Variables
Public BattV
Public FCLoaded
Public PTemp_C
' Wind Speed and Direction Variables
Public WS_ms
Public WindDir
' Temperature Variables
Public T107_C
Dim R110PV
Public T110PV_C
'Measurment Variables
Public FTPResult As Boolean, Flag(2) As Boolean, FTPResult2 As Boolean
'TableFile Variables
Public OutStat As Boolean, OutStatTrig As Boolean, LastFileName As String *50
'FTP Parameter Strings (As Constants), Message String & Result Variable
Const IPAddress="192.168.1.1"
Const UserName="guest"
Const Password="password"
' Strain Gage Variables
Public CReps
Public ZMode
Public QBSSMode
Public CIndex
Public CAvg
Public LCount
Public Strain(16)
Public Vr1000(16)
Public GFAdj(16)
Public BrZero(16)
Public CKnown(16)
Public CReps_2
Public ZMode_2
Public QBSSMode_2
Public CIndex_2
Public CAvg_2
Public LCount_2
Public Strain_2(16)
Public Vr1000_2(16)
Public GFAdj_2(16)
Public BrZero_2(16)
Public CKnown_2(16)
Public GFsRaw(16)={2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135} 'Gage Factors for 1st AM16/32
Public GFsRaw_2(16)={2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135,2.135} 'Gage Factors for 2nd AM16/32
'*****************************ALIAS VARIABLES************************************
Alias BattV = Battery_Voltage
Alias PTemp_C = CR1000_Temperature
'Alias PTemp_C_Max = Max_CR1000_Temperature
Alias WS_ms = Wind_Speed
'Alias WS_ms_Max = Max_Wind_Speed
'Alias WS_ms_Min = Min_Wind_Speed
'Alias WS_ms_Avg = Average_Wind_Speed
Alias WindDir = Wind_Direction
Alias T107_C = Ambient_Temperature
'Alias T107_C_Avg = Average_Ambient_Temperature
'Alias T107_C_Max = Max_Ambient_Temperature
'Alias T107_C_Min = Min_Ambient_Temperature
Alias T110PV_C = Surface_Temperature
'Alias T110PV_C_Avg = Average_Surface_Temperature
'Alias T110PV_C_Max = Max_Surface_Temperature
'Alias T110PV_C_Min = Min_Surface_Temperature
'Alias Strain(1) = Gage_1
'Alias Strain(2) = Gage_2
'Alias Strain(3) = Gage_3
'Alias Strain(4) = Gage_4
'Alias Strain(5) = Gage_5
'Alias Strain(6) = Gage_6
'Alias Strain(7) = Gage_7
'Alias Strain(8) = Gage_8
'Alias Strain(9) = Gage_9
'Alias Strain(10) = Gage_10
'Alias Strain(11) = Gage_11
'Alias Strain(12) = Gage_12
'Alias Strain(13) = Gage_13
'Alias Strain(14) = Gage_14
'Alias Strain(15) = Gage_15
'Alias Strain(16) = Gage_16
'Alias Strain_2(1) = Gage_17
'Alias Strain_2(2) = Gage_18
'Alias Strain_2(3) = Gage_19
'Alias Strain_2(4) = Gage_20
'Alias Strain_2(5) = Gage_21
'Alias Strain_2(6) = Gage_22
'Alias Strain_2(7) = Gage_23
'Alias Strain_2(8) = Gage_24
'Alias Strain_2(9) = Gage_25
'Alias Strain_2(10) = Gage_26
'Alias Strain_2(11) = Gage_27
'Alias Strain_2(12) = Gage_28
'Alias Strain_2(13) = Gage_29
'Alias Strain_2(14) = Gage_30
'Alias Strain_2(15) = Gage_31
'Alias Strain_2(16) = Gage_32
'*********************************UNITS********************************************
Units BattV=Volts
Units PTemp_C=Deg C
Units WS_ms=meters/second
Units WindDir=degrees
Units T107_C=Deg C
Units T110PV_C=Deg C
Units Strain=microstrain
Units Vr1000=mV/V
Units GFAdj=unitless
Units BrZero=mV/V
Units Strain_2=microstrain
Units Vr1000_2=mV/V
Units GFAdj_2=unitless
Units BrZero_2=mV/V
'****************************DATA TABLES*****************************************
DataTable(Data_Table,True,-1)
DataInterval(0,1,Min,10)
Sample(1,BattV,FP2)
Minimum(1,BattV,FP2,False,True)
Maximum(1,PTemp_C,FP2,False,False)
Maximum(1,WS_ms,FP2,False,False)
Minimum(1,WS_ms,FP2,False,False)
WindVector (1,WS_ms,WindDir,FP2,False,5,0,0)
FieldNames("WindSpeed_ms_S_WVT,WindDirection_D1_WVT,WindDirection_SD1_WVT")
Sample(1,WindDir,FP2)
Average(1,WS_ms,FP2,False)
Average(1,T107_C,FP2,False)
Average(1,T110PV_C,FP2,False)
Maximum(1,T107_C,FP2,False,False)
Maximum(1,T110PV_C,FP2,False,False)
Minimum(1,T107_C,FP2,False,False)
Minimum(1,T110PV_C,FP2,False,False)
Maximum(1,Strain(1),IEEE4,False,False)
Minimum(1,Strain(1),IEEE4,False,False)
Sample(1,Strain(1),IEEE4)
Maximum(1,Strain(2),IEEE4,False,False)
Minimum(1,Strain(2),IEEE4,False,False)
Sample(1,Strain(2),IEEE4)
Maximum(1,Strain(3),IEEE4,False,False)
Minimum(1,Strain(3),IEEE4,False,False)
Sample(1,Strain(3),IEEE4)
Maximum(1,Strain(4),IEEE4,False,False)
Minimum(1,Strain(4),IEEE4,False,False)
Sample(1,Strain(4),IEEE4)
Maximum(1,Strain(5),IEEE4,False,False)
Minimum(1,Strain(5),IEEE4,False,False)
Sample(1,Strain(5),IEEE4)
Maximum(1,Strain(6),IEEE4,False,False)
Minimum(1,Strain(6),IEEE4,False,False)
Sample(1,Strain(6),IEEE4)
Maximum(1,Strain(7),IEEE4,False,False)
Minimum(1,Strain(7),IEEE4,False,False)
Sample(1,Strain(7),IEEE4)
Maximum(1,Strain(8),IEEE4,False,False)
Minimum(1,Strain(8),IEEE4,False,False)
Sample(1,Strain(8),IEEE4)
Maximum(1,Strain(9),IEEE4,False,False)
Minimum(1,Strain(9),IEEE4,False,False)
Sample(1,Strain(9),IEEE4)
Maximum(1,Strain(10),IEEE4,False,False)
Minimum(1,Strain(10),IEEE4,False,False)
Sample(1,Strain(10),IEEE4)
Maximum(1,Strain(11),IEEE4,False,False)
Minimum(1,Strain(11),IEEE4,False,False)
Sample(1,Strain(11),IEEE4)
Maximum(1,Strain(12),IEEE4,False,False)
Minimum(1,Strain(12),IEEE4,False,False)
Sample(1,Strain(12),IEEE4)
Maximum(1,Strain(13),IEEE4,False,False)
Minimum(1,Strain(13),IEEE4,False,False)
Sample(1,Strain(13),IEEE4)
Maximum(1,Strain(14),IEEE4,False,False)
Minimum(1,Strain(14),IEEE4,False,False)
Sample(1,Strain(14),IEEE4)
Maximum(1,Strain(15),IEEE4,False,False)
Minimum(1,Strain(15),IEEE4,False,False)
Sample(1,Strain(15),IEEE4)
Maximum(1,Strain(16),IEEE4,False,False)
Minimum(1,Strain(16),IEEE4,False,False)
Sample(1,Strain(16),IEEE4)
Maximum(1,Strain_2(1),IEEE4,False,False)
Minimum(1,Strain_2(1),IEEE4,False,False)
Sample(1,Strain_2(1),IEEE4)
Maximum(1,Strain_2(2),IEEE4,False,False)
Minimum(1,Strain_2(2),IEEE4,False,False)
Sample(1,Strain_2(2),IEEE4)
Maximum(1,Strain_2(3),IEEE4,False,False)
Minimum(1,Strain_2(3),IEEE4,False,False)
Sample(1,Strain_2(3),IEEE4)
Maximum(1,Strain_2(4),IEEE4,False,False)
Minimum(1,Strain_2(4),IEEE4,False,False)
Sample(1,Strain_2(4),IEEE4)
Maximum(1,Strain_2(5),IEEE4,False,False)
Minimum(1,Strain_2(5),IEEE4,False,False)
Sample(1,Strain_2(5),IEEE4)
Maximum(1,Strain_2(6),IEEE4,False,False)
Minimum(1,Strain_2(6),IEEE4,False,False)
Sample(1,Strain_2(6),IEEE4)
Maximum(1,Strain_2(7),IEEE4,False,False)
Minimum(1,Strain_2(7),IEEE4,False,False)
Sample(1,Strain_2(7),IEEE4)
Maximum(1,Strain_2(8),IEEE4,False,False)
Minimum(1,Strain_2(8),IEEE4,False,False)
Sample(1,Strain_2(8),IEEE4)
Maximum(1,Strain_2(9),IEEE4,False,False)
Minimum(1,Strain_2(9),IEEE4,False,False)
Sample(1,Strain_2(9),IEEE4)
Maximum(1,Strain_2(10),IEEE4,False,False)
Minimum(1,Strain_2(10),IEEE4,False,False)
Sample(1,Strain_2(10),IEEE4)
Maximum(1,Strain_2(11),IEEE4,False,False)
Minimum(1,Strain_2(11),IEEE4,False,False)
Sample(1,Strain_2(11),IEEE4)
Maximum(1,Strain_2(12),IEEE4,False,False)
Minimum(1,Strain_2(12),IEEE4,False,False)
Sample(1,Strain_2(12),IEEE4)
Maximum(1,Strain_2(13),IEEE4,False,False)
Minimum(1,Strain_2(13),IEEE4,False,False)
Sample(1,Strain_2(13),IEEE4)
Maximum(1,Strain_2(14),IEEE4,False,False)
Minimum(1,Strain_2(14),IEEE4,False,False)
Sample(1,Strain_2(14),IEEE4)
Maximum(1,Strain_2(15),IEEE4,False,False)
Minimum(1,Strain_2(15),IEEE4,False,False)
Sample(1,Strain_2(15),IEEE4)
Maximum(1,Strain_2(16),IEEE4,False,False)
Minimum(1,Strain_2(16),IEEE4,False,False)
Sample(1,Strain_2(16),IEEE4)
TableFile("USR:Test",8,-1,0,1,Min,OutStat,LastFileName)
EndTable
'Calibration history table
DataTable(CalHist,NewFieldCal,10)
SampleFieldCal
EndTable
'***************************EVENT DRIVEN TABLE**********************************
DataTable(Event_Table,True,-1)
DataInterval(0,3,Sec,10)
DataEvent (60,WS_ms>=.44,WS_ms<.44,60)
Sample(1,BattV,FP2)
Maximum(1,PTemp_C,FP2,False,True)
Maximum(1,WS_ms,FP2,False,False)
Minimum(1,WS_ms,FP2,False,False)
WindVector (1,WS_ms,WindDir,FP2,False,5,0,0)
FieldNames("Event Driven Data")
Sample(1,WindDir,FP2)
Average(1,WS_ms,FP2,False)
Average(1,T107_C,FP2,False)
Average(1,T110PV_C,FP2,False)
Maximum(1,T107_C,FP2,False,False)
Maximum(1,T110PV_C,FP2,False,True)
Minimum(1,T107_C,FP2,False,False)
Minimum(1,T110PV_C,FP2,False,True)
Maximum(1,Strain(1),IEEE4,False,False)
Minimum(1,Strain(1),IEEE4,False,False)
Sample(1,Strain(1),IEEE4)
Maximum(1,Strain(2),IEEE4,False,False)
Minimum(1,Strain(2),IEEE4,False,False)
Sample(1,Strain(2),IEEE4)
Maximum(1,Strain(3),IEEE4,False,False)
Minimum(1,Strain(3),IEEE4,False,False)
Sample(1,Strain(3),IEEE4)
Maximum(1,Strain(4),IEEE4,False,False)
Minimum(1,Strain(4),IEEE4,False,False)
Sample(1,Strain(4),IEEE4)
Maximum(1,Strain(5),IEEE4,False,False)
Minimum(1,Strain(5),IEEE4,False,False)
Sample(1,Strain(5),IEEE4)
Maximum(1,Strain(6),IEEE4,False,False)
Minimum(1,Strain(6),IEEE4,False,False)
Sample(1,Strain(6),IEEE4)
Maximum(1,Strain(7),IEEE4,False,False)
Minimum(1,Strain(7),IEEE4,False,False)
Sample(1,Strain(7),IEEE4)
Maximum(1,Strain(8),IEEE4,False,False)
Minimum(1,Strain(8),IEEE4,False,False)
Sample(1,Strain(8),IEEE4)
Maximum(1,Strain(9),IEEE4,False,False)
Minimum(1,Strain(9),IEEE4,False,False)
Sample(1,Strain(9),IEEE4)
Maximum(1,Strain(10),IEEE4,False,False)
Minimum(1,Strain(10),IEEE4,False,False)
Sample(1,Strain(10),IEEE4)
Maximum(1,Strain(11),IEEE4,False,False)
Minimum(1,Strain(11),IEEE4,False,False)
Sample(1,Strain(11),IEEE4)
Maximum(1,Strain(12),IEEE4,False,False)
Minimum(1,Strain(12),IEEE4,False,False)
Sample(1,Strain(12),IEEE4)
Maximum(1,Strain(13),IEEE4,False,False)
Minimum(1,Strain(13),IEEE4,False,False)
Sample(1,Strain(13),IEEE4)
Maximum(1,Strain(14),IEEE4,False,False)
Minimum(1,Strain(14),IEEE4,False,False)
Sample(1,Strain(14),IEEE4)
Maximum(1,Strain(15),IEEE4,False,False)
Minimum(1,Strain(15),IEEE4,False,False)
Sample(1,Strain(15),IEEE4)
Maximum(1,Strain(16),IEEE4,False,False)
Minimum(1,Strain(16),IEEE4,False,False)
Sample(1,Strain(16),IEEE4)
Maximum(1,Strain_2(1),IEEE4,False,False)
Minimum(1,Strain_2(1),IEEE4,False,False)
Sample(1,Strain_2(1),IEEE4)
Maximum(1,Strain_2(2),IEEE4,False,False)
Minimum(1,Strain_2(2),IEEE4,False,False)
Sample(1,Strain_2(2),IEEE4)
Maximum(1,Strain_2(3),IEEE4,False,False)
Minimum(1,Strain_2(3),IEEE4,False,False)
Sample(1,Strain_2(3),IEEE4)
Maximum(1,Strain_2(4),IEEE4,False,False)
Minimum(1,Strain_2(4),IEEE4,False,False)
Sample(1,Strain_2(4),IEEE4)
Maximum(1,Strain_2(5),IEEE4,False,False)
Minimum(1,Strain_2(5),IEEE4,False,False)
Sample(1,Strain_2(5),IEEE4)
Maximum(1,Strain_2(6),IEEE4,False,False)
Minimum(1,Strain_2(6),IEEE4,False,False)
Sample(1,Strain_2(6),IEEE4)
Maximum(1,Strain_2(7),IEEE4,False,False)
Minimum(1,Strain_2(7),IEEE4,False,False)
Sample(1,Strain_2(7),IEEE4)
Maximum(1,Strain_2(8),IEEE4,False,False)
Minimum(1,Strain_2(8),IEEE4,False,False)
Sample(1,Strain_2(8),IEEE4)
Maximum(1,Strain_2(9),IEEE4,False,False)
Minimum(1,Strain_2(9),IEEE4,False,False)
Sample(1,Strain_2(9),IEEE4)
Maximum(1,Strain_2(10),IEEE4,False,False)
Minimum(1,Strain_2(10),IEEE4,False,False)
Sample(1,Strain_2(10),IEEE4)
Maximum(1,Strain_2(11),IEEE4,False,False)
Minimum(1,Strain_2(11),IEEE4,False,False)
Sample(1,Strain_2(11),IEEE4)
Maximum(1,Strain_2(12),IEEE4,False,False)
Minimum(1,Strain_2(12),IEEE4,False,False)
Sample(1,Strain_2(12),IEEE4)
Maximum(1,Strain_2(13),IEEE4,False,False)
Minimum(1,Strain_2(13),IEEE4,False,False)
Sample(1,Strain_2(13),IEEE4)
Maximum(1,Strain_2(14),IEEE4,False,False)
Minimum(1,Strain_2(14),IEEE4,False,False)
Sample(1,Strain_2(14),IEEE4)
Maximum(1,Strain_2(15),IEEE4,False,False)
Minimum(1,Strain_2(15),IEEE4,False,False)
Sample(1,Strain_2(15),IEEE4)
Maximum(1,Strain_2(16),IEEE4,False,False)
Minimum(1,Strain_2(16),IEEE4,False,False)
Sample(1,Strain_2(16),IEEE4)
EndTable
'***************************MAIN PROGRAM****************************************
'Main Program
BeginProg
'Set User drive size so files can be stored to it
SetStatus("USRDriveSize",100000)
'Initialize calibration variables for
CIndex=1 : CAvg=1 : CReps=16 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000()'
For LCount = 1 To 16
GFAdj(LCount)=GFsRaw(LCount)
Next
'Initialize calibration variables for
CIndex_2=1 : CAvg_2=1 : CReps_2=16 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000_2()'
For LCount_2 = 1 To 16
GFAdj_2(LCount_2)=GFsRaw_2(LCount_2)
Next
FCLoaded=LoadFieldCal(True) 'Load the most recent calibration values from the CalHist table
Scan(3,Sec,1,0) 'Main Scan
Battery(BattV) 'Default Datalogger Battery Voltage measurement 'BattV'
PanelTemp(PTemp_C,_60Hz) 'Default Wiring Panel Temperature measurement 'PTemp_C'
PulseCount(WS_ms,1,1,1,1,0.098,0) '05103 Wind Speed Sensor measurements 'WS_ms
BrHalf(WindDir,1,mV2500,1,1,1,2500,True,0,_60Hz,355,0) '05103 Wind Direction Sensor measurements 'WindDir
If WindDir>=360 OR WindDir<0 Then WindDir=0
Therm107(T107_C,1,2,1,0,_60Hz,1,0) '107 Temperature Probe measurement 'T107_C'
BrHalf(R110PV,1,mV2500,3,1,1,2500,True,0,_60Hz,1,0) '110 Temperature Probe measurement 'T110_C'
R110PV=4990*(1-R110PV)/R110PV 'Convert mV to ohms
R110PV=R110PV-1.6 'Subtract cable resistance (see 110PV cable label for cable resistance)
T110PV_C=1/(1.129241E-3+2.341077E-4*LN(R110PV)+8.775468E-8*LN(R110PV)^3)-273.15 'Convert resistance to temperature using Steinhart-Hart equation
PortSet(2,1) 'Turn AM16/32 Multiplexer On
Delay(0,150,mSec)
LCount=1
SubScan(0,uSec,16)
PulsePort(1,10000) 'Switch to next AM16/32 Multiplexer channel
BrFull(Vr1000(LCount),1,mV7_5,3,2,1,2500,True,True,0,_60Hz,1,0) 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000()'
LCount=LCount+1
NextSubScan
' Calculated Strain result 'Strain()' for
StrainCalc(Strain(),16,Vr1000(),BrZero(),-1,GFAdj(),0) 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000()'
' Quarter bridge Strain shunt calibration For
FieldCalStrain(13,Strain(),1,GFAdj(),0,QBSSMode,CKnown(),CIndex,CAvg,GFsRaw(),0) 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000()'
' Zeroing calibration For
FieldCalStrain(10,Vr1000(),CReps,0,BrZero(),ZMode,0,CIndex,CAvg,0,Strain()) 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000()'
PortSet(2,0) 'Turn AM16/32 Multiplexer Off
Delay(0,150,uSec)
PortSet(3,1) 'Turn AM16/32 Multiplexer On
Delay(0,150,mSec)
LCount_2=1
SubScan(0,uSec,16)
PulsePort(1,10000) 'Switch to next AM16/32 Multiplexer channel
BrFull(Vr1000_2(LCount_2),1,mV7_5,4,2,1,2500,True,True,0,250,1,0) 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000_2()'
LCount_2=LCount_2+1
NextSubScan
'Calculated strain result 'Strain_2()' for
StrainCalc(Strain_2(),16,Vr1000_2(),BrZero_2(),-1,GFAdj_2(),0) 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000_2()'
'Quarter bridge strain shunt calibration for
FieldCalStrain(13,Strain_2(),1,GFAdj_2(),0,QBSSMode_2,CKnown_2(),CIndex_2,CAvg_2,GFsRaw_2(),0) 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000_2()'
'Zeroing calibration for
FieldCalStrain(10,Vr1000_2(),CReps_2,0,BrZero_2(),ZMode_2,0,CIndex_2,CAvg_2,0,Strain_2()) 'Quarter Bridge Strain, 3-wire 350 ohm with 4WFBS350 TIM measurement 'Vr1000_2()'
PortSet(3,0) 'Turn AM16/32 Multiplexer Off
Delay(0,150,uSec)
'*******Call Data Tables and Store Data*******
CallTable(Data_Table)
CallTable(CalHist)
CallTable (Event_Table)
'When new file is written, set a trigger to True
'Outstat will be set to false at next CallTable,
'so this keeps a variable "true" until FTPClient
'is executed
If OutStat Then OutStatTrig=True
If Flag(1)
FTPResult2=FTPClient (IPAddress,UserName,Password,"USR:Dir.txt","",6)
Flag(1)=False
EndIf
NextScan
'Run FTPClient in slowsequence, so the rest of the program
'Can go on while FTP is taking place
SlowSequence
Scan (1,Min,3,0)
If OutStatTrig
FTPResult=FTPClient (IPAddress,UserName,Password,LastFileName,Mid(LastFileName,5,20),0)
'set trigger var to false
OutStatTrig=False
EndIf
NextScan
EndProg
I assume you are using an NL115 or NL120 connected to the front of the CR1000, are it's settings correct?
Have you checked your USR to see if the file is getting written?