FC 148 - Batch Sequence

The batch sequence (BSEQ) function code coordinates sequence activities for a batch process.

 

 

Outputs:

Blk

Type

Description

N

R

Current recipe ID Number

N+1

R

Current phase number

N+2

B

Current status:

0 = hold

1 = run

N+3

B

Fault logic active:

0 = no

1 = yes

N+4

B

Hold logic active:

0 = no

1 = yes

N+5

B

Batch complete:

0 = no

1 = yes

N+6

B

Reset operator acknowledge:

0 = no

1 = yes

N+7

R

Fault code

N+8

R

Current statement number

 

 

Specifications:

Spec

Tune

Default

Type

Range

Description

S1

N

5

I

Note 1

Block address of recipe ID number

S2

N

5

I

Note 1

Block address of phase number

S3

N

0

I

Note 1

Block address of run/hold pushbutton

S4

N

0

I

Note 1

Block address of operator acknowledge pushbutton

S5

N

0

I

Note 1

Block address of E-STOP

S6

N

0

I

Note 1

Spare boolean input

S7

N

0

I

Note 1

Spare boolean input

S8

N

0

I

Note 1

Spare parameter

S9

Y

0.000

I

Full

Batch program ID number

S10

Y

1

I

Full

Debug operation

S11

N

1

I

Full

RAM allocation for object file (1 kbyte increments)

S12

N

256

I

Full

RAM allocation for data (Pos = bytes, Neg = kbytes)

S13

N

0

I

Full

Spare parameter

S14

N

0

I

Full

Spare parameter

 

NOTES:

1. Maximum values are:9,998 for the BRC-100, IMMFP11/12 and 31,998 for the HAC

 

 

 

148.1   Explanation

 

148.1.1  Specifications

 

S1

Identifies the current recipe ID number for the BSEQ block. The recipe ID number is defined by the operator. A new recipe cannot be loaded into the BSEQ block until the previous recipe is complete or the sequence is in hold.

 

NOTE: Alphanumeric Recipe IDs are supported by connecting S1 of the BSEQ block to the N+1 ST output of a DATA EXPT (FC 194) or DATA IMPT (FC 193) function block. The batch program must include the #ALPHA compiler directive in order to support Alphanumeric Recipe IDs.

 

S2

Defines the start/restart phase number for the BSEQ block.

 

S3

Controls the status of the batch sequence. A zero to one transition causes the sequence to begin or resume running. A zero input causes the sequence to hold unless external hold is disabled.

 

S4

Operator acknowledge input. It latches in the true state by a zero to one transition. It remains true until read by an ACK statement.

 

S5

Block address of the E-STOP (executed stop).

 

S6 and S7

Spare boolean input.

 

S8

Spare parameter.

 

S9

Defines the ID number of the batch program that the BSEQ block will execute. The program ID number is determined by the last two digits of the program name or the compiler directive #PROGRAMID.

 

S10

Defines a debug operation. Under normal program execution requirements, use the default value (one).

1000 = transition to 1000 (from any other value) causes a debugger STOP command S to be executed

1001 = transition to 1001 (from any other value) causes a debugger GO command G to be executed

9000 = value of 9000 causes a debugger STOP command S to be executed whenever the program is started (complete to running) or restarted (holding to running)

 

S11

Controls the RAM allocation for the object file in one kilobyte increments. The program listing file name.LST shows the minimum value for this specification in its last comment lines.

 

S12

Controls the RAM allocation for the dynamic data. This data consists of batch, local and stack data for the active step subroutine. The program listing file name.LST shows the minimum value for this specification in its last comment lines. For redundant configurations, the primary controller copies the entire dynamic data space to the backup. Therefore, to minimize update time, the smallest amount of memory should be allocated.

 

NOTE: Do not use online configuration to change the value of specification S12 in redundant configuration. Online

configuration of S12 while a batch program is running forces the program state to Batch Complete.

 

 

148.1.2   Outputs

 

