Rolling average

2000-09-06 Thread Steve Rigby

Hi all,

What I would like is a way to calculate the average position of a valve over
the last hour, updated say every minute.
and then available as an input for a block. Any ideas?

Thanks in advance.

Steve Rigby
Air Liquide Industrie BV
Merseyweg 10
3197 KG Botlek-Rotterdam
The Netherlands
Tel: +31(0)181-271131
Fax:+31(0)181-271100
Email:
[EMAIL PROTECTED]
[EMAIL PROTECTED]





---
This list is neither sponsored nor endorsed by the Foxboro Company. All 
postings from this list are the work of list subscribers and no warranty 
is made or implied as to the accuracy of any information disseminated 
through this medium. By subscribing to this list you agree to hold the 
list sponsor(s) blameless for any and all mishaps which might occur due to 
your application of information received from this mailing list.

To be removed from this list, send mail to 
[EMAIL PROTECTED] 
with unsubscribe foxboro in the Subject. Or, send any mail to
[EMAIL PROTECTED]




RE: Rolling average

2000-09-06 Thread Stear, Bo

Here's a way to do it using a TIMER and an IND block.  You could do without
the timer and just use the WAIT for the period but then you might run into
problems if your CP goes into overrun.

This is set for a flow but will work on anything..

INDEPENDENT_SEQUENCE{***
  **  **
  **   INDEPENDENT SEQUENCE   **
  ** CONTROL BLOCK**
  **  **
  *}

CONSTANTS {*
  * specify any Constants  *
  * in the following format:   *
  **
  * 12_char_name = value ; *
  *}

VARIABLES {*
  * specify any Block Local Variables  *
  * in the following format:   *
  **
  * 12_char_name [ , 12_char_name ] : type;*
  **
  *where type is one of B, I, R, S, S12, S6*
  *}

AVG:R[360];
ICT:I;

USER_LABELS{
  * specify any user labeled parameters*
  *   in one of the following formats: *
  **
  *   10_char_name : BI00nn; n = 01 -- 24  *
  *   10_char_name : BO00nn; n = 01 -- 16  *
  *   10_char_name : BA000n; n =  1 --  4  *
  *   10_char_name : RI00nn; n = 01 -- 15  *
  *   10_char_name : RO00nn; n = 01 -- 15  *
  *   10_char_name : RA000n; n =  1 --  2  *
  *   10_char_name : II000n; n =  1 --  8  *
  *   10_char_name : IO000n; n =  1 --  5  *
  *   10_char_name : IA0001;   *
  *   10_char_name : SN00nn; n = 01 -- 10  *
  *}

FI3050: RI0001; {MEASURED FLOW}
FA3050: RO0001; {AVERAGE FLOW}
CNTIDX: IO0001; {AVERAGER INDEX}
SUM:RO0002; {TEMPORARY SUM}
TIM:RI0002; {10 SECOND TIMER INPUT}
REMOVE: RO0003; {VALUE TO REMOVE FROM SUM}
BTU:RI0003; {ENTERED VALUE FOR BTU}
BTU_VAL: RO0015; {CALCULATED BTU VALUE FOR CURRENT FLOW}

  {*
  * Specify any Subroutines*
  **
  **
  * SUBROUTINE name ( formal arguments ) ; *
  *  VARIABLES  subr. local variables ;*
  *  STATEMENTS*
  *  ; *
  * ENDSUBROUTINE  *
  *}


  {*
  * Specify any*
  *Standard Block Exception Handlers   *
  **
  **
  * BLOCK_EXCEPTION exc_name [ DISABLE ]   *
  *  STATEMENTS*
  *  ; *
  * ENDEXCEPTION   *
  *}


STATEMENTS{*
  *  Specify the statements here   *
  *}

CNTIDX := 1;
AVG := SET_ARRAY(FI3050);
SUM := FI3050 * 360.0;
START_TIMER(::10SECONDS.TIMR1,0.0);
START
REMOVE := AVG[CNTIDX];
AVG[CNTIDX] := FI3050;
SUM := SUM - REMOVE;{REMOVE THE OLD VALUE}
SUM := SUM + AVG[CNTIDX];   {ADD IN THE NEW VALUE}
CNTIDX := CNTIDX + 1;
IF CNTIDX  360 THEN
  CNTIDX := 1;
