HLBL question

2001-08-28 Thread Stefano Persico

Hi list

i built an HLBL source where are defined some user labels for Real
Output with a name like OUT1 OUT2 and so on.
I've also an array (in a subroutine) with a S12 internal flag used to
build the same name of the ones used for RO.
I made this because i need to reset to zero a certain real output when a
given integer and boolean are passed to the sequence.

So the structure af the array is
sorg[1] := "OUT1" ; sorg[2] := "OUT2" ; .(sorg --> S12)

I call the subroutine at first step of the sequence and some steps after
i've the IF clause wich test the status of a given boolean and use the
array with a given integer .
I supposed to do
sorg[integer_input] := 0;
but nothing run.
It's probably because my array build a STRING which can't have a real
value ???
If so how can i build the name of a given real output user label and
then put it to a given real value ???

(OK probably is the worst way to have this function but when i started i
didn't know where i'll arrive...)

Thank's lot


---
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: HLBL question

2001-08-28 Thread Jorge Monsalvo

Stefano,
What you are really doing is converting an integer value (0) to a string
(sorg[n]).  If it is posible, you can use external references, something
like

STRING :CMPND:BLK:PARAM'IO0001' := 0.0;

I don't have a system alive to test that,  I used a similar structure but I
can't remember the exact sintax.

Jorge Monsalvo
IVControl S.R.L.
Argentina

- Original Message -
From: "Stefano Persico" <[EMAIL PROTECTED]>
To: "Foxboro DCS Mail List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 7:09 PM
Subject: HLBL question


> Hi list
>
> i built an HLBL source where are defined some user labels for Real
> Output with a name like OUT1 OUT2 and so on.
> I've also an array (in a subroutine) with a S12 internal flag used to
> build the same name of the ones used for RO.
> I made this because i need to reset to zero a certain real output when a
> given integer and boolean are passed to the sequence.
>
> So the structure af the array is
> sorg[1] := "OUT1" ; sorg[2] := "OUT2" ; .(sorg --> S12)
>
> I call the subroutine at first step of the sequence and some steps after
> i've the IF clause wich test the status of a given boolean and use the
> array with a given integer .
> I supposed to do
> sorg[integer_input] := 0;
> but nothing run.
> It's probably because my array build a STRING which can't have a real
> value ???
> If so how can i build the name of a given real output user label and
> then put it to a given real value ???
>
> (OK probably is the worst way to have this function but when i started i
> didn't know where i'll arrive...)
>
> Thank's lot
>
>
> ---
> 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: HLBL question

2001-08-28 Thread Johnson, Alex (Foxboro)

How is this example? It will look better if you put it in a file and use a
courier (monospace) font.


Watch how I use APPNAME.
*   I declare it (APP_NAME : SN0001;) to  be the contents of SN0001
*   I use it to get the value of a variable (CTLINT :=
:'APP_NAME':DMCOP.CTLINT;)


Now, look at CNTDWN
*   I declare it (CNTDWN   : SN0009;)
*   I initialize it to the name of the countdown timer (CNTDWN :=
APP_NAME,":DMCOP.CNTDWN";)
*   I set the value to 0 (:'CNTDWN' := 0; )


Does this help?



INDEPENDENT_SEQUENCE




USER_LABELS



   WDT  : BO0001;{ Watch Dog Timer Trip (True is good) }
   DELAY: RI0001;{ Delay(sec.) for next input }
   PERIOD   : RI0002;{ Waiting time(sec.) before dropping WDT }
   CTLINT   : II0001;{ Controller execution period(sec.) }
   SYSERROR : II0002;{ System error counter; wraps at 1000 }
   USRERROR : II0003;{ User error counter; wraps at 1000 }



   APP_NAME : SN0001;{ Name of DMC application }
   CNTDWN   : SN0009;{ AOA reference for CNTDWN }
   ONREQ: SN0010;{ AOA reference for ONREQ }







{ Trap errors and wait for them to clear }
BLOCK_EXCEPTION TO_SYS_ERROR
STATEMENTS
   IF (SYSERROR < 100 )
   THEN
  SYSERROR := SYSERROR + 1;
   ELSE
  SYSERROR := 0;
   ENDIF;
   GOTO ERROR;
ENDEXCEPTION



BLOCK_EXCEPTION TO_USR_ERROR
STATEMENTS
   IF (USRERROR < 100 )
   THEN
  USRERROR := USRERROR + 1;
   ELSE
  USRERROR := 0;
   ENDIF;
   GOTO ERROR;
