Re: [foxboro] HLBL Array Question
- From: "Doucet, Terrence" <tdoucet@xxxxxxxxxxxxxxxxxx>
- To: <foxboro@xxxxxxxxxxxxx>
- Date: Thu, 15 May 2008 15:12:47 -0400
Peter,
I tried the same thing as you a while back and was blown out of the =
water with cpu (IND) loading. I wanted the value now (easy) and the =
value 15 minutes ago (no so easy). So we looked at AIM since the =
historian was storing samples and the data was available.
We were going to write a C-program and use
call fh_RTP_Index to get the index number for the =
Compound:Block.Parameter
call fh_Fdb_GetValues (histname, index, oldtime=3D0, numpts=3D1)
AIM returns latest value and current time (CTIM)
CTIM + 15 =3D NTIM
call fh_Fdb_GetValues (histname, index, oldtime=3DNTIM, numpts=3D1)
Other projects took precedence and we never finished this so I cannot =
state that it worked.
I'm not sure what you ultimately want but there are ways to get data =
from the historian in a program and store it in a shared variable.
Hope this helps.
Terry Doucet
15 may 2008 14:46
'Foxboro DCS Mail List' ('Foxboro DCS Mail List')
Objet=A0: [foxboro] HLBL Array Question
Gentlemen (and Ladies)
I have a large array size is 1440 (holds 24 hours worth of 1 min =
sa=3D
mples)
Every minute I want to update the 1 of the sample value and =
throw o=3D
ut the oldest value.
Problem 1)
Currently I am shuffling each value 1 at a time using this loop:
----------------------------
x :=3D3D 1;
SN01 :=3D3D "Preparing Array for new value ....";
WHILE (x < 1440) DO
ARHR[x] :=3D3D ARHR[x+1]; {* throw out arry position 1 and =
shuffle *}
x :=3D3D x + 1;
ENDWHILE;
ARHR[1440] :=3D3D RI01; {* Load newest value into array =
position 14=3D
40 *}
------------------------------
This works however just to shuffle the values takes almost 30 =
secon=3D
ds.
Is there a quicker way to do this ?
Is there a way to copy array position [2] through [1440] to =
another a=3D
rray using a single command ?
Problem 2)
During the next step of my sequence I have to find the average =
for =3D
the last 24 hours so I need to find the sum of the array then divide by =
144=3D
0. I use the following loop to find the sum:
----------------------------
y :=3D3D 1;
SUM :=3D3D 0;
WHILE ( y < 1441 ) DO
SUM :=3D3D SUM + ARHR[ y ];
y :=3D3D y + 1;
ENDWHILE;
RO01 :=3D3D SUM/1440; {* 24 Hour rolling average *}
----------------------------
Again it takes about 30 seconds just to find the sum of the =
array.
Is there a quicker way to find the sum of an array?
Thank You,
Peter Bruley
=20
=20
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
=20
foxboro mailing list: http://www.freelists.org/list/foxboro
to subscribe: =
mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Djoin
to unsubscribe: =
mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Dleave
=20
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
foxboro mailing list: http://www.freelists.org/list/foxboro
to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
- References:
- [foxboro] HLBL Array Question
- From: Bruley, Peter T
Other related posts:
- » Re: [foxboro] HLBL Array Question
- » Re: [foxboro] HLBL Array Question
- » Re: [foxboro] HLBL Array Question
- » Re: [foxboro] HLBL Array Question
- » Re: [foxboro] HLBL Array Question
- » Re: [foxboro] HLBL Array Question
- » Re: [foxboro] HLBL Array Question
- » Re: [foxboro] HLBL Array Question
- » Re: [foxboro] HLBL Array Question
- » Re: [foxboro] HLBL Array Question
- [foxboro] HLBL Array Question
- From: Bruley, Peter T