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.

Reading multiple variables off 05103 Anemometer.


RJP May 10, 2024 12:28 PM

Hello,

Firstly, thankyou for reading. I am new to the Campbell Scientific suite and am still learning how to edit in CRBasic after using shortcut to get started. I have an electronics/IT background and am configuring up a CR6 with a 05103 Anemometer. 

I am curious if there is a way to have the sensor output multiple variables into the readings table such as WS_ms, WS_knot from the same sensor or if this needs to be done downstream with conversions for display?

Thanks! 

My code - 

'CR6 Series
'Created by Short Cut (4.5)

'Declare Variables and Units
Public BattV
Public PTemp_C
Public AirTC
Public RH
Public WS_ms
Public WindDir

Units BattV=Volts
Units PTemp_C=Deg C
Units AirTC=Deg C
Units RH=%
Units WS_ms=meters/second
Units WindDir=degrees

'Define Data Tables
DataTable(Hourly,True,-1)
	DataInterval(0,60,Min,10)
	'The following TableFile instruction causes new data to be copied to an optional removable
	'drive (SC115 or USB mass storage) when it is plugged into the datalogger.
	'This TableFile instruction has no effect unless a removable drive is plugged into the datalogger.
	TableFile("USB:"+Status.SerialNumber+"Hourly",8,-1,0,0,Hr,0,0)
	Minimum(1,BattV,FP2,False,True)
	Maximum(1,BattV,FP2,False,True)
	Minimum(1,PTemp_C,FP2,False,True)
	Maximum(1,PTemp_C,FP2,False,True)
	Minimum(1,AirTC,FP2,False,True)
	Maximum(1,AirTC,FP2,False,True)
	Minimum(1,RH,FP2,False,True)
	Maximum(1,RH,FP2,False,True)
	Maximum(1,WS_ms,FP2,False,True)
	Minimum(1,WS_ms,FP2,False,True)
	Sample(1,WindDir,FP2)
EndTable

DataTable(Daily,True,-1)
	DataInterval(0,1440,Min,10)
	Minimum(1,BattV,FP2,False,False)
EndTable

'Main Program
BeginProg
	'Main Scan
	Scan(5,Sec,1,0)
		'Default CR6 Datalogger Battery Voltage measurement 'BattV'
		Battery(BattV)
		'Default CR6 Datalogger Wiring Panel Temperature measurement 'PTemp_C'
		PanelTemp(PTemp_C,60)
		'MP100A (constant power) Temperature & Relative Humidity Sensor (CSL) measurements 'AirTC' and 'RH'
		VoltSE(AirTC,1,mV1000,U1,False,0,60,0.1,0)
		VoltSE(RH,1,mV1000,U2,False,0,60,0.1,0)
		If (RH>100) And (RH<108) Then RH=100
		'05103 Wind Speed & Direction Sensor measurements 'WS_ms' and 'WindDir'
		PulseCount(WS_ms,1,U6,5,1,0.098,0)
		BrHalf(WindDir,1,mV5000,U4,U3,1,2500,True,20000,60,355,0)
		If WindDir>=355 Or WindDir<0 Then WindDir=0
		'Call Data Tables and Store Data
		CallTable Hourly
		CallTable Daily
	NextScan
EndProg

 


yohannathomas11 May 26, 2024 10:43 AM

This post is under review.


Miakos Jun 27, 2024 09:47 AM

This post is under review.

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