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.

PulseCount in High Frequency scan rate


LeonardoOliveira Nov 12, 2011 01:57 AM

Hello,

I'm trying to use two reed switch sensors with low frequency measures in a program that also reads high frequency.

What is the better option to measure a 14a in low frequency in a program wich the main program is in high frequency? I want to read the value in a 10s of scan rate but I have an EC system in a 50ms of scan rate and PulseCount could not be used in Slowsequency. The sensor is not working good in that frequency (the same for a tb4). I tryed to use a SDM-SW8a but it also is not working good. The values are zero in every scan and are too many NAN in the tb4 case.

please, see the software below. (some terms and variables are in portuguese but I think you can understand the logic of programation)

Public OC_in
Public OL_in
Public OL_out
Public OC_out
Public Par_in
Public Par_out
Public Tar_52m
Public Uar_52m
Public Dir_vento
Public WindSpeed_52m
Public rain
Public Bat
Public Rnet_CNR1
Public Rnet
Public Pressao
Public licor(11)

'variaveis de entrada serial do gill r3
Public InString As String * 38
Public d3 As String *6
Public d4 As String *6
Public d5 As String *6
Public d6 As String *6

'Define Aliases
Alias d3 = Ux
Alias d4 = Uy
Alias d5 = Uz
Alias d6 = TS

Alias licor(1) = co2
Alias licor(2) = h2o
Alias licor(5) = pressure_licor
Alias licor(6) = Temp_licor


Units OC_in = W/m²
Units OL_in = W/m²
Units OL_out = W/m²
Units OC_out = W/m²
Units Par_in = W/m²
Units Par_out = W/m²
Units Tar_52m = ºC
Units Uar_52m = %
Units Dir_vento = º
Units WindSpeed_52m = m/h
Units rain = mm²
Units Bat = Volts
Units Rnet = W/m²
Units Rnet_CNR1 = W/m²
Units Pressao = hPa
Units co2 = mm/m^3
Units h2o = mm/m^3
Units pressure_licor = kPa
Units Ux = m/s^2
Units Uy = m/s^2
Units Uz = m/s^2
Units TS = C

'Define Data Tables
'tabela de fluxos
DataTable (fluxo,1,-1)
CardOut (0,-1)

Sample (1,d3,FP2)
Sample (1,d4,FP2)
Sample (1,d5,FP2)
Sample (1,d6,FP2)
Sample (2,licor(1),FP2)
Sample (2,licor(5),FP2)

EndTable

'tabela de dados meteorologicos de baixa frequencia
DataTable (table222,1,-1)
DataInterval(0,30,Min,10)
CardOut (0,-1)
Average(1, Tar_52m, FP2, 0)
Average(1, Uar_52m, FP2, 0)
Maximum(1, Vel_52m, FP2, 0, True)
WindVector(1, WindSpeed_52m, Dir_vento, FP2, 0, 0, 0, 1)
Average(1, OC_in, FP2, 0)
Average(1, OL_in, FP2, 0)
Average(1, OC_out, FP2, 0)
Average(1, OL_out, FP2, 0)
Average(1, Par_in, FP2, 0)
Average(1, Par_out, FP2, 0)
Totalize(1,rain, FP2,False)
Average (1,Pressao,IEEE4,False)
'Rnet = (OC_in - OC_out) + (OL_in - OL_out)
Average (1,Rnet,FP2,False)
Average (1,Rnet_CNR1,FP2,False)
Sample(1, Bat, FP2)

EndTable

'tabela de valores diarios
DataTable (table223,1,-1)
DataInterval(0,24,Hr,10)
CardOut (0,-1)
Maximum(1, Tar_52m, FP2, 0, True)
Minimum(1, Tar_52m, FP2, 0, True)
Maximum(1, Uar_52m, FP2, 0, True)
Minimum(1, Uar_52m, FP2, 0, True)
Totalize(1, Chuva, FP2, 0)
Average (1,Rnet,FP2,False)

EndTable


'Main Program

BeginProg

SerialOpen (Com3,19200,0,0,1000)
Scan (50,mSec,0,0)
SerialIn (InString,Com3,10,13,1000)
SerialFlush (Com3)
CS7500 (licor(1),1,7,4)

'Extracao dos dados do sonico
d3= Mid (InString,8,6)
d4= Mid (InString,15,6)
d5= Mid (InString,22,6)
d6= Mid (InString,29,6)

CallTable fluxo
NextScan
SlowSequence

Scan(1,Sec, 0, 0)
If IfTime (0,10,Sec) Then


SDMSW8A (rain,1,0,2,1,0.254,0)
SDMSW8A (WindSpeed_52m,1,0,1,2,2,0)
WindSpeed_52m = WindSpeed_52m * 0.08
'multiplier founded with theory of operation of the sensor



(...)


here are being made several measures of low frequency that are not giving me problems

(...)

'Grava dados a cada 30 minutos
CallTable table222

'Grava dados diarios
CallTable table223

EndIf

NextScan

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