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
<<INIT>>
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";
<<RESTART>>
{ 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;
<<TIMEOUT>>
{ Timed out. Turn off DMC Controller}
:'ONREQ' := FALSE;
<<ERROR>>
{ 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 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]