ENDIF;
FA3050 := SUM / 360.0;
{CALCULATE BTU VALUE}
BTU_VAL := FA3050 * BTU;
::10SECONDS.TIMR1V := 0.0;
WAIT 1;
WAIT UNTIL TIM = 10.0;
GOTO START;

ENDSEQUENCE

-Original Message-
From: Steve Rigby [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 06, 2000 8:01 AM
To: 'Foxboro DCS Mail List' (E-mail)
Subject: Rolling average


Hi all,

What I would like is a way to calculate the average position of a valve over
the last hour, updated say every minute.
and then available as an input for a block. Any ideas?

Thanks in advance.

Steve Rigby
Air Liquide Industrie BV
Merseyweg 10
3197 KG Botlek-Rotterdam
The Netherlands
Tel: +31(0)181-271131
Fax:+31(0)181-271100
Email:
[EMAIL PROTECTED]
[EMAIL PROTECTED]






RE: Rolling average

2000-09-06 Thread Windle,John

I would use an independent sequence block.  Run the block once per minute,
dump the current value of the point to be averaged into a real array indexed
by the minute in the current hour, sum up the values in the array, divide by
60 and you have a rolling hourly average.  This will automatically overwrite
a value which is over an hour old.

You have some details to work out, such as how to handle a bad status on the
input, getting the minute in the current hour, how to handle the first hour,
initializations, restarts, etc., but it should be pretty straightforward.

John Windle
The Foxboro Company

 -Original Message-
 From: Steve Rigby [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, September 06, 2000 9:01 AM
 To:   'Foxboro DCS Mail List' (E-mail)
 Subject:  Rolling average
 
 Hi all,
 
 What I would like is a way to calculate the average position of a valve
 over
 the last hour, updated say every minute.
 and then available as an input for a block. Any ideas?
 
 Thanks in advance.
 
 Steve Rigby
 Air Liquide Industrie BV
 Merseyweg 10
 3197 KG Botlek-Rotterdam
 The Netherlands
 Tel: +31(0)181-271131
 Fax:+31(0)181-271100
 Email:
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 
 
 
 
 
 ---
 This list is neither sponsored nor endorsed by the Foxboro Company. All 
 postings from this list are the work of list subscribers and no warranty 
 is made or implied as to the accuracy of any information disseminated 
 through this medium. By subscribing to this list you agree to hold the 
 list sponsor(s) blameless for any and all mishaps which might occur due to
 
 your application of information received from this mailing list.
 
 To be removed from this list, send mail to 
 [EMAIL PROTECTED] 
 with unsubscribe foxboro in the Subject. Or, send any mail to
 [EMAIL PROTECTED]

---
This list is neither sponsored nor endorsed by the Foxboro Company. All 
postings from this list are the work of list subscribers and no warranty 
is made or implied as to the accuracy of any information disseminated 
through this medium. By subscribing to this list you agree to hold the 
list sponsor(s) blameless for any and all mishaps which might occur due to 
your application of information received from this mailing list.

To be removed from this list, send mail to 
[EMAIL PROTECTED] 
with unsubscribe foxboro in the Subject. Or, send any mail to
[EMAIL PROTECTED]




RE: Rolling average

2000-09-06 Thread John Miller

This may be overly simplistic, but what about using a filter in an AIN block
or an LLAG block?  A low pass filter really isn't mathematically the same as
a rolling average, but for a lot of the applications where the process
engineers thought they needed a rolling average, we've found that it's close
enough.  You'd either need to do the math to calculate the filter time or
experiment until you get a satisfactory value.  You could set the PERIOD to
obtain the desired sampling time.  Valve position (or anything else where
you don't need accuracy to the nth digit) would seem to be a good candidate
for a filtered value.

-Original Message-
From: Steve Rigby [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 06, 2000 8:01 AM
To: 'Foxboro DCS Mail List' (E-mail)
Subject: Rolling average


Hi all,

What I would like is a way to calculate the average position of a valve over
the last hour, updated say every minute.
and then available as an input for a block. Any ideas?

Thanks in advance.

Steve Rigby
Air Liquide Industrie BV
Merseyweg 10
3197 KG Botlek-Rotterdam
The Netherlands
Tel: +31(0)181-271131
Fax:+31(0)181-271100
Email:
[EMAIL PROTECTED]
[EMAIL PROTECTED]

---
This list is neither sponsored nor endorsed by the Foxboro Company. All 
postings from this list are the work of list subscribers and no warranty 
is made or implied as to the accuracy of any information disseminated 
through this medium. By subscribing to this list you agree to hold the 
list sponsor(s) blameless for any and all mishaps which might occur due to 
your application of information received from this mailing list.

To be removed from this list, send mail to 
[EMAIL PROTECTED] 
with unsubscribe foxboro in the Subject. Or, send any mail to
[EMAIL PROTECTED]




AB KF2 at 19.2 Kbaud?

2000-09-06 Thread David Johnson

I have noticed that most of the Allen-Bradley KF2 modules I come across in 
the field are running at 9600 baud.  I also know of some instances where a 
Foxboro Integrator 30 is communicating with AB KF2s at 19.2 Kbaud.  Is 
there any reason not to run the baud rate at 19.2K? You sure get a lot more 
I/O throughput that way.

Regards,
David


---
This list is neither sponsored nor endorsed by the Foxboro Company. All 
postings from this list are the work of list subscribers and no warranty 
is made or implied as to the accuracy of any information disseminated 
through this medium. By subscribing to this list you agree to hold the 
list sponsor(s) blameless for any and all mishaps which might occur due to 
your application of information received from this mailing list.

To be removed from this list, send mail to 
[EMAIL PROTECTED] 
with unsubscribe foxboro in the Subject. Or, send any mail to
[EMAIL PROTECTED]




RE: Rolling average

2000-09-06 Thread Johnson,Alex

My personal favorite is:


1)  Build a DTIME block and set the duration to the time period of
interest * 1.2.
2)  Take the 8 most recent bucket outputs of the DTIME block to the
inputs of a SSEL block
3)  Set the SSEL block to average its inputs.


This approach is kind of cool because:


1)  It requires no coding
2)  It is pretty darn easy to build
3)  It deals intelligently with bad inputs.


