ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#9095 - 10/02/05 07:16 AM averaging temp inputs.
Paul_dup1 Offline
newbie


Registered: 04/17/03
Posts: 21
Loc: Berlin, MA
Help, help. I would like code to average bobcat temperature reading every 10 seconds and put the calculated average into a varible location.

Paul
_________________________
Paul

Top
#9096 - 10/02/05 07:35 AM Re: averaging temp inputs.
Anonymous
Unregistered



This is what I have been using for a year or more and it works great. Replace the points with you own. Guy gave me this code.



0001 - IF Timer-#20-1800-sec-outside-temp-load is = 0 Outside temp start
0002 - THEN Timer-#20-1800-sec-outside-temp-load = 1
0003 - IF Module #1 -SECU16 Analog-#2-outside-temp is < 256
0004 - THEN Load Data to: Variable-#25-outside-temp-average Load value into a variable
0005 - IF Timer-#20-1800-sec-outside-temp-load becomes > 30 Capture first value
0006 - THEN Variable-#26-outside-temp-average = Variable-#25-outside-temp-average
0007 - IF Timer-#20-1800-sec-outside-temp-load becomes > 60 Capture second value
0008 - THEN Variable-#27-outside-temp-average = Variable-#25-outside-temp-average
0009 - IF Timer-#20-1800-sec-outside-temp-load becomes > 90 Capture third value
0010 - THEN Variable-#28-outside-temp-average = Variable-#25-outside-temp-average
0011 - IF Timer-#20-1800-sec-outside-temp-load becomes > 120 Capture fourth value
0012 - THEN Variable-#29-outside-temp-average = Variable-#25-outside-temp-average
0013 - IF Timer-#20-1800-sec-outside-temp-load becomes > 180 Capture fifth value
0014 - ELSE Skip to line 25
0015 - THEN Variable-#30-outside-temp-average = Variable-#25-outside-temp-average
0016 - THEN Variable-#31-outside-temp-average = Variable-#26-outside-temp-average Add variable
0017 - THEN Variable-#31-outside-temp-average + Variable-#27-outside-temp-average
0018 - THEN Variable-#31-outside-temp-average + Variable-#28-outside-temp-average
0019 - THEN Variable-#31-outside-temp-average + Variable-#29-outside-temp-average
0020 - THEN Variable-#31-outside-temp-average + Variable-#30-outside-temp-average
0021 - THEN Variable-#31-outside-temp-average / 5 divide by 5
0022 - THEN Variable-#100-Outside-temp = Variable-#31-outside-temp-average Load to outside control variable
0023 - THEN Timer-#20-1800-sec-outside-temp-load = 0 Reset timer

Regards, Keith

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
0 registered and 65 anonymous users online.
Recent Posts
Ocelot Battery
by ADI Tech Support
Today at 07:38 AM
Comms Retry Error
by HDTVPete
09/18/17 04:04 PM
Cmax Message: Failed to set data for a 'delay'
by HDTVPete
09/16/17 04:36 PM
Shout Box

Newest Members
brigiel, vevevie, zhutree, 416, saiqul
3003 Registered Users
Forum Stats
3003 Members
19 Forums
4002 Topics
23435 Posts

Max Online: 132 @ 11/13/16 10:07 AM
September
Su M Tu W Th F Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30