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.

Programming for CR1000


fufu Sep 3, 2015 02:33 PM

Hi, I am currently using Cr1000. I am new to programming and would like to ask how do I record the average values for RH for table2. I am currently using shortcut, and the shortcut does not provide me with the option to save the averaged data, it only allows me to save the sampled data. Thank you so much for your help.

My script:
'CR1000
'Created by SCWIN (2.5)

'Declare Variables and Units
Public Batt_Volt
Public DiffVolt
Public PTemp_C
Public Temp_C
Public AirTC
Public RH
Public AirTC_2
Public RH_2

Units Batt_Volt=Volts
Units DiffVolt=mV
Units PTemp_C=Deg C
Units Temp_C=Deg C
Units AirTC=Deg C
Units RH=%
Units AirTC_2=Deg C
Units RH_2=%

'Define Data Tables
DataTable(Table1,True,-1)
DataInterval(0,1,Sec,10)
Sample(1,Batt_Volt,FP2)
Sample(1,DiffVolt,FP2)
Sample(1,PTemp_C,FP2)
Sample(1,Temp_C,FP2)
Sample(1,AirTC,FP2)
Sample(1,RH,FP2)
Sample(1,AirTC_2,FP2)
Sample(1,RH_2,FP2)
EndTable

DataTable(Table2,True,-1)
DataInterval(0,1,Min,10)
Minimum(1,Batt_Volt,FP2,False,False)
Average(1,DiffVolt,FP2,False)
Average(1,PTemp_C,FP2,False)
Average(1,Temp_C,FP2,False)
Average(1,AirTC,FP2,False)
Sample(1,RH,FP2)
Average(1,AirTC_2,FP2,False)
Sample(1,RH_2,FP2)
EndTable

'Main Program
BeginProg
Scan(1,Sec,1,0)
'Default Datalogger Battery Voltage measurement Batt_Volt:
Battery(Batt_Volt)
'Generic Differential Voltage measurements DiffVolt:
VoltDiff(DiffVolt,1,mV5000,1,True,0,_50Hz,0.2,0.0)
'Wiring Panel Temperature measurement PTemp_C:
PanelTemp(PTemp_C,_60Hz)
'Type E (chromel-constantan) Thermocouple measurements Temp_C:
TCDiff(Temp_C,1,mV7_5C,2,TypeE,PTemp_C,True,0,_60Hz,1,0)
'HMP45C (7-wire) Temperature & Relative Humidity Sensor measurements AirTC and RH:
PortSet(1,1)
Delay(0,150,mSec)
VoltSE(AirTC,1,mV2500,5,0,0,_60Hz,0.1,-40.0)
VoltSE(RH,1,mV2500,6,0,0,_60Hz,0.1,0)
PortSet(1,0)
If RH>100 And RH<108 Then RH=100
'HMP45C (7-wire) Temperature & Relative Humidity Sensor measurements AirTC_2 and RH_2:
PortSet(2,1)
Delay(0,150,mSec)
VoltSE(AirTC_2,1,mV2500,7,0,0,_60Hz,0.1,-40.0)
VoltSE(RH_2,1,mV2500,8,0,0,_60Hz,0.1,0)
PortSet(2,0)
If RH_2>100 And RH_2<108 Then RH_2=100
'Call Data Tables and Store Data
CallTable(Table1)
CallTable(Table2)
NextScan


JDavis Sep 3, 2015 05:52 PM

On the Output page in ShortCut, you may right click the variable for relative humidity to add an average of the measurement.

By default, you are not given the option to average relative humidity. That is because the average of the measurement is not very useful statistically. You expect it to go up and down every day. Average dewpoint is more meaningful to show a trend.


fufu Dec 11, 2015 09:36 AM

Hi,

I have tried to use the CR basic programming in loggernet & the shortcut program in loggernet. However, both programs only allow me to choose sampling rate for the relative humidity measurements for the HMP, there is no average provided (but for temperature measurements, i am allowed to choose average readings for every 5 secs).

When I right click on the relative humidity measurement, only maximum, minimum and sample options are available.

May I ask is there any way I can change the script/ code above to program the CR1000 to record the average relative humidity reading for every 5 seconds?

Thanks for your help in advance. Hope you have a nice day ahead.


JDavis Dec 11, 2015 09:28 PM

When your right click the name of the RH measurement in the selected sensors list, a drop down list will appear allowing you to select average. If you don't get the drop down list, install the latest version of ShortCut from our website.

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