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.

MinSpa isnt working


Makada May 23, 2017 06:26 PM

Hi all,

the MinSpa temperature isnt working with swath 1440, it working fine when i change the swath to 1 or 2...

Maxspa temperature is working fine.

If tableonemin.output Then
Move (Windskmdag(2),1439,Windskmdag(1),1439)
Windskmdag(1) = Tableonemin.MaxWindskm(1,1)
Move (Windrdag(2),1439,Windrdag(1),1439)
Windrdag(1) = Tableonemin.DiratMaxWindskm(1,1)
Move (Tempdag(2),1439,Tempdag(1),1439)
Tempdag(1) = Tableonemin.TempMax
Move (Tempdag(2),1439,Tempdag(1),1439)
Tempdag(1) = Tableonemin.TempMin
'Also use an array of times (as long integers)
Move (Timeofmaxdag(2),1439,Timeofmaxdag(1),1439)
Timeofmaxdag(1) = Tableonemin.Timeofmax(1,1)
'Look through all 60 values in the array (not 59)
MaxSpa (WindskmdagMax(),1440,Windskmdag(1))
MinSpa (WindskmdagMin(),1440,Windskmdag(1))
MaxSpa (TempdagMax(),1440,Tempdag(1))
MinSpa (TempdagMin(),1440,Tempdag(1))
'The MaxSpa second output points to the max value in the array
'We use that value to pick out the matching direction and time
'in the other two arrays of data
Winddiratmaxdag=Windrdag(WindskmdagMax(2))
Timeatmaxdag=Timeofmaxdag(WindskmdagMax(2))EndIf


Makada May 24, 2017 09:52 AM

it seems to work now, but it took alot of hours before it showed a value...

while the maxspa gives a value right after a program is send to the datalogger cr1000 with latest os.


Makada May 24, 2017 10:05 AM

or is it because i use the same source for the tempmax and tempmin part:

Move (Tempdag(2),1439,Tempdag(1),1439)
Tempdag(1) = Tableonemin.TempMax
Move (Tempdag(2),1439,Tempdag(1),1439)
Tempdag(1) = Tableonemin.TempMin


aps May 24, 2017 10:59 AM

Sorry I have been offline, but one thing to warn all of you when doing these analyses, especially using the Move command, is that many of the dataloggers can show their relatively slow processing power when you start to shuffle large arrays of data in memory, especially every second.  You can check this by looking for skipped scans.

In the past I have had to resort to working with sub-intervals, e.g. creating 15 min or hourly values and storing those in arrays for processing, rather than working with 1440 minute values.   The result is not quite the same but is close.


Makada May 24, 2017 11:19 AM

Ok, but why does it take so long to have data shown from the minspa function, even when ik remove the maxspa function?

 Or Is there another way to accomplish the running min and max with timestamp of a sensor in crbasic which uses less memory?


Makada May 24, 2017 07:26 PM

i found out even with a 10 minute lookup value it takes ages to get the minspa value, while the maxspa is showing data almost immediately...

'CR1000

'Declare Variables and Units
Public Temp
Dim Temp2(10)

Public Temp2Max(2)
Public Temp2Min(2)

'Define Data Tables
'First the one minute one
DataTable(TableOnemin,True,-1)
DataInterval(0,1,min,10)
Sample(1,Temp,IEEE4,False)
FieldNames ("Temp")
Maximum(1,Temp,IEEE4,False,True)
FieldNames ("Temp2Max")
Minimum(1,Temp,IEEE4,False,True)
FieldNames ("Temp2Min")

EndTable

DataTable(rollingmaxtest,true,14)
DataInterval(0,1,min,10)

'Sample the 10 min rolling max temp
Sample (1,Temp2Max(),FP2)
Sample (1,Temp2Min,FP2)
EndTable

'Main Program

BeginProg
Scan(1,Sec,1,0)
'Generic 4-20 mA Input measurement Temp
VoltDiff(Temp,1,mV2500,3,True,0,_60Hz,0.05,-65)

If rollingmaxtest.output Then

Move (Temp2(2),9,Temp2(1),9)
Temp2(1) = Tableonemin.Temp2Max(1,1)
Move (Temp2(2),9,Temp2(1),9)
Temp2(1) = Tableonemin.Temp2Min(1,1)
MinSpa (Temp2Min,10,Temp2(1))
MaxSpa (Temp2Max,10,Temp2(1))EndIf
'Call Data Tables and Store Data
CallTable TableOnemin
CallTable rollingmaxtest
NextScan
EndProg

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