ENDEXCEPTION
BLOCK_EXCEPTION TO_INACTIVE
STATEMENTS
   GOTO ERROR;
ENDEXCEPTION



STATEMENTS



<>



   SYSERROR := 0;
   USRERROR := 0;



{ Get controller cycle time }
   REPEAT
  CTLINT := :'APP_NAME':DMCOP.CTLINT;
  WAIT 5.0;
   UNTIL CTLINT <> 0;
{ Setup the A:O.A for ONREQ }
   ONREQ  := APP_NAME,":DMCOP.ONREQ";
{ Setup the A:O.A for CNTDWN }
   CNTDWN := APP_NAME,":DMCOP.CNTDWN";



<>



{ Pull up WDT trip }
   WDT := TRUE;
{ Set timeout period }
   PERIOD := DELAY;
{ Initialize delay }
   DELAY := 0;
{ Zero 'Application':DMCOP.CNTDWN }
   :'CNTDWN' := 0;
{ Send out controller interval to count down timer }
::PULSE.II01 := CTLINT;
{ Now wait for controller to send non-zero CNTDWN }
   WAIT UNTIL (DELAY <> 0) AFTER PERIOD GOTO TIMEOUT;
{ Start over }
   GOTO RESTART;



<>



{ Timed out. Turn off DMC Controller}
   :'ONREQ' := FALSE;



<>



   { Drop WDT }
   WDT := FALSE;
{ Initialize DELAY }
   DELAY := 0.0;
{ Zero 'Application':DMCOP.CNTDWN }
   :'CNTDWN' := 0;
{ Now wait for controller to send non-zero CNTDWN }
   WAIT UNTIL (DELAY <> 0);
{ Re-initialize }
   GOTO INIT;



ENDSEQUENCE


Regards,


Alex Johnson
10707 Haddington
Houston, TX 77043
713.722.2859 (office)
713.722.2700 (switchboard)
713.932.0222 (fax)
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 


