• No se han encontrado resultados

Operations started from a unit recipe can manipulate the unit recipes using built-in functions. This section explains the manipulation of unit recipes using built-in functions.

The operation started from a unit recipe can perform the following manipulation to the unit recipe.

• Dynamic assignment of units • Download

• Start • Abort • Complete • Cancel

n

Manipulating Unit Recipes

Table 6.2-1 Unit Recipe Functions that Can be Manipulated from Operations

Function Change in unit recipe status Manipulation method

Dynamic assignment of units NOASSIGN→ASSIGNED urassign built-in function

Download ASSIGNED→READY urload built-in function

Start READY→ACTIVE Set “START” (*1) inSYSPCMnn.STATUS (*2).

Abort NOASSIGN→ABORTED ASSIGNED→ABORTED READY→ABORTED ACTIVE→ABORTED LOG→ABORTED

Set “ABORT” in SYSPCMnn.STA- TUS.

Complete NOASSIGN→COMPLETEASSIGNED→COMPLETE READY→COMPLETE

Set “END” in SYSPCMnn.STA- TUS.

Cancel ASSIGNED→NOASSIGNREADY→NOASSIGN Set “CANCEL” inSYSPCMnn.STATUS.

*1: “START,” “ABORT,” “END” and “CANCEL” are status change directives.

*2: SYSPCMnn is a system-fixed common block for each unit recipe. nn indicates the unit recipe number. If nn is a single-digit value, add “0” as in “SYSPCM01” and “SYSPCM02.”

The diagram below shows the transition of unit recipe statuses:

Unit assign NOASSIGN ASSIGNED Download Cancel Abort Abort Abort Abort Abort READY Start Complete Complete Complete ACTIVE ABORTED LOG COMPLETE Cancel

Figure 6.2-1 Unit Recipe Statuses

n

Dynamic Assignment of Units and Download Operations

urassign() assigns a unit recipe to a unit instrument at run time. urload() downloads a unit rec- ipe for which a unit instrument has already been assigned, from the HIS to the control station.

urassign (<unit recipe number>, <unit name>) urload (<unit recipe number>)

<unit recipe number> Specify the unit recipe number using a variable or constant. <unit name> Specify the unit instrument tag name using a character-string variable or character-string constant. Use uppercase letters

for the unit name.

Figure 6.2-2 The format of the built-in function "urassign()" Table 6.2-2 Manipulating Unit Recipes

Function name Function Type normal executionReturn value at Return value at er-ror

urassign Dynamic assign-ment of units integer 0 -1

urload Download integer 0 -1

The dynamic assignment of unit using urassignbid() can be performed for a unit recipe only when the status of the unit recipe is either NOASSIGN, ASSIGNED or READY.

The operation and monitoring functions will generate a system error when the dynamic as- signment fails. The main cause of system alarms are shown below:

• The status of the specified unit recipe is neither NOASSIGN, ASSIGNED nor READY. The downloading of unit using urloadbid() can be performed for a unit recipe only when the status of the unit recipe is ASSIGNED.

The operation and monitoring functions will generate a system error when the downloading fails. The main causes of system alarms are shown below:

• The specified batch ID does not exist.

• The status of the specified unit recipe is not ASSIGNED.

<6.2 Manipulating Unit Recipes >

6-6

An example of assigning a unit to the unit recipe of unit recipe number 3 dynamically, then downloading and starting the unit recipe, is shown below:

! SEBOL steps for SFC block

! unit recipe number 3 is assumed to have been set in the global variable "partno "

! tag name of the unit instrument to be assigned is assumed to have been set in t he global variable "unittag"

char*8 comblk ! variable to store the common block name

*

* --- sets the system-fixed common block name "SYSPCM03" in "comblk" --- *

format "SYSPCM%02d",partno;comblk

*

* --- checks whether or not the unit recipe status is NOASSIGN --- *

if (ccmread (comblk,"STATUS")<>"NOASSIGN") then

message "Cannot be assigned since the status is not NOASSIGN." quit

end if

*

* --- assigns the unit recipe to a unit instrument with the tag name "unittag" -- -

*

if (urassign (partno,unittag) <> 0) then message "urassign generated an error." quit

end if

*

* --- confirms that the unit recipe has been assigned ---

* --- common block data UNITNAME becomes the specified unit instrument tag ---

end if

*

* --- confirms that the unit recipe status changes to READY --- *

wait until (ccmread (comblk,"STATUS") == "READY" );time 300,error LOADERR

*

* --- starts the unit recipe --- *

if (cmwrite (comblk,"STATUS","START") <> 0) then message "Setting of START generated an error." quit

end if

*

* --- confirms that the unit recipe status changes to START --- *

wait until (ccmread (comblk,"STATUS") == "ACTIVE");time 30,error STRTERR

· If the started unit recipe is to end shortly, its status will also change fro m

· ACTIVE to LOG (and to COMPLETE) at the same time; therefore, consider the · possibility of status change to LOG or COMPLETE.

*processing continues following the start ...

quit ! ends the step * --- error handling ---

ASGNERR:

message "Does not change to ASSIGNED even 300 seconds after the assignment." quit

LOADERR:

message "Does not change to READY even 300 seconds after the load." quit

STETERR:

message "Does not change to ACTIVE even 30 seconds after the start." quit

! end of SEBOL steps

n

Start, Delete and Cancel Operations

To perform start, delete or cancel operation, set a character string for the corresponding sta- tus change directive using cmwrite(), in the common block status of the system-fixed common block for each recipe.

When a directive for manipulating a unit recipe using the built-in function urassign(), urload() or cmwrite() ends without generating an error, it means the process management functions acknowledged the directive. It does not mean the operation has been completed.

<6.2 Manipulating Unit Recipes >

6-8

If necessary, the user may be required to reference the common block data status using ccmread() after the directive has been executed, and check if the operation with respect to the unit recipe has been completed.

n

Aborting the Unit Recipe

There are three methods by which to abort a unit recipe as explained below:

l

Changing the Unit Instrument Status to “END”

A unit recipe can be aborted by setting a directive that changes the unit instrument’s block status to END in the unit instrument’s data item BSTS.

With this method, preprocessing and post-processing for the status change is performed for the operation currently executed by the unit supervision. The unit instrument’s BSTS changes to “END” when the status change directive is set in the BSTS.

When the unit recipe has been aborted, the status of the SYSPCMnn common block changes to COMPLETE.

The user should use this method to stop the unit recipe operation if the execution of prepro- cessing and post-processing for the status change are needed.

l

Setting “ABORT” in the Unit Instrument’s BSTS

A unit recipe can be aborted by setting the status change directive ABORT in the unit instru- ment’s data item BSTS. At this time, the block status of the unit changes to ABORTED. With this method, preprocessing and post-processing for the status change are not carried out for the operation currently executed by the unit. Since the ABORT directive executes forci- ble termination, the unit instrument is aborted when ABORT is set in the unit instrument’s BSTS.

When the unit recipe has been aborted, the status of the SYSPCMnn common block changes to ABORT.

l

Setting “ABORT” in the Status of the SYSPCMnn Common Block

A unit recipe can be aborted by setting ABORT in the common block data status of the sys- tem-fixed common block SYSPCMnn (nn is the unit recipe number). At this time, the common block SYSPCMnn status changes to ABORTED. The block status of the unit instrument also changes to ABORTED.

With this method, preprocessing and post-processing for the status change are not carried out for the operation currently executed by the unit supervision. Also, the unit instrument is aborted not when ABORT is set in the common block data status but when the unit instrument is executed according to the set order after the setting of ABORT.

Documento similar