Re: [foxboro] Sequence Block Help
- From: "Douglas G. Lloyd" <DGLControls@xxxxxxxxxxx>
- To: <foxboro@xxxxxxxxxxxxx>
- Date: Thu, 24 Jul 2003 18:50:59 -0400
Jack,
I don't think that you can write directly to string substituted output
parameters. The 'string' substitution works for portions of a C:B.P. But,
since the parameters you want to set are outputs, the logic will generate
error 3's and not recognize that it's your own output.
The following is a snippet of code borrowed from a simple resource handler
(with all of the non-pertinent guts removed). The logic writes into the
required slot of a Boolean array and then updates all of the Boolean output
parameters with a single BIT_PATTERN set. This works fine if you don't mind
overwriting all of the Boolean outputs. If you need to selectively write to
only some of the Booleans, you'll have to do it with individual assignments
from the particular array slot. I hope that this is useful.
Regards,
Doug Lloyd
DGL Controls
INDEPENDENT_SEQUENCE
CONSTANTS
VARIABLES
i : I; { Loop index }
s : S6; { Loop index string }
bn : S12; { Block name string }
USER_LABELS
book_array : BA0001; { Array of Booleans }
is : IO0001; { Packed BI000x buffer }
was : IO0002; { Previous packed BI000x buffer }
booked : IO0003; { Packed booked status }
STATEMENTS
bn := BLOCK_NAME;
was := is;
WHILE TRUE DO
is := BIT_PATTERN(BI0001);
IF is <> was THEN
FOR i := 1 TO 16 DO
IF i > 9 THEN
s := i;
ELSE
s := "0",i;
ENDIF;
book_array[i] := ::'bn'.BI00's';
ENDFOR;
booked := BIT_PATTERN(book_array);
BO0001 := BIT_PATTERN(booked);
ENDIF;
was := is;
WAIT 1;
ENDWHILE;
ENDSEQUENCE
-----Original Message-----
From: foxboro-bounce@xxxxxxxxxxxxx [mailto:foxboro-bounce@xxxxxxxxxxxxx]On
Behalf Of ZIEGLER, JOHN E
Sent: Thursday, July 24, 2003 3:58 PM
To: Foxboro Mailing List (E-mail)
Subject: [foxboro] Sequence Block Help
I need some help with sequence block coding. I want to turn on and off=
several boolean outputs of a sequence code in order. =20
My first thought was to use a "FOR" loop, but I can't seem to address the=
output correctly. Here is what I have tried so far.
FOR j :=3D 1 TO 5 DO
BO000j :=3D TRUE ; {Compiler says parameter 'BO000j' not=
declared}
BO000'j' :=3D TRUE ; {Complier says parameter 'BO000' not=
declared}
=20
stringvar :=3D j ; {stringvar is a variable defined as a=
string variable}
BO000'stringvar' :=3D TRUE ; {Compiler says parameter 'BO000' not=
declared}
::.BO000'stringvar' :=3D TRUE ; {Compiles okay but give error 3 at run=
time - secured variable}
ENDFOR;
Any help with this method or an alternative is very much appreciated.
Jack Ziegler
Sunoco Chemicals
Frankford Phenol Plant
Margaret & Bermuda Sts
Philadelphia, PA 19137
215-537-2450
JEZiegler@xxxxxxxxxxxxx=20
This email and any files transmitted with it are intended solely for the=
use of the individual or entity to whom they are addressed. If you have=
received this e-mail in error, please notify the originator.
_______________________________________________________________________
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
_______________________________________________________________________
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] Sequence Block Help
- From: ZIEGLER, JOHN E
Other related posts:
- » Re: [foxboro] Sequence Block Help
- » Re: [foxboro] Sequence Block Help
- » Re: [foxboro] Sequence Block Help
- » Re: [foxboro] Sequence Block Help
- [foxboro] Sequence Block Help
- From: ZIEGLER, JOHN E