Remember my Implementation Rules:

1)  Do it in regulatory control blocks. (most efficient; least prone to
problems)
2)  If the regulatory control blocks can't do it, use a CALC block.
(efficient, but must deal with BAD and coding errors; debuging is a pain)
3)  If the CALC block can't do it, use a Sequence Block (pretty
inefficient, but in the CP. Code/compilation relatively complex. Debugging
is a pain.)
4)  If you can't do it in a sequence block, reconsider if you need to do
it.
5)  If you must do it, see if you can do it in a shell (sh, ksh, csh,
perl, etc.) script (easier to debug, easy to schedule, remember to use
omgetimp and omsetimp to avoid broadcasts, remember to use show_params to
check the IMPORT table)
6)  If you can't do it in a script, reconsider doing it.
7)  If you must do it, see if there is a 3rd party or Foxboro package
that will do it. (Ask on the mailing list.)
8)  If you must do it and can't find a package, write a program.



Regards,

Alex Johnson
The Foxboro Company
10707 Haddington
Houston, TX 77043
713.722.2859 (v)
713.722.2700 (sb)
713.932.0222 (f)
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 


-Original Message-
From:   Steve Rigby [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, September 06, 2000 8:01 AM
To: 'Foxboro DCS Mail List' (E-mail)
Subject:Rolling average

Hi all,

What I would like is a way to calculate the average position of a
valve over
the last hour, updated say every minute.
and then available as an input for a block. Any ideas?

Thanks in advance.

Steve Rigby
Air Liquide Industrie BV
Merseyweg 10
3197 KG Botlek-Rotterdam
The Netherlands
Tel: +31(0)181-271131
Fax:+31(0)181-271100
Email:
[EMAIL PROTECTED]
[EMAIL PROTECTED]






---
This list is neither sponsored nor endorsed by the Foxboro Company.
All 
postings from this list are the work of list subscribers and no
warranty 
is made or implied as to the accuracy of any information
disseminated 
through this medium. By subscribing to this list you agree to hold
the 
list sponsor(s) blameless for any and all mishaps which might occur
due to 
your application of information received from this mailing list.

To be removed from this list, send mail to 
[EMAIL PROTECTED] 
with unsubscribe foxboro in the Subject. Or, send any mail to
[EMAIL PROTECTED]

---
This list is neither sponsored nor endorsed by the Foxboro Company. All 
postings from this list are the work of list subscribers and no warranty 
is made or implied as to the accuracy of any information disseminated 
through this medium. By subscribing to this list you agree to hold the 
list sponsor(s) blameless for any and all mishaps which might occur due to 
your application of information received from this mailing list.

To be removed from this list, send mail to 
[EMAIL PROTECTED] 
with unsubscribe foxboro in the Subject. Or, send any mail to
[EMAIL PROTECTED]




Re: AB KF2 at 19.2 Kbaud?

2000-09-06 Thread Kirk D Carver



From our in house AB guru:

  I do not know of a situation in which it wouldn't work at 19.2K, but the
bandwidth requirement is small: the bottleneck is the GP, not the DF1 line.  If
he's actually getting real empirical results back showing a huge ==x2
improvement when moving the DF1 connection from 9600 to 19.2K, then I'd be both
surprised and suspecting his ABSCAN and compound configuration. 


and from our local rep:


 First, let's clear up any potential confusion.

1770-KF2 - Stand alone box w/ 120VAC power (from outlet) that converts DH+
messages to RS-232C DF1 messages for communicating with the Foxboro.

1785-KE - PLC slide-in module that does the exact same thing.  (It fits in
a 1771 I/O chassis).

The 1770-KF2 does NOT have an option for communicating at 19.2K
The 1785-KE DOES let you go 19.2K.
Other than that, they are the same beast.

The only (potential) draw back to going to 19.2K baud on a 1785-KE module is
the baud rate is less noise resistant.
It does work, though, and I have little or no problems with it handling that
(blazing?!?!) speed!  You shouldn't see any problems in your installations,
since you guy's typically use well shielded cable for your serial
interfaces.

Kirk, I know you have a lot of KE modules out there, but I do think you
are using some KF2 modules also, although I don't know where.  The Foxboro,
or any DCS, can not tell the difference between the two, since they're are
basically the same thing, only in a different housing.



Kirk Carver
ExxonMobil Chemical
Beaumont Polyethylene Plant
PO Box 2295
Beaumont, Texas 77704
Phone: 409-860-1314
[EMAIL PROTECTED]
-




David Johnson [EMAIL PROTECTED] on 09/06/2000 09:32:08 AM

Please respond to Foxboro DCS Mail List
  [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:(bcc: Kirk D Carver/Beaumont/Mobil-Notes)
Subject:  AB KF2 at 19.2 Kbaud?





I have noticed that most of the Allen-Bradley KF2 modules I come across in
the field are running at 9600 baud.  I also know of some instances where a
Foxboro Integrator 30 is communicating with AB KF2s at 19.2 Kbaud.  Is
there any reason not to run the baud rate at 19.2K? You sure get a lot more
I/O throughput that way.

Regards,
David


---
This list is neither sponsored nor endorsed by the Foxboro Company. All
postings from this list are the work of list subscribers and no warranty
is made or implied as to the accuracy of any information disseminated
through this medium. By subscribing to this list you agree to hold the
list sponsor(s) blameless for any and all mishaps which might occur due to
your application of information received from this mailing list.

To be removed from this list, send mail to
[EMAIL PROTECTED]
with unsubscribe foxboro in the Subject. Or, send any mail to
[EMAIL PROTECTED]







---
This list is neither sponsored nor endorsed by the Foxboro Company. All 
postings from this list are the work of list subscribers and no warranty 
is made or implied as to the accuracy of any information disseminated 
through this medium. By subscribing to this list you agree to hold the 
list sponsor(s) blameless for any and all mishaps which might occur due to 
your application of information received from this mailing list.

To be removed from this list, send mail to 
[EMAIL PROTECTED] 
with unsubscribe foxboro in the Subject. Or, send any mail to
[EMAIL PROTECTED]