The block outputs show the status of the batch sequence (BSEQ) function block. These outputs can be linked to any other

block in the configuration to monitor the batch process. The output of block number N+7 is a fault code.

 

148.1.3  Run-Time Fault Code Explanation

 

The BSEQ function block executes a series of diagnostic tests that detect errors that cannot be detected by the compiler.  The fault codes can be seen by using the batch debugger or by viewing the BSEQ block output (N+7). The errors are detectable only while the controller is in execution and are, therefore, called run-time errors. Table 148-1 lists the possible error codes and an explanation of each.

 

 

Table 148-1 BSEQ Run-Time Fault Codes

 

Fault Codes

Explanation

Any positive

number

Assigned (any positive number) by the user in the batch language program and is used to indicate what type of fault has occurred. There is no limit to the number of fault codes the user can assign.

 

-1.0 Hold

command

The batch sequence is in hold, through either the BSEQ function block or a command in the batch language. Going to hold suspends normal logic and starts execution of hold logic.

 

-3.0 Stack overflow

Contact ABB technical support.

 

-4.0 Error reading

object file

No batch program exists in the NVRAM memory that matches the number indicated in specification S9 of the BSEQ function block. Normally this means that the batch object file has not been downloaded to the controller, or specification S9 of the BSEQ function block references an undefined program number.

 

-5.0 Object file

exceeds memory

allocation

Batch program size exceeds the amount of controller volatile memory specified by specification S11 of the BSEQ function block. Correct this problem by increasing specification S11.

 

-7.0 Phase data

size exceeds

memory allocation

Amount of data used by a step/phase exceeds the amount of memory specified by specification S12 of the BSEQ function block. To correct, increase the value of S12 in the BSEQ function block.

 

-8.0 Recipe refers

to undefined

phase subroutine

Unit recipe contains a phase subroutine name that is not contained within the batch program. This situation can happen when a batch program is edited so that a phase subroutine is removed, but the corresponding recipes are not changed. To correct, add the undefined phase subroutine or remove the called (undefined) phase subroutine from the unit recipe.

 

-9.0 Batch

directory error

Format the controller and reload necessary programs, recipes, and data files.

-10.0 Recipe error

Execution of a unit recipe was attempted that does not exist within the NVRAM memory of the controller. To correct, create or download a unit recipe to the controller, or input a valid recipe ID. Then restart the sequence.

 

-12.0 Illegal

parameter type

Argument data type conflict between the unit recipe and the batch program.  To correct, recompile the batch program and the recipe. Then download both the recompiled batch program and the unit recipe.

 

-13.0 ESTOP/

Aborting from

block input

Emergency input to the BSEQ function block (specification S5) is ON. This drives the batch program unconditionally to operation 0 of the current unit recipe.  To correct, find out why the emergency shutdown input is being set to ON and correct it.

 

-15.0 Invalid

operation number

Starting of a batch sequence was attempted at an operation number not defined within the unit recipe being run. Create a unit recipe with an operation number that matches the one to be executed, or change the operation number.

 

-16.0 Bad function

block reference

In the batch data declaration sections of the batch language, the program is trying to reference a function block that does not exist or one whose type does not match the function code type in the declaration. The batch debugger will provide the function block number within the batch data section that is making the reference. To correct, change the function block number to a valid one, erase the reference from the program, or correct the type to match the function block in the controller.

 

-17.0 Array error

Array subscript is out of bounds. Normal logic is suspended and execution of fault logic begins. Note that it is possible to inspect the value of the fault code to detect when this fault has occurred.

 

-18.0 BCODE

revision mismatch

Batch program was compiled using firmware that does not match the firmware in the controller. Recompile the batch program with the compiler that matches the firmware within the controller.

 

-19.0 Recipe

requires too many

parallel phases

Execution of a recipe was attempted that contains more parallel phase  subroutines than are allowed in the target program. To correct, edit and recompile the unit recipe to contain less parallel phase subroutines, or edit the #MAXPARALLEL statement.

 

-20.0 Invalid number

of parameters

in phase data

Unit recipe contains the wrong number of recipe parameters compared to the target program. Normally, the recipe must be corrected. Otherwise, the program must be corrected.

 

-21.0 Invalid online

program change

Execution of a new program was attempted that differs from the previous one because of a change in the batch data area or the local declaration section of the active phase subroutine. Such online changes are not permitted.

 

-22.0 Batch

descriptor not

unique

Batch and lot number in the BHIST function block are not unique to the batch historian. Change the batch and/or lot number and restart the program.

-23.0 Wait for

batch historian

Batch historian is busy, and the program may not proceed until it is available.  No corrective action is required.

 

-24.0 Batch

historian offline

Batch historian is offline, and the program may not proceed until the batch historian is online and the program is restarted.

 

-25.0 Bad block

reference in phase

data

Unit recipe used contains a reference to an incorrect or nonexistent block. Correct the block number in the unit recipe.

 

-26.0 Bad data

reference in recipe

Data entry in the unit recipe does not match the program. This most commonly happens when a unit recipe argument value was selected from a selection list, and the program was changed to no longer include that selection. Resolve any discrepancies and recompile the unit recipe with the batch program.

 

-27.0 Bad block

reference in Unit

Data

Function block declaration in the unit data file does not match the controller configuration. (Either the function block address or the function code type is in error). Resolve any discrepancies and recompile the unit data file against the batch program.

 

-28.0 Bad CSEQ

reference in Unit

Data

CSEQ reference in the unit data file does not match the program. Resolve any discrepancies and recompile the unit data file against the batch program.

 

-29.0 Unit Data

does not match

B90 program

Unit data file does not match the batch program structurally (the number or the type of the declarations does not match). Resolve any discrepancies and recompile the unit data file against the batch program.

 

-30.0 Error reading

UNIT.DEF file

No unit data file exists in the NVRAM memory that matches the number indicated by specification S9 of the BSEQ function block. Normally, this means that the unit data object file has not been downloaded to the controller.

 

-31 ID type

mismatch

Recipe ID type connected to the BSEQ function block is not the same as the program file type selected by BSEQ specification S9. This error is caused by the BSEQ input specification S1 connected to a DATAEXPT (FC144) and the program referenced by specification S9 being Numeric, or specification S1 connected to a READ and the program referenced is #alpha.

 

-32 String

subscript error

String position specified in the program is negative or larger than the maximum size of the string. This error occurs during program execution and transfers the program to fault logic.

 

-33 Restart error,

Historian queue

full

Hold-to-run command was received but ignored. This is due to a historian queue-full condition with a good Historian status. This state is a continuation of the Hold Command state. (Refer to fault code -1). Even though the run input may still be active, a new Hold-to-Run transition must be initiated to attempt another restart. The program will not restart unless the queue-full condition was rectified prior to the Hold-to-Run transition request, regardless of the setting in FC220, specification 9. Note that if and when the historian is marked bad, the queue is cleared.

 

 

 

148.2   Application

 

Figure 148-1 is a batch sequence example. Specification S1 links the BSEQ block to the first remote manual set constant (REMSET) block. This link gives the BSEQ block the recipe ID number. Specification S2 links the BSEQ block to the second REMSET block. This link gives BSEQ block the phase number.

 

 

The output of the first remote control memory (RCM) block is linked to S3 of the BSEQ block. This input value describes the status of the run/hold pushbutton. The second RCM block output supplies the BSEQ block with the status of the E-STOP pushbutton.

 

Output N of the BSEQ block is the current recipe ID number. This output functions as a feedback signal for the first REMSET block. The N+1 output of the BSEQ block is the current phase number. This output functions as a feedback signal for the second REMSET block. The N+2 output identifies the run/hold status of the BSEQ block. If this output is one, the BSEQ block is running. If the output is zero, the BSEQ block is in hold mode.