-Original Message-
From:   Stefano Persico [SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, August 28, 2001 3:09 PM
To: Foxboro DCS Mail List
Subject:HLBL question

Hi list

i built an HLBL source where are defined some user labels for Real
Output with a name like OUT1 OUT2 and so on.
I've also an array (in a subroutine) with a S12 internal flag used
to
build the same name of the ones used for RO.
I made this because i need to reset to zero a certain real output
when a
given integer and boolean are passed to the sequence.

So the structure af the array is
sorg[1] := "OUT1" ; sorg[2] := "OUT2" ; .(sorg --> S12)

I call the subroutine at first step of the sequence and some steps
after
i've the IF clause wich test the status of a given boolean and use
the
array with a given integer .
I supposed to do
sorg[integer_input] := 0;
but nothing run.
It's probably because my array build a STRING which can't have a
real
value ???
If so how can i build the name of a given real output user label and
then put it to a given real value ???

(OK probably is the worst way to have this function but when i
started i
didn't know where i'll arrive...)

Thank's lot



---
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 an

RE: HLBL question

2001-08-29 Thread Marsman, Bram

If I understand you correct, you want to set one or more Real-outputs on the
sequence block to 0?
Unfortunately, in HLBL you cant make a variable variable. So you cant build
a string which happens to match a variable you declared and then use it in a
statement. However, you CAN build variable external references in a sequence
to write to its own block. The catch is, you can only do this using input
parameters. (cant set RO000x from "outside") 
So instead of using RO0001 to RO0012, use RI0001 to RI0012, then:

Let's assume the number of the RI you want to set is on II0001, and
block_name and number are Strings:


block_name := BLOCK_NAME;
number := II0001;
::'block_name'.RI000'number' := 0;

If the number > 9, you must redirect the program (like below)
If you want to set all 12 (initialisation or something) then you could:


FOR number := 1 TO 9 DO
  ::'block_name'.RI000'number' :=0;
ENFOR
FOR number :=  10 TO 12 DO 
  ::'block_name'.RI00'number' := 0;
ENDFOR

If you insist on using the RO, ignore this suggestion.


A general warning applies here:
Be "critical" using external references (:C:B.P) in sequences, as they could
noticeably increase network load when used unwise. An external reference to
a compound not in the same CP causes a broadcast. Not a problem, unless you
have hundreds of them at the same time. So avoid cunstructions like 'WAIT
UNTIL :COMPOUND:BLOCK.PARAMETER" since it will do a broadcast each BPC.
Having a bunch of sequences doing this in a bunch of different CP's to a
bunch of other CP's at the same time can cause eh... "unessecary" network
traffic. (this doesn't apply to above example since we stay in the same CP)

Hope this helps,

Bram Marsman.




-Original Message-
From: Stefano Persico [mailto:[EMAIL PROTECTED]]
Sent: woensdag 29 augustus 2001 0:09
To: Foxboro DCS Mail List
Subject: HLBL question


Hi list

i built an HLBL source where are defined some user labels for Real
Output with a name like OUT1 OUT2 and so on.
I've also an array (in a subroutine) with a S12 internal flag used to
build the same name of the ones used for RO.
I made this because i need to reset to zero a certain real output when a
given integer and boolean are passed to the sequence.

So the structure af the array is
sorg[1] := "OUT1" ; sorg[2] := "OUT2" ; .(sorg --> S12)

I call the subroutine at first step of the sequence and some steps after
i've the IF clause wich test the status of a given boolean and use the
array with a given integer .
I supposed to do
sorg[integer_input] := 0;
but nothing run.
It's probably because my array build a STRING which can't have a real
value ???
If so how can i build the name of a given real output user label and
then put it to a given real value ???

(OK probably is the worst way to have this function but when i started i
didn't know where i'll arrive...)

Thank's lot


---
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: HLBL question

2001-08-29 Thread Marsman, Bram

Ah, almost right this first time,

It should ofcourse be:

FOR i := 1 TO 9 DO
  number := i;
  ::'block_name'.RI000'number' :=0;
ENFOR
FOR i :=  10 TO 12 DO 
  number := i;
  ::'block_name'.RI00'number' := 0;
ENDFOR

where 'i' is declared as interger and 'number' as string.

-Original Message-
From: Marsman, Bram [mailto:[EMAIL PROTECTED]]
Sent: woensdag 29 augustus 2001 10:10
To: 'Foxboro DCS Mail List'
Subject: RE: HLBL question


If I understand you correct, you want to set one or more Real-outputs on the
sequence block to 0?
Unfortunately, in HLBL you cant make a variable variable. So you cant build
a string which happens to match a variable you declared and then use it in a
statement. However, you CAN build variable external references in a sequence
to write to its own block. The catch is, you can only do this using input
parameters. (cant set RO000x from "outside") 
So instead of using RO0001 to RO0012, use RI0001 to RI0012, then:

Let's assume the number of the RI you want to set is on II0001, and
block_name and number are Strings:


block_name := BLOCK_NAME;
number := II0001;
::'block_name'.RI000'number' := 0;

If the number > 9, you must redirect the program (like below)
If you want to set all 12 (initialisation or something) then you could:


FOR number := 1 TO 9 DO
  ::'block_name'.RI000'number' :=0;
ENFOR
FOR number :=  10 TO 12 DO 
  ::'block_name'.RI00'number' := 0;
ENDFOR

If you insist on using the RO, ignore this suggestion.


A general warning applies here:
Be "critical" using external references (:C:B.P) in sequences, as they could
noticeably increase network load when used unwise. An external reference to
a compound not in the same CP causes a broadcast. Not a problem, unless you
have hundreds of them at the same time. So avoid cunstructions like 'WAIT
UNTIL :COMPOUND:BLOCK.PARAMETER" since it will do a broadcast each BPC.
Having a bunch of sequences doing this in a bunch of different CP's to a
bunch of other CP's at the same time can cause eh... "unessecary" network
traffic. (this doesn't apply to above example since we stay in the same CP)

Hope this helps,

Bram Marsman.




-Original Message-
From: Stefano Persico [mailto:[EMAIL PROTECTED]]
Sent: woensdag 29 augustus 2001 0:09
To: Foxboro DCS Mail List
Subject: HLBL question


Hi list

i built an HLBL source where are defined some user labels for Real
Output with a name like OUT1 OUT2 and so on.
I've also an array (in a subroutine) with a S12 internal flag used to
build the same name of the ones used for RO.
I made this because i need to reset to zero a certain real output when a
given integer and boolean are passed to the sequence.

So the structure af the array is
sorg[1] := "OUT1" ; sorg[2] := "OUT2" ; .(sorg --> S12)

I call the subroutine at first step of the sequence and some steps after
i've the IF clause wich test the status of a given boolean and use the
array with a given integer .
I supposed to do
sorg[integer_input] := 0;
but nothing run.
It's probably because my array build a STRING which can't have a real
value ???
If so how can i build the name of a given real output user label and
then put it to a given real value ???

(OK probably is the worst way to have this function but when i started i
didn't know where i'll arrive...)

Thank's lot


---
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]

---
This list is neither sp