100% found this document useful (3 votes)
7K views277 pages

Sebol Training Manual PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
7K views277 pages

Sebol Training Manual PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 277

Instruction

Manual
SEBOL
Function Manual
Release : R2
IM 33G3C20-11E

IM 33G3C20-11E
6th Edition
Yokogawa Electric Corporation
◆ Preface
This manual describes the operation and syntax of the sequence programming language
SEBOL (SEquence and Batch Oriented Language).
SEBOL is used for the process control at the field control station (FCS) of the
CENTUM CS system. It has functions specially designed for the purpose in addition to
those available with high-level programming languages, such as FORTRAN, C, and
BASIC.

■ Manual Configuration
This manual is composed of 16 chapters and four appenddixes as follows:
Chapter 1 is an introduction.
Chapters 2 to 6 describe the syntax and other protocols the language requires, such as
program units, data types, operands, variables, and functions.
Chapter 7 describes details of function block data, or process data that SEBOL can
manage.
Chapters 8 and 9 describe the use of program control and message statements.
Chapter 10 describes error processing.
Chapter 11 describes the use of variables and expressions.
Chapter 12 and 13 describe the management of the CPU and shared resources.
Chapter 14 describes the functions of subsystem communication supported by SEBOL.
Chapter 15 describes the manipulation of signals.
Appendixes list error codes, variable declarations, maximum values, and reserved words.

■ Applicable Readers
This manual has been written for those who have general knowledge of instrumentation,
process control systems, ICS, FCS, SEBOL and SFC block functions for use in the
engineering of the CENTUM CS system.

NOTE
The SEBOL explained in this manual is not the same as the SEBOL used with the
CENTUM XL Batch and their programs are not interchangeable.

■ Trademarks
• “UNIX” is a registered trademark in the United States and other countries and
licensed exclusively through X/Open Company Limited.
• “Motif” and “OSF/Motif” are trademarks of Open Software Foundation, Inc.
• “X-Window” and “X Window System” are trademarks of the Massachusetts
Institute of Technology.
• “Ethernet” is a registered trademark of XEROX Corporation.
• “HP” and “HP9000” are registered trademark of Hewlett Packard Company.
• “IBM” is a registered trademark of International Business Machine Corporation.
• “SUN” is a registered trademark of Sun Microsystems, Inc.
• Other brand and product names are registered trademarks of their respective holders.

FD No. IM 33G3C20-11E-CS
6th Edition: Apr. 2000 (YG)
All Rights Reserved, Copyright © 1995, Yokogawa Electric Corporation
IM 33G3C20-11E i
◆ Document Map
■ System Concept and Design Manuals
System
Overview (TI)

ICS Operation Recipe Management


FCS Control
and Monitoring / Batch Control
Function Manual
Function Manual Function Manual

ICS Management Advanced


User Program
Information Control Function
Function Manual
Function Manual Manual

Other Software Subsystem Communication


Operation Communication Unit Function
Manuals of ICS Function Manual Manual

ICS Other Software Other Function


Startup Operation Operation Manuals
Manual Manual of FCS

■ Engineering Manuals System Builder Common


Configuration Operation Manual
Manual

Builder Operation
ICS Builder FCS Builder
Manuals of Other
Operation Manual Operation Manual
Units and Functions

Graphic Builder
Operation Manual

Self
Test Function Documentation
Manual Manual

■ Installation and
Installation
Maintenance Manuals Guidance (TI)

■ Operation Manuals
Communication and
ICS Operation ICS Hardware FCS Hardware Network Device
Manual Manual Manual Hardware Manual

Peripherals Node Device


Message Manual
Manual Manual

(Note) ICS: Information and Command Station, Related Device


Hyper Information and Command Station(HICS), and Manual
PC-based Information and Command Station(PICS)
FCS: Field Control Station

■ Recommended Readings
• IM 33G2C20-11E SIH1100 ICS Operation and Monitoring Function Manual
• IM 33G3C10-11E FCS Control Station Function Manual
• IM 33G3C21-11E CS Batch SEBOL-Block Function Manual
• IM 33G3C31-11E CS Batch SFC-Block Function Manual

ii IM 33G3C20-11E
◆ Notice
■ Regarding This Manual
1. This manual should be passed on to the end user.
2. Read this manual carefully and fully understand how to operate this product before
you start operation.
3. Yokogawa makes no warranty of any kind with regard to this manual, including,
but not limited to, implied warranties of merchantability and fitness for a particu-
lar purpose.
4. All rights reserved. No part of this manual may be reproduced in any form
without Yokogawa’s written permission.
5. The contents of this manual are subject to change without prior notice.
6. If any question arises or errors are found, or if there is any information missing
from this manual, please inform Yokogawa’s documentation department respon-
sible for this manual or the nearest Yokogawa sales office, or use the form in the
back of this manual to inform us accordingly.
■ Regarding Protection, Safety, and Prohibition Against Unauthorized Modification
1. For the protection and safe use of the product and the system controlled by it, be
sure to follow the instructions on safety described in this manual when handling
the product. In addition, if you handle the product in contradiction to these
instructions, our company does not guarantee safety.
2. The following safety symbol marks are used on the product concerned and in this
Manual :
Les symboles suivants touchant à la sécurité sont utilisés sur le produit concerné et
dans ce manuel.

CAUTION
This marking on the product indicates that the operator must refer to an
explanation in the instruction manual in order to avoid injury or death of
personnel or damage to the instrument. The manual describes that the operator
should exercise special care to avoid electric shock or other dangers that may
result in injury or the loss of life.

ATTENTION
Ce symbole marqué sur le produit indique que l’opérateur doit se reporter au
manuel d’instruction pour éviter tout accident corporel ou tout dégât matériel.
Le manuel d’instruction indique que l’opérateur doit faire particulièrement
attention pour éviter tout choc électrique ou autre accident pouvant entrainer un
accident ou la mort.

IM 33G3C20-11E iii
CAUTION
A CAUTION sign denotes a hazard. It calls attention to a procedure, practice,
condition or the like, which, if not correctly performed or adhered to, could
result in damage to or destruction of part or all of the product.

CAUTION
Le symbole CAUTION annonce un risque Il désigne une procédure, une
marche à suivre ou autre qui, n’étant pas correctement observée, peut entainer
un dommage ou une destruction partielle ou totale du produit.

Protective ground terminal


In order to provide protection against electrical shock in case of a fault. This
symbol indicates that the terminal must be connected to ground prior to
operation of equipment.

Borne de connexion à la terre de protechon


Ce symbole indique que la borne doit être reliée à la terre de protechon avant
toute utilisation du matériel, dans le but de se protéger d’une électrocution en
cas de défaillance.

Function ground terminal


In order to provide protection against noise.
This symbol indicates that the terminal must be connected to ground prior to
operation of equipment.

Borne de connexion à la terre sans bruit


Ce symbole indique que la borne doit être reliée à la terre sans bruit avant
toute utilisation du materiel, dans le but de se protéger du bruit.

Indicates the “AC power supply.”


Ce symbole indique qu’il s’agit d’une Source d’Alimentation Alternative.

Indicates the “DC power supply.”


Ce symbole indique qu’il s’agit d’une Source d’Alimentation Continue.

Indicates the power switch state “ON.”


Ce symbole indique que le commutateur de mise soustension est en position de
“Marche.”

Indicates the power switch state “Stand - by.”


Ce symbole indique que le commutateur de mise soustension est en position de
“Veille.”

Indicate the power switch state “OFF.”


Ce symbole indique que le commutateur de mise soustension est en position de
“Arret.”

iv IM 33G3C20-11E
The symbolic conventions below are used only in the manual.
Les conventions suivantes sont utilisées uniquement dans le manuel d’instruction.

IMPORTANT
Indicates that operating the hardware or software in this manner may damage it
or lead to system failure.

IMPORTANT
Indique que manipuler le matériel ou le logiciel de cette manière peut
l’endommager ou provoquer l’arrêt du système.

NOTE
Draws attention to information essential for understanding the operation and
features.

NOTE
Attire l’attention sur une information essentielle pour la comprehension des
opérations à effectuer ou des caractéristiques.

3. If protection / safety circuits are to be used for the product or the system con-
trolled by it, they should be installed outside of the product.
4. When you replace parts or consumables of the product, use those specified by our
company.
5. Do not modify the product.

■ Regarding Force Majeure


1. Yokogawa Electric Corporation does not make any warranties regarding the
product except those mentioned in the WARRANTY that is provided separately.
2. Yokogawa Electric Corporation assumes no liability to any party for any loss or
damage, direct or indirect, caused by the use or any unpredictable defect of the
product.

■ Regarding Software Supplied by YOKOGAWA


1. Yokogawa makes no other warranties expressed or implied except as provided in
its warranty clause for software supplied Yokogawa.
2. Use this software with one specified computer only.
You must purchase another copy of the software for use with each additional
computer.
3. Copying this software for purposes other than backup is strictly prohibited.
4. Store the streamer or tape (original medium) in a secure place.
5. Reverse engineering such as the disassembly of software is strictly prohibited.
6. No portion of the software supplied by Yokogawa may be transferred, exchanged,
or sublet or leased for use by any third party without prior permission by
Yokogawa.

IM 33G3C20-11E v
◆ Note
■ Appearance and Accessories
After you received this product, check the following:
• Appearance
• Standard accessories
If coating falls off, a product is broken, or accessories are missing, contact our
representative from which you purchased this product or our sales department.
If the label on the power distribution board is filthy or falls off, order a label (part
number: T9029BX).

: Label attached to the power distribution board

■ Model and Suffix Codes


Model and suffix codes are put on the nameplate attached to this product. Check them
against model and suffix codes listed on this manual to confirm whether a product you
ordered is delivered. If you have any questions, contact our representative from which
you purchased this product or our sales department.

vi IM 33G3C20-11E
◆ Documentation Conventions
Throughout this manual, the following conventions of notation clarify the input device
(keyboard, touch panel, or mouse) used.
• Characters or symbols enclosed in denote keys on the ICS operation key-
board.
Example:To change to the next page, press the key.

• Characters enclosed in < > represent keys on the engineering keyboard.


Example:To enter %, press the <%> key while pressing the <SHIFT> key.

• Characters enclosed in [ ] indicate in ICS softkey, command for a window or menu,


or an item on worksheets of various types.
Example:Press on the [START] softkey to save the data.

• An underline boldface font denotes the format of the data you enter on a panel.
Example:The cursor appears, prompting input.
FIC100.SV=50.0

• This manual uses the following conventional symbols.

TIP
Gives information that complements the present topic.

See Also
Gives the reference locations for further information on the topic.

Operation with the mouse is shown.


Indicates operation using a touch screen function.
The input operation from the keyboard is shown.
Indicates operation with a track ball.
The display status of the panel is shown.

■ Figures of Simulated
• The figures that appear in this manual of simulated may sometimes be emphasized
or simplified, or may fail to show the entire image for reasons of convenience in
explaining them.
• The display position or character (large/small letter, etc.) of the CRT chart shown in
this manual might be different from that of actual CRT display within the range not
to give obstacles of the function understanding and operation monitoring.

IM 33G3C20-11E vii
Blank Page
Contents

◆ Preface ...................................................................................................................... i
◆ Document Map ........................................................................................................ ii
◆ Notice ........................................................................................................................ iii
◆ Note ........................................................................................................................... vi
◆ Documentation Conventions .................................................................................. vii

1. Overview
1.1 Introduction .............................................................................................. 1-1

2. Program Units
2.1 Types of Program Units ........................................................................... 2-1
2.2 Defining the SFC Block ........................................................................... 2-2
2.3 Defining the SEBOL Block ..................................................................... 2-2
2.3.1 Ending the SEBOL Block Program ................................................. 2-2
2.4 Defining the Function Subprogram ......................................................... 2-3
2.4.1 Ending the Function Program .......................................................... 2-3

3. Syntax and Other Protocols


3.1 Identifiers .................................................................................................. 3-1
3.2 Statement, etc. .......................................................................................... 3-1
3.3 Data Types ............................................................................................... 3-2
3.4 Constants .................................................................................................. 3-3
3.5 Variables ................................................................................................... 3-5
3.6 Declaring Local Variables ....................................................................... 3-6
3.6.1 Simple Variables .............................................................................. 3-6
3.6.2 Declaring Local Variable Arrays ..................................................... 3-7
3.6.3 Referencing a Local Variable Array or Element ............................. 3-8
3.7 Function Block Data ................................................................................ 3-10
3.7.1 Data of Present SFC/SEBOL Block ................................................ 3-10
3.8 Implicit Declaration ................................................................................. 3-11
3.8.1 #IMPLICIT Command ..................................................................... 3-11
3.8.2 Implicitly Declared Local Variables ................................................ 3-12
3.8.3 Implicitly Declared Tag Names ....................................................... 3-12
3.9 Substituting Identifiers with Tokens ........................................................ 3-13
3.10 Inclusion of Files ...................................................................................... 3-14

4. Operators and Expressions


4.1 Arithmetic Operation ............................................................................... 4-3
4.2 Relational and Equality Operations ......................................................... 4-4
4.3 Logical Operation ..................................................................................... 4-5
4.4 Bitwise Logical and Shift Operations ...................................................... 4-6
4.5 Character-String Operation ...................................................................... 4-7
4.6 Operation Priority ..................................................................................... 4-8
4.7 Conversion of Operands .......................................................................... 4-9
4.8 Assignment Statements ............................................................................ 4-11

IM 33G3C20-11E ix
5. Variables
5.1 Local Variables ........................................................................................ 5-1
5.2 Function-Block Data ................................................................................ 5-3
5.2.1 Declaring Tag Names ....................................................................... 5-4
5.2.2 Assigning Tag Names ...................................................................... 5-5
5.2.3 Block Type Names and Model Designations .................................. 5-7

6. Functions
6.1 Defining Functions ................................................................................... 6-1
6.2 Calling Functions ..................................................................................... 6-3
6.3 Function Arguments ................................................................................. 6-4
6.3.1 Verifying Argument Types .............................................................. 6-6
6.3.2 Function Types ................................................................................. 6-7
6.4 Declaring Function Block Formal Arguments ........................................ 6-8
6.4.1 Referencing Function Block Data .................................................... 6-10
6.4.2 “assign” Statement ............................................................................ 6-11
6.5 Variables Used with Functions ................................................................ 6-12
6.5.1 Local Variables ................................................................................. 6-12
6.5.2 Tag Names ........................................................................................ 6-12
6.5.3 Local Generic Names ....................................................................... 6-12
6.5.4 Unit Generic Names ......................................................................... 6-13
6.6 Built-in Functions ..................................................................................... 6-14
6.6.1 Arithmetic Functions ........................................................................ 6-16
6.6.2 Bit Operation Functions ................................................................... 6-17
6.6.3 High-Low Limit Functions ............................................................... 6-18
6.6.4 Trigonometric Functions .................................................................. 6-19
6.6.5 Square-Root Function ....................................................................... 6-19
6.6.6 Exponentiation Function .................................................................. 6-19
6.6.7 Natural Logarithm Function ............................................................. 6-19
6.6.8 Character-String Functions ............................................................... 6-20
6.6.9 Date and Time Functions ................................................................. 6-21
6.6.10 Function Block Data Function ......................................................... 6-21
6.6.11 Error Functions ................................................................................. 6-22
6.6.12 Signal Function ................................................................................. 6-23
6.6.13 Process Management ........................................................................ 6-23
6.6.14 Other Functions ................................................................................ 6-24

7. Function Block Data


7.1 Overview .................................................................................................. 7-1
7.2 Grouped Function-block Data Manipulation ........................................... 7-3
7.2.1 Group Assignment Statement ........................................................... 7-8
7.2.2 Data of Another Plant ....................................................................... 7-12
7.2.3 “compare” Statement ........................................................................ 7-13
7.2.4 “drive” Statement ............................................................................. 7-16
7.3 Block Modes and Block Statuses ............................................................ 7-20
7.3.1 Reading Block Modes ...................................................................... 7-21
7.3.2 Changing Block Modes .................................................................... 7-23
7.3.3 Block Statuses .................................................................................. 7-24

x IM 33G3C20-11E
7.4 Data Status ............................................................................................... 7-27
7.4.1 Checking Data Status ....................................................................... 7-28
7.4.2 Changing Data Status ....................................................................... 7-31
7.5 Alarm Status ............................................................................................. 7-32
7.5.1 Referencing Alarm Status ................................................................ 7-32
7.5.2 Data Items AF, AOFS, AFLS .......................................................... 7-33
7.5.3 Referencing Alarm Statuses Individually ........................................ 7-37
7.6 Sequence-Table Block ............................................................................. 7-40
7.6.1 One-Shot Execution and Check ....................................................... 7-41
7.6.2 Periodic Start with One-Shot Execution .......................................... 7-42
7.6.3 Periodic Start without One-Shot Execution ..................................... 7-44
7.7 Logic-Chart Block .................................................................................... 7-45
7.7.1 One-Shot Execution .......................................................................... 7-45
7.7.2 Periodic Start with One-Shot Execution .......................................... 7-46
7.7.3 Periodic Start without One-short Execution .................................... 7-47
7.8 Process I/O and Software I/O .................................................................. 7-48
7.8.1 Process I/O Terminal Numbers ........................................................ 7-48
7.8.2 Software I/O Element Numbers ....................................................... 7-50
7.8.3 CP213 Communication Element Numbers ..................................... 7-51
7.8.4 Declaration ........................................................................................ 7-52
7.8.5 Group 16-Bit I/O .............................................................................. 7-53
7.9 Timer Block ............................................................................................. 7-56
7.10 “oneshot” Statement ................................................................................. 7-57

8. Program Control Statements


8.1 “if” Statement ........................................................................................... 8-1
8.2 “for” Statement ......................................................................................... 8-3
8.3 “while” Statement .................................................................................... 8-5
8.4 “repeat” Statement ................................................................................... 8-7
8.5 “wait until” Statement .............................................................................. 8-9
8.6 “switch” Statement ................................................................................... 8-11
8.7 “goto” Statement ...................................................................................... 8-14
8.8 “delay” Statement ..................................................................................... 8-16
8.9 “delaycycle” Statement ............................................................................ 8-17

9. Message Statements
9.1 “opeguide” Statement ............................................................................... 9-3
9.2 “dialogue” Statement ............................................................................... 9-4
9.3 “message” Statement ................................................................................ 9-7
9.4 “history” Statement .................................................................................. 9-8
9.5 “request” Statement .................................................................................. 9-9
9.6 “sysalarm” Statement ............................................................................... 9-10
9.7 “prcsalarm” Statement ............................................................................. 9-11
9.8 Formatting String ..................................................................................... 9-16
9.8.1 “format” Statement ........................................................................... 9-18
9.9 Message Restrictions ................................................................................ 9-19

IM 33G3C20-11E xi
10. Error Processing
10.1 Individual Statement Error-Processing Description ................................ 10-1
10.1.1 Error Variable ................................................................................... 10-2
10.1.2 Branching Destination ...................................................................... 10-4
10.1.3 Group Statements and Error Processing .......................................... 10-5
10.2 Common Error-Processing Definition ..................................................... 10-6
10.3 Classified Error Codes ............................................................................. 10-9
10.4 Substitution of Values .............................................................................. 10-10
10.5 Conditional Expression Errors ................................................................. 10-12
10.6 Sequence Table/Logic Chart Errors ......................................................... 10-13
10.7 Transition-Condition Errors ..................................................................... 10-13

11. Use of Variables and Expressions


11.1 Classification of Functions ...................................................................... 11-1
11.2 Classification of Expressions ................................................................... 11-2
11.3 Special Operands ...................................................................................... 11-4
11.4 Built-In Function Actual Arguments ....................................................... 11-5

12. Allocating CPU Time (nopreempt Statement)


12.1 Monopolizing CPU Time ......................................................................... 12-1
12.2 Counting Run Lines ................................................................................. 12-5

13. Managing Shared Resources


13.1 “semlock” Statement and “semunlock” Statement .................................. 13-4
13.2 Deadlocks and Their Prevention .............................................................. 13-6

14. Subsystem Communication


14.1 Accessing DDC/SEQ Data ...................................................................... 14-3
14.1.1 Reading Subsystem Data .................................................................. 14-4
14.1.2 Data Statuses .................................................................................... 14-6
14.1.3 Writing Subsystem Data ................................................................... 14-8
14.1.4 Example ............................................................................................ 14-11
14.2 Accessing Monitor Data .......................................................................... 14-13
14.2.1 Reading Subsystem Data .................................................................. 14-14
14.2.2 Writing Subsystem Data ................................................................... 14-16
14.2.3 Using Interrupt Programs ................................................................. 14-19
14.3 Options ..................................................................................................... 14-21

15. Signaling Operation


15.1 Signal Names and Signal Parameters ...................................................... 15-1
15.2 Queued Signals and Interrupt Signals ..................................................... 15-1
15.3 “signal” Statement .................................................................................... 15-2
15.4 Manipulating Queued Signals .................................................................. 15-5
15.5 Masking Interrupt Signal Handling ......................................................... 15-9

xii IM 33G3C20-11E
Appendixes
Appendix 1 Error Codes ................................................................................... A1-1
App. 1.1 Classified Error Codes .................................................................. A1-1
App. 1.2 Detailed Error Codes ..................................................................... A1-10
Appendix 2 Variable Declarations .................................................................... A2-1
Appendix 3 Maximum Values .......................................................................... A3-1
Appendix 4 Reserved Words ............................................................................ A4-1
Appendix 5 Application Size ............................................................................ A5-1
Appendix 6 Differences from XL-BATCH ...................................................... A6-1
Appendix 7 System-Fixed Include Files .......................................................... A7-1

◆ Reader’s Comment Form


◆ Revision Record

IM 33G3C20-11E xiii
1. Overview

1. Overview
An outline of SEBOL is given in this chapter.

1.1 Introduction
SEBOL, which is an acronym for the SEquence and Batch Oriented Language, is a
programming language designed for use in the control of processes. It has a number of
specific functions designed for the purpose in addition to those basically similar to
FORTRAN, C, and BASIC.
Programs written in SEBOL are used as SEBOL and SFC (sequential function chart)
blocks and run on the CENTUM CS system FCS (field control station).
This manual explains the syntax and other elements of the language using examples.

NOTE

The SEBOL explained in this manual is not the same as the SEBOL used with the
CENTUM XL Batch and their programs are not interchangeable.

IM 33G3C20-11E 1-1
2. Program Units

2. Program Units
This chapter describes SEBOL program units.

2.1 Types of Program Units


A SEBOL program is composed of program units. There are three program units,
namely an SFC block and a SEBOL block, which are main programs, and a function
subprogram:

Program units Main program SFC block

SEBOL block

Subprogram Function

Figure 2.1 SEBOL Program Units

• The SFC block is a main program that is graphically generated by using an engineer-
ing function builder.
• The SEBOL block is a main program that is created by using a text editor, similar to
C and BASIC.
• Both SFC and SEBOL blocks run as function blocks on the FCS and can be con-
trolled from another function block or the operation-and-monitoring function.
• The “function” subprogram contains an argument and the result of an operation for an
exchange of data with a calling function. It can be called from the SFC or SEBOL
block or a function.
NOTE: The SFC block and the SEBOL block are noted as “SFC/SEBOL block”
when both blocks are referred to in this manual.

IM 33G3C20-11E 2-1
2.2 Defining the SFC Block
The SFC block builder is used to define an SFC block. For details, see the Builder
Operation Manual (IM33G4L20-11E).

2.3 Defining the SEBOL Block


The SEBOL block builder is used to define a SEBOL block. For details, see the Builder
Operation Manual (IM33G4L20-11E).
A SEBOL block program begins with a “sebolblock” statement and ends with an “end”
statement — see Figure 2.2. One source file is used to define one SEBOL block.

sebolblock <program name>


Declaration statement

Executable statement

end

Figure 2.2 SEBOL Block Program

2.3.1 Ending the SEBOL Block Program


The execution of a SEBOL block program can be ended using the “exit” statement —
see Figure 2.3. If an “exit” statement without a program ending code or an “end”
statement is used, “0” will be entered as the ending code.

exit [<program ending code>]

<program ending code>: Use a numeric expression with value ranging from -32768 to 32767.

Figure 2.3 Ending SEBOL Block Program

2-2 IM 33G3C20-11E
2. Program Units

2.4 Defining the Function Subprogram


A function program begins with a “function” statement and ends with the “end” state-
ment — see Figure 2.4. One source file is used to define one function.

<type specifier> function <function name> ([<formal argument array>])


Declaration statement

Executable statement

end

Figure 2.4 Function Program

2.4.1 Ending the Function Program


The execution of a function program can be ended using a “return” or “end” statement
— see Figure 2.5. If a “return” or “end” statement is used without specifying a return
value, the function will not return any value.

return [<return value>]

<return value>: Use an expression to specify the return value.

Figure 2.5 Ending Function Program

IM 33G3C20-11E 2-3
3. Syntax and Other Protocols

3. Syntax and Other Protocols


This chapter describes the syntax and other protocols of SEBOL.

3.1 Identifiers
An identifier is a sequence of alphanumeric characters, percent signs (%), underscores
(_), and dollar signs ($). It must begin with an alphabetic letter or a percent sign. It can
be of any length but only the first eight characters are significant except a tag name, in
which case up to 16 characters are significant. Uppercase and lowercase letters are not
distinguished.

3.2 Statement, etc.


(1) Statement
A program unit is composed of a number of statements, and a statement is normally
described in one line. If a statement cannot be completed in one line, enter “\” or “//” at
the end of the line to continue the entry of the statement — but a statement cannot be
entered exceeding 511 bytes, which will cause a compile error.
A sequence of two or more blanks in places other than a nonnumeric constant is counted
as one byte. The “\“ and “//” used to continue a line are excluded from the total line
length of 511 bytes.

(2) Comment
A comment can be inserted in the program marking the start of the line by an asterisk
(*). Also it can be written anywhere in the line delimiting it by an exclamation mark (!)
— the text between the exclamation mark and the return code is translated as a com-
ment.

(3) Label
A position-identifying label, or an identifier, can be attached to a statement as shown in
Figure 3.1. If there is no statement on the right side, the label will be attached to the
subsequent statement.

<identifier> : <statement>

Figure 3.1 Label Format

IM 33G3C20-11E 3-1
3.3 Data Types
Data types and their ranges of data values SEBOL can manage are shown in Table 3.1:

Table 3.1 Data Types & Ranges

Data Type Type Specifier No. of Bits Min. Value Max. Value
Character string char*n 8*n — —
Integer integer 16 -32768 32767
Double-length integer long 32 -2147483648 2147483647
Single-precision floating point float 32 -3.402823*10ˆ38 3.402823*10ˆ38
Double-precision floating point double 64 -1.79769313486231*10ˆ308 1.79769313486231*10ˆ308

In this manual, integer and long-integer data types are referred to as the integer type,
single- and double-precision floating-point data types as the real-number type, and these
four data types as the numeric type.
The number of significant digits is seven for single-precision floating-point data and 15
for double-precision floating-point data. Up to 255 bytes can be used for character-
string data (“n” in “char*n” must be less than 255).
The configuration of each data type is shown in Figure 3.2. The mantissa fields of
integer and real-number data are twos complements.

Character-string data (char*n)

First byte ...... nth byte

Integer data (integer)

15-bit integer

Sign bit: 1 bit (0: positive, 1: negative)

Long integer data (long)

31-bit integer

Sign bit: 1 bit (0: positive, 1: negative)

Single-precision floating-point data (float)

8-bit exponent field (E) 23-bit mantissa field (M)

Sign bit (S): 1 bit, value computed in (-1)s * 2E-127 * 1.M

Double-precision floating-point data (double)

11-bit exponent field (E) 52-bit mantissa field (M)

Mantissa field (M) continued

Sign bit (S): 1 bit, value computed in (-1)s * 2E-1023 * 1.M

Figure 3.2 Data Configuration

3-2 IM 33G3C20-11E
3. Syntax and Other Protocols

3.4 Constants
(1) Integer Constants
A decimal integer constant is long-type data and contains an array of digits 0 through 9.
A hexadecimal integer constant begins with a dollar sign ($) and can contain alphabetic
letters A through F in both uppercase and lowercase in addition to numerals.
EXAMPLES: Decimal integer constants: 10, 100, 123
Hexadecimal integer constants: $10, $FFFF, $ABCD

(2) Floating-Point Constants


A floating-point constant is double-type data and expressed using decimal numerals. It
can be expressed using a decimal point as in “10.0” or using an exponent field as
described below:
<mantissa field> E <exponent field> or <mantissa field>
e <exponent field>
Mantissa field: Decimal point used, or decimal numerals without decimal point.
Exponent field: No sign used, or decimal numerals with a sign.
When the mantissa field is “x” and the exponent field is “y”, the value is x*10y.
EXAMPLES: Exponent field not used: 1.0, 15.8, 0.05
Exponent field used: 1.0E5, 1.0e-5, 123E3

(3) Character-String Constants


A character-string constant is char*n-type data and expressed using a character string
and double quotation marks to mark the beginning and end of the string.
Non-printing characters, including double quotation marks, expressed using a backslash
(\) are shown in Table 3.2.

Table 3.2 Non-Printing Character Expression

Non-Printing Character Expression Used


Return code \n
Horizontal tab \t
Backslash \\
Double quotation mark \”

IM 33G3C20-11E 3-3
The return code following a backslash used in a character-string constant is ignored.
Thus the two snapshot statements in the example shown in Figure 3.3 will be output as
one continuous statement. (The snapshot statement is described in Chapter 9.)

sebolblock example

snapshot ”How to write\


a long character-string\n”
snapshot ”How to write a long character-string\n”

end

Figure 3.3 Ignored Return Code

A number of built-in functions are available to manipulate character strings — see


Chapter 6 for their description.

3-4 IM 33G3C20-11E
3. Syntax and Other Protocols

3.5 Variables
Variables are classified according to data types as shown in Figure 3.4.

Character-string variable (char*n)


Integer variables (integer)
Variables Integer variables
Long integer variables (long)
Numeric variables
Double-precision floating-point variables (double)
Real-number variables
Single-precision floating-point variables (float)

Figure 3.4 Classification of Variables by Data Type

There are two kinds of variables selectively used according to varied purposes and
ranges as shown in Figure 3.5.

Local variables

Variables

Function block data

Figure 3.5 Classification of Variables by Use

They are further classified according to the number of elements contained as shown in
Figure 3.6 — the two dimensional array is not applicable to the function block data.

Simple variables

Variables
One-dimensional arrays
Arrays
Two-dimensional arrays

Figure 3.6 Classification of Variables by Data Element

IM 33G3C20-11E 3-5
3.6 Declaring Local Variables
Local variables are declared by stating data type and one or more variables.
EXAMPLES: integer i1,i2 (integer-type variables i1 and i2 are declared).
float f1,f2 (float-type variables f1 and f2 are declared).
The declaration statement must be described as action for the start symbol when writing
an SFC block program or preceding the executable statement when writing a SEBOL
block program.

3.6.1 Simple Variables


(1) Declaring Local Simple Variables
Local simple variable are declared by stating data type and one or more variables of the
specified data type — see Figure 3.7.

<type specifier> <variable name> [,<variable name>…]

<type specifier>: State the data type (char*n, integer, long, float, or double).

<variable name>: State the variable name using the identifier. More than one variables can be declared
for each data type specifier using commas between variable names.

Figure 3.7 Declaring Local Simple Variables

In the type specifier for a character-string variable (char*n), enter the length of the
variable (1 to 255 bytes) in place of the “n.”

3-6 IM 33G3C20-11E
3. Syntax and Other Protocols

(2) Referencing a Local Simple Variable


A local simple variable can be referenced by specifying the variable name — see Figure
3.8 and the example shown below.

<variable name>

Figure 3.8 Referencing Local Simple Variable

EXAMPLE:
Declaring and referencing simple a local variable (“cat” is a built-in function to connect
character strings):
sebolblock sample2
integer I,J,K
char*4 CHR1,CHR2
char*8 CHR3
......
K = I * J
CHR3 = cat(CHR1,CHR2)
......
end

3.6.2 Declaring Local Variable Arrays


A local variable can use a one- or two-dimensional array stating the number of array
elements in the declaration statement.

One-dimensional array:
<type specifier><array name>'['<no. of elements>']'[,…]

Two-dimensional array:
<type specifier><array name>'['<no. of 1-dim. elements>,<no. of 2-dim.
elements>']'[,…]
<type specifier>: State the data type (char'n, integer, long, float, or double).
<array name>: State the element name using the identifier.
<no. of elements>: State the number of elements using the integer constant.

Figure 3.9 Declaring Local Variable Array

• More than one arrays can be declared for each data type specifier using commas
between array statements.
• Simple variables and arrays can be declared using the same line.
• Subscript expressions begin with 1. When a[n] is declared, elements are expressed
a[1],…a[n].
• With a two-dimensional array, the declared array is placed in memory so that the two-
dimensional elements are renewed first.

IM 33G3C20-11E 3-7
EXAMPLE:
Sequence of data in a two-dimensional array. (The array is placed in memory as shown
in Figure 3.10.)
integer a[2,3]

a [1,1] a [1,2] a [1,3] a [2,1] a [2,2] a [2,3]

Figure 3.10 Two-Dimensional Array Placed in Memory

The range of the numbers of elements in local variable arrays is shown in Table 3.3.

Table 3.3 Number of Elements in Local Variable Arrays

Local Variable Array & Element Number of Elements


One-dimensional array elements
Two-dimensional array one-dimensional elements 1 to 32767
Two-dimensional array two-dimensional elements

3.6.3 Referencing a Local Variable Array or Element


An element of a local variable array can be referenced by specifying the array name and
the subscript expression. An entire array can be referenced by entering the array name
and an asterisk instead of the subscript expression or the array name only. See Figure
3.11.

One-dimensional array element:


<type specifier><array name>'['<subscript expression>']'

Two-dimensional array element:


<type specifier><array name>'['<subscript expression>,<subscript expression>']'

Entire array:
<array name>'['*']' or <array name>
<array name>: State the name of the array to be referenced.
<subscript expression>: Specify the element to be referenced using an integer expression.

Figure 3.11 Referencing Local Variable Array or Element

Only constants and local simple variables can be used in the subscript expression. (In
this manual, simple variables and array elements may be referred to simply as variables.)

3-8 IM 33G3C20-11E
3. Syntax and Other Protocols

EXAMPLE:
Declaring and referencing an array:
sebolblock sample3
integer I,J,K,SUM,A[3,3]
char*4 STAT[10]
......
SUM = 0
for I = 1 to 3
for J = 1 to 3
SUM = SUM + A[I,J]
next@
next@
......
message ”message %4s %5d”,STAT[K],SUM
......
end

IM 33G3C20-11E 3-9
3.7 Function Block Data
Tag and data item names are used to access function-block data, which are used in
SEBOL as parameters in an expression or a statement similar to local variables.
EXAMPLE:
Reading process variable (PV) value of function block with a tag name of FIC001 to
local variable “pv_value”:
sebolblock example1
block PID FIC001
double pv_value
......
pv_value = FIC001.PV
......
end
The tag name of a function block can be declared using a block statement as in this
example in the manner similar to the declaration of local variables, and the data of a
function block can be accessed by specifying the tag name and the data item name.
There is another way of declaring the tag name of a function block called “implicit
declaration,” which is described in 3.8, Implicit Declaration. The declaration of tag
names is further described in detail in Chapter 7, Section 1.
Function block data can also be accessed by using a local generic name and a function
formal argument instead of the tag name.
See Table 3.4 for a list of variables used in relation to function block data.

Table 3.4 Variables for Function Block Data

Variables Declaration Reference Item


Local generic name genname 5.2 Function-Block Data
Formal argument argblock 6.4 Declaring Function Block Formal Arguments

3.7.1 Data of Present SFC/SEBOL Block


Data of the present SFC/SEBOL block can be accessed by entering a percent symbol
instead of the tag name and specifying a data item name following the period — see the
example shown below.
EXAMPLE:
Reading the block mode data of the present SEBOL block to local variable “s1”:
sebolblock example2
char*8 s1
......
s1 = %.MODE
......
end
In addition to system-fixed data items, users may define data items in a SFC block.
(Only system-fixed data items are allowed in a SEBOL block.)

3-10 IM 33G3C20-11E
3. Syntax and Other Protocols

3.8 Implicit Declaration


All the variable must have been declared before their use in SEBOL — a compile error
will be caused if an undeclared variable is used.
An undeclared variable can be declared implicitly, however, using the compiler-control
command #IMPLICIT, which determines the attribute of the undeclared variable as a
local variable or tag name according to the context.

NOTE

Implicit declaration is useful with small programs of less than about 50 lines but not so
useful with larger programs. Because erroneous entries of similar letters, such as I, l,
and 1, will be determined as new variables and will not be detected as compile errors,
making it difficult to find errors in large programs. Thus it is recommended to use
implicit declaration only when the program is small.

3.8.1 #IMPLICIT Command


The compiler-control command #IMPLICIT is used in the SFC/SEBOL block to enable
implicit declaration. In the SFC block, it is written as an action in the initial step. In
the SEBOL block, it is written anywhere between “sebolblock” and “end” statements.

#IMPLICIT

Figure 3.12 #IMPLICIT Command

IM 33G3C20-11E 3-11
3.8.2 Implicitly Declared Local Variables
An undeclared variable is implicitly declared as a local simple variable if the undeclared
variable has no period following its name. And the data type of the implicitly declared
variable is determined by the first letter in the name of the undeclared variable — see
Figure 3.13.

First Letter Data Type


I integer
L long
F float
C char∗16
Others double

Figure 3.13 Data Types of Implicitly Declared Variables

If a variable in the array or array element is not declared, it cannot be implicitly declared
and a compile error will be caused.

3.8.3 Implicitly Declared Tag Names


An undeclared variable is implicitly declared as a tag name if the variable has a period
following its name.
If the implicitly declared tag name is defined by the builder and belongs to the same
control station as the SFC/SEBOL block, the compiler checks the tag’s data items for
the following items and a compile error will be caused if any error is found:
• Whether the data item exists in the block.
• Whether data can be written if it is an assignment statement or the left-hand side of a
group assignment statement.
• Whether the data item is a numeric or character-string type — so that numeric and
character data will be correctly managed.

NOTE

• The data item check will not be performed if the tag name is not builder-defined or
exists in a different control area from the SFC/SEBOL block.
• If the tag name begins with a numeral or contains a hyphen, implicit declaration is not
applicable and must be declared otherwise — see 5.2.1, Declaring Tag Names; and
5.2.2, Local Generic Name & “assign” Statement.

3-12 IM 33G3C20-11E
3. Syntax and Other Protocols

3.9 Substituting Identifiers with Tokens


An identifier can be substituted with a token using the compiler-control command
#define — the substitution takes place with the identifier appearing following the
command line. The identifier in a character string will not be subjected to the substitu-
tion, however.

#define <identifier><token>

Figure 3.14 #define Command

A character string as long as to the return code can be entered as a “token” but the white
spaces and comments preceding the return code will be excluded. A line can be
continued in the next line entering a backslash (\) or double slashes (//) at the end of the
line.
Substituting an identifier with a token can make it easier to read the program as in the
example shown below:
EXAMPLE:
The constant “2” is substituted with the token “OPEN” (the drive statement changes the
output state of a switch instrument with an answerback check — see 7.2.4 for descrip-
tion):
sebolblock example
#define OPEN 2
block SIO-22 VALVE1,VALVE2
......
drive [VALVE1 = OPEN]
drive [VALVE2 = OPEN]
......
end
When a substituting token contains a numeric expression, place the expression in
parentheses.
EXAMPLE:
If the numeric expression is not placed in parentheses as in the fourth line, the expres-
sion may not properly be calculated:
sebolblock example2
#define MAXLEN 256
#define GOOD(MAXLEN-1) ! This is correct.
#define BAD MAXLEN-1 ! This is wrong.
integer i1,i2
......
i1 = GOOD * 5 ! Calculated as (MAXLEN-1)*5.
i2 = BAD * 5 ! Calculated as MAXLEN-(1*5).
......
end

IM 33G3C20-11E 3-13
3.10 Inclusion of Files
A command line can be replaced with a file using the compiler-control command
#include — the command line itself is replaced with the file specified in the line.

#include “<filename>”

Figure 3.15 #include Command

The inclusion of a file is useful when using the same constant in more than one pro-
gram, for example. A file can be created defining the identifier for the constant in a
#define statement, then the file can be included in more than one SFC/SEBOL blocks
using #include command lines. If the value of the constant changes, the file can be
modified and the blocks containing the included files can then be recompiled.
File inclusion cannot be nested — a compile error will be caused if an included file
contains a #include command line.
If a compile error has been detected in an included file, the line number in the error
message corresponds to that of the #include line used for the inclusion of the file.
Table 3.5 lists the system-fixed include files that are provided by the system.

Table 3.5 System-Fixed Include Files

Filename Use Remarks

std.h Standard label definition


smode.h Individual reference to block modes See Section 7.3.1, “Reading Block Modes”
sbsts.h Individual reference to block status See Section 7.3.3, “Block Statuses”
Individual reference to and manipulation of
salarm.h See Section 7.5, “Alarm Statuses”
alarm statuses

The contents of the system-fixed include files are described in Appendix 7, “System-
Fixed Include Files.”

3-14 IM 33G3C20-11E
4. Operators and Expressions

4. Operators and Expressions


SEBOL uses nine types of operators, which are shown in Figure 4.1.

SEBOL operators

Binary arithmetic operators

+ (addition)
– (subtraction)
* (multiplication)
/ (division)
mod (remainder)

Unary arithmetic operators

+ (positive)
– (negative)

Relational operators

< (less than)


> (greater than)
<= (less than or equal)
>= (greater than or equal)

Equality operators

== (equal)
<> (not equal)

Binary logical operators

and (logical AND)


or (logical OR)
eor (logical Exclusive OR)

Unary logical operator

not (logical NOT)

Bitwise binary logical operators

& (bitwise logical AND)


| (bitwise logical OR)
ˆ (bitwise logical Exclusive OR)

Bitwise unary logical operators

— (ones complement)

Bitwise shift operators

<< (bit-shift left)


>> (bit-shift right)
<@ (cyclic bit-shift left)
>@ (cyclic bit-shift right)

Figure 4.1 SEBOL Operators

IM 33G3C20-11E 4-1
SEBOL uses expressions, which represent constants and variables that appear alone or in
combination with operators; they are shown in Figure 4.2.

SEBOL expressions

<function>

<constant>

<variable>

(<expression>)

<expression><binary arithmetic operator><expression>

<unary arithmetic operator><expression>

<expression><relational operator><expression>

<expression><equality operator><expression>

<expression><binary logical operator><expression>

<unary logical operator><expression>

<expression><bitwise binary logical operator><expression>

<bitwise unary logical operator><expression>

<expression><bitwise shift operator><expression>

Figure 4.2 SEBOL Expressions

4-2 IM 33G3C20-11E
4. Operators and Expressions

4.1 Arithmetic Operation


Arithmetic operations are performed on numeric data using binary and unary arithmetic
operators.

(1) Binary Arithmetic Operators


The binary operators used in the arithmetic operation are “addition (+)”, “subtraction
(–)”, “multiplication (*)”, “division (/)”, and “remainder (mod).”
In the division operation on integers, the resulted decimals are rounded down. In the
remainder operation, real-number operands are first converted to long-integer operands
and rounded off before the operation. A white space is required before and after the
remainder operator (mod). Addition (+) and subtraction (–) operators have equal
priority but among all binary operators their priority is lower than the others.

(2) Unary Arithmetic Operators


The unary operators used in the arithmetic operation are “positive (+)” and
“negative (–)”.
EXAMPLE 1:
Function to convert Fahrenheit to Celsius temperature:
float function CELSIUS(FAHR)
float FAHR
return (5.0 / 9.0) * (FAHR – 32.0)
end
EXAMPLE 2:
Function to return the negative value for a positive value or zero for a negative value:
integer function CONV(I)
integer I
if (I > 0) then
return – I
else
return 0
end if
end

IM 33G3C20-11E 4-3
4.2 Relational and Equality Operations
Relational and equality operations are performed on numeric data as well as character-
string data.

(1) Relational Operation


The operators used in the relational operation are “less than (<),” “greater than (>),”
“less than or equal (<=),” and “greater than or equal (>=).”
In the relational operation “<expression><relational operator><expression>,“ the result
is 1 when the relationship is true and 0 when false — the result data is an integer-type
data.

(2) Equality Operation


The operators used in the equality operation are “equal (==)” and “not equal (<>).”
The priority of equality operators is lower than relational operators. Thus caution is
needed when comparing real numbers using an equality operator or when comparing a
real number with an integer, in which the integer is converted to a real number.
The real number has finite precision and produces a diminutive error in most cases when
operated on or converted in the data type from double to float. A false result will be
obtained if values containing errors are compared. Thus it is necessary to use relational
operands (>=, <=, >, <) in the comparison of real numbers. Or high- and low-end
values must be checked to see whether they are within a stipulated range.

4-4 IM 33G3C20-11E
4. Operators and Expressions

4.3 Logical Operation


Logical operation is performed on numeric data using binary and unary logical opera-
tors.

(1) Binary Logical Operators


The binary operators used in the logical operation are “logical AND (and),” “logical OR
(or),” and “logical Exclusive OR (eor).”

(2) Unary Logical Operators


There is just one unary operator used in the logical operation: “logical NOT (not).”
In the logical expression “<expression><logical operator><expression>” or
“not<expression>”, logical operation is performed interpreting values other than 0 as
true and 0 as false and producing 1 when the result is true and 0 when false.— the result
is an integer-type data. A white space is required before and after a logical operator.
EXAMPLE:
Operation to judge whether character-string variable (a$) is alphabetic character (“ichr”
used in the example is the built-in function to convert a character string into character
codes):
sebolblock sample5
char*1 A$
integer A
......
A = ichr(A$)
if ((A >= ichr(”A”) and A <= ichr(”Z”)) or \
(A >= ichr(”a”) and A <= ichr(”z”))) then
* (A$ is alphabetic character)
else
* (A$ is not alphabetic character)
else if
......
end

IM 33G3C20-11E 4-5
4.4 Bitwise Logical and Shift Operations
Bitwise logical and shift operations are performed on numeric data .

(1) Bitwise Logical Operation


The operators used in the bitwise logical operation are “bitwise logical AND (&),”
“bitwise logical OR (|),” “bitwise logical Exclusive OR (^),” and “ones complement
(—).” The operator “ones complement” is a unary operator.
Real-number operands are first converted to long-integer operands and rounded off
before the operation.

(2) Bitwise Shift Operation


The operators used in the bitwise shift operation are “bit-shift left (<<),” “bit-shift right
(>>),” “cyclic bit-shift left (<@),” and “cyclic bit-shift right (>@).”
In the bitwise shift operation “<expression 1><shift operator><expression 2>,” the
expression 1 is bit-shifted or cyclically bit-shifted as much as the expression 2.
If the two expressions are real numbers, they are converted to long-integers and rounded
off before the arithmetic bit-shift operation. If the expression 1 is an integer, bits are
shifted as much as the remainder of division of the expression 2 by 16. If the expres-
sion 1 is a long integer or real number, bits are shifted as much as the remainder of
division of the expression 2 by 32.
The most significant bit is saved when bits are shifted right and the least significant bit
is assigned with 0 when shifted left.
EXAMPLE:
Extracting N-bits from bit-position P in X:
integer function GETBITS(X,P,N)
integer X,P,N
return ((X >> (P + 1 - N))&—(—0 << N))
end

4-6 IM 33G3C20-11E
4. Operators and Expressions

4.5 Character-String Operation


Character strings can be compared using relational and equality operators in the same
manner as numeric data. Comparison is made character-by-character starting with the
first characters of the strings on left and right sides — white spaces are regarded as
characters.
If a discrepancy is found between the two strings, a string that contains larger internal
codes is determined to be greater than the other — internal codes are compared as
unsigned 8-bit codes. If a string is shorter than the other and comparison is cut short,
the shorter string is determined to be less than the other.
EXAMPLE:
Function to return 1 when two strings are equal and 0 when they are not:
integer function COMP(ASTR,BSTR)
char*100 ASTR,BSTR
return ASTR == BSTR

IM 33G3C20-11E 4-7
4.6 Operation Priority
Priority is given to operators in operations as shown in Table 4.1.

Table 4.1 Priority of Operators

Operation Operator Associativity Priority


Parenthetical () Left to right. Highest
Function function Left to right.
Unary — not –, + Right to left.
Multiplication & division *, /, mod Left to right.
Addition & subtraction +, – Left to right.
Shift <<, >>, <@, >@ Left to right.
Relational <, <=, >, >= Left to right.
Equality ==, <> Left to right.
Logical & Left to right.
Logical ˆ Left to right.
Logical | Left to right.
Logical and Left to right.
Logical eor Left to right.
Logical or Left to right. Lowest

Relational operators (<, <=, >, >=) and equality operators (==, <>) need to be carefully
used.
Expressions (0<A<10) and (0<A and A<10) are taken as two completely different
expressions, for example. The relational operator “<” operates from left to right; thus
the expression (0<A<10) is evaluated as ((0<A)<10), starting operation with (0<A) and
returning 1 (true) when the relational condition is satisfied or 0 (false) when not satis-
fied. The result is then compared with 10 to produce the final value, which cannot be
other than 1 (true) because the compared result always is 1 or 0 and smaller than 10.
Thus, the other expression (0<A and A<10) must be used in this case.
If A is -1, the following two expressions will evaluated to produce different results:
(“<” has priority over “and”):
((0<A) and (A<10)) → (0 and 1) → 0
((0<A) <10)) → (0<10) → 1
EXAMPLES:
• 4*2–8/4 is the same as (4*2)–(8/4) .
• X=A==D is the same as X=(A==D) .
• S<“0” or S>“9” is the same as (S<“0”) or (S>“9”) … (S is a character variable.)

4-8 IM 33G3C20-11E
4. Operators and Expressions

4.7 Conversion of Operands


The conversion of operands in binary operations is described in this section. (Overflows
and other operation errors are further described in Chapter 10.
When a binary operator that requires two operands is assigned with operands of different
types, the type of the operand having a lower-priority type is converted to that of the
other operand that has a higher-priority type before operation. Thus the product will be
of the higher-priority type. Conversion rules for arithmetic, relational, and equality
operators are described below. In any case, the mixed use of numeric and character-
string operands is not permitted.

(1) Arithmetic, Relational, and Equality Operators


With arithmetic operators except the remainder operator (mod), all float-type operands
are converted to double-type operands on both sides, producing a double-type result. If
one is the double-type operand, the other is converted to double, producing a double-
type result. If one is the long-type, the other is converted to long, producing a long-type
result. In another case that the operator has integer-type operands on both sides, an
integer-type result is produced without any type-conversion. See Table 4.2.1.
With relational and equality operators, an integer-type result is produced in all cases.
See Table 4.2.2.
In the following tables (4.2.1 through 4.3.2), the first column shows left-hand side
operands and the top row shows right-hand side operands and the converted result of
each combination is shown in the cell with the type of the operated result. For example,
in the operation of “integer*long” the left integer-type (I) operand is converted to the
long type (L) coinciding with the right long-type (L) operand and a long-type result (L)
is produced, thus shown “L·L:L.” If an overflow is caused during an operation, the
operation will be repeated after making a type conversion if there is a higher-priority
operand.

Table 4.2.1 Conversion of Arithmetic Operators (+, –, *, /)

Left \ Right integer long float double


integer I·I:I L·L:L D·D:D D·D:D
long L·L:L L·L:L D·D:D D·D:D
float D·D:D D·D:D D·D:D D·D:D
double D·D:D D·D:D D·D:D D·D:D

I: integer, L: long, F: float, D: double

Table 4.2.2 Conversion of Relational & Equality Operators

Left \ Right integer long float double


integer I·I:I L·L:I D·D:I D·D:I
long I·L:I L·L:I D·D:I D·D:I
float D·D:I D·D:I D·D:I D·D:I
double D·D:I D·D:I D·D:I D·D:I

I: integer, L: long, F: float, D: double

IM 33G3C20-11E 4-9
(2) Arithmetic “mod,” Bitwise Binary Logical and Shift Operators
With the arithmetic operator “mod,” bitwise binary logical operators, and bitwisde shift
operators, real-number operands are converted to integer operands and rounded off
before operation. If an overflow is caused in the type conversion, the maximum
absolute value of the same sign will be used.

Table 4.3.1 Conversion of Operators (mod, &, |, ^)

Left \ Right integer long float double


integer I·I:I L·L:L L·L:L L·L:L
long L·L:L L·L:L L·L:L L·L:L
float L·L:L L·L:L L·L:L L·L:L
double L·L:L L·L:L L·L:L L·L:L

I: integer, L: long, F: float, D: double

Table 4.3.2 Conversion of Bitwise Shift Operators

Left \ Right integer long float double


integer I·L:I I·L:I I·L:I I·L:I
long L·L:L L·L:L L·L:L L·L:L
float L·L:L L·L:L L·L:L L·L:L
double L·L:L L·L:L L·L:L L·L:L

I: integer, L: long, F: float, D: double

4-10 IM 33G3C20-11E
4. Operators and Expressions

4.8 Assignment Statements


In an assignment statement, the right-hand side expression is evaluated and then as-
signed to the variable on the left-hand side. If the expression is numeric, the variable
must also be numeric; likewise if the expression is a character string, the vaiable must
also be a character string. See Figure 4.3 for the format of assignment statements.

<variable> = <expression>

<variable>: Assigned with the result of the expresion on the right-hand side.
<expression>: Calculates the value to be assigned to the variable on the left-hand side.

Figure 4.3 Assignment Statement Format

(1) Numeric Types


To assign the result of an expression of a numeric type to the variable of another
numeric type, the type of the expression is converted to the type of the variable —
which requires some cautions — see Table 4.4 and note below.

Table 4.4 Cautions Needed for Expression Conversion

Left \ Right integer long float double


integer — A A A
long — — A A
float — B — “A,B”
double — — — —

A: Caution for overflow, B: Caution for column truncation, —: Caution not needed

NOTE

• Code extension is executed when an integer-type result is assigned to a long-type


variable.
• Column truncation may be caused when a long-type result is assigned to a float-type
variable.
• The result is rounded off to one decimal place when a real number result is assigned
to an integer variable — it can be rounded down instead by using the built-in function
“int.” An overflow error is caused if the result exceeds the range of integer data.
• The least significant bit is deleted when a double-type result is assigned to a float-
type variable. An overflow error is caused if the result exceeds the range of float-
type data.
• An overflow error is caused if the result exceeds the range of integer data when a
long-type result is assigned to an integer variable.

For the detail of overflow errors, see Chapter 10.

IM 33G3C20-11E 4-11
(2) Character-String Type
When a long character string is assigned to a short character-string variable, excessive
characters are deleted from the end of the long string to match the length of the short
string.
When a short character string is assigned to a long character-string variable, a terminal
symbol is added to the end of the short string judging that the variable has a short string.

4-12 IM 33G3C20-11E
5. Variables

5. Variables
The use of local variables and function-block data is described in this chapter.

5.1 Local Variables


The purpose and range of using local variables are explained; how they are declared and
referenced have already been described in Chapter 3.
Local variables are program-specific and accessible only in a program in which they
have been declared. If a local variable is declared in a SEBOL block and another local
variable with the same name is declared in a function, they are two different local
variables in different program units that reside in separate areas and each variable is
specific to each program.
EXAMPLE:
Local variable “i” is declared in a SEBOL block and a function:
sebolblock mainprog
#define NUMDATA 100

integer average()
integer data[NUMDATA]
integer i,ave !←Local variable in SEBOL block “mainprog”.
......
* Value-setup at array “data” considered to have been instructed.
i = data[0]
ave = average(data,NUMDATA)
* Value of “i” does not change because it is different from “i” in function below.
......
end

integer function average(buf,n)


integer buf[],n
integer i !←Local variable in function “average.”
long sum
......
sum = 0
for i = 1 to n
sum = sum + buf[i]
next@
return (sum/n)
......
end

IM 33G3C20-11E 5-1
The local values in an SFC/SEBOL block are initialized to 0 when the block is started.
The local values in a function, however, are not initialized by the system and their
values are thus indefinite when the function is called.
Local variables are available only during the execution of the program. The local
variables in an SFC block are available only when the block status is RUN or PAUS,
and those in a SEBOL block only in the RUN status. The local variables in a function
are available during the time after the function has been called and until its execution is
terminated by the return or end statement.
Local variables can be accessed at a relatively higher speed than function-block data.
Thus in a program that demands high performance, function-block data, especially those
of other stations, can be stored in local variables, which can then be referenced at high
speeds. However, discrepancies may be caused between the data stored for the conve-
nience and the actual function-block data as time elapses, requiring special attention.
Also when a program contains such local variables, the readability of the program is
generally adversely affected compared to programs that require direct access to function-
block data.

5-2 IM 33G3C20-11E
5. Variables

5.2 Function-Block Data


The function-block data can be accessed declaring a tag name and using the tag name
and a data item name.
EXAMPLE:
Setting 100.0 at SV of function block (PID) tag-named PID001:
sebolblock example1
block PID PID001
......
PID001.sv = 100.0
......
end
Local generic names and formal arguments can also be used to access function-block
data in addition to using tag names. Table 5.1 shows declarations used for function-
block data. (For the use of formal arguments, see Chapter 6, Functions.)

Table 5.1 Function Block Declarations

Object Declaration SFC/SEBOL Block Function-Block Data


Tag name block Applicable Applicable
Local generic name genname Applicable Applicable
Formal argument argblock Not applicable Applicable

The format of “%+ ‘data item name’ ” is used to access the data of the present SFC/
SEBOL block.
EXAMPLE:
Referencing the mode of present SEBOL block (reading data to local character-string
variable s1:
sebolblock example
char*8
......
s1 = %.MODE
......
end
The SFC block permits to user-define data items in addition to system-specific data
items; user-defined data items are not allowed in the SEBOL block.
With the SFC block, a compile error is caused if a data item name following ‘%.’
(period) is not defined using the builder’s SFC block data definition.

IM 33G3C20-11E 5-3
5.2.1 Declaring Tag Names
A “block” statement is used to declare the tag name for a function block. A tag name
uses the first 16 characters for identification. However, its eight leading characters must
be unique and distinguishable from local variable names and other identifiers, such as
the names defined using “#define”, which use the first eight characters for identification.
It is necessary to designate an alias for the tag name if it contains a hyphen or begins
with a numeral, and the alias must be used in the program.

block<block code> <tag name> [, <tag name> …]


<alias>alias<tag name> <alias>alias<tag name>

<block code>: Specifies the code for the function block.


<tag name>: Specifies the tag name for the function block — valid up to 16 characters.
<alias>: Specifies an alias for the tag name.

Figure 5.1 Tag Name Declaration

EXAMPLE:
Replacing tag name PID-001 with alias PID_001:
sebolblock example
block PID PID_001 alias PID-001
......
PID_001.SV = 100.0 ! Alias must be used in the program.
......
end

NOTE

The tag name declared using the block statement is not checked during compilation
whether it has been builder-defined. An error will be caused during execution if the tag
name is not builder-defined.

Data item names are checked during compilation for the following items:
• Whether the data item exists in the specified block code.
• Whether data can be written if it is an assignment statement or the left-hand side of a
group assignment statement.
• Whether the data item is a numeric or character-string type — so that numeric and
character data will be correctly managed.

5-4 IM 33G3C20-11E
5. Variables

5.2.2 Assigning Tag Names


The local generic name is used to dynamically change the tag name that is to be pro-
cessed. A local generic name is declared using a “genname” statement and assigned
with a tag name using an “assign” statement.
EXAMPLE:
Assigning tag name PIC001 to local generic name tag001:
sebolblock example1
genname PID tag001
......
assign “PIC001” to tag001
tag001.SV = 100.0 ! Sets 100.0 at PIC001.SV.
......
end
A local generic name is declared using a simple variable or one-dimensional array as
shown in Figure 5.2. Local generic names are identified by their leading eight charac-
ters.

Simple variable
genname<block code><local generic name>[,<local generic name>…]

One-dimensional array
genname<block code><local generic name>‘[’<number of elements>‘]’
[,<local generic name>‘[’<number of elements>‘]’…]

<block code>: Specifies the code for the function block.


<local generic name>: Specifies the local generic name for the function block using an identifier.
<number of elements>: Specifies the number of array elements using an integer constant of up to 128.

Figure 5.2 Local Generic Name Declaration

The array element number begins with 1. When the array is declared to be “g[10]”, it
has 10 elements from “g[1]” through “g[10]”. They can be processed as a group for the
entire local generic name array using a group assignment, compare, or drive statement
— see Chapter 7 for details.
Data item names are checked for the specified block code of the declared generic name
and a compile error will be caused if an error is detected.
Local generic names are local variables and the relationships between local generic
names and tag names are specific to the program.

IM 33G3C20-11E 5-5
The “assign” statement is used to assign a tag name to a local general name as shown in
Figure 5.3.

assign<tag name>to<local generic name>

<tag name>: Specifies the tag name to be assigned to the local generic name using a
character-string variable or constant, which can contain hyphens or begin
with a numeral. The first 16 bytes are significant if the string exceeds
16 bytes. The tag name must be specified in uppercase letters.
<local generic name>: Specifies the simple variable or array elements for the local generic name.

Figure 5.3 Tag Name Assignment Statement

The “assign” statement does not check the existence of the same tag name — an error
will be caused if it does when accessing the function block using the local generic name.
No error is caused if the block code for the assigned tag name does not coincide with
the block code specified in the “genname” declaration.
Local generic names are used when changing tag names to be processed at the start of
SFC/SEBOL blocks.
EXAMPLE:
Assigning tag name, specified to character-string parameter of SEBOLP1 SEBOL block,
to local generic name using “assign” statement:
sebolblock example2
genname PID tag001,tag002,tag003
......
assign %.CH01 to tag001
assign %.CH02 to tag002
assign %.CH03 to tag003
......
if (tag001.PV > 100) then
tag002.SV = 100.0
else
tag003.sv = 100.0
endif
......
end
In the example, the data following “%.” are data of the present SEBOL block; the tag
name strings specified at character-string parameters CH01, CH02, and CH03 in the
present block are assigned to local generic names tag001, tag002, and tag003.

5-6 IM 33G3C20-11E
5. Variables

5.2.3 Block Type Names and Model Designations


Block type names are specified with the block, genname, and argblock statements. As an
example, the tag PID001 having “PID” as its CENTUM CS block type is declared in the
following format:
sebolblock sample1
block PID PID001
.....
end
To access CENTUM-XL or CENTUM-V function blocks (internal instruments), the
model designation must be specified in place of the block type. As an example, the PID
controller having “XPID001” as its CENTUM-XL tag name is declared in the following
format:
sebolblock sample2
block PID:EFCS XPID001
.....
end
A model designation entry consists of a block type name followed by a colon (:), then a
model designation, as in “EFCS” in PID:EFCS. No space is allowed between the block
type name and the model designation. Table 7.4 lists the model designations selectable.

Table 5.2 Model Designations


Model Model
Designation
Omitted CENTUM CS
EFCS CENTUM-XL
µXL
CFCS CENTUM-V

Tags are handled as CENTUM CS function blocks by implicit declaration. To access


non-CENTUM CS tags, declare the tag name with a block statement.

IM 33G3C20-11E 5-7
6. Functions

6. Functions
A number of statements can be grouped together in a subprogram and user-defined as a
function, creating a new procedure, for example. The manners of function defining and
calling are described in this chapter.

6.1 Defining Functions


Functions can be user-defined as described below.

<type specifier>function<function name>([formal argument list])


Declaration of formal argument
Declaration of variable

Executable statements

end

<type specifier>: Specifies the type of value returned by the function (integer, long, float,
or double). (Character string-type data cannot be used)
<function name>: Specifies the identifier used as the name of the function.
<formal argument list>: Specifies the variable list to receive from the function caller.

Figure 6.1 Function Definition

The function permits exchanging data with the function-caller by means of the argument
array and the return value. The argument specified in the function call line of the caller
is an actual argument and that used in the function definition is a formal argument. Up
to 32 arguments can be used.

NOTE

• A function can call another function. Function calls can be nested in up to six levels
— an error is caused and the SFC/SEBOL block will be terminated if the function at
the sixth level calls another function.

IM 33G3C20-11E 6-1
The function can be terminated using a “return” or “end” statement — the “return”
statement returns a value to the caller.

return [<function value>]

<function value>: Specifies the value to be returned using an expression.

Figure 6.2 “return” Statement

Specifying an expression following the “return” command returns the value resulted in
the expression to the function-caller after converting the type of the value to the function
type specified in the “function” statement.

NOTE

• The return value will be infinite when a function is ended using a “return” statement
without any return-specifying expression or an “end” statement.
• An error is caused during execution if a function that does not return a value is
described in a numeric expression or on the right-hand side of an assignment state-
ment — the variable on the left-hand side of the statement will not be affected.

6-2 IM 33G3C20-11E
6. Functions

6.2 Calling Functions


To call a function, it is necessary that it is declared in the format shown in Figure 6.3.

<type specifier><function name> () [,<function name> () …]

<type specifier>: Specifies the type of the function to call (integer, long, float, or double).
<function name>: Specifies the name of the function to call.

Figure 6.3 Function Declaration

A function and a local variable can be declared in the same line. The function cannot
return character-string values — use arguments to exchange character-string data.
The declared function can be called using the format shown in Figure 6.4.

<function name> ([actual argument list])

<actual argument list>: Specifies the data list for the function.

Figure 6.4 Function Calling

EXAMPLE:
Function to obtain average value:
sebolblock mainprog
#define NUMDATA 100
integer average(),data(NUMDATA),ave
......
* Value-setup at array “data” considered to have been instructed.
ave = average(data,NUMDATA)
......
end

integer function average(buf,n)


integer buf[*],n
integer i
long sum
sum = 0
for i = 1 to n
sum = sum + buf(i)
next@
return (sum/n)
end
In this example, the function named “average” returns an average value to the local
variable named “ave” using the “return” statement.

IM 33G3C20-11E 6-3
6.3 Function Arguments
An argument that the caller to a function specifies on the function call line is called an
actual argument; one that is declared in a definition of that function is called a formal
argument. Up to 32 arguments can be used.

(1) Actual Arguments


The following can be used as actual arguments:
(a) Constants
(b) Local simple variables
(c) Local variable array elements
(d) Local variable arrays
(e) Tag names
(f) Generic name simple variables
(g) Generic name array elements
(h) Generic name arrays
When the value of a formal argument is changed in a function, the value of the actual
argument in the caller is also changed. If the actual argument is a constant, however, an
error will be caused during execution if you try to change the corresponding formal
argument.

(2) Formal Arguments


The formal argument type and the array size must be declared at the beginning of a
function. It is necessary to declare all formal arguments used because implicit declara-
tion is not applied to them. Declaration statements for formal arguments are shown in
Table 6.1.

Table 6.1 Formal Argument Declaration Statements

Declaration Statement Variable


integer
long
float Formal argument local variable
double
char* ●
argblock Formal argument function block

To declare a character string-type formal argument, specify 0 for the length, which is
determined by the actual argument.
To declare one-dimensional array formal argument, specify “*” for the number of
elements, which is determined by the actual argument.
To declare two-dimensional array formal argument, specify “*” for the number of first-
dimension elements. The number of second-dimension elements is determined by the
actual argument. SEBOL arranges two-dimensional array elements so that second-
dimension elements are updated first. Thus the size of second-dimension elements is
required in calculating subscripts of the elements.

6-4 IM 33G3C20-11E
6. Functions

EXAMPLE:
Using character string, one-dimensional array, and two-dimensional array as arguments:
sebolblock mainprog
integer al[10],a2[3,6]
char*16 str
integer example()
integer i1,i2
......
example(a1, i1, a2, i2, str) ! Function call.
......
end

integer function example (b1,n1,b2,n2,s)


integer b1[*] ! Declaration of one-dimensional array formal argument.
integer n1
integer b2[*,6] ! Declaration of two-dimensional array formal argument.
integer n2
char*0 s ! Declaration of character string.
......
end
EXAMPLE:
Specifying array as actual argument in function call:
sebolblock mainprog
integer a1[10],a2[3,6]
char*16 str
integer example()
integer i1,i2
......
example(a1[*],i1,a2[*],i2,str) ! Function call.
......
end
As in this example, “[*]” can be attached to the array name to specify an entire array.

IM 33G3C20-11E 6-5
6.3.1 Verifying Argument Types
The types of actual and formal arguments are verified to ascertain their compatibility
when a function is called for execution, causing an error if they are not compatible.
An error is caused if the actual argument is a local variable and the formal argument is a
function block or vice versa. When both actual and formal arguments are local vari-
ables, they are compatible (●● ) or an error is caused (×) when executed as shown in
Table 6.2.

Table 6.2 Compatibility of Local Variable Arguments

Actual Arg. Declaration\Formal Arg. Declaration Simple 1-dim. Array 2-dim. Array
Constant ● × ×
Simple ● × ×
Array element ● × ×
One-dimensional array × ● ●
Two-dimensional array × ● ●

The combination of one- and two-dimensional arrays does not cause an error when
executed. Because two-dimensional arrays are arranged so that second-dimension
elements are updated first, they correspond to one-dimensional array elements in the
updated order.
EXAMPLE:
Combination of two-dimensional array actual argument and one-dimensional array
formal argument:
sebolblock mainprog
integer array[2,4] ! Two-dimensional array actual argument.
integer example()
......
example(array,8) ! 8 elements.
......
end

integer function example(arg,n)


integer arg[*] ! One-dimensional formal argument.
integer n ! Number of array “arg” elements.
......
arg[1] = 1 ! Corresponds to actual argument “array[1,1]”.
arg[2] = 2 ! Corresponds to actual argument “array[1,2]”.
arg[3] = 3 ! Corresponds to actual argument “array[1,3]”.
arg[4] = 4 ! Corresponds to actual argument “array[1,4]”.
arg[5] = 5 ! Corresponds to actual argument “array[2,1]”.
arg[6] = 6 ! Corresponds to actual argument “array[2,2]”.
arg[7] = 7 ! Corresponds to actual argument “array[2,3]”.
arg[8] = 8 ! Corresponds to actual argument “array[2,4]”.
arg[9] = 9 ! Error (out of array subscript range) when executed.
......
end
As in this example, an out-of-array subscript range error is caused when accessed
exceedindg the number of array elements.

6-6 IM 33G3C20-11E
6. Functions

The compatibility of argument types when formal arguments are local simple variables
is shown in Table 6.3. If both arguments are numeric-type or character string-type, they
will be executed without causing any error. Formal arguments are considered to have
the type of their corresponding actual arguments.

Table 6.3 Correspondence between Actual Arguments and Local Simple Variable
Formal Arguments

Actual Arg. Type\Formal Arg. Type integer long float double char*0
integer ● ● ● ● ×
long ● ● ● ● ×
float ● ● ● ● ×
double ● ● ● ● ×
char*n × × × × ●

The testing of arrays of different types, unlike that of simple variables, results in a run-
time error. Arguments are assumed to have the actual argument type.

Table 6.4 Correspondence between Actual Arguments and Local Variable Array
Formal Arguments

Actual Arg. Type\Formal Arg. Type integer long float double char*0
integer ● × × × ×
long × ● × × ×
float × × ● × ×
double × × × ● ×
char*n × × × × ●

6.3.2 Function Types


If the type of the function calling a function does not agree with the defined type of the
function, the defined type is used without causing any errors when executed.

IM 33G3C20-11E 6-7
6.4 Declaring Function Block Formal Arguments
Function block formal arguments are declared using an “argblock” statement as shown
in Figure 6.5.

argblock<block code><formal argument name>,[<formal argument name>…]

Figure 6.5 Declaration of Function Block Formal Arguments

One-dimensional array formal arguments are declared also using an “argblock” state-
ment as shown in Figure 6.6. They are regarded as having a size of an actual argument.
A one-dimensional array and a simple variable can be declared in the same line. (Two-
dimensional arrays cannot be used in function blocks.)

argblock<block code><formal argument name[*]>,[<formal argument name[*]>…]

Figure 6.6 Declaration of One-Dimensional Array Formal Arguments

Actual arguments that can be specified as simple-variable function-block formal argu-


ments are listed in Table 6.5:

Table 6.5 Actual Arguments Specifiable as Simple-Variable Function-Block


Formal Arguments

Actual Argument Example of Declaration Example of Function Call


Tag name block PID TAG101 func1(TAG101)
Tag name global block PID TAG201 func1(TAG201)
Present block – func1(%)
Present unit – func1(%%)
Simple local generic name genname PID gen101 func1(gen101)
Local generic name array element genname PID gen201[10] func1(gen201[3])
Simple global generic name global genname PID gen301 func1(gen301)
Global generic name array element global genname PID gen401[10] func1(gen401[3])
Simple generic name unit genname PID ugen101 func1(ugen101)
Generic name array element unit genname PID ugen201[10] func1(ugen201[3])
Simple generic name global unit genname PID ugen301 func1(ugen301)
Generic name array element global unit genname PID ugen401[10] func1(ugen401[3])
Simple formal-argument function- argblock PID block1 func1(block1)
block
Formal-argument function-block argblock PID block2[10] func1(block2[3])
array element

6-8 IM 33G3C20-11E
6. Functions

An example of calling the function “func1” is shown below:


EXAMPLE:
integer function func1(blk001)
argblock PID blk001

char*8 blkmode

blkmode = blk001.MODE
......

return
Actual arguments that can be specified as one-dimensional-arry function-block formal
arguments are listed in Table 6.6:

Table 6.6 Actual Arguments Specifiable as One-Dimensional-Array Function-


Block Formal Arguments

Actual Argument Example of Declaration Example of Function Call


Entire local generic name array genname PID gen502[3] func1(gen502[*])
Entire global generic name array global genname PID gen602[3] func1(gen602[*])
Entire generic name array unit genname PID ugen702[3] func1(ugen702[*])
Entire generic name arrays global unit genname PID ugen802[3] func1(ugen802[*])
Entire formal-argument function- argblock PID block3[3] func1(block3[*])
block array

NOTE: [*] may be omitted.

An example of calling the function “func2” is shown below:


EXAMPLE:
integer function func2(blk002)
argblock PID blk002[*]

char*8 blkmode
chart*8 blksts[3]

blkmode = blk002[1].MODE ! Formal-argument array element.


......
[blksts[*] = blk002[*].BSTS] ! Entire formal-argument array.
......

return

IM 33G3C20-11E 6-9
6.4.1 Referencing Function Block Data
Formal-argument function-block data are referenced using the formal argument name
and a data item name.
EXAMPLE:
integer function example(simple,array,n,max)
argblock PID simple,array[*] ! Formal argument declaration.
integer n,max ! Element No. and array size.
......
simple.MV = 10.0
wait until (simple.PV >= 9.9)
......
if (n <= max) then
array[n].MV = 10.0
wait until (array[n].PV >= 9.0)
end if
......
end
The block code is specified in the “argblock” statement. The compiler checks the
applicability of the data item name with the block code. A compile error is caused if a
non-applicable data item name is used or a write-disable data item name is entered on
the left-hand side of the assignment statement.
When the block code specified in the “argblock” statement and the block code for the
function block specified to the actual argument are not identical, they will be executed
without causing any error.

6-10 IM 33G3C20-11E
6. Functions

6.4.2 “assign” Statement


A tag name can be assigned to the generic name used as an actual argument by specify-
ing a formal-argument function block in the “assign” statement. (See 5.2.2, Assigning
Tag Names, for more information about “assign” statements.)
In the following example, tag name “TAG101” is assigned to local generic name
“gen001” that is declared in a “genname” statement. Function “asschk” assigns argument
“tag” to argument “gen” — the function reads “gen.MODE,” checks the tag name
specified for “tag,” and returns “0” when justified or “–1” if not.
EXAMPLE:
sebolblock example1
genname PID gen001
integer asschk()

if (asschk(gen001,"TAG101") <> 0) then exit


end if
......

!Tag name TAG101 is assigned to local generic name “gen001.”)


!The rest is omitted.
integer function asschk(gen, tag)
argblock PID gen ! Generic name.
char*0 tag ! Tag name.

char*8 blkmode

assign tag to gen


[blkmode = gen.MODE] ; error ERR900
return 0

ERR900:
message "tag name %s does not exist", tag
return –1

A tag name can be assigned to an actual argument by specifying the formal-argument


function block in the “assign” statement when the actual argument is a local generic
name (“genname” declared), global generic name (“global genname” declared), or
generic name (“unit genname” or “global unit genname” declared).
An execution error will be caused if a formal-argument function block is specified for
any other actual argument — a tag name (“block” or “global block” declared), present
block (%), or present unit (%%).

IM 33G3C20-11E 6-11
6.5 Variables Used with Functions
Functions can also use local variables in addition to formal arguments.

6.5.1 Local Variables


An area is reserved local variables in a function when the function is called and can-
celled when the function is terminated by a “return” or “end” statement. Function local
variables are declared similarly to SFC/SEBOL blocks but their initial values are infinite
— (SFC/SEBOL block local variables are initialized to zero when the block is started.)

6.5.2 Tag Names


Tag names can also be declared in a function similarly to SFC/SEBOL blocks. If a tag
name is written directly in a function, the function’s general-purpose applicability will
be lost. Thus a tag name should be declared in a function that does not require general-
purpose applicability and if the tag name is fixed.

6.5.3 Local Generic Names


Local generic names can also be declared in a function similarly to SFC/SEBOL blocks.
Tag names received as character strings by formal arguments are normally assigned to
the declared local generic names using the “assign” statement.
EXAMPLE:
sebolblock mainprog
integer setmv()
......
setmv(”FIC001”,10.0,9.9)
setmv(”FIC002”,12.0,11.0)
setmv(”FIC003”,20.0,19.0)
......
end

integer function setmv(tagname, value1, value2)


char*0 tagname
double value1, value2
genname PID block1 ! Local generic name declared in function “setmv”.
......
assign tagname to block1
block1.MV = value1
wait until (block1.PV >= value2)
......
end

6-12 IM 33G3C20-11E
6. Functions

6.5.4 Unit Generic Names


Unit generic names can also be declared in a function using the “unit genname” state-
ment similarly to SFC sequences. The “global unit genname” statement is not applicable.
For the use of the “unit genname” statement, refer to SFC Block Function Manual (IM
33G3C31-11E).
EXAMPLE:
integer function example(value1, value2)
double value1, value2
unit genname PID ugen001

ugen001.MV = value1
wait until(ugen001.PV >= value2)
end

IM 33G3C20-11E 6-13
6.6 Built-in Functions
A built-in function is a system-defined function. Built-in functions can be called by the
function name and argument the same way as ordinary functions are called. Unlike
user-defined functions, built-in functions do not require declaration. The names of built-
in functions are handled as reserved words.
Build-in functions are available in several groups — see Tables 6.7.

Table 6.7 Built-in Functions (1)

Group Function General Format Argument Type Function Type

labs(a) L L
Absolute value
dabs(a) D D
lmax(a,b,c,…) L L
Max. value
dmax(a,b,c,…) D D
Arithmetic lmin(a,b,c,…) L L
Min. value
dmin(a,b,c,…) D D

Power power(a,b) D D

Decimal fraction round-down int(a) D D

bitpstn(a,b) I or L(*1), I or L L
Bit operation Bit position search
bitsrch(a,b) I or L(*1), I or L L
llimit(a,b,c) L L
High-low limit High & low limits
dlimit(a,b,c) D D
Sine sin(a) D D
Cosine cos(a) D D
Trigonometric
Tangent tan(a) D D
Arctangent atan(a) D D
Square root Square root sqrt(a) D D
Exponentiation Exponent exp(a) D D

Natural logarithm Natural logarithm log(a) D D

Conversion to integer type ichr(a) C*n I


Conversion to char type chr(a) I C*1
String length len(a) C*n I
String concatenation cat(a) C*m,C*n C*(m+n)
Character string Substring index index(a,b) C*m,C*n I
left(a,b) C*n,I C*n
String retrieval right(a,b) C*n,I C*n
mid(a,b) C*n,I,I C*n
Numeric string conversion snum(a) C*n D
Date getdate(a,b,c) I,I,I(*2) L
Time gettime(a,b,c) I,I,I(*2) L
Elapsed time timems() — L
Date & time
GMT serial seconds timegmt() — L
localtime
Date and time conversion L,I,I,I,I,I,I(*3) I
(a,b,c,d,e,f)

I: integer, L: long, F: float, D: double, C: char (I, L, F, D, C: simple variables or array elements)
*1: Only a local variable can be used to specify an array or array element.
*2: All arguments can use only local simple variables or array elements.
*3: b, c, d, e, f, and g are limited to local simple variables or array elements.

6-14 IM 33G3C20-11E
6. Functions

Table 6.7 Built-in Functions (2)

Group Function General Format Argument Type Function


Type
Function
Data-status check dscheck(a,b) DS,C I
block data
Latest-error class-code errc() — L
Latest-error detail-code errce() — L
Latest-error line errl() — L
Latest-error function-name errf() — C*8
Latest-error step number errs() — L
Error
Latest-error plane number errp() — L
Value check errorval(a) I,L,F,D I
cerrorid() — C*16
Error-identifier retrieval lerrorid() — L
derrorid() — D
lreadpara(a) I L
Signal Signal parameter retrieval dreadpara(a) I D
creadpara(a) I C*16
lcmread
(a,b,[,c[,d]]) C*8,C*8,I,I L

Common block read dcmread


C*8,C*8,I,I D
(a,b,[,c[,d]])
ccmread
C*8,C*8,I,I C*16
Process (a,b,[,c[,d]])
management cmwrite
Common block write (a,b,[,c[,d]],e) C*8,C*8,I,I ILFDC I

Dynamic unit assignment urassign(a,b) I,C*16 I


Unit recipe download urload(a) I I
Recipe setup rpreserve(a,b,c,d) I,C*16,C*16,C*16 I
lcmreadbid
I,C*16,C*8,C*8,I,I L
(a,b,c,d,[,e[,f]])
dcmreadbid
Common block read I,C*16,C*8,C*8,I,I D
(a,b,c,d,[,e[,f]])
Process ccmreadbid
management (a,b,c,d,[,e[,f]]) I,C*16,C*8,C*8,I,I C*16
(Batch ID
specification) Common block write cmwritebid(a,b,c,d I,C*16,C*8,C*8,I,I, I
,[,e[,f]],g) ILFDC
Dynamic unit assignment urassignbid I,C*16,I,C*16 I
(a,b,c,d)
Unit recipe download urloadbid(a,b,c) I,C*16,I I
Present block tag name gettagno() — C*16
Generic name conversion getname(a) G C*16
Other Start status boot() — I
ckstep() — I
Restart judgement
ckstepcl() — I

I: integer, L: long, F: float, D: double, C: char (I, L, F, D, C: Simple variables or array elements)
G: Local generic name or formal argument function block.
DS: Function block data with data item #<data item name>, or long-type local variable.

IM 33G3C20-11E 6-15
6.6.1 Arithmetic Functions
(1) Absolute Value (labs, dabs)
labs (arg) converts the argument type to long and returns a long-type absolute
value of the argument.
dabs (arg) converts the argument type to double and returns a double-type absolute
value of the argument.

(2) Maximum Value (lmax, dmax)


lmax (arg1,arg2,…) converts the argument type to long and returns a long-type
value that is largest in the argument list. Up to 32 arguments can be used.
dmax (arg1,arg2,…) converts the argument type to double and returns a double-
type value that is largest in the argument list. Up to 32 arguments can be used.

(3) Minimum Value (lmin, dmin)


lmin (arg1,arg2,…) converts the argument type to long and returns a long-type
value that is smallest in the argument list. Up to 32 arguments can be used.
dmin (arg1,arg2,…) converts the argument type to double and returns a double-
type value that is smallest in the argument list. Up to 32 arguments can be used.

(4) Power (power)


power (arg1,arg2) converts the argument type to double and returns a double-
type value resulted by multiplying “arg1” a number of “arg2” times. If “arg1” is 0 and
“arg2” is 0 or less, or “arg1” is less than 0 and “arg2” is not an integer, an error will be
caused when executed, returning 0.

(5) Decimal Fraction Round-Down (int)


int (arg) converts the argument type to double and returns a double-type value with
decimal fractions rounded down.

6-16 IM 33G3C20-11E
6. Functions

6.6.2 Bit Operation Functions


(1) Bit Position Search (bitpstn, bitsrch)
These functions searches for the position of the most significant “1” bit in the integer
variable specified by “arg1”.
bitpstn(arg1,arg2) returns –1 if the specified variable has two or more “1” bits.
bitsrch(arg1,arg2) stops the search when the first “1” bit is found and returns
the position of that bit. Both returns a long-type value indicating the bit position, 0
when all bits are 0, or –1 if an error is caused.
When “arg1” is a simple variable, “arg2” is ignored and the number of elements is
considered to be one. When “arg1” is an array or an array element, “arg2” needs to be
assigned with the number of elements. When “arg1” is an array name or an entire array
specified with a “*” subscript, the search will be made starting with the first array
element and as far as the elements specified in number by “arg2.” When “arg1” is an
array element, the search will be made starting with that element and as far as the
elements specified in number by “arg2.” An error is caused if the subscript of “arg1” or
“arg2” is out of the array subscript range.
Bit positions returned by these functions are shown in Figure 6.7.

integer: simple variable

1 16

long: simple variable

1 32

integer: array variable

1 16 17 32 33 48 49 64 65 80 81

long: array variable

1 32 33 64 65

Figure 6.7 Bit-position Returns

IM 33G3C20-11E 6-17
When “arg1” is an array element, the search will be made starting with that element and
as far as the elements specified in number by “arg2,” and the most significant bit in the
“arg1”-specified array element is returned. See Figure 6.8

integer, array element: Element 3 is specified in bitpstn(I[3],k)

1 16 17 32 33 48

Element 1 Element 2 Element 3 Element 4 Element 5

long, array element: Element 2 is specified in bitpstn(I[2],k)

1 32 33

Element 1 Element 2 Element 3

Figure 6.8 Array Element Bit Positions

6.6.3 High-Low Limit Functions


(1) High and Low Limits (llimit, dlimit)
llimit(arg1,arg2,arg3) and dlimit(arg1,arg2,arg3) are used to
confine data within high and low limits. “arg1” specifies data, “arg2” the low limit, and
“arg3” the high limit.
When they are assigned llimit(data,min,max) and
dlimit(data,min,max), their returns will be as follows:
min (data<min)
data (min data max)
max (data>max)
llimit converts the argument type to long and returns long-type values. dlimit
converts the argument type to double and returns double-type values. An error is caused
if “arg2” is larger than “arg3” and the value of the “arg1”-specified data will be re-
turned.

6-18 IM 33G3C20-11E
6. Functions

6.6.4 Trigonometric Functions


(1) Sine (sin)
sin(arg) uses a radian argument, converts its type to double, and returns a double-
type sine value of the argument. It returns zero if the absolute value of the argument is
too large to operate on and an error is caused.

(2) Cosine (cos)


cos(arg) uses a radian argument, converts its type to double, and returns a double-
type cosine value of the argument. It returns zero if the absolute value of the argument
is too large to operate on and an error is caused.

(3) Tangent (tan)


tan(arg) uses a radian argument, converts its type to double, and returns a double-
type tangent value of the argument. It returns zero if the absolute value of the argument
is too large to operate on and an error is caused.

(4) Arctangent (atan)


atan(arg) uses a radian argument, converts its type to double, and returns a double-
type arctangent value of the argument.

6.6.5 Square-Root Function


(1) Square Root (sqrt)
sqrt(arg) converts the argument type to double, and returns a double-type square
root value of the argument. It returns zero if the argument is a negative value and an
error is caused.

6.6.6 Exponentiation Function


(1) Exponent (exp)
exp(arg) converts the argument type to double, and returns a double-type value
resulted by multiplying “e” a number of “arg” times.

6.6.7 Natural Logarithm Function


(1) Natural logarithm (log)
log(arg) converts the argument type to double, and returns a double-type natural
logarithm value (“e” as the logarithm base) of the argument. The argument must be
larger than 0.

IM 33G3C20-11E 6-19
6.6.8 Character-String Functions
(1) Conversion to Integer-Type (ichr)
ichr(arg) converts a character-string argument into an integer-type value and returns
the code corresponding to each character. The first character is used when the argument
contains two or more characters.

(2) Conversion to Character String-Type (chr)


chr(arg) converts an integer-type argument into a character string-type value and
returns the character corresponding to each code. A space is returned if the argument
contains an undefined value.

(3) String Length (len)


len(arg) returns the length of a character string. It uses a character string-type
argument and returns an integer value that indicates the string length counting characters
regardless of 1- or 2-byte characters.

(4) String Concatenation (cat)


cat(arg1,arg2) uses character strings in its two arguments and returns character
string-type data joining the “arg2” string to the “arg1” string.

(5) Substring Index (index)


index(arg1,arg2) uses character strings in its two arguments and returns the
position of the “arg2” string in the “arg1” string. When the “arg2” string is a substring
in the “arg1” string, an integer value that indicates the position of the start of the
substring is returned; if not, 0 is returned. The position is indicated by the number of
characters counted from left to right regardless of 1- or 2-byte characters. If the “arg2”
string appears twice or more in the “arg1” string, the start position of the first substring
is returned. If the “arg1” string is longer than the “arg2” string, 0 is returned.

(6) String Retrieval (left,right,mid)


left(arg1,arg2) retrieves the number of characters specified by “arg2” from the
left of the character string entered in “arg1.” It returns the result in a character string.
Characters are counted from left to right regardless of 1- or 2-byte characters.
right(arg1,arg2) retrieves the number of characters specified by “arg2” from the
right of the character string entered in “arg1.” It returns the result in a character string.
Characters are counted from right to left regardless of 1- or 2-byte characters.
mid(arg1,arg2,arg3) retrieves the number of characters specified by “arg3”
beginning at the nth character specified by “arg2” from the character string entered in
“arg1.” It returns the result in a character string. Characters are counted from right to
left regardless of 1- or 2-byte characters.

(7) Numeric String Conversion (snum)


snum(arg) returns a double-type numeric value that can be expressed using the
character string the argument specifies.

6-20 IM 33G3C20-11E
6. Functions

6.6.9 Date and Time Functions


(1) Date (getdate)
getdate(arg1,arg2,arg3) returns today’s date separated into the year (lower
two digits of the year), month, and day, which are loaded in arg1, arg2, and arg3,
respectively. The date is the local date (not the Greenwich time). The function returns
the serial date counted from January 1 of the year as 0 as data of the long type. getdate
returns -1 when an error occurs.

(2) Time (gettime)


gettime(arg1,arg2,arg3) returns today’s time separated into the hour (24-hour
basis), minute, and seconds, which are loaded in arg1, arg2, and arg3, respectively. The
time is the local time (not the Greenwich time). gettime returns the same value as does
timems. gettime returns -1 when an error occurs.

(3) Elapsed Time (timems)


timems() returns the time in milliseconds elapsed since 00:00 local time. The least
resolution is 10 msec.

(4) GMT serial seconds (timegmt)


timegmt() returns the serial number of seconds elapsed since 00:00:00, January 1,
1970 Greenwich Time.

(5) Date and time conversion (localtime)


localtime(time,year,month,day,hour,min,sec) converts the serial
number of seconds elapsed since 00:00:00, January 1, 1970 Greenwich Time specified
by time to the year, month, day, hour, minute and second and loads them into year,
month, day, hour, minute and second, respectively. The year indicated is the lower two
digits of the year. localtime returns 0 if it ends normally, or it returns -1 when an error
occurs or conversion fails.

6.6.10 Function Block Data Function


(1) Data-Status Check (dscheck)
dscheck(arg1,arg2) is used to check the status of the data specified in “arg2” of
the function block data specified in “arg1.” It returns 1 when the data status is true and 0
if the status is false. “arg1” takes data with #-attached data item name, such as in
<function block>.#<data item name>. “arg2” takes a character string to
specify the status. See Chapter 7, 7.4.1, Checking Data Status for details.

IM 33G3C20-11E 6-21
6.6.11 Error Functions
(1) Latest error code (errc)
errc() returns the error code of the most recently occurring error. It returns 0 if no
error has occurred since the initiation of the SFC or SEBOL block.

(2) Latest detailed error code (errce)


errce() returns the detailed error code of the most recently occurring detailed error.
It returns 0 if no detailed error has occurred since the initiation of the SFC or SEBOL
block.

(3) Latest error line (errl)


errl() returns the number of the line containing the most recently occurring error. It
returns 0 if no error has occurred since the initiation of the SFC or SEBOL block.
If an error is detected as an SFC block transition condition,
errl() returns a value from -1 to -8 (negative transition condition number). It returns
0 if an error occurs during any action defined in the sequence table or logic chart of an
SFC block.

(4) Latest error function name (errf)


errf() returns the name of the function containing the most recently occurring error.
It returns a character string with a length of 0 for an error occurring elsewhere. It also
returns a character string with a length of 0 if no error has occurred since the initiation
of the SFC or SEBOL block.
If an error is detected as an SFC block transition condition or during any action defined
in the sequence table or logic chart of an SFC block, errf() returns a character string
with a length of 0.

(5) Latest error step number (errs)


errs() returns the step number of the step containing most recently occurring error. It
returns 0 if no error has occurred since the initiation of the SFC block. With SEBOL
blocks, it always returns 0.

(6) Latest error plane number (errp)


errp() returns the plane number of the plane containing most recently occurring error.
It returns 0 if no error has occurred since the initiation of the SFC block. With SEBOL
blocks, it always returns 0.

(7) Value Check (errorval)


errorval(arg) checks whether the value of the argument-specified variable is the
value of when an operation error has been caused. It returns 1 if it is and 0 if not. The
argument takes an integer, long, float, or double varibale but not a character-string
variable.

(8) Error-Identifier Retrieval (cerrorid, lerrorid, derrorid)


These functions return error-identifier values. cerrorid() is used for the char*n
type, lerrorid() for the integer type, and derrorid() for the real number type.

6-22 IM 33G3C20-11E
6. Functions

6.6.12 Signal Function


(1) Signal Parameter Retrieval (lreadpara, dreadpara, creadpara)
These functions are used to retrieve signal parameters. Each takes one argument to
specify a parameter number. The signal name can be retrieved by specifying 0 in
creadpara(arg).

6.6.13 Process Management


(1) Common block read (Icmread, dcmread, ccmread)
Icmread, dcmread, and ccmread are built-in functions used to read common block data
of the integer, real, and character string types, respectively. For more details, refer to
SFC Block Function Manual (IM 33G3C31-11E).

(2) Common block write (cmwrite)


cmwrite is a built-in function to set the data to common block data. For more details,
refer to SFC Block Function Manual (IM 33G3C31-11E).

(3) Dynamic unit assignment (urassign)


urassign(arg1,arg2) assigns the unit recipe with the unit recipe number specified by arg1
to the unit specified by arg2. For more details, refer to SFC Block Function Manual
(IM 33G3C31-11E).

(4) Unit recipe download (urload)


urload(arg) downloads the unit recipe with the unit recipe number specified by arg into
the field control station from the operation and monitoring functions. For more details,
refer to SFC Block Function Manual (IM 33G3C31-11E).

(5) Recipe setup (rpreserve)


rpreserve (arg1,arg2,arg3,arg4) reserves the master recipe specified by arg1 and arg2 —
arg1 specifies the recipe group number and arg2 the master recipe name. arg3 is used to
specify the batch ID and arg4 the train name. For more details, refer to SFC Block
Function Manual (IM 33G3C31-11E).

(6) Built-in functions with batch ID specification


lcmreadbid(), dcmreadbid(), ccmreadbid(), cmwritebid() are built-in functions which
access common block data with batch ID specification. urloadbid() and urassignbid() are
built-in functions which operate unit recipe with batch ID specification. For details, see
“SFC Block Function Manual (IM33G3C31-11E)”.

IM 33G3C20-11E 6-23
6.6.14 Other Functions
(1) Present Block Tag Name (gettagno)
gettagno() returns the tag name of the present SFC/SEBOL block. In a unit-started
SFC block operation, however, gettagno() returns the tag name of the present unit.
Use getname(%) to acquire the tag name of the present SFC/SEBOL block or
getname(%%) to acquire the tag name of the present unit at all times.

(2) Generic Name Conversion (getname)


getname(arg) is used to get a tag name string from a local generic name or function
block formal argument. The result is of the character string type.

(3) Start Status (boot)


boot() is used to identify the start status, returning 0 for initial cold start and 1 for
restart.

(4) Restart Judgement (ckstep, ckstepcl)


ckstep() is used to determine whether the SFC block can be restarted.
ckstepcl() is used to clear the condition after an interruption. For details, refer to
the SFC Block Function Manual (IM 33G3C31-IIE).

6-24 IM 33G3C20-11E
7. Function Block Data

7. Function Block Data


The use of local variables and function-block data is described in this chapter.

7.1 Overview
The function block data of the present plant can be described — in the same way as
local variables — within an expression or on the left-hand side of an assignment
statement using SEBOL.
Function block data is written in the format of <tag name>.<data item name>.
EXAMPLE:
Waiting until PV of the block tag-named TAG001 reaches 50.0 or higher:
sebolblock sample
block PID TAG001
......
wait until (TAG001.PV >= 50.0)
......
end
Function block data can also be accessed describing its local generic name and a
function formal argument — one-dimensional arrays can be used for global generic
names and generic names as well as local generic names and formal arguments. See
Table 7.1 for a list of declarations used for function blocks.

Table 7.1 Declarations for Function Blocks

Declared Statement SEBOL SFC Function One-Dim. Reference


Block Block Array
Tag name block 5.2.1
Tag name global block (1*)
Local generic name genname 5.2.2
Global generic name global genname (1*)
Generic name unit genname (1*)
Generic name global unit genname (1*)
Formal argument argblock 6.4

● : Applicable ×: Not applicable


*1: Refer to SFC Block Function Manual (IM 33G3C31-11E).

Simple variables and two-dimensional arrays can be used to describe data item names as
shown in Table 7.2.

Table 7.2 Data Item Name Description

Function Block Data Item Example of Description


Simple variable Simple variable FIC001.PV
Array element Simple variable GEN01[1].PV
Simple variable Array element FIC001.ITEM[1]
Array element Array element GEN01[1].ITEM[2,1]

IM 33G3C20-11E 7-1
An entire function block array can be described using a group assignment or “compare”
statement but data item array elements cannot be described.

Table 7.3 Function Block Array Description

Function Block Data Item Example of Description


Entire array Simple variable GEN01[*].PV
Entire array Array element Cannot be described.

7-2 IM 33G3C20-11E
7. Function Block Data

7.2 Grouped Function-block Data Manipulation


Multiple function-block data can be written, read, and compared in one operation using
statements shown in Table 7.4.

Table 7.4 Grouped Function-Block Data Manipulation

Statement Function
Group assignment Grouped input/output of function-block data.
“compare” statement Grouped comparison of function-block data.
“drive” statement Grouped output with answerback check.

The group assignment statement instructs writing or reading multiple function-block data
specifying data on both sides or one side of the statement. The “compare” statement is
used for a group comparison and the “drive” statement for a group output of data to a
switch instrument with answerback check.
The group assignment statements can be used for accessing function-block data of
another plant but the other two statements are used only with the function-block data of
the present plant.
EXAMPLE:
Grouped data writing and comparison:
sebolblock example
block PID TAG001,TAG002
......
[TAG001.SV,TAG002.SV = 10.0,10.0] ! Group assignment statement.
compare[TAG001.PV,TAG002.PV >= 9.7,9.7] ! Compare statement.
......
end
In this example, the group assignment statement sets two function-block setpoint values
at 10.0 and the “compare” statement compares two function-block process variables until
they are 9.7 or higher.
Error processing can be described in any of the three group statements and the duration
of comparison can be specified in seconds in the “compare” statement. Their formats
are described later in this section.

IM 33G3C20-11E 7-3
Local variables, constants, or function-block data variables lists are used on the left- and
right-hand sides of a group statement. Variables used in the function-block data
variables list are shown in Table 7.5. Where local variables can be used, formal argu-
ment local variables can be used; and where local generic names can be used, generic
names and formal argument function blocks can be used.

Table 7.5 Variables Allowed in Group Assignment Statements

Assignment “compare”
“drive” Statement
Variable Statement Statement
LH RH LH (*1) RH (*2) LH (*3) RH (*4)
Constant × ● ● ● × ●
Simple local variable ● ● ● ● × ●
Local variable array element ● ● ● ● × ●
Local variable array ● ● ● ● × ●
Tag name + Data item name ● ● ● ● × ×
Simple local generic name + Data item name ● ● ● ● × ×
Local generic name array element + Data item name ● ● ● ● × ×
Local generic name array + Data item name ● ● ● ● × ×
Simple function-block formal argument + Data item name ● ● ● ● × ×
Function-block formal argument array element + Data item name ● ● ● ● × ×
Function-block formal argument array + Data item name ● ● ● ● × ×
Tag name × × × × ● ×
Simple local generic name × × × × ● ×
Local generic name array element × × × × ● ×
Local generic name array × × × × ● ×
Simple function-block formal argument × × × × ● ×
Function-block formal argument array element × × × × ● ×
Function-block formal argument array × × × × ● ×
● : Applicable ×: Not applicable
*1: Variable or constant entered on the left of comparison symbol.
*2: Variable or constant entered on the right of comparison symbol.
*3: Target function block, such as switch instrument, for output.
*4: Output value.

Where tag names can be described, the present block (%) or present unit (%%) can be
described — see SFC Block Function Manual (IM 33G3C31-11E) for the description of
the present unit. See Table 7.6 for the applicability of tag-name and other description in
SEBOL and SFC blocks and functions.

7-4 IM 33G3C20-11E
7. Function Block Data

Table 7.6 Tag Name & Other Description

Description SEBOL Block SFC Block Function


Tag name (“block” declared)
Tag name (“global block” declared)
Present block (%)
Present unit (%%)

● : Applicable ×: Not applicable

Where local generic names can be described, generic names and others listed in Table
7.7 can be specified.
Table 7.7 Generic Name & Other Description

Description SEBOL Block SFC Block Function


Local generic name (“genname” declared)
Global generic name (“global genname” declared)
Generic name (“unit genname” declared)
Generic name (“global unit genname” declared)
Formal-argument function-block (“argblock” declared)

● : Applicable ×: Not applicable

One group assignment statement or “compare” statement can manipulate up to 32 units


of data. One “drive” statement can manipulate up to 16 units of data. The number of
data when an array is specified is the number of elements.
Commas are used to separate variables and constants in the variables list. Periods are
used separate data item names when more than one name are specified for access. The
data of the present SFC/SEBOL block must begin with “%.” — a percent symbol and a
period. The data of the present unit must begin with “%%.” — two percent symbols and
a period. Figure 7.1 shows the formats.

IM 33G3C20-11E 7-5
<tag name>.<data item name>[.<data item name>…]

<local generic name>.<data item name>[.<data item name>…]

<function-block formal argument>.<data item name>[.<data item name>…]

<local generic name array element>.<data item name>[.<data item name>…]

<function-block formal argument array element>.<data item name>[.<data item name>…]

Present SFC/SEBOL-block data:

%.<data item name>[.<data item name>…]

Present unit data:

%%.<data item name>[.<data item name>…]

Array:

<local generic name array>’[’*’]’.<data item name>[.<data item name>…]

<function-block formal argument array>’[’*’]’.<data item name>[.<data item name>…]

Array – with [*] omitted:

<local generic name array>.<data item name>[.<data item name>…]

<function-block formal argument array>.<data item name>[.<data item name>…]

Figure 7.1 Variable List Formats

Enter in “<tag name>“ a tag name that is declared in the “block” or “global block”
statement. Variables that can be described in place of “<local generic name>“ are listed
in Table 7.8.

Table 7.8 Variables Describable as Local Generic Name

Variable Declaration Statement


Local generic name genname
Global generic name global genname
Unit generic name unit genname
Global unit generic name global unit genname

Simple variables or array elements can be used for data item names when the function
block is a simple variable or array element:
Simple variable: TAG001.PV
One-dimensional array element: TAG001.ITEM[i+l]
Two-dimensional array element: TAG001.ITEM[i,j]

7-6 IM 33G3C20-11E
7. Function Block Data

Only simple variables can be used for data item names with a function-block array.
EXAMPLE:
Reading function-block mode and process values:
sebolblock example
block PID TAG001,TAG002
char*16 s1,s2
double d1,d2
......
[s1,d1,s2,d2 = TAG001.MODE.PV,TAG002.MODE.PV]
......
end
In the above example, the block mode is read to local variables s1 and s2, and process
values to local variables d1 and d2.
EXAMPLE:
Specifying data item names for array:
sebolblock example
genname PID TAG[3]
......
assign ”TAG001” to TAG[1]
assign ”TAG002” to TAG[2]
assign ”TAG003” to TAG[3]
......
[TAG[*].MODE.SV = ”AUT”,”AUT”,”AUT”,10.0,10.0,10.0]
......
end
In this example, data are read to TAG[*].MODE.SV in order of TAG[1].MODE,
TAG[2].MODE, TAG[3].MODE, TAG[1].SV, TAG[2].SV, and TAG[3].SV.

IM 33G3C20-11E 7-7
7.2.1 Group Assignment Statement
The group assignment statement is written as shown in Figure 7.2.

’[’<variables list>=<variables or constants list>’]’[,<plant name>]

[<error array>’[’*’]’][; error <label>[,<error identifier>]]


errorsub

<variables list>: Specifies a list of up to 32 assigned variables. (The array is counted as


one for every array element.) See Table 7.8 for the types of variables
that can be used.
<variables/constants list>: Specifies a list of variables/constants of the types compatible with assigned
variables. See Table 7.8 for the types of variables/constants that can be used.
<plant name>: Specifies the name of the plant to be accessed for data using a character
string-type local variable or constant, only when the plant is other than the
present plant, for which the entry is omitted.
<error array>: Specifies an integer-type local variable array in which the error code is set
if an error is caused when reading the right-hand side variable or writing
the left-hand side variable. If errors are caused on both sides, priority is
given to the right-hand side. The entry can be omitted if it is not necessary
to check individual data errors. A simple local variable or array element can
be used if only one unit of data is assigned.
<label>: Specifies the branching destination when an error is caused.
<error identifier>: Specifies a local variable or constant for the identification of the location
where an error is caused.

Figure 7.2 Group Assignment Statement

The “variables/constants list” on the right-hand side is set in the “variables list” on the
left-hand side. “Error array” sets an error code in the array element (0 is set when
normal) so that the function-block data that caused an error can be identified. “Label”
specifies the destination for branching when an error is caused. “Error identifier”
permits to identify the location of the error in the error-handling phase, making a built-in
function return the error identifier value. See Chapter 10 for the details of error-
handling.

7-8 IM 33G3C20-11E
7. Function Block Data

Order of group assignment to multiple function-block data


Data are set from left to right of the variables list in the group assignment statement.
The data-setting order is guaranteed only when the function blocks to set data are in the
same control area. The order is not adversely affected if the SFC/SEBOL block that
executes the group assignment statement is not in the same control area or station as the
function blocks. The order is not guaranteed if the data are in different control areas
even when they belong to the same control station.
In the following two examples, the function block that has tagnames TAG0100A and
TAG0100B is in control area 1 and the block that has tagnames TAG0200A and
TAG0200B is in control area 2:
EXAMPLE 1:
sebolblock example1
block PID TAG0100A,TAG0100B ! Control area 1.
......
[TAG0100A.MODE.SV,TAG0100B.MODE.SV = \
”AUT”,10.0,”AUT”,10.0]
......
end
In example 1, it is guaranteed that data are set in order of TAG0100A.MODE,
TAG0100A.SV, TAG0100B.MODE, and TAG0100B.SV.
EXAMPLE 2:
sebolblock example2
block PID TAG0100A, TAG0100B ! Control area 1.
block PID TAG0200A, TAG0200B ! Control area 2.
......
[TAG0100A,MODE.SV,TAG0100B.MODE.SV,TAG0200A.MODE.SV,\
TAG0200B.MODE.SV = ”AUT”,5.0,”AUT”,5.0,”AUT”,5.0,\
”AUT”,5.0,”AUT”,5.0]
......
end
In example 2, it is guaranteed that data in control area 1 are set in order of
TAG0100A.MODE, TAG0100A.SV, TAG0100B.MODE, and TAG0100B.SV; and those
in control area 2 in order of TAG0200A.MODE, TAG0200A.SV, TAG0200B.MODE,
and TAG0200B.SV. However, the user is not informed of whether the setting of data
started with the function block in control area 1 or with the block in control area 2.

IM 33G3C20-11E 7-9
Table 7.9 shows the operations that take place when the amount of data on the left-hand
side and that of data on the right-hand side differs. The tests outlined in Table 7.9 are
made at compile time unless the variable contains an entire array of formal arguments of
the function. If the variable contains an entire array of formal arguments of the func-
tion, an error is detected at execution time. When an error occurs while checking the
amount of data, the assignment variable on the left-hand side and the value of each
element of the error array remain unchanged.

Table 7.9 Checking Amounts of Data on Left- and Right-hand Sides

Left-Hand Side Right-Hand Side Processing

Local variable only Function block data only Error caused if there are more data on the right-hand
side than the left-hand side.
Error caused if there are more data on the left-hand
Function block data only Local variable only side than the right-hand side.
Function block data only Function block data only Error caused if there are more data on the right-hand
Local variable only Local variable only side than the left-hand side.

Function lock data and local variables are intermixed on


either the left- or right-hand side or on both. Error caused if numbers of data are same on both sides.

If the number of error-array elements is larger than the number of processed data, 0 or
an error code is set at the first element of the error array but values of redundant
elements remain unchanged.
If the number of error-array elements is less than the number of processed data, an error
is caused. This error is caused during compilation if any function formal argument array
is contained in the statement — if it is, the error is caused during execution. If the error
is caused when executed, values of the assigned variable and error array elements on the
left-hand side remain as they were before the execution of the statement.

NOTE

• The variable on the left-hand side of a group assignment statement cannot be used on
the right-hand side or in the array subscript in the same statement.
• The user is not informed of whether the value after the assignment is used or the
value before the assignment is used.

7-10 IM 33G3C20-11E
7. Function Block Data

EXAMPLE:
The user is not informed of whether access is made to the local generic name array
GEN001[3] or GEN001[5] in the following program:
......
integer i
genname PID GEN001[10],GNAM001
......
! Incorrect program.
i=3
[i,GEN001[i].MODE,GNAM001.SV=5,”AUT”,100.0]
......
The assignment to subscript variable “i” should be removed from the above incorrect
program, rewriting it as follows:
......
integer i
genname PID GEN001[10],GNAM001
......
! Correct program.
i=5
[GEN001[i].MODE,GNAM001.SV=”AUT”,100.0]
......
EXAMPLE:
It is not known whether TAG001.SV is set with 5 or 10 in the following program:
......
integer i
block PID TAG001
......
! Incorrect program.
i=5
[i,TAG001.SV = 10,i]
......
The program should be written as follows:
......
integer i
block PID TAG001
......
! Correct program.
i=5
[i,TAG001.SV = 10,10]
......

IM 33G3C20-11E 7-11
7.2.2 Data of Another Plant
Function-block data of another plant can be accessed designating the plant name in the
group assignment statement.
The plant name, which can use a character string of 8 or less bytes, is the unit of
managing plants. Tag names need to be unique only within a named plant; that is that
the same tag names can be used with another plant if its name is different.
The function blocks on both sides of the group assignment statement are taken as tag
names that belong to the plant designated in the statement. Two or more plants cannot
be designated in one line, however, to access their function block data.
EXAMPLE:
Reading process values to local variables d1 and d2 from tag names PID001 and PID002
at PLANT-XL:
sebolblock example3
block PID:XL PID001,PID002
double d1,d2
......
[d1,d2=PID001.PV,PID002.PV],”PLANT-XL”
......
end
The “XL” in the “block” statement specifies the system model, which is necessary when
accessing data of a block that uses a model other than CENTUM CS.
Function-block data of another plant can only tbe accessed using the group assignment
statement; they cannot be written on the left-hand side of an ordinary assignment
statement or expression. Also, neither the “compare” nor “drive” statement can be used
for the purpose.
When running a single program to access function blocks that have the same tag number
existing in different plants, use a local generic name for either or both. Assume that the
tag number FIC001 exists in both plants P1 and P2.

sebolblock example4
genname PID P1_FIC001, P2_FIC001
double d1, d2

assign ”FIC001” to P1_FIC001


assign ”FIC001” to P2_FIC001

[d1 = P1_FIC001.PV], ”P1” ! Access FIC001.PV in plant P1


[d2 = P2_FIC001.PV], ”P2” ! Access FIC001.PV in plant P2

*1 A plant name is the basic unit of plant management. A plant name must be unique
for each tag name. Identical tag names having different plant names are handled as
different tag names. A plant name is a string of eight or fewer alphanumeric
characters.

7-12 IM 33G3C20-11E
7. Function Block Data

7.2.3 “compare” Statement


The “compare” statement is written as shown in Figure 7.5.

compare’[’<variables or constants list><comparison symbol>


<variables or constants list>’]’[<error array>’[’*’]’]
[; time<time>[, error <label>[,<error identifier>]] ]
errorsub
error <label>[,<error identifier>
errorsub

<variables or constants list>: Specifies a list of variables/constants for comparison up to 32 variables or


constants on either side of the comparison symbol. (The array is counted
as one for every array element.) See Table 7.8 for the types of
variables/constants that can be used.
<comparison symbol>: Specifies the type of comparison using a relational operator (>,<,>=,<=)
or an equality operator (==,<>).
<error array>: Specifies an integer-type local variable array in which the error code is
set if an error is caused when the condition is not satisfied or a value is
returned. If errors are caused on both sides, priority is given to the right-
hand side. The entry can be omitted if it is not necessary to check
individual data errors. A simple local variable or array element can be
used if only one unit of data is compared.
<time>: Specifies a period of time for comparison in seconds using an integer
constant or local variable. If not specified, comparison continues until
the condition is satisfied.
Specify 0 if comparison is to be made just once.
<label>: Specifies the branching destination when an error is caused.
<error identifier>: Specifies a local variable or constant for the identification of the location
where an error is caused.

Figure 7.3 “compare” Statement

The “compare” statement compares the value of the variable or constant on the left-hand
side of the comparison symbol with that on the right-hand side of the symbol. When the
condition is satisfied after comparing all elements, the statement is normally ended and
the execution of the program proceeds to the next line.
When “time” is specified, comparison is performed until the condition is satisfied and as
long as the specified time period permits — an error will be caused if the condition is
not satisfied within the specified time. Comparison is performed infinitely until the
condition is satisfied when “time” is not specified.
If the types of data on left- and right-hand sides do not agree, they are converted
according to the rules for relational and equality operators — see 4.7, Conversion of
Operands, for details.
To compare function-block data with a local variable/constant, function-block data must
be entered on one side rather than entering them on both sides, which shortens the
processing time.
If a communication error is caused with a variable on either side, the “compare”
statement will be cancelled. The statement will also be cancelled when a comparison of
numeric and character-string data is attempted.

IM 33G3C20-11E 7-13
“Error array” sets an error code in the corresponding array element if an error is caused
when the condition is not satisfied or a value is returned — 0 is set when the condition
is satisfied. “Label” specifies the destination for branching when an error is caused.
“Error identifier” permits to identify the location of the error in the error-handling phase,
making a built-in function return the error identifier value. See Chapter 10 for the
details of error-handling.
The “compare” statement cannot compare ambiguous data, such as “PV 50” or
“approximately 50”; caution is needed when comparing analog or real-number data. It
should also be noted that a comparison of a float- or double-type real-number data and a
real-number constant using the equality operator “==” may result the unsatisfied
condition. Real-number data are values having finite precision and produce diminutive
errors in almost all cases when operated or converted in types from “double” to “float.”
And the comparison of real-number data that contains an error using the equality
operator “==” results the unsatisfied condition. It is thus necessary to use a relational
operator (>=, <=, >, <) to compare real numbers.
As to the timing of getting function-block data for comparison, data on both sides can be
acquired at the same time if they are at the same control station as the SFC/SEBOL
block that executes the “compare” statement.
When comparing data of another station, communication is generated for the acquisition
of data and thus data cannot be acquired at the same timing when comparing them
between the present and another stations or between two other stations. If function
blocks are at other stations, data for the left- and right-hand sides are acquired separately
through communication, so the timing of data acquisition is not guaranteed. Function
blocks on one side allow acquisition of their data at the same timing if they are in the
same area, but not if they are in different control areas even if they are at the same
control station other than the station that contains the SFC/SEBOL block.
When comparing data of the function-blocks of another station or other stations, it is not
guaranteed that comparison is executed every second because of the limited performance
of communication. Although caution is needed, the comparison does take place at least
once even if the specified time is exceeded.
See Figure 7.6 for the processing of data when there is a difference between the num-
bers of data on left- and right-hand sides. If variables do not contain any function
formal argument array, an error is caused when compiled — if they do, an error is
caused when executed. If the error is caused when executed, the error array value
remains unchanged. See Figure 7.6 for the data-checking performed at the time of
compilation.

7-14 IM 33G3C20-11E
7. Function Block Data

Table 7.10 Checking Amounts of Data on Left- and Right-hand Sides

Left-Hand Side Right-Hand Side Processing


Error caused if there are more data on the right-
Local variable only Function block data only hand side than the left-hand side.
Error caused if there are more data on the left-hand
Function block data only Local variable only side than the right-hand side.
Function block data only Function block data only
=.. with data on
Data on the left-hand side compared
Local variable only Local variable only the right-hand side that have less number of data.
Both function block data and local variable on either Error caused if numbers of data are different on
side or both sides. both sides.

If the number of error-array elements is larger than the number of processed data, 0 or
an error code is set at the first element of the error array but values of redundant
elements remain unchanged.
If the number of error-array elements is less than the number of processed data, an error
is caused. This error is caused during compilation if any function formal argument array
is contained in the statement — if it is, the error is caused during execution. If the error
is caused when executed, values of the assigned variable and error array elements on the
left-hand side remain unchanged.

IM 33G3C20-11E 7-15
7.2.4 “drive” Statement
The drive statement alters the output status of a motor control block or switch instru-
ment block and waits for the end of the answerback checking by the block.

drive’[’<function-blocks list>=<local variables/constants list>’]’


[<error array>’[’*’]’][; error <label>[,<error identifier>]]
errorsub

<function-blocks list>: Specifies a list of up to 16 function blocks. (The array is counted as one
for every array element.) See Table 7.5 for the types of variables that
can be used. It is not necessary to describe data item names because
they are fixed in the case of the “drive” statement.
<local variable/constants list>: Specifies an output value (0, 1 or 2) using local variables/constants.
<error array>: Specifies an integer-type local variable array in which the error code is
set if an error is caused — 0 is set when normal. A simple local variable
or array element can also be used if only one unit of data is output.
<label>: Specifies the branching destination when an error is caused.
<error identifier>: Specifies a local variable or constant for the identification of the location
where an error is caused.

Figure 7.4 “drive” Statement

The “drive” statement sets a value to the manipulated variable (MV) for the function
block on the left-hand side and waits until the block’s answerback check is completed.
The following describes actions of the “drive” statement:

(1) Checking Block Code


The function-block code is checked — an error is caused if a code other than those
listed in Table 7.11 is used.

(2) Checking Block Mode


The block mode and operation type are checked whether they permit output to the
function block or not. An operation type can be selected from the three shown in Table
7.12 for each station that executes the SEF/SEBOL block. An error is caused if the
block mode does not permit output.

(3) Setting MV Value


A value on the right-hand side*2 is set to the manipulated variable on the left-hand side*1
— an error is caused if the value is other than 0, 1, and 2.
When the value is set at 1, however, the answerback check function is not available for
the motor control or switch instrument block — the drive statement for the block will
simply set 1 at MV before completing its execution.
*1: Write <function-block-list> to the left of = on the left-hand side.
*2: Write <local-variable-or-constant-list> to the right of = on the right-hand side.

7-16 IM 33G3C20-11E
7. Function Block Data

(4) Delaying Action


The action is delayed one scan period if all function blocks belong to the present station
or two periods if any of the blocks belongs to another station. The delay adjusts the
action in order to wait for the start of answerback check.

(5) Waiting for Completion of Answerback Check


The completion of answerback check is monitored once every scan period. The moni-
toring ends when all function blocks normally complete answerback checks even while
the check is masked.

(6) Checking Block Mode and MV Value


The block mode at the time of output manipulation and that at the time of answerback
check completion are compared — an error is caused if they don’t agree. Also the MV
value set by the “drive” statement and that at the time of answerback check completion
are compared — an error is caused if they don’t agree.

(7) Checking Alarm Status


The alarm status is checked — an error is caused when the status is ANS+, ANS–, or
PERR.
“Error array” sets an error code in the array element (0 is set when normal) so that the
function-block data that caused an error can be identified. “Label” specifies the destina-
tion for branching when an error is caused. “Error identifier” permits to identify the
location of the error in the error-handling phase, making a built-in function return the
error identifier value. See Chapter 10 for the details of error-handling.

IM 33G3C20-11E 7-17
If the number of data on the right-hand side is less than the number of data on the left-
hand side, an error is caused. This error is caused during compilation if any function
formal argument array is contained in the statement — if it is, the error is caused during
execution. If the error is caused, output manipulation is not carried out and the error
variable remains as it was before the execution of the statement.
If the number of error-array elements is larger than the number of processed data
(number of function blocks of on the left-hand side), 0 or an error code is set at the first
element of the error array but values of redundant elements remain unchanged.
An error is also caused if the number of error-array elements is smaller than the number
of processed data. This error is caused during compilation if the left-hand side contains
any function formal argument array — if it does, the error is caused during execution.
If the error is caused during execution, output manipulation is not carried out and the
error variable remains unchanged.

Table 7.11 Switch Instrument Block and Motor Control Block Type Names

Type Name
SO-1
SO-2
SIO-11
Switch instrument block SIO-12
SIO-21
SIO-22
SIO-12P
SIO-22P
MC-2
Motor control block MC-3

Note: The switch Instrument blocks SI-1 and SI-2 cannot be handled with the drive
statement.

Table 7.12 “drive” Statement Operation Type

Mode of Subject Blocks


Type
IMAN TRK MAN AUT CAS ROUT (*3)
1 × × ×
2 × × (*1)
3 × × (*2)

●: Output manipulation, ×: No output manipulation (error)


*1: Operation is carried out after changing the block mode to AUT, which is not returned to MAN.
*2: Operation is carried out with the block mode remained at MAN.
*3: MAN (ROUT) is handled the same as MAN, AUT (ROUT) as AUT,and CAS (ROUT) as CAS.

7-18 IM 33G3C20-11E
7. Function Block Data

EXAMPLE:
Use of “drive” statement:
sebolblock example
#define CLOSE 0
block SIO-22 VALVE01 VALVE02
......
drive[VALVE01,VALVE02 = CLOSE,CLOSE];errorsub ERR000
......
exit
ERR000:
message “VALVE close error line = %d errcode = %d–
%x”,errl(),errc(),errce()
ereturn
......
end
In this example, a switch block instrument with the tag names VALVE01 and
VALVE02 is loaded with an MV value of 0 before the valves are closed. When an
error occurs, the line number and error code are output in a message.

IM 33G3C20-11E 7-19
7.3 Block Modes and Block Statuses
The block mode is a piece of status information that represents the control or output
status of a function block. SEBOL permits reading the block mode as a character string
or changing it.
Nine basic block modes are available as listed in Table 7.13. The basic block modes are
common to all function blocks, though valid function modes vary from one function
block type to another. For definitions of the basic block modes and the types of basic
block modes applicable to particular function block types, refer to FCS Field Control
Station Function Manual (IM 33G3C10-11E).

Table 7.13 Basic Block Modes

Symbol Name
O/S Out-of-service
IMAN Initialization manual

TRK Tracking
MAN Manual

AUT Automatic
SEMI Semiautomatic

CAS Cascade
PRD Primary direct

RCAS Remote cascade


ROUT Remote output

Automatic (AUT) and manual (MAN) modes each are an independent mode of single,
significant action. Initialization manual (IMAN) and tracking (TRK) modes are depen-
dent on other basic modes and determine actions only in combination with others —
forming compound block modes for combined actions.
There are modes that are mutually exclusive or complementary. Those mutually
exclusive are automatic (AUT), MAN, semiautomatic (SEMI), cascade (CAS), and
primary direct (PRD) modes and their actions cannot be combined. Those mutually
complementary are IMAN and TRK modes and they can be combined with others to
form compound block modes.
Basic block modes have the order of priority to determine the order of action when
combined in a compound block mode — see Table 7.14.

Table 7.14 Priority of Basic Block Modes

Order of Priority Basic Block Mode


High O/S
IMAN
TRK
MAN,AUT,SEMI,CAS,PRD
Low RCAS,ROUT

7-20 IM 33G3C20-11E
7. Function Block Data

The effective action of a compound block mode is the action of the mode that has the
highest priority among the basic modes used in the compound mode. This basic block
mode of the highest priority is called the active mode in a compound block mode.
To compose a compound block mode, the active basic block mode is written first and it
is followed by other basic block modes each in parentheses according to their order of
priority as in the following example:
EXAMPLE:
Compound block mode of IMAN and AUT modes:
IMAN(AUT(RCAS))

7.3.1 Reading Block Modes


Three data items can be used to read block modes — see Table 7.15.

Table 7.15 Block Mode-Reading Data Item

Data Item Name Type


MODE Block mode char*8
OMOD Block mode of lowest priority char*4
CMOD Block mode of highest priority char*4

The data item name MODE uses a character string when the mode is composed of
assorted basic block modes, listing the mode of the highest priority first and followed by
the modes of lower priority. If there is only one acceptable basic block mode, MODE
uses the character string for that basic block mode.
The data item name OMOD uses the character string for the acceptable basic block
mode of the lowest priority. The data item name CMOD uses the character string for
the acceptable mode of the highest priority. If there is only one acceptable basic block
mode, OMOD uses the character string for that basic block mode, and CMOD uses a
character string of zero length.
Examples are shown in Table 7.16.

Table 7.16 Data Item-Name Character Strings

Data Item-Name Character String


Block Mode
MODE OMOD CMOD
AUT ”AUT” ”AUT” ””
TRK(AUT) ”AUT TRK” ”AUT” ”TRK”
IMAN(AUT(RCAS)) ”RCASIMAN” ”RCAS” ”IMAN”

When the OMOD or CMOD character string is less than 4 bytes, the string is shortened
but the space is maintained.
When the basic mode of the lowest priority has a string less than 4 bytes in the MODE
character string, the space is reduced in the first half of the string. Then the character
string for the basic mode of the highest priority starts at the fifth byte; if the string is
less than 4 bytes, it is shortened but the space is maintained in the last half of the
MODE string. If there is only one acceptable basic block mode, MODE uses a character
string of less than 4 bytes for that block.

IM 33G3C20-11E 7-21
Use @MODE to check to see if a particular basic block mode is established or not
among two or more basic block modes that coexist. @MODE is a 32-bit sequence of
data (long type), each bit of which represents one basic block mode. A 1 bit means that
the corresponding basic Block mode is established; a 0 bit means that the corresponding
basic Block mode is not established. The system-fixed include file, smode.h, holds a
definition of the correspondence between the basic block modes and bit numbers as
mask patterns defined by the #define instruction (see Table 7.17).
For example, if the tag name FIC001 is in the mode IMAN (AUT (RCAS)), then the
data items MODE are “RCASIMAN,” OMOD, “RCAS,” and CMOD, “IMAN.”
Whether AUT is established or not cannot be determined from this context (see Table
7.15), thus requiring a check with @MODE.
EXAMPLE:
sebolblock example
#include "smode.h"
block PID FIC001

if ((FIC001.@MODE & MD_AUT)<>0) then


!Action to take when the basic block mode AUT is established
......
end if
......
end
When the tag FIC001 is in the mode IMAN (AUT (RCAS)), bits 5, 10, and 13 would be
1, with @MODE equaling $08480000. Since AUT is given by bit 10, a bitwise AND
(&) operation would yield $00400000 (nonzero value) as
TAG001.@MODE&MD_AUT. Note that parentheses are used to enclose
FIC001.@MODE&MD_AUT in the conditional expression
((FIC001.@MODE&MD_AUT)<>0), since the operator & is lower in priority than the
operator <>.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Figure 7.5 Bit Numbers

Table 7.17 Basic Block Mode Labels and Values

Bit Number Basic Block Mode Value smode.h Label

1 O/S $80000000 MD_OS


5 IMAN $08000000 MD_IMAN
6 TRK $04000000 MD_TRK
8 SEMI $01000000 MD_SEMI
9 MAN $00800000 MD_MAN
10 AUT $00400000 MD_AUT
11 CAS $00200000 MD_CAS
12 PRD $00100000 MD_PRD
13 RCAS $00080000 MD_RCAS
14 ROUT $00040000 MD_ROUT

7-22 IM 33G3C20-11E
7. Function Block Data

7.3.2 Changing Block Modes


The block mode can be changed by assigning a block mode character string to MODE
using an assignment statement or a group assignment statement.
EXAMPLE:
Changing TAG001 mode to AUT and TAG002 and TAG003 modes to MAN:
sebolblock example
block PID TAG001,TAG002,TAG003
......
TAG001.MODE = ”AUT” ! Assignment statement
......
[TAG002.MODE,TAG003.MODE = ”MAN”,”MAN”]
! Group assignment statement
......
end
Table 7.18 shows a list of character strings that can be used when changing block
modes.

Table 7.18 Character Strings Used for Changing Block Modes

Character String Action


“O/S” Sets O/S mode, resetting all other modes.
“MAN” Sets MAN mode, resetting modes other than O/S, IMAN, and TRK.
“AUT” Sets AUT mode, resetting modes other than O/S, IMAN, and TRK.
“SEMI” Sets SEMI mode, resetting modes other than O/S, IMAN, and TRK.
“CAS” Sets CAS mode, resetting modes other than O/S, IMAN, and TRK.
“PRD” Sets PRD mode, resetting modes other than O/S, IMAN, and TRK.
“RCAS” Sets RCAS mode.
“ROUT” Sets ROUT mode.

The IMAN or TRK mode cannot be set using SEBOL. Also some block modes cannot
be changed depending on the current block mode. For details, refer to the FCS Field
Control Station Function Manual (IM 33G3C10-11E).

IM 33G3C20-11E 7-23
7.3.3 Block Statuses
A block status designates the overall operating status a function block in combination
with a block mode. Block statuses are defined only for certain function blocks. The
names and meanings of the block statuses depend on the function block.
The individual statuses defined for a function block are called basic block statuses. Four
levels of priority exist among the basic block statuses. More than one basic block status
may be defined to have the same level of priority. Basic block statuses having the same
level of priority are exclusive with one another and are never established simultaneously.
Basic block statuses varying in their level of priority, on the other hand, may be estab-
lished simultaneously.
Either the data item BSTS or @BSTS with @ is used to read the block status of a
function block. The data item BSTS is a character string of up to eight bytes. Where
two or one basic block statuses coexist, BSTS gives the character string of the highest-
priority basic block status.
@BSTS is a 32-bit sequence of data (long type), each bit of which represents one basic
block status. A 1 bit means that the corresponding basic Block status is established; a 0
bit means that the corresponding basic Block status is not established. The system-fixed
include file, sbsts.h, holds a definition of the correspondence between the basic block
statuses and bit numbers as mask patterns defined by the #define instruction.
The data item BSTS should be used to reference the block status of any function block
whose basic block statuses have the same level of priority, such as SFC/SEBOL blocks
or units, and to program the block status as a character string. The data item @BSTS
should be used, on the other hand, to reference the block status of any function block
whose basic block statuses have varying levels of priority, such as timer blocks, and to
program the block status as 32-bit data. This is because, where two or one basic block
statuses coexist, the data item BSTS cannot check to see if any lower-priority basic
block status is established or not.
An example illustrates how the data item BSTS can be used to reference the block status
of a function block whose basic block statuses have the same level of priority. SFC
blocks involve four different block statuses: RUN, PAUS, STOP, and ABRT. Since not
all these block statuses are established simultaneously, the data item BSTS should be
used for programming purposes in handling SFC blocks.

7-24 IM 33G3C20-11E
7. Function Block Data

EXAMPLE:
sebolblock sample1

block SF001 SFC0301

if (SFC0301.BSTS<>"RUN") then
!Action to take when the block status RUN is not established
......
end if
......
switch (SFC0301.BSTS)
case"RUN"
!Action to take when the block status RUN is established
......
case"PAUS"
!Action to take when the block status PAUS is established
......
case"STOP"
!Action to take when the block status STOP is established
......
case"ABRT"
!Action to take when the block status ABRT is established
......
end switch
......
end

Next, consider the case of a function block having basic block statuses with varying
levels of priority. As Table 7.19 indicates, three levels of priority exist among the basic
block statuses of a timer block (block model name TM).

Table 7.19 Block Status of a Timer Block

Priority Basic Block Status Meaning Bit Number

3 (high) PAUS Paused 1


2 PALM Prealarm 9
CTUP Timeout 10

NR Normal 11
1 (low) RUN Running 17
STOP Stopped 18

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Figure 7.6 Bit Numbers

When a normally running timer block is paused, its block status changes to PAUS
(NR(RUN)). Since the data item BSTS is PAUS (having the highest level of priority) in
this status, it cannot check to see if any lower-priority basic block status, such as RUN
or NR, is established or not. When the timer block is in the block status PAUS
(NR(RUN)), bits 1, 11,and 17 would be 1, with @BSTS equaling $80208000.

IM 33G3C20-11E 7-25
The system-fixed include file, sbsts.h, is used to check the block status of a function
block with @BSTS. It holds a definition of the mask patterns of the basic block statuses
in the following format of #define:

BS_<basic block status>

Figure 7.7

Notes: 1. The block status NR is labeled in one of the two ways:


• BS_NR1 used when a switch instrument or the like is assigned to priority 1.
• BS_NR2 used when a timer instrument or the like is assigned to priority 2.
2. The block status ABORTED is labeled BS_ABORT, though it can be safely
written in a program as BS_ABORTED (as in UNT001.@ALRM&BS_
ABORTED). Since BS_ABORTED is 10 characters long, the last two
character are ignored.
The mask patterns of the block status of a timer block stored in sbsts.h are as follows:
EXAMPLE: Part of sbsts.h
......
#define BS_PAUS $80000000 ! 1bit
#define BS_PALM $00800000 ! 9bit
#define BS_CTUP $00400000 ! 10bit
#define BS_NR2 $00200000 ! 11bit (NR priority 2)
#define BS_RUN $00008000 ! 17bit
#define BS_STOP $00004000 ! 18bit
......
An example of using @BSTS and the include file, sbsts.h, to check the block status of a
timer block follows.
EXAMPLE:
sebolblock sample2

#include "sbsts.h"

block TM TM0305

......
if ((TM0305.@BSTS & BS_RUN)<>0) then
!Action to take when the block status RUN is established
......
end if
......
if ((TM0305.@BSTS & BS_CTUP)==0) then
!Action to take when the block status CTUP is not established
......
end if
......
end
Note that parentheses are used to enclose TM0305.@BSTS&BS_RUN in the conditional
expression ((TM0305.@BSTS&BS_RUN)<>0), since the operator & is lower in priority
than the operators <> and ==.

7-26 IM 33G3C20-11E
7. Function Block Data

7.4 Data Status


Process values (PV) and manipulated values (MV) in a function block are attached with
data status that identifies the quality of the data. In most cases, data status is input or
output from one function block to another and used to determine control action or
operation when exception events, such as irregular processing and operation, occur.
The data status can be checked or changed using SEBOL. A built-in function is used
for the check in the user application; writing or reading a function block data using
SEBOL cannot cause the system check the status. To change the status, the instruction
is written to “&data item name” as shown in the example, in which the PV data status is
changed to CAL in order to have the PID control block in the calibration mode:
EXAMPLE:
sebolblock example1
block PID FIC001
......
FIC001.&PV = ”CAL”
......
end

IM 33G3C20-11E 7-27
7.4.1 Checking Data Status
The built-in function “dscheck” is used to check the data status as shown in Figure 7.8.

dscheck (<function block data>,<data status>)

<function block data>: Specifies the function block data for the check of its data status using
the format <function block>.#<data item name>. The tag name
and a simple variable array element for the local generic name and
formal argument are used to specify the function block.
<data status>: Specifies the data status using a character-string constant or variable.

Figure 7.8 Checking Data Status

The built-in function “dscheck” returns 1 when the data status is true, or 0 if it is false
— the return value is an integer.
EXAMPLE 1:
Checking PV data status of TAG002 block:
sebolblock example2
block PID TAG002
......
if (dscheck(TAG002.#PV,”CAL”) == 1) then
! Processing if status is CAL.
......
else
! Processing if status is not CAL.
......
end if
......
end
EXAMPLE 2:
Waiting until calibration status of FIC003 is cancelled, terminating CAL status of PV:
sebolblock example3
block PID FIC003
......
wait until (dscheck(FIC003.#PV,”CAL”) == 0)
......
end

7-28 IM 33G3C20-11E
7. Function Block Data

EXAMPLE 3:
Checking more than one data status using logical operator OR:
sebolblock example4
block PID FIC004
......
if (dscheck(TAG004.#PV,”CAL”) == 1
or dscheck(TAG004.#PV,”BAD”) == 1) then
! Processing if status is CAL or BAD.
......
end if
......
end
EXAMPLE 4:
Checking more than one data status using logical operator AND:
sebolblock example5
block PID TAG005
......
if (dscheck(TAG005.#PV,”CAL”) == 0
and dscheck(TAG005.#PV,”BAD”) == 1) then
! Processing if status is not CAL and is BAD.
......
end if
......
end
Logical operators OR and AND can be used together combining examples 3 and 4.
The manner of reading data and checking its data status at the same time is explained
below. The data is acquired using “#data item name” and stored in a long-type variable;
and specifying this long-type value to the built-in function “dscheck” checks the data
status.

dscheck (<long-type variable>,<data status>)

<long-type variable>: Specifies the value of the long-type variable using the format
<function block>.#<data item name>. If a different variable is
specified, an erratic action will be caused when executed instead of an error.
<data status>: Specifies the data status using a character-string constant or variable.

Figure 7.9 Reading Data & Checking Data Status

IM 33G3C20-11E 7-29
Reading both data and data status using a group assignment statement permits the
reading of data and the checking of data status at the same time.
EXAMPLE:
Reading both PV and data status at the same time and instructing error processing if
status is BAD or using PV read to local variable “pvvalue” if status is not BAD:
sebolblock example6
block PID TAG006
long dstat
double pvvalue
......
[pvvalue,dstat = TAG006.PV,TAG006.#PV]
! Reading both data and data status.
if (dscheck(dstat,”BAD”) == 1) then
! Processing if status is BAD.
......
else
! Processing using “pvvalue.”
......
end if
......
end

7-30 IM 33G3C20-11E
7. Function Block Data

7.4.2 Changing Data Status


The data status can be changed using “&data item name” on the left-hand side of an
assignment statement or a group assignment statement. Because it does not instruct
reading, “&data item name” cannot be written in an expression, on the right-hand side of
a group assignment statement, or to a “compare” statement parameter — a compile error
is caused otherwise.
EXAMPLE:
sebolblock example7
block PID TAG007,TAG008,TAG009
genname PID GEN000[2]
......
assign ”PID001” to GEN000[1]
assign ”PID002” to GEN000[2]
......
[GEN000[*].&PV = ”CAL”,”CAL”]
[TAG007.&PV,TAG008.&PV = ”CAL”,”CAL”]
TAG009.&PV = ”CAL”
......
end
Table 7.20 shows character strings that can be used when changing data status.

Table 7.20 Character Strings Used for Changing Data Status

Character String Action


”CAL” Sets the calibration status.
”NCL” Cancels the calibration status.

IM 33G3C20-11E 7-31
7.5 Alarm Status
Alarm status indicates the process alarm state that the function block has detected and it
can be referenced using the data item ALRM (alarm status). It cannot be changed by
setting data at ALRM, however.
SFC/SEBOL blocks permit to use a “prcsalarm” statement (see Chapter 9) to generate or
reset a process alarm and have the system change the data item ALRM.
There are other process alarm-related data items in addition to ALRM, which are AF
(alarm detection), AOFS (alarm suppression), and AFLS (alarm flashing). Many
function blocks, including SFC/SEBOL blocks, have these data items and they are used
to control process alarms.

7.5.1 Referencing Alarm Status


The alarm status can be read using the data item ALRM, which is a 8-byte character
string.
EXAMPLE:
Reading alarm status of FIC001 to local variable “alm”:
sebolblock example
block PID FIC001
char*8 alm
......
alm = FIC001.ALRM
......
end
If the process alarm character string is less than 8 bytes, the ALRM string is shortened
to less than 8 bytes but the space is not maintained. When a number of alarms have
been caused, the process alarm of the highest priority is read to ALRM. The method of
referencing alarm statuses individually is explained in Section 7.5.3, “Referencing Alarm
Statuses Individually.”
It is not allowed to write in ALRM. A compile error is caused if the ALRM of a
function block, which has a tag name declared using a “block” statement or a local
generic name declared using a “genname” statement, is written on the left-hand side of
an assignment statement or group assignment statement.

7-32 IM 33G3C20-11E
7. Function Block Data

7.5.2 Data Items AF, AOFS, AFLS


AF (alarm detection specification), AOFS (alarm masking specification), and AFLS
(alarm flashing status) are data items that control process alarm status.
Modifications can be made to these data items of a function block to manipulate its
process alarm operations, by setting a status change command character string. Table
7.21 lists the status change command character strings that can be used to manipulate
alarms in a group.

Table 7.21

Data Item Name Status Change Command Character String Explanation

”AOF” Enables group bypassing of alarm detection


AF
”AON” Disables group bypassing of alarm detection

”AOF” Enables group alarm masking


AOFS
”AON” Disables group alarm masking

AFLS ”ACK” Acknowledges alarm in group (flashing off)

For more details on the status change command character strings, refer to FCS Field
Control Station Function Manual (IM 33G3C10-11E). For more details on alarms
occurring in SFC blocks, refer to SFC Block Function Manual (IM 33G3C31-11E). For
more details on alarms occurring in SEBOL blocks, refer to SEBOL Block Function
Manual (IM 33G3C21-11E).

EXAMPLE:
Setting group alarm suppression for function block FIC001:
sebolblock example1
block PID FIC001
......
FIC001.AOFS = ”AOF” ! ”AOF” is status change instruction.
......
end
EXAMPLE:
Setting group alarm acknowledgement for SEBOL block:
sebolblock example2
block SEBOL SEBOL001
......
SEBOL001.AFLS = ”ACK” ! ”ACK” is status change instruction.
......
end

IM 33G3C20-11E 7-33
The system-fixed include file, salarm.h. is used to manipulate AF (alarm detection
specification) and AOFS (alarm masking specification). AFLS (alarm flashing status)
cannot be manipulated individually. salarm.h holds a definition of the labels used to
individually manipulate alarms in the following format of #define:

• Enable alarm status detection bypassing.


• Enable alarm status masking.
AOF_<alarm status>

• Disable alarm status detection bypassing.


• Disable alarm status masking.
AON_<alarm status>
Replace '+' in the alarm status with 'P,' '-' with 'M.'

Figure 7.10

An example of controlling alarms that occur in a PID controller block is shown below.
EXAMPLE:
sebolblock sample1

#include "salarm.h"

block PID FIC301


FIC301.AF = AOF_IOPM !Enable IOP- alarm status detection bypassing
FIC301.AF = AOF_VELP !Enable VEL+ alarm status detection bypassing
FIC301.AF = AOF_HI !Enable HI alarm status masking
......

FIC301.AF = AON_IOPM !Disable IOP- alarm status detection bypassing


FIC301.AF = AON_VELP !Disable VEL+ alarm status detection bypassing
FIC301.AF = AON_HI !Disable HI alarm status masking
......

end

7-34 IM 33G3C20-11E
7. Function Block Data

The method of individually manipulating alarms that occur in function blocks that
permit user definition of alarm status character strings is explained below. User-defined
alarm statuses are manipulated with status change command character strings in the
formats described in Table 7.22.

Table 7.22 Status Change Command Character Strings Used to Individually


Manipulate Data Items AF and AOFS

Status Change Command Character String Explanation


ALnnOF Enable AF (alarm detection) bypassing for bit nn
ALnnON Disable AF (alarm detection) bypassing for bit nn
ALnnOF Enable AOFS (alarm masking) bypassing for bit nn
ALnnON Disable AOFS (alarm masking) bypassing for bit nn

• Specify a bit number in place of nn in ALnnOF and ALnnON. nn is a number from


09 to 32.
• The AF settings of “AL09OF” and “AL09ON” have no effect. NR cannot be
masked.
In a user-defined alarm status character string, each engineering function panel number
indicates a bit number. In Figure 7.11, NR, HI, LO, and ERR are defined in bit 9, bit
17, bit 18, and bit 28, respectively.
A sample program created to define the user-defined alarm status character string shown
in Figure 7.11 follows.
EXAMPLE:
sebolblock sample2

#define ALOF_HI "AL17OF"


#define ALON_HI "AL17ON"
#define ALOF_LO "AL18OF"
#define ALON_LO "AL18ON"
#define ALOF_ERR "AL28OF"
#define ALON_ERR "AL28ON"

block SEBOLP1 SBL203

SBL203.AF = ALOF_LO !Enable LO alarm detection bypassing


SBL203.AOFS = ALOF_HI !Enable HI alarm status masking
......

SBL203.AF = ALON_LO !Disable LO alarm detection bypassing


SBL203.AOFS = ALON_HI !Disable HI alarm status masking
......

end

IM 33G3C20-11E 7-35
Figure 7.11 User-Defined Alarm Status Character String

Data items AF, AOFS, and AFLS each can be read as an 8-byte character string — to
know whether AF or AOFS has any group specification, or whether AFLS has unac-
knowledged flashing alarm. In states other than these, these data items are read as null-
character strings.

Table 7.23 AF, AOFS, & AFLS Character Strings

Data Item Data Type Character String Description


AF ”AF” Group by-pass is specified for alarm detection.
AOFS char*8 ”AOF” Group suppression is specified for alarm detection.
AFLS ”AFL” Flashing alarm is not acknowledged.

EXAMPLE:
sebolblock example3
block PID FIC001
char*4 strl
......
FIC001.AOFS = ”AOF” ! Sets group alarm suppression.
strl = FIC001.AOFS ! Sets ”AOF” to ”strl”.
......
FIC001.AOFS = ”AON” ! Cancels group alarm suppression.
strl = FIC001.AOFS ! Sets null-character string (””) to ”strl”.
......
end

7-36 IM 33G3C20-11E
7. Function Block Data

7.5.3 Referencing Alarm Statuses Individually


@ALRM, @AF, @AOFS, and @AFLS are used to reference alarm statuses individu-
ally. @ALRM, @AF, @AOFS, and @AFLS are each a 32-bit sequence of data (long
type), each bit of which represents one alarm status.

Table 7.24 Referencing Alarm Statuses Individually

Data Item Bit Value Meaning


1 Alarm present
@ALRM
0 No alarm present
1 Alarm detection bypassing set
@AF
0 Alarm detection bypassing not set
1 Alarms masked
@AOFS
0 Alarms unmasked
1 Alarm flashing
@AFLS
0 Alarm not flashing

The correspondence between alarm statuses and bit numbers is explained below. The
leftmost bit number is 32; the rightmost one is 32 (see Figure 7.12). Alarm statuses,
such as OOP, IOP, and IOP-, are assigned to bits 9 to 32. Table 7.25 summarizes the
correspondence between the bit numbers and alarm statuses.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Figure 7.12 Bit Numbers

Table 7.25 Alarm Status Bit Numbers

Bit Number @ALRM @AFLS @AOFS @AF

1 0 (*1) 0 0
2 0 0 (*2) 0
3 0 0 0 (*3)

4 to 8 0 0 0 0
9 to 32 (*4) (*4) (*4) (*4)

*1: Bit 1 of @AFLS is 1 if there is a flashing alarm, 0 if not.


*2: Bit 2 of @AOFS is 1 if group alarm masking has been set, 0 if not.
*3: Bit 3 of @AF is 1 if group alarm bypassing has been set, 0 if not.
*4: As per Table 7.24

The system-fixed include file, salarm.h. holds a definition of the correspondence


between the alarm statuses and bit numbers as mask patterns defined by the #define
instruction in the following format:

AL_<alarm status>
Replace '+' in the alarm status with 'P,' '-' with 'M.'

Figure 7.13

IM 33G3C20-11E 7-37
EXAMPLE: salarm.h mask patterns (some)
......
#define AL_AFL $80000000 ! 1bit
#define AL_AOF $40000000 ! 2bit
#define AL_AF $20000000 ! 3bit
#define AL_NR $00800000 ! 9bit
#define AL_OOP $00400000 ! 10bit
#define AL_IOP $00200000 ! 11bit
#define AL_IOPM $00100000 ! 12bit IOP-
#define AL_HH $00080000 ! 13bit
#define AL_LL $00040000 ! 14bit
#define AL_HI $00008000 ! 17bit
#define AL_LO $00004000 ! 18bit
#define AL_DVP $00000800 ! 21bit DV+
#define AL_DVM $00000400 ! 22bit DV-
......
An example of using the include file, salarm.h, to individually reference alarms in a PID
controller block and a two-position motor control block (MC-2) follows.
EXAMPLE:
sebolblock sample3

#include "salarm.h"

block PID FIC301


block MC-2 MO302

if ((FIC301.@ALRM & AL_OOP) <> 0) then


!Action to take when the OOP alarm is present
......
end if

if ((FIC301.@AOFS & AL_HI) == 0) then


!Action to take when HI alarm bypassing has not been set
......
end if

if ((MO302.@AF & AL_PERR) <> 0) then


!Action to take when the PERR alarm has been masked
......
end if

if ((MO302.@AFLS & AL_ANSM) <> 0) then


!Action to take when the ANS- alarm is flashing
......
end if
......
end

7-38 IM 33G3C20-11E
7. Function Block Data

Note that parentheses are used to enclose FIC301.@ALRM&AL_OOP in the conditional


expression ((FIC301.@ALRM&AL_OOP)<>0), since the operator & is lower in priority
than the operators <> and ==.
In a user-defined alarm status character string, each engineering function panel number
indicates a bit number. A sample program created to define the user-defined alarm
status character string shown in Figure 7.11 follows.
EXAMPLE:
sebolblock sample3

#define ALM_HI $00008000 !Bit 17


#define ALM_LO $00004000 !Bit 18
#define ALM_ERR $00000010 !Bit 28

block SEBOLP1 SBL203

if ((SBL203.@ALRM & ALM_ERR) <> 0) then


!Action to take when the ERR alarm is present
......
end if

if ((SBL203.@AOFS & ALM_HI) == 0) then


!Action to take when HI alarm bypassing has not been set
......
end if
......

end

IM 33G3C20-11E 7-39
7.6 Sequence-Table Block
Sequence-table blocks (block model: ST16) in the same control area can be manipulated
for one-shot execution and periodic starts using SEBOL.

Table 7.26(a) Sequence-Table Block Manipulation

Sequence-Table Block Type


Action
TC/TE Type OC/OE Type B/I Type In Other Areas
One-shot execution and check ● ● ● ×
Periodic start following one-shot execution ● × × ×
Periodic start (in AUT block mode) ● ▲ ▲ ●

● : Applicable ×: Error caused when executed


▲ : Periodic start not executed although block mode is changed.

Table 7.26(b) Sequence-Table Block Types & Actions

Block Type Action


TC Periodic start executed only when status is changed.
TE Periodic start executed every time when condition is satisfied.
OC One-shot start executed only when status is changed.
OE One-shot start executed every time when condition is satisfied.
B Executed at initial cold start.
I Executed at initial cold start and restart.

• One-shot execution and check can be performed in the MAN or AUT block mode and
the mode will not be changed.
• B- and I-type sequence-table blocks primarily execute user-defined initialization
processing when initial cold-starting or restarting the control station. These blocks
can also be specified for execution using one-shot execution statements; in this case,
however, the one-shot execution takes place when the statement is executed.

7-40 IM 33G3C20-11E
7. Function Block Data

7.6.1 One-Shot Execution and Check


A sequence-table block can be specified for one-shot execution by specifying its tag
name in a “seqtable oneshot” statement. The specified block is executed once when the
condition is checked and satisfied. Similarly, a sequence-table block can be specified
for a one-shot check by specifying its tag name in a “seatable check” statement. The
specified block is checked once but will not be executed even when the condition is
satisfied.

seqtable oneshot<tag name>[,<execution step name>];<check result>


[;<error variable>][; error <label>[,<error identifier>]]
errorsub

seqtable check<tag name>[,<execution step name>];<check result>


[;<error variable>][; error <label>[,<error identifier>]]
errorsub

<tag name>: Specifies the tag name of the sequence-table block. Local generic name and formal
argument blocks can also be specified.
<PV>: Specifies the step name of the step-type sequence table using a 2-byte-or-less
character-string constant or variable — the first 2 bytes are significant if the string has
more than 2 bytes.
<check result>: Specifies an integer local variable into which the result of the sequence table condition
check is set. With a nonstep sequence table, 1 is set if any one of the 32 rules is
satisfied, or 0 is set if none are satisfied. With a step sequence table, the rules in the step
with <execution step name> if it is specified (or with the current PV value in the sequence
table if <execution step name> is not specified) are checked. 1 is set if any one of these
rules in the specified step is satisfied, or 0 is set if none of the rules are satisfied.
<error variable>: Specifies the local variable that takes error codes. 0 is entered when no error is caused.
<label>: Specifies the branching destination when an error is caused.
<error identifier>: Specifies a constant or local variable for the identification of the location where an
error is caused.

Figure 7.14 One-Shot Execution & Check

With a step sequence table, the step to be run by one-shot execution (check) can be
specified in <execution step name>. When the “seqtable” statement is run, all the rules
in the step specified by <execution step name> and step 00 are run (checked). When
<execution step name> is specified, the PV value in the sequence table changes to
<execution step name> if oneshot is specified. With check specified, however, the
execution step specified is checked but the PV value does not change. If the step
specified by <execution step name> does not exist, a runtime error occurs and the
sequence table is not run (tested).
If a step sequence table is run without specifying <execution step name> (with oneshot
specified), the step with the current PV value in the sequence table and step 00 are run.
If a step sequence table is checked without specifying <execution step name> (with
check specified), only step 00 is checked.
With a nonstep sequence table, all the rules are run (checked). The specification of
<execution step name> in a nonstep sequence table is meaningless.

IM 33G3C20-11E 7-41
7.6.2 Periodic Start with One-Shot Execution
TC- and TE-type sequence-table blocks can be specified for one-shot execution that is
followed by a periodic start using the “seqtable drive” statement. The block is first
executed once when the statement is executed; the block mode is changed to AUT at the
same time. The block is then executed for a periodic start according to its own timing
for successive actions.
The “seqtable drivewait” statement instructs the specified block to wait until an SFC/
SEBOL return event message is output after the block has been started in a periodic
start. Instructions other than the wait instruction are the same as the “drive” statement.

seqtable drive<tag name>[,<execution step name>]


[;<error variable>][; error <label>[,<error identifier>]]
errorsub

seqtable drivewait<tag name>[,<execution step name>];<manipulated signal parameter>


[;<error variable>][; error <label>[,<error identifier>]]
errorsub

<tag name>: Specifies the tag name of the sequence-table block. Local generic name
and formal argument blocks can also be specified.
<execution step name>: Specifies the step name of the step-type sequence table using a 2-byte-or-less
character-string constant or variable — the first 2 bytes are significant if the
string has more than 2 bytes.
<manipulated signal parameter>: Specifies a long-type local variable that takes the parameter (SFC/SEBOL
return event message, %RE) from the manipulated signal column of the
sequence table.
<error variable>: Specifies the local variable that takes error codes. 0 is entered
when no error is caused.
<label>: Specifies the branching destination when an error is caused.
<error identifier>: Specifies a constant or local variable for the identification of the location
where an error is caused.

Figure 7.15 Periodic Start with One-Shot Execution

• When a step name is specified for a step-type sequence-table block, the step is
changed to the specified step before one-shot execution, the specified step and “00”
steps are then executed once, and then a period start follows.
• If a non-existing step name is specified, an error is caused and the block is not
executed nor its mode is changed.
• If a step name is not specified, the step having the current PV of the block and “00”
steps are executed once and then a period start follows.
• If the block is non-step type, all rules are executed and any specified step name will
be ignored.

7-42 IM 33G3C20-11E
7. Function Block Data

• With the “drivewait” statement, the specified manipulated signal parameter is returned
when an SFC/SEBOL return event message is output. The parameter value ranges
from 0 to 65535, thus required a long-type local variable. (An integer-type variable
can only take values ranging from –32768 to 32767.)
• When the mode of the block started by the “drivewait” statement is changed to MAN
without outputting an SFC/SEBOL return event message, the statement will be
normally terminated returning –1 to the manipulated signal parameter. If the block
mode is changed to O/S, an error is caused when executed and the parameter remains
unchanged.
• The system changes the mode of the block started by the “drivewait” statement to
MAN when an SFC/SEBOL return event message is output. Also the system changes
the mode to MAN if the SFC/SEBOL block that started the sequence-table block
specified by the “drivewait” statement is forcibly terminated. Strictly speaking, the
mode is changed to MAN when the SFC/SEBOL block is forcibly terminated by a
block status change command if the mode is AUT and an SFC/SEBOL return event
message has not yet been output.
• If the sequence-table block outputs an SFC/SEBOL return event message when the
block has first been executed in one-shot execution, the block mode changes to MAN
and the periodic start will not be executed.
• An error is not caused when the block mode is AUT before the “seqtable” statement
is executed and the period start has already been executed — one-shot execution and
periodic starts will be executed normally.

IM 33G3C20-11E 7-43
7.6.3 Periodic Start without One-Shot Execution
When the mode of the TC- or TE-type sequence-table block is changed to AUT, the
successive sequence-table block will be periodic-started according to its own timing for
actions.

<tag name>.MODE = ”AUT”

Figure 7.16 Changing Mode of TC/TE-Type Block

• A group assignment statement is used to start the block with error-checking. (See
7.2.1 for the description of the group assignment statement.)
• The sequence-table block is executed first in one-shot execution when the “seqtable
drive” statement is executed. If the block mode is changed to AUT, the successive
sequence-table block will be executed according to its own timing for actions.
• The starting of a sequence-table block by changing the block mode is used when not
starting the block with one-shot execution or when starting a sequence-table block in
another area.

7-44 IM 33G3C20-11E
7. Function Block Data

7.7 Logic-Chart Block


Logic-chart blocks (block model: LC16 or LC64) in the same control area can be
manipulated for one-shot execution and periodic starts using SEBOL. The differences
between these and sequence-table blocks are that check results are not returned and steps
are not specified.

Table 7.27(a) Logic-Chart Block Manipulation

Sequence-Table Block Type


Action
TE Type OE Type B/I Type In Other Areas
One-shot execution ● ● ● ×
Periodic start following one-shot execution ● × × ×
Periodic start (in AUT block mode) ● ▲ ▲ ●

● : Applicable ×: Error caused when executed


▲ : Periodic start not executed although block mode is changed.

Table 7.27(b) Logic-Chart Block Types & Actions

Block Type Action


TC Periodic start.
OE One-shot start.
B Executed at initial cold start.
I Executed at initial cold start and restart.

• One-shot execution and check can be performed in the MAN or AUT block mode and
the mode will not be changed.
• B- and I-type logic-chart blocks primarily execute user-defined initialization process-
ing when initial cold-starting or restarting the control station. These blocks can also
be specified for execution using one-shot execution statements; in this case, however,
the one-shot execution takes place when the statement is executed.

7.7.1 One-Shot Execution


A logic-chart block can be specified for one-shot execution by specifying its tag name in
a “logicchart oneshot” statement.

logicchart oneshot<tag name>


[;<error variable>][; error <label>[,<error identifier>]]
errorsub

<tag name>: Specifies the tag name of the sequence-table block. Local generic name and formal
argument blocks can also be specified.
<error variable>: Specifies the local variable that takes error codes. 0 is entered when no error is caused.
<label>: Specifies the branching destination when an error is caused.
<error identifier>: Specifies a constant or local variable for the identification of the location where an
error is caused.

Figure 7.17 One-Shot Execution

IM 33G3C20-11E 7-45
7.7.2 Periodic Start with One-Shot Execution
The TE-type logic-chart block can be specified for a periodic start using the “logicchart
drive” statement. The block is first executed once when the statement is executed; the
block mode is changed to AUT at the same time. The block is then executed for a
periodic start according to its own timing for successive actions.
The “logicchart drivewait” statement instructs the specified block to wait until an SFC/
SEBOL return event message is output after the block has been started in a periodic
start. Instructions other than the wait instruction are the same as the “drive” statement.

logicchart drive<tag name>


[;<error variable>][; error <label>[,<error identifier>]]
errorsub

logicchart drivewait<tag name>;<manipulated signal parameter>


[;<error variable>][; error <label>[,<error identifier>]]
errorsub

<tag name>: Specifies the tag name of the logic-chart block. Local generic name
and formal argument blocks can also be specified.
<manipulated signal parameter>: Specifies a long-type local variable that takes the parameter (SFC/SEBOL
return event message, %RE) from the manipulated signal column of the
logic chart.
<error variable>: Specifies the local variable that takes error codes. 0 is entered
when no error is caused.

<label>: Specifies the branching destination when an error is caused.

<error identifier>: Specifies a constant or local variable for the identification of the location
where an error is caused.

Figure 7.18 Periodic Start with One-Shot Execution

• With the “drivewait” statement, the specified manipulated signal parameter is returned
when an SFC/SEBOL return event message is output. The parameter value ranges
from 0 to 65535, thus required a long-type local variable. (An integer-type variable
can only take values ranging from –32768 to 32767.)
• When the mode of the block started by the “drivewait” statement is changed to MAN
without outputting an SFC/SEBOL return event message, the statement will be
normally terminated returning –1 to the manipulated signal parameter. If the block
mode is changed to O/S, an error is caused when executed and the parameter remains
unchanged.
• The system changes the mode of the block started by the “drivewait” statement to
MAN when an SFC/SEBOL return event message is output. Also the system changes
the mode to MAN if the SFC/SEBOL block that started the logic-chart block speci-
fied by the “drivewait” statement is forcibly terminated. Strictly speaking, the mode
is changed to MAN when the SFC/SEBOL block is forcibly terminated by a block
status change command if the mode is AUT and an SFC/SEBOL return event mes-
sage has not yet been output.
• An error is not caused when the block mode is AUT before the “logicchart” statement
is executed and the period start has already been executed — one-shot execution and
periodic starts will be executed normally.

7-46 IM 33G3C20-11E
7. Function Block Data

7.7.3 Periodic Start without One-short Execution


When the mode of the TE-type logic-chart block is changed to AUT, the successive
logic-chart block will be periodic-started according to its own timing for actions.

<tag name>.MODE = ”AUT”

Figure 7.19 Changing Mode of TE-Type Block

• A group assignment statement is used to start the block with error-checking. (See 7.2
for the description of the group assignment statement.)
• The logic-chart block is executed first in one-shot execution when the “logicchart
drive” statement is executed. If the block mode is changed to AUT, the successive
logic-chart block will be executed according to its own timing for actions.
• The starting of a logic-chart block by changing the block mode is used when not
starting the block with one-shot execution or when starting a logic-chart block in
another area.

IM 33G3C20-11E 7-47
7.8 Process I/O and Software I/O
Tag names cannot be used with process I/O and software I/O. Terminal numbers are
used to access process I/O and element numbers are used to access software I/O.

7.8.1 Process I/O Terminal Numbers


Process I/O terminal numbers are expressed as shown in Figure 7.20.

<process I/O identifier><node number><unit number>


<terminal number>[<auxiliary qualifier number>]

<process I/O identifier>: Specifies the RIO bus network.


<node number>: Specifies the node number.
<unit number>: Specifies the unit number.
<terminal number>: Specifies the terminal number.
<aux. qualifier number>: Specifies domain and station numbers when accessing process I/O at another station.

Figure 7.20 Process I/O Terminal Number

See Table 7.28 for the details of process I/O terminal numbers.

Table 7.28 Terminal Number Details

Name Terminal Number Protocol


nn: Node number (01 to 16)
RIO bus network 1 %Znnusmm[Sddss] u: Unit number (1 to 5)
s: Slot number (1 to 4)
mm: Terminal number (01 to 32)
RIO bus network 2 %Ynnusmm[Sddss] dd: Domain number (01 to 64; S is fixed)
ss: Station number (01 to 64)

7-48 IM 33G3C20-11E
7. Function Block Data

Each process I/O terminal number (<node number><unit number><terminal number>)


must be unique across a field control station. Numbers, such as node numbers, must be
padded with 0s to the specified length as needed.
EXAMPLE:
Acquiring process values from process I/O terminals 1 to 3 at node 1, unit 2, slot 3 of
present station:
sebolblock example1
block %Z %Z012301, %Z012302, %Z012303
integer data[3]
......
[data[*] = %Z012301.PV,%Z012302.PV,%Z012303.PV]
......
end
EXAMPLE:
Acquiring process value from process I/O terminal at domain 3, station 5:
sebolblock example1
block %Z %Z085001S0305, %Z085002S0305, %Z085003S0305
integer data[3]
......
[data[*] = %Z085001S0305.PV,%Z085002S0305.PV,
%Z085003S0305.PV]
......
end

IM 33G3C20-11E 7-49
7.8.2 Software I/O Element Numbers
Software I/O element numbers are expressed as shown in Figure 7.21.

<software I/O identifier>,<consecutive number>[<aux. qualifier number>]

<software I/O identifier>: Specifies the type of software I/O.


<consecutive number>: Specifies a consecutive number, which is unique in a control station for
internal switches and unique in a control area for message numbers.
<aux. qualifier number>: Specifies a station number, etc., when accessing software I/O at
another station.

Figure 7.21 Software I/O Element Number

The software I/O that can be accessed using SEBOL are listed in Table 7.29 — others
cannot be accessed. (Add leading zeros to numbers, matching their numbers of digits as
shown in the table.)

Table 7.29 Software I/O Accessible Using SEBOL

Name Element Number Protocol


nnn: Consecutive number (001 to 256)
Global switches mm.ss: Station number (01 to 64). Present
%GSnnnmm[Sddss]
(internal switches) station number used when “00” is specified.
dd: Domain number (01 to 64; S is fixed)
nnnn: Consecutive number (0001 to 4096)
Common switches
%SWnnnn[Sddss] dd: Domain number (01 to 64)
(internal switches)
ss: Station number (01 to 64; S is fixed)
nnnn: Consecutive number (0001 to 1000)
Annunciator messages dd: Domain number (01 to 64; S is fixed)
%ANnnnn[Sddssaa]
(message outputs) ss: Station number (01 to 64)
aa: Area number (01 to 08)

7-50 IM 33G3C20-11E
7. Function Block Data

There are differences between the two formats used for global switches, %GSnnnmm
and %GSnnnmmSddss. The %GSnnnmm format permits to access the global switch
image of the present station, which is updated by the global switch under control of
another specified station (mm). The %GSnnnmmSddss format permits to access the
global switch image of the control station, which has the specified domain number (dd)
and station number (ss) and is updated by the global switch under control of another
specified station (mm).
Thus, when %GSnnnmm is used, the data of the present station are accessed even when
another station (mm) is the control station. And when %GSnnnmmSddss is used, the
data of another station are accessed unless the domain number (dd) and station number
(ss) specify the present station.
Data cannot be written to the global switch image of another station using the
%GSnnnmm format — an error is caused if “mm” specifies another station. Data can
be written to the global switch image using the %GSnnnmmSddss format if station
numbers “mm” and “ss are the same — an error is caused if they are not.
Common switches %SW0001 to %SW0099 are reserved elements for use by the system
in identifying start actions of the control station. They can be referenced and their
setting is restricted.

7.8.3 CP213 Communication Element Numbers


The CP213 communication function is optional. The two CP213 communication
element numbers available area %WW, which connects data as analog data, and %WB,
which connects data as digital data. Table 7.30 lists the CP213 communication element
numbers. Pad the register number and bit position with 0s to the specified length.

Table 7.30 CP213 Communication Element Numbers

Name Element Number Element Number Convention

Analog data %WWaaaa aaaa : Register number (0001 to 1024 (*1)

aaaa : Register number (0001 to 1024 (*1)


Digital data %WWaaaamm
mm : Bit position (01 to 16)

*1 As the register position aaaa, 0001 to 0512 are associated with the receive register numbers 001 to 512,
0513 to 1024, with the send register numbers 001 to 512.

IM 33G3C20-11E 7-51
7.8.4 Declaration
When process I/O or software I/O is used with a “block” or “genname” statement, the
identifiers listed in Table 7.31 are used in place of the block name.

Table 7.31 Names Used in Declaration

Process/Software I/O Identifier


%Z
Process I/O
%Y
Global switches %GS
Common switches %SW
Annunciator messages %AN
CP213 communication (Analog data) %WW
CP213 communication (Digital data) %WB

EXAMPLE:
Declaring common switch having tag name SWITCH01:
sebolblock example
block %SW SWITCH01
integer i
......
i = SWITCH01.PV
......
end

7-52 IM 33G3C20-11E
7. Function Block Data

7.8.5 Group 16-Bit I/O


Process values of 16 consecutively numbered process or software I/O can be input or
output as one unit of data using the data item named PV16, which uses 32-bit long-type
integer data for each process value in the 16 low-order bits and 0 in the 16 high-order
bits. See Figures 7.22 and 7.23.

<tag name>.PV16
<local generic name>.PV16
<formal argument function block>.PV16
<terminal number>.PV16
<element number>.PV16

Figure 7.22 PV16 Format

Note: An array or array elements can also be used for local generic names or formal
argument function blocks.

EXAMPLE: %SW0007.PV16
High-order bits Low-order bits

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Bits 1 to 16: 0
Bit 17: %SW0007.PV
Bit 18: %SW0008.PV
Bit 19: %SW0009.PV
. .
. .
Bit 30: %SW0020.PV
Bit 31: %SW0021.PV
Bit 32: %SW0022.PV

Figure 7.23 PV16 Data

IM 33G3C20-11E 7-53
Zero is entered to the PV16 bit if it has no data. For example, process I/O use terminal
numbers 1 through 32 and thus %Z075129.PV16 (node 7, unit 5, slot 1, terminal 29)
assigns process values at terminal numbers 29, 30, 31, and 32 to bits 17 through 20,
entering 0 to the remaining 12 low-order bits. See Figure 7.24.

EXAMPLE: %Z075129.PV16

High-order bits Low-order bits

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Bits 1 to 16: 0
Bit 17: %Z075129.PV
Bit 18: %Z075130.PV
Bit 19: %Z075131.PV
Bit 20: %Z075132.PV
Bit 21: 0
Bit 22: 0
.
.
Bit 31: 0
Bit 32: 0

Figure 7.24 PV16 Data

EXAMPLE:
Process value input using PV16:
sebolblock example1
block %SW SW0001
long z1,zdata[3]
......
z1 = %SW0001.PV16
[zdata[*] = %SW0017.PV16,%SW0033.PV16,%SW0049.PV16]
......
end

7-54 IM 33G3C20-11E
7. Function Block Data

When PV16 data are assigned to a long-type variable, zeros are set at the 16 high-order
bits. An overflow is caused if PV16 data are assigned to an integer-type variable and
the process value of the specified 17-bit-compatible process I/O or software I/O is 1.
EXAMPLE:
When %SW0101 PV is 1 and %SW0102 to %SW0116 PVs are 0:
sebolblock example2
block %SW SW0101
integer int1
long lng1
......
lng1 = %SW0101.PV16 ! lng1 16 high-order bits are zeros.
! $00008000 assigned to lng1.
......
int1 = %SW0101.PV16 ! Causes an overflow.
! $00008000=32768 is out of range for integer-type
variable.
......
end
To assign a long-type value to PV16, set the high-order 16 bits to 0. To assign an
integer-type negative value (the MSB being 1) to PV16, set the high-order 16 bits to 0
by masking with $0000FFFF as well.
EXAMPLE:
sebolblock example3
block %SW SW0101
long lngl
integer intl

! A set variable is assumed to have been set in the low-order 16 bits of lng1.
! Set the high-order 16 bits to 0.
%SW101.PV16 = lngl & $0000FFFF
.....
! A set variable is assumed to have been set in the 16 bits of int1.
! The result of int1&$0000FFFF is a long-type value with the high-order 16 bits
! being 0.
%SW0101.PV16 = intl & $0000FFFF
end

Data can be assigned to the data item PV16 in process I/O (%Z, %Y) only if all the 16
pins associated with PV16 have been defined in the SO or PO operation mode.

IM 33G3C20-11E 7-55
7.9 Timer Block
The timer block is a function block that measures time in seconds or minutes and has
the block model of TM. In addition to the measuring of elapsed time, it permits a user-
defined action when a specified time has elapsed, such as changing the SFC/SEBOL
block mode or status and signal transmission to an SFC block.
SEBOL does not have a timer function although its “delay” and “delaycycle” functions
can delay the timer. Thus the timer block must be used to generate actions periodically
or after a specified time has elapsed. The timer block can be started or stopped using
SEBOL. Referencing the block status identifies the status of the timer block.
Referecing the timer block process value informs the elapsed time. Data item names
used for these purposes are shown in Table 7.32.
For the details of the timer block, see the FCS Field Control Station Function Manual
(IM 33G3C10-11E).

Table 7.32 Timer Block Data Item Names

Data Item Names Description


OP Used to start/stop the timer block.
BSTS Used to know the status of the timer block.
PV Used to know the elapsed time.

The timer block can be manipulated using an assignment statement or a group assign-
ment statement to set an integer to the timer block data item OP — see Table 7.33 and
the example below.

Table 7.33 Timer Block Manipulating Integers

Integer Description
1 Stops the timer.
2 Starts the timer.
3 Restarts the timer.
4 Stops the timer temporarily.

EXAMPLE:
sebolblock example
#include ”std.h ” ! The label TM**** is defined in std.h
block TM TIM0001
TIM0001.OP = TMSTAT ! Starts the timer block
.....
TIM0001.OP = TMPAUS ! Pauses the timer block
.....
TIM0001.OP = TMCONT ! Restarts the timer block
.....
TIM0001.OP = TMSTOP ! Stops the timer block
end

7-56 IM 33G3C20-11E
7. Function Block Data

7.10 “oneshot” Statement


The oneshot statement controls a oneshot execution of a specified function block.

oneshot<function block>[,<parameter>]
[;<error variable>][; error <label>[,<error identifier>]]
errorsub

<function block>: Specifies a function block using the declared tag name (block statement), local
generic name (genname statement), or generic name (unit genname statement).
<parameter>: Specifies a parameter using a numeric constant or variable. 0 is set when omitted.
<error variable>: Specifies a local variable at which an error code will be set. 0 is set when no errors
are caused.
<label>: Specifies the branching destination when an error is caused.
<error identifier>: Specifies a constant or local variable for the identification of the location where an
error is caused.

Figure 7.25 “oneshot” Statement

See Section 10.1 for further description of “error variable,” “label,” and “error identi-
fier.”
For a list of the function blocks that can be specified using the oneshot statement, see
Table 7.34. The following rules apply in specifying function blocks:
• A function block without the parameter specification will be ignored if a parameter is
specified.
• A sequence table cannot be specified in the oneshot statement. The seqtable oneshot
statement must be used.
• A logic chart cannot be specified in the oneshot statement. The logicchart oneshot
statement must be used.
Two examples of oneshot execution of software counter blocks using the oneshot
statement are shown below:
EXAMPLE 1: Counter update operation
Setting the parameter at 1 in the statement and executing the specified software counter
block updates the counter incrementing the block’s count (data item: PV) by 1.
sebolblock example1
block CTS CTS003
.....
oneshot CTS003,1 !Parameter “1” updates the counter.
.....
end
This example brings the same result as the execution of “CTS003.ACT.ON …… Y” in the
action signal column of a sequence table.

IM 33G3C20-11E 7-57
EXAMPLE 2: Counter stopping operation
Setting the parameter at 0 in the statement and executing the specified software counter
block stops the counter changing the block status (data item: BSTS) to STOP.
sebolblock example2
block CTS CTS003
.....
oneshot CTS003,0 !Parameter “0” stops the counter.
.....
end
……
This example brings the same result as the execution of “CTS003.ACT.OFF Y” in
the action signal column of a sequence table.

7-58 IM 33G3C20-11E
7. Function Block Data

Table 7.34 Function Blocks Specifiable in “oneshot” Statement

Type Model Name Parameter


Software CTS Software counter block 0, 1 (Note 1)
counter blocks
Code input CI Code input block
blocks
None
Code output CO Code output block
blocks
BDSET-1 One-batch data set block

BDSET-1C One-batch data set block (character string data only)


BDSET-1L One-batch data set block (with set value limiter)
0~17 (Note 2)
BDSET-2 Two-batch data set block
Calculation BDSET-2C Two-batch data set block (character string data only)
auxiliary
BDSET-2L Two-batch data set block (with set value limiter)
BDA Batch data acquisition block

BDA-C Batch data acquisition block (character string data only) 0~17 (Note 3)

BDA-L Batch data acquisition block (with set value limiter)


General CALCU General purpose calculation block
purpose None
calculation CALCU-C General purpose calculation block (with character string I/O)
ADD Addition block

Numeric MUL Multiplication block


None
calculation DIV Division block

AVE Averaging block


AND Logic product block

OR Logic sum block

NOT Negation block


SRS1-S Set-dominant flip-flop (with 1 output)

SRS1-R Reset-dominant flip-flop (with 1 output)


SRS2-S Set-dominant flip-flop (with 2 outputs)

Logic SRS2-R Reset-dominant flip-flop (with 2 outputs)


None
operation WOUT Wipeout block

GT Comparator block (>)


GE Comparator block (≥)

EQ Comparator block (=)

BAND Bitwise AND block


BOR Bitwise OR block

BNOT Bitwise NOT block

Notes:
*1: Software-counter-block parameters and operations are shown in Table 7.35. For the description of the
operations, see IM 33G3C10-11E, FCS Control Station Function Manual.

Table 7.35 Software Counter Block Parameters

Parameter Operation
1 Updates the counter.
0 Stops the counter.

IM 33G3C20-11E 7-59
*2: Batch-data-set-block parameters and operations are shown in Table 7.36. For the description of the
operations, see IM 33G3C10-11E, FCS Control Station Function Manual.

Table 7.36 Batch Data Set-Block Parameters

Parameter Operation
0 Sets all current set data at 0.
1~16 Sets specified current set data (DTnn).
17 Sets all current set data.

*3: Batch data acquisition-block parameters and operations are shown in Table 7.37. For the description of
the operations, see IM 33G3C10-11E, FCS Control Station Function Manual.

Table 7.37 Batch Data Acquisition-Block Parameters

Parameter Operation
0 Sets all acquired data at 0.
1~16 Acquires specified data (DTmm).
17 Acquires all data.

7-60 IM 33G3C20-11E
8. Program Control Statements

8. Program Control Statements


SEBOL uses nine statements that control program execution and procedures. The nine
statements, which are described in this chapter, are as follows:
“if” statement
“for” statement
“while” statement
“repeat” statement
“wait until” statement
“switch” statement
“goto” statement
“delay” statement
“delaycycle” statement

8.1 “if” Statement


An “if” statement controls execution of the program according to the condition of the
expression in the statement.

(1) if (<expression>)<statement>
(2) if (<expression>) then
......
[else
......]
end if
(3) if (<expression>) then
......
else if (<expression>) then
[else
......]
end if

<expression>: A numeric expression that evaluates the condition.


<>0 ... True
0 ... False

<statement>: A statement that is executed when the expression is true.

Figure 8.1 “if” Statements

IM 33G3C20-11E 8-1
• In format (1), the expression is calculated and then, if the result is true, the statement
is executed.
• In format (2), the expression is calculated and then, if the result is true, the statement
entered between “then” and “else” is executed. If the statement is evaluated false, the
“else” clause is executed if an “else” clause is present.
• In format (3), two expressions are successively evaluated and then, if the result of
either one of the two expressions is true, the statement following the “then” for that
expression is executed. If both expressions are evaluated false, the “else” clause is
executed if an “else” clause is present.
• Branching out of an “if” statement can be instructed using a “goto” statement in the
“if~end if” construct, but branching into an “if” statement is not permitted.
EXAMPLE:
Judging local variable A:
integer function FUNC(A,MSG)
integer A,B
......
B = 0
if (A == 0) then
MSG = ”RUN”
else if (A == 1) then
MSG = ”STOP”
else
MSG = ”ERROR”
B = 1
end if
......
return B
......
end
EXAMPLE:
Changing setpoint values and generating message:
sebolblock example
block CT CT001
block PID SC001
......
if (CT001.PV == 1) then
[SC001.MODE.SV = ”AUT”,10] ! Change to low-speed.
else if (CT001.PV == 2) then
[SC001.MODE.SV = ”AUT”,50] ! Change to mid-speed.
else if (CT001.PV == 3) then
[SC001.MODE.SV = ”AUT”,100] ! Change to high-speed.
else
opeguide ”%aRPM SETTING ABNORMAL”,1 ! Message (red).
[SC001.MODE.SV = ”AUT”,10] ! Change to low-speed.
end if
......
end

8-2 IM 33G3C20-11E
8. Program Control Statements

8.2 “for” Statement

(1) for <variable>=<initial value> to <final value> [step <increment>]


......
next

(2) for <variable>=<initial value> to <final value> [step <increment>]


......
next@

<variable>: A numeric variable. Only local variables can be used.


<initial value>: Specifies the initial value of the variable using a numeric value.
<final value>: Specifies the final value of the variable using a numeric value.
<increment>: Specifies increments for the variable value using a positive or negative numeric value.
If omitted, 1 is assumed.

Figure 8.2 “for” Statements

A “for” statement repeats execution of the specified condition in a loop — with a delay
of one scan period imposed following every “for…next” loop process. The delay can be
cancelled using “next@” instead of “next” at the end of the statement — then the loop is
repeatedly executed without interruptions.
• The <variable> in the “for” statement is first set to the <initial value>. The state-
ments intervening between the “for” statement and the associated “next” statement are
run if the <increment> is positive and the <initial value> is less than or equal to the
<final value> or if the <increment> is negative and the <initial value> is greater than
or equal to the <final value>. The value of the <variable> is incremented or
decremented by the statement specified by the <increment> Next, the <variable> and
the <final value> are compared. If the sign of the difference remains unchanged since
the last comparison, control returns to the statement next to the “for” statement to
iterate the same operation. The <final value> and the <increment> are calculated
once before the starts of the iteration. The <final value> and the <increment> thus
calculated are used until control exits from the loop, instead of being recalculated for
each iteration.
• If the type of the initial value, increment, or final value is not the same as the type of
the variable, the former type is converted to the latter type before operation.
The “for” statement is not at all executed if the increment is positive and the initial
value is larger than the final value, or the increment is negative and the initial value is
smaller than the final value.
• If the increment value has a decimal point, the final value may not be executed
because of an error caused in the real-number operation.
• The “for” statement can have a nest construct. When a “for~next” loop is nested
inside another “for” statement, the “next” of the nested loop must associate with its
own “for,” or the nearest preceding “for.” Every “for” statement must be concluded
with a “next” of its own.
• Branching out of a “for” statement can be instructed using a “goto” statement in the
“for~next” loop, but branching into a “for” statement is not permitted, which instabili-
ties actions.

IM 33G3C20-11E 8-3
EXAMPLE:
Function to get SM by repeating the loop N-times:
integer function SUM(N)
integer N,I,SM
......
SM = 0
for I = 1 to N step 1
SM = SM + 1
next@
return SM
......
end
EXAMPLE:
Clearing data of local variable buffer IBUFF:
sebolblock example1
integer IBUFF[50]
integer i
......
for i = 1 to 50 ! Cleared in ascending order.
IBUFF[i] = 0
next@
......
......
for i = 50 to 1 step –1 ! Cleared in descending order.
IBUFF[i] = 0
next@
......
end

8-4 IM 33G3C20-11E
8. Program Control Statements

8.3 “while” Statement

(1) while (<expression>)


......
wend

(2) while (<expression>)


......
wend@

<expression>: A numeric expression that evaluates the condition.


<>0 ... True
0 ... False

Figure 8.3 “while” Statements

A “while” statement repeats execution of the specified condition in a loop if the expres-
sion in the statement is evaluated true. A delay of one scan period is imposed following
every “while…wend” loop process. The delay can be cancelled using “wend@” instead
of “wend” at the end of the statement — then the loop is repeatedly executed without
interruptions. The execution of the loop ends when the expression is evaluated false.
• If the initial evaluation of the expression is false, the “while” statement is not at all
executed.
• The “while” statement can have a nest construct. When a “while~wend” loop is
nested inside another “while” statement, the “wend” of the nested loop must associate
with its own “while,” or the nearest preceding “while.” Every “while” statement must
be concluded with a “wend” of its own.
• Branching out of a “while” statement can be instructed using a “goto” statement in
the “while~wend” loop, but branching into a “while” statement is not permitted.
EXAMPLE:
Function to add 1 to SM as long as N is larger than 0:
integer function SUM1(N)
integer N,SM
......
SM = 0
while (N>0)
SM = SM + 1
N = N – 1
wend@
return SM
......
end

IM 33G3C20-11E 8-5
EXAMPLE:
Terminating control when flow rate becomes abnormal before multiplication of FC001 is
completed:
sebolblock example
block BSETU-2 FC001
......
while (FC001.SUM < FC001.BSET)
if (FC001.ALRM <> ”NR”) then
[FC001.SW = 3]
%.BSTS = ”STOP” ! % is present block.
end if
wend
......
end

8-6 IM 33G3C20-11E
8. Program Control Statements

8.4 “repeat” Statement

(1) repeat (<expression>)


......
until

(2) repeat
......
until@ (<expression>)

<expression>: A numeric expression that evaluates the condition.


<>0 ... True
0 ... False

Figure 8.4 “repeat” Statements

A “repeat” statement repeats execution of the specified condition in a loop as long as the
expression in the statement is evaluated false. A delay of one scan period is imposed
following every “repeat~until” loop process. The delay can be cancelled using “until@”
instead of “until” at the end of the statement — then the loop is repeatedly executed
without interruptions. The loop condition is evaluated at the end of the loop and thus
the loop is executed at least once for the purpose of the evaluation. The execution of
the loop ends when the expression is evaluated true, and the control is passed to the next
line following “until.”
• The “repeat” statement can have a nest construct. When a “repeat~until” loop is
nested inside another “repeat” statement, the “until” of the nested loop must associate
with its own “until,” or the nearest preceding “until.” Every “repeat” statement must
be concluded with an “until” of its own.
• Branching out of a “repeat” statement can be instructed using a “goto” statement in
the “repeat~until” loop, but branching into a “repeat” statement is not permitted.
EXAMPLE:
Function to add N to SM until N exceeds 0:
integer function SUM2(N)
integer N,SM
......
SM = 0
repeat
SM = SM + 1
N = N – 1
until@ (N<=0)
return SM
......
end

IM 33G3C20-11E 8-7
EXAMPLE:
Terminating control when flow rate becomes abnormal before multiplication of FC002 is
completed:
sebolblock example
block BSETU-2 FC002
......
repeat
if (FC002.ALRM <> ”NR”) then
[FC002.SW = 3]
end if
until (FC002.SUM < FC002.BSET)
......
end

8-8 IM 33G3C20-11E
8. Program Control Statements

8.5 “wait until” Statement

wait until (<expression>) [;<error variable>]


[; time<wait time>[, error <label>[,<error identifier>]] ]
errorsub
error <label> [,<error identifier>
errorsub

<expression>: A numeric expression that evaluates the condition.


<>0 ... True
0 ... False
<wait time>: Specifies the maximum period of time for the check in seconds using
an integer constant or variable. If omitted, the check continues
infinitely until the condition is satisfied.
<error variable>: Specifies an integer local variable that takes error codes. 0 is
entered when the condition is satisfied.
<label>: Specifies the branching destination when the condition is not
satisfied or an error is caused.
<error identifier>: Specifies a constant or variable for the identification of the location
where an error is caused in the error-handling phase.

Figure 8.5 “wait until” Statement

A “wait until” statement checks the specified condition until the expression is the
statement is evaluated true. The check is executed just once in one scan period. The
control is passed to the next line when the expression is evaluated true.
• The time option specifies the maximum duration of the check. The <error label>,
<label>, and <error identifier> specify what action should be taken when the condi-
tion is false or when errors occur. If the time option is omitted, the system continues
to wait until the condition becomes true.
• “wait until” statement can not be used in the function referenced in the condition test
formula called by a “wait until” statement. Otherwise, error may occur. The function
referenced in the condition test formula called by a “wait until” statement subjects the
following constraints.
• “delay” and “delaycycle” statement can not be used. “drive” statement can not
direct to a function block in different station.
• “time” parameter can not be applied to “dialogue” or “compare” statement.

IM 33G3C20-11E 8-9
EXAMPLE:
Waiting 30 seconds for TIC001 PV to exceed 50:
sebolblock HEAT
block PID TIC001
......
TIC001.MODE = ”AUT”
TIC001.SV = 60.0
......
wait until (TIC001.PV > 50);time 30,error LBL1
......
exit
LBL1:
......
end
EXAMPLE:
Operating mixer MX1 for 60 seconds:
sebolblock KAKUHAN
block SIO-11 MX1
block TM TM001
#define START 2
#define STOP 0
......
drive [MX1 = START];errorsub DRVERR
......
TM001.PH = 60
TM001.OP = 2 ! Timer start.
wait until (TM001.ALRM == ”CTUP”)
TM001.OP = 1 ! Timer stop.
......
drive [MX1 = STOP];errorsub DRVERR
......
exit
......
DRVERR:
opeguide ”MIXER OPERATION ABNORMAL.”
KAKUHAN.BSTS = ”STOP”
......
end

8-10 IM 33G3C20-11E
8. Program Control Statements

8.6 “switch” Statement

switch (<expression>)
case <constant>[,<constant>…:
......
[case <constant>[,<constant>…]:
[otherwise:
......
]]
end switch

<expression>: An integer or character-string expression that evaluates the condition.


The data type must agree with the constants used in the “case” clause or clauses.
<constant>: An integer or character-string constant to be compared with the result of the
expression. The data type must agree with the expression.

Figure 8.6 “switch” Statement

A “switch” statement checks whether its expression satisfies one of the constants in the
“case” clause and then the control is branched according to the evaluation.
• The expression is calculated first and then the result is compared with constants of the
“case” clause when the “switch” statement is executed. If the result of the expression
equals one of the constants, the statement following the “case” clause is executed. If
the result does not equal any of the constants, the “otherwise” clause is executed. If
an “otherwise” clause is not present, none of statements placed between “switch” and
“end switch” are executed.
• When processing following a “case” or “otherwise” clause is completed, the control is
passed to the next line following “end switch.”
• Branching out of a “switch” statement can be instructed using a “goto” statement in
the “switch…end switch” construct, but branching into a “switch” statement is not
permitted.

IM 33G3C20-11E 8-11
EXAMPLE:
Branching according to local variable A:
integer function FUNC1 (A,MSG)
integer A,B
char*10 MSG
......
B = 0
switch(A)
case 0:
MSG = ”RUN”
case 1:
MSG = ”STOP”
B = 0
otherwise:
MSG = ”ERROR”
B = 1
end switch
......
return B
......
end

8-12 IM 33G3C20-11E
8. Program Control Statements

EXAMPLE:
Generating operator guide message according to error variable:
sebolblock KAKUHAN
block SIO-11 V01,P01,MX1
#define OPEN 2
#define START 2
integer ERR
char*12 MSG
......
drive [V01 = OPEN];errorsub DRVERR,1
......
drive [P01 = START];errorsub DRVERR,2
......
drive [MX1 = START];errorsub DRVERR,3
......
exit
......
DRVERR:
ERR = lerroid()
switch(ERR)
case 1:
MSG = ”VALVE”
case 2:
MSG = ”PUMP”
case 3:
MSG = ”MIXER”
otherwise:
MSG = ”SWITCH INSTRUMENT”
end switch
opeguide ”%a%s NOT OPERABLE.”,1,MSG
ereturn
end

IM 33G3C20-11E 8-13
8.7 “goto” Statement
goto <label>

<label>: Specifies the identifier for the destination of branching.

Figure 8.7 “goto” Statement

A “goto” statement executes unconditional branching to the line with the specified label.
• A compile error is caused if the specified label is not present in the program.
EXAMPLE:
Function of branching to NML and RTN:
function SUB(A,MSG)
integer A,B
char*10 MSG
......
if (A == 0) then
MSG = ”RUN”
goto NML
else if (A == 1) then
MSG = ”STOP”
goto NML
else
MSG = ”ERROR”
end if
B = 1
goto RTN
......
NML:
B = 0
RTN:
return B
......
end

8-14 IM 33G3C20-11E
8. Program Control Statements

EXAMPLE:
Branching to LBL1 when temperature controller TIC5 PV is less than 50.0:
sebolblock ONCHOU
block PID TIC5
block TM TM001
......
[TIC5.MODE.SV = ”AUT”,60.0]
[TM001.PH.OP = 90,2]
wait until (TM001.ALRM == ”CTUP”)
TM001.OP = 1
......
if (TIC5.PV < 50.0) goto LBL1
......
exit
......
LBL1:
opeguide ”%a LOW INTERNAL TEMPERATURE.”,3
%.BSTS = ”STOP” ! % is present block.
......
end

IM 33G3C20-11E 8-15
8.8 “delay” Statement
delay <delay period>

<delay period>: Specifies the period of time to be delayed in milli-seconds using an integer
real-number or variable.

Figure 8.8 “delay” Statement

A “delay” statement causes a delay in processing the program for a period of time
specified in milli-seconds. The precision of the delayed time is dependent on the basic
scan period.
EXAMPLE:
Delaying 200 seconds after setting FIC001 SV:
sebolblock sample6
block PID FIC001
......
FIC001.SV = 10
delay 200000
......
end
EXAMPLE:
Waiting until FIQC1 batch ends:
sebolblock SIKOMI
block BSETU-2 FIQC1
......
FIQC1.BSET = 100.0
[FIQC1.MODE.SV = ”AUT”,1]
delay 1000
wait until (FIQC1.ZONE == 7 or FIQC1.ZONE == 0)
......
end

8-16 IM 33G3C20-11E
8. Program Control Statements

8.9 “delaycycle” Statement

delaycycle [<number of cycles>]

<number of cycles>: Specifies the number of basic scan periods to be delayed using
an integer real-number or variable.

Figure 8.9 “delaycycle” Statement

A “delaycycle” statement causes a delay in processing the program as much as the


number of scan periods specified. If the specification is omitted, the delay is assumed to
be one basic scan period.
EXAMPLE:
Delaying as much as one basic scan period:
sebolblock sample2
block PID FIC003
......
FIC003.SV = 30.0
delaycycle
......
end
EXAMPLE:
Waiting until FIQC1 batch ends:
sebolblock SIKOMI
block BSETU-2 FIQC1
......
FIQC1.BSET = 200.0
[FIQC1.MODE.SV = ”AUT”,1]
delaycycle
wait until (FIQC1.ZONE == 7 or FIQC1.ZONE == 0)
......
end

IM 33G3C20-11E 8-17
9. Message Statements

9. Message Statements
SEBOL uses eight statements that control the generation of messages, which are
outlined below and described in detail later in this chapter.

(1) “opeguide” statement


Used to output an operator guide message. The message is specified using a string of
characters or the message element number.

(2) “dialogue” statement


Used to permit the use of a dialogue window using the operation and monitoring
function.

(3) “message” statement


Used to print a sequence message that is specified by an optional character string or by a
printout message element number and stores it in a historical file.

(4) “history” statement


Used to store the sequence message that is specified by an optional character string or
by a printout message element number in a historical file.

(5) “request” statement


Used to output various sequence messages by element number.

(6) “sysalarm” statement


Used to generate optional character strings to report the occurrence of a system alarm
and recovery therefrom.

(7) “prcsalarm” statement


Used to generate or recover from process alarms in an SFC/SEBOL block.

IM 33G3C20-11E 9-1
Message statements are expressed as shown in Table 9.1.

Table 9.1 Message Statements

Default Color %a Color Spec. (*2) Line Return (“\n”) (*3)


Statement Specification Size
(*1) Display Printout Display Printout

Character string (*11) 128 bytes max (*4) Effective (*10) Effective Effective
“opeguide” White
Element number Fixed (*7) … … … …

Character string (*11) 192 bytes max (*5) Effective (*10) Effective Effective
“dialogue” White
Element number Fixed (*7) … … … …

Character string (*11) 128 bytes max … (*10) … Effective


“message” (Not displayed)
Element number Fixed (*7) … … … …

Character string (*11) 128 bytes max … … (Not


“history” (Not displayed) (Not printed)
printed)
Element number Fixed (*7) … …

“request” Element number Fixed (*7) (Not displayed) … … … …

“sysalarm” Character string (*11) 128 bytes max (*8) White Effective (*6) (*10) Effective Effective

“prcsalarm” Character string (*9) 8 bytes max White Not allowed (*9) (*6) (*10) … …

(*1): Color of the message character string appearing onscreen.


(*2): Specified with a format character string.
(*3): Specified with a format character string. Using a line feed code (“\n”) allows character strings to be
line-fed when they display and print.
(*4): The color specification of %a requires 6 bytes per color, with 1 byte needed to effect a line feed. The
total byte length of the character string as formatted, including these bytes, may not exceed 128 bytes.
The character string can be displayed in a length up to 70 bytes per line onscreen, excluding the escape
sequence %a.
(*5): The character string can be displayed in a length up to 70 bytes per line onscreen and on up to seven
lines in the dialog window. The color specification of %a requires 6 bytes per color, with 1 byte needed
to effect a line feed. The total byte length of the character string as formatted, including these bytes,
may not exceed 192 bytes.
(*6): If the printer can print in red and black, alarms print in red when they occur and in black when they are
cleared, regardless of the specification of %a.
(*7): Element number.
(*8): The color specification of %a requires 6 bytes per color, with 1 byte needed to effect a line feed. The
total byte length of the character string as formatted, including these bytes, may not exceed 128 bytes.
Up to 76 bytes can be displayed per line onscreen, excluding the escape sequence %a. Up to 58 bytes
can be displayed in a message window.
(*9): Process alarm character string defined with the builder.
(*10): When the specification of %a is enabled or not depends on the print type.
(*11): The horizontal tab character (\t) cannot be used.

Table 9.2 Range of Element Numbers

Statement Symbol Element Number


“opeguide” 1 to 9999 (“nnnn” in “%OGnnnn”)
“dialogue” OG
“message” PR 1 to 9999 (“nnnn” in “%PRnnnn”)
“history” PR
VM 1 to 100 (“nnnn” in “%VMnnnn”)
“request” RQ 1 to 200 (“nnnn” in “%RQnnnn”)
M3 1 to 9999 (“nnnn” in “%M3nnnn”)
CP 1 to 9999 (“nnnn” in “%CPnnnn”)

• The message statements other than “snapshot” are transmitted to the control station at
which the SFC/SEBOL block that has executed them and to all the operation and
monitoring functions in the same operation group. To which operation and monitor-
ing station in the system the messages are output is determined to the builder defini-
tion.

See the following pages for details of each message statement and the formatting string.

9-2 IM 33G3C20-11E
9. Message Statements

9.1 “opeguide” Statement


An “opeguide” statement specifies a character string using characters or a message
element number and outputs the string as an operator guide message.

opeguide <formatting string>[,<output data>…]


OG, <element number>

<formatting string>: See 9.8 for details.


<output data>: Specifies up to eight integer expressions or character strings to be output.
<element number>: Specifies the message element number (“nnnn” in “%OGnnnn”) using
an integer expression (1 through 9999).

Figure 9.1 “opeguide” Statement

• The message of a specified character string can be displayed in a color other than the
default white using the “%a” specification in the formatting statement. (See 9.9 for
details.)
• Up to 70 bytes can be displayed in one line in the operator guide panel and any
excessive bytes are shown in the second line. Up to 128 bytes can be printed or
stored in the historical file.
• If a color other than the default white is specified, which uses 6 bytes, the information
is not included in the number of bytes displayed, but it is included in the number of
bytes printed or stored.
• To which operation and monitoring station in the system the message is sent is
determined according to the operation group definition.
EXAMPLE:
Message output using formatting statement:
sebolblock example1
#define WHITE 7
#define GREEN 2
integer temp ! Local variable to maintain temperature.
......
* Displaying the temperature part in green and the rest in white.
opeguide ”CURRENT TEMPERATURE IS
%a%d%a DEGREES.”,GREEN,temp,WHITE
......
end
EXAMPLE:
Outputting %OG0001 of present control station:
sebolblock example2
......
opeguide OG,1
......
end

IM 33G3C20-11E 9-3
9.2 “dialogue” Statement
A “dialogue” statement specifies an interactive operation using a dialogue window of the
operation and monitoring function. The statement takes different forms according to the
three message types as shown in Figure 9.2.

● For data entry operation:

dialogue [<dialogue name>]; <formatting string>[,<output data>…]


OG, <element number>

; <prompt string> ,<input variable> [;<error variable>]

[; time<wait time>[, error <label>[,<error identifier>]] ]


errorsub
error <label> [;<error identifier>
errorsub

● For acknowledgement operation:

dialogue [<dialogue name>]; <formatting string>[,<output data>…]


OG, <element number>

; confirm [;<error variable>]

[; time<wait time>[, error <label>[,<error identifier>]] ]


errorsub
error <label> [;<error identifier>
errorsub

● For reentry operation:


dialogue [<retry string> ;retry, <input variable> [;<error variable>]

[; time<wait time>[, error <label>[,<error identifier>]] ]


errorsub
error <label> [;<error identifier>
errorsub

<dialogue name>: Specifies a dialogue name using a character constant or variable of up to 8 bytes
— eight asterisks are entered if omitted.
<formatting string>: See 9.8 for details.
<output data>: Specifies up to eight integer expressions or character strings to be output.
<element number>: Specifies the message element number (“nnnn” in “%OGnnnn”) using an integer
expression (1 through 9999).
<prompt string>: Specifies an input prompting message using a character constant or variable of
up to 32 bytes.
<retry string>: Specifies a reentry prompting message using a character constant or variable of
up to 32 bytes.
<input variable>: Specifies a local variable to which entered data are stored using an integer, or
characters of up to 32 bytes.
<wait time>: Specifies a maximum waiting period in seconds using an integer constant or
local variable.
<error variable>: Specifies a local variable that takes error codes. 0 is entered when no error is
caused.
<label>: Specifies the branching destination when an error is caused.
<error identifier>: Specifies a constant or local variable for the identification of the location where
an error is caused in the error-handling phase.

Figure 9.2 “dialogue” Statements

9-4 IM 33G3C20-11E
9. Message Statements

• The data-entry “dialogue” statement calls the dialogue window and permits the
operator an entry operation when he touches the dialogue softkey in the window. The
SFC/SEBOL block suspends processing until the operator makes an entry and it is
assigned to the input variable in the “dialogue” statement — then the block exits the
statement to resume execution with the next line.
• The acknowledgement “dialogue” statement permits the operator to make an
acknowledgement using the “confirm” softkey.
• The reentry “dialogue” statement makes effective again the message the SFC/SEBOL
block previously generated on the operator guide panel. The reentry message can be
printed and is stored in the historical file.
• When the dialog message is a reentry type interactive message, the input variable of
the reentry type dialogue statement must also be numeric if the input variable of the
last executed reentry type dialogue statement is numeric, or it must be a character
string if the input variable of the last executed reentry type dialogue statement is a
character string. Mismatched input variable types would cause a runtime error to
occur during execution of a reentry type dialogue statement.
• The dialogue name is displayed on the tuning and other panels of the SFC/SEBOL
block.
• For data entry type and confirmation operation type interactive messages, the operator
guide message in any character string or with any element number displays in the
interactive message panel. Any character string can be displayed in a length up to 70
bytes per line onscreen and on up to seven lines in the dialog window. The length of
the character string may not exceed 192 bytes. The prompt character string is neither
stored in the historical file nor printed.
• When specifying “wait time,” it is necessary to consider the case of when all opera-
tion and monitoring stations in the operation group of the control station are not being
operated. The specification may be omitted to effect infinite waiting, or should be
ample enough to take up the time required for the startup of an operation and moni-
toring station. (An error is caused when the specified time period is up.)
• When the error identifier is specified, the identifier can be referenced using a built-in
function in the error-handling phase. Available built-in functions are integer-type
“lerrorid(),” real number-type “derrorid(),” and character-type “cerrorid().” See
Chapter 10 for the detail of error-handling.
• To which operation and monitoring station in the system the message is sent is
determined according to the operation group definition. That is that the message is
transmitted to all operation and monitoring stations that belong to the same operation
group as the control station executing the SFC/SEBOL block.

IM 33G3C20-11E 9-5
EXAMPLE 1:
Data-entry and reentry diaglogues:
sebolblock example2
block PID FIC001
long setvalue
......
dialogue ”MSG001”;”ENTER SETPOINT.”\
;”SETPOINT=”,setvalue;time 120,error LBL2
while (setvalue<50 or setvalue>100)
dialogue ”RANGE ERROR. REENTER.”\
;retry setvalue;time 120,error LBL2
wend
......
FIC001.SV = setvalue ! Assigning entered value to SV.
......
exit
......
LBL2:
* Error-processing defined for no entry.
end
In the above example, the message “ENTER SETPOINT.” is output to the message
panel and window. And if the data entered in the window is out of the 50-100 range,
the message “RANGE ERROR. REENTER.” is output.
EXAMPLE 2:
Acknowledgement dialogue:
sebolblock example3
......
dialogue ”MSG002”;”CATALYST CHARGED?”\
;confirm;time 120;error LBL2
......
exit
......
LBL2:
* Error-processing defined for no acknowledgement.
end
In the above example, the processing is suspended until the “confirm” softkey is pressed
in response to the message “CATALYST CHARGED?”.

9-6 IM 33G3C20-11E
9. Message Statements

9.3 “message” Statement

message <formatting string>[,<output data>…]


PR, <element number>[,<parameter>]

<formatting string>: See 9.8 for details.


<output data>: Specifies up to eight integer expressions or character strings to be output.
<element number>: Specifies the message element number (“nnnn” in “%PRnnnn”) using an
integer expression (1 through 9999).
<parameter>: Specifies a parameter using an integer (0 through 65535).

Figure 9.3 “message” Statement

A “message” statement specifies a sequence message string to be printed and stored in


the historical file using a character string or message element number.
• When the message is a character string, the size after formatting that can be printed
and stored in the historical file is up to 128 bytes.
• When the message is specified using the element number, up to three units of builder-
specified process data are added to the message.
• A parameter can be specified for the element number-specified message. The
specified-parameter value can be output as the first data if the first one of the three
process data is not specified by the builder — the parameter value is not output if the
first process data is builder-specified. If the first data is not specified by the builder
nor the parameter, the data assumes zero. An error is caused when the parameter is
specified out of the 0~65535 range.
• To which operation and monitoring station in the system the message is sent is
determined according to the operation group definition.
EXAMPLE:
Character-string message used formatting string:
sebolblock example4
......
message “VALVE IS ABNORMAL.”
......
end
In the above example, the sequence message “VALVE IS ABNORMAL.” is output.
EXAMPLE:
Element number-specified message:
sebolblock example2
......
message PR,3
......
end

IM 33G3C20-11E 9-7
9.4 “history” Statement

history <formatting string>[,<output data>…]


PR, <element number>[,<parameter>]

<formatting string>: See 9.8 for details.


<output data>: Specifies up to eight integer expressions or character strings to be output.
<element number>: Specifies the message element number (“nnnn” in “%PRnnnn”) using an
integer expression (1 through 9999).
<parameter>: Specifies a parameter using an integer (0 through 65535).

Figure 9.4 “history” Statement

A “history” statement specifies a sequence message to be stored in the historical file


using a character string or message element number. The message cannot be printed —
which is the only difference between this statement and the “message” statement.
• When the message is a character string, the size after formatting that can be stored in
the historical file is up to 128 bytes.
• When the message is specified using the element number, up to three units of builder-
specified process data are added to the message.
• A parameter can be specified for the element number-specified message. The
specified-parameter value can be output as the first data if the first one of the three
process data is not specified by the builder — the parameter value is not output if the
first process data is builder-specified. If the first data is not specified by the builder
nor the parameter, the data assumes zero. An error is caused when the parameter is
specified out of the 0-65535 range.
• To which operation and monitoring station in the system the message is sent is
determined according to the operation group definition.
EXAMPLE:
Character-string message used formatting string:
sebolblock example4
......
history “PUMP IS ABNORMAL.”
......
end
In the above example, the sequence message “PUMP IS ABNORMAL.” is output for
storage in the historical file.
EXAMPLE:
Element number-specified message:
sebolblock example2
......
history PR,5
......
end

9-8 IM 33G3C20-11E
9. Message Statements

9.5 “request” Statement


A “request” statement specifies a sequence message to be output using its type and
element number.

request <message type>,<element number>

<message type>: Specifies the type of the output message

<element number>: Specifies the message element number using an integer

Figure 9.5 “request” Statement

Table 9.3 Message Types & Element Numbers

Type Description Element Number


VM Voice message 1 to 100 (“nnnn” in “%VMnnnn”)
RQ Request message 1 to 200 (“nnnn” in “%RQnnnn”)
Supervisory computer event message for
M3 1 to 9999 (“nnnn” in “%M3nnnn”)
operation and monitoring function program
Supervisory computer event message for
CP 1 to 9999 (“nnnn” in “%CPnnnn”)
computer program

• The destination of the message transmission is determined according to the operation


group definition.
EXAMPLE:
Voice message:
sebolblock example5
......
request VM,3
......
end

IM 33G3C20-11E 9-9
9.6 “sysalarm” Statement
A “sysalarm” statement specifies system-alarm message strings to be generated for the
present station when an alarm has occurred in the system and when the normal condition
is recovered.

• Message generated when an alarm has occurred:


sysalarm <formatting string>[,<output value>…]

• Message generated when the normal condition is recovered:


sysalarm recover <formatting string>[,<output value>…]

<formatting string>: See 9.8 for details.


<output data>: Specifies up to eight numeric expressions or character strings to be output.

Figure 9.6 “sysalarm” Statement

• The message mark in the system alarm message panel changes to red when the alarm
message is generated and green when the recovery message is generated.
• Up to 76 bytes can be displayed in one line in the system alarm message panel and
any excessive bytes are shown in the second line. In the message window, however,
only up to 58 bytes can be displayed. Up to 128 bytes can be printed or stored in the
historical file.
• The destination of the message transmission is determined according to the operation
group definition.
EXAMPLE:
Outputting system alarm and recover messages:
sebolblock example5
block PVI T100
......
if (T100.ALRM == ”IOP”) then
sysalarm ”T100 THERMOMETER IS OUT OF ORDER.”
end if
......
if (T100.ALRM <> ”IOP”) then
sysalarm recover ”T100 THERMOMETER NORMALIZED.”
end if
......
end
In this example, the message ”T100 THERMOMETER OUT OF ORDER.” is generated
when the status of T100 has changed to IOP and the message ”T100 THERMOMETER
NORMALIZED.” when the normal condition is recovered.

9-10 IM 33G3C20-11E
9. Message Statements

9.7 “prcsalarm” Statement


A “prcsalarm” statement specifies process-alarm message strings to be generated for the
SFC/SEBOL block, which executes the “prcsalarm” statement, when a process alarm has
occurred and when the normal condition is recovered.

• Message generated when an alarm has occurred:


prcsalarm <alarm status string>

• Message generated when the normal condition is recovered:


prcsalarm recover [<alarm status string>]

<alarm status string>: Specifies a character string to be generated using a constant or variable.
The string can use up to 8 bytes.

Figure 9.7 “prcsalarm” Statement

• The “prcsalarm” statement outputs a process alarm occurrence message in the <alarm
status character string> specified, with an alarm in the alarm status (data item ALRM)
occurring. No process alarm occurrence message is output if the alarm already exists.
• The “prcsalarm” statement with recover specified outputs a process alarm recovery
message in the <alarm status character string> specified, with an alarm in the alarm
status (data item ALRM) being cleared. No process alarm recovery message is output
if the alarm does not exist. If an alarm status character string is not specified, all the
alarms existing in the SFC/SEBOL block are cleared, with a process alarm recovery
message being output for each alarm cleared. When all the alarms existing in the
SFC/SEBOL block are cleared by executing the recovery specification of the
“prcsalarm” statement, a process alarm clear message with the alarm status name NR
is output.
• An <alarm status character string> is a user-defined character string defined with the
builder. Up to 23 alarm status character strings can be defined, each consisting of a
user-defined character string of NR (normal status NoRmal).
• Users can define one alarm status character string for use in SEBOL blocks (*1) and
specify one alarm status character string for use in the SFC blocks (*2) for each
model name involved. A runtime error would occur if an alarm status character string
not defined with the builder is specified as a parameter of the “prcsalarm” statement.
*1: SEBOL block alarm status character strings are defined at USER10.
*2: SFC block alarm status character strings are default-set at USER10.

• Process alarm occurrence and clear messages occurring in SEBOL blocks have the
value of the data item LINE, as of the time of their occurrence, appended to them as
data (*3). Those occurring in SFC blocks have the value of the data item STEPNO,
as of the time of their occurrence, appended to them as data.
*3: When repeated warning alarm messages occur, the value of the data item LINE or STEPNO, as of the
time of their occurrence, is appended to them, not the line or step number in which the “prcsalarm”
statement is executed.

IM 33G3C20-11E 9-11
• Each SFC/SEBOL block can output only one process alarm message in one basic
scan period. If an attempt is made to output two process alarm messages in one basic
scan period, the SFC/SEBOL block would be delayed by one period. The second
“prcsalarm” (or “prcsalarm recover”) statement is executed in the next scan period.
• Each time an SFC/SEBOL block is run, the alarm status ALRM is reset to NR. Any
process alarm left over from the last run of the SFC/SEBOL block is cleared by the
system with a process alarm clear message being output.
• A repeated warning alarm message can be output according to the builder definition
when SFC/SEBOL blocks are kept running for longer than a predetermined period of
time without running a “prcsalarm recover” statement to clear the process alarm
message output by a “prcsalarm” statement. Only SFC/SEBOL blocks in the running
state (block status RUN or PAUS) are subject to repeated warning alarm message
output. No repeated warning alarm message is output even if the SFC/SEBOL block
stops running (block status STOP or ABRT) without clearing the existing process
alarm message. SFC/SEBOL blocks are similar to other function blocks except that
they are subject to repeated warning alarm message output while in the running state.
• SFC/SEBOL blocks have the data items, AF (alarm detection specification) and
AOFS (alarm masking specification). The process alarm messages that are output by
the “prcsalarm” statement are governed by the specification of these two data items.
Figures 9.8 and 9.9 show the flows of generating and clearing process alarms in SFC/
SEBOL blocks, respectively.
• SFC/SEBOL blocks have the data item, AFLS (alarm flashing status). Since the
correspondence between the alarm flashing action of SFC/SEBOL blocks and alarm
flashing status in the implementation of the operation and monitoring functions, refer
to FCS Field Control Station Function Manual (IM 33G3C10-11E) for a description
of alarm handling. For more details on alarms occurring in SFC/SEBOL blocks, refer
to SFC Block Function Manual (IM 33G3C31-11E) and SEBOL Block Function
Manual (IM 33G3C21-11E). For how to reference and alter alarm data items, see
Section 7.5, “Alarm Statuses.”

9-12 IM 33G3C20-11E
9. Message Statements

“prcsalarm” statement executed

Yes
Alarm detection group by-pass
specified (AF)

No

No
Alarm group suppression
specified (AOFS)

Yes

Alarm flashing suppressed (AFLS)

Yes
Alarm has occurred

No

Alarm message is output

End

Figure 9.8 Process Alarm Message Generation

IM 33G3C20-11E 9-13
“prcsalarm recover” statement executed

Yes
Alarm detection group by-pass
specified (AF)

No

No
Alarm group suppression
specified (AOFS)

Yes

Alarm flashing suppressed (AFLS)

No
Alarm has occurred

Yes

Alarm is reset

No
Alarm is cleared

Yes

Alarm recovery message is output (NR)

End

Figure 9.9 Process Alarm Recovery Message Generation

9-14 IM 33G3C20-11E
9. Message Statements

EXAMPLE:
Output of one process-alarm and recovery messages:
sebolblock example1
......
* No alarm is assumed at this moment.
prcsalarm “HIGH” ! Output of alarm message “HIGH.”
......
prcsalarm recover “HIGH” ! Output of two messages informing
! alarm recovery and normalization (NR).
......
end
EXAMPLE:
Output of two process-alarm and recovery messages:
sebolblock example2
......
* No alarm is assumed at this moment.
prcsalarm “HIGH” ! Output of alarm message “HIGH.”
prcsalarm “LOW” ! Output of alarm message “LOW.”
......
prcsalarm recover ! Output of three messages informing alarm (HIGH
! and LOW) recovery and normalization (NR).
......
end

IM 33G3C20-11E 9-15
9.8 Formatting String
Messages specified for formatting in their statements are formatted as described below
before being output. The formatted messages have two major types:
1. Formatted and output in an ordinary character string.
2. Formatted and output with output values converted. The converted message starts
with “%” and ends with a conversion character as shown below — specifying “%%”
outputs “%”:

%[<flag character>][<field minimum width][.<precision>]<conversion character>

Figure 9.10.
(1) Flag Character (omittable)
–: Closes up the converted result to the left.
+: Attaches a sign to the numeric result.

(2) Field Minimum Width (omittable)


The minimum width of the field is specified using a decimal string. If the converted
value is a character string shorter than the specified width, padding characters are added
to the left of the string — null characters are entered if the width specification does not
start with 0 or zeros are entered if the specification begins with 0.

(3) Precision (omittable)


The maximum number of characters or that of decimal fraction places to the right of the
decimal point that is to be output is specified.

(4) Conversion Characters


“a” Receives the output value as a color code and converts the code to an escape
sequence. The escape sequence is incorporated in the output message string,
reconverted to the color code, and changes the color of the message when displayed.
Colors and their code numbers are as follows:
0: black 8: steel blue
1: red 9: pink
2: green 10: bluish green
3: yellow 11: golden yellow
4: blue 12: moss green
5: magenta 13: purple
6: cyan 14: cyan-blue
7: white 15: grey
“d” Converts the output value to a decimal numeral. Precision is specified using the
minimum number of output digits — 1 is assumed when omitted.
“e” Receives the output value as a float- or double-type data and converts it to a decimal
numeral in the form of [–]m.nnnnnnE[±]xx (1 decimal digit and the number of
decimal fraction places specified by “precision” — six places when omitted).
“f” Receives the output value as a float- or double-type data and converts it to a decimal
numeral in the form of [–]mmm.nnnn (6 decimal fraction places when “precision” is
not specified).

9-16 IM 33G3C20-11E
9. Message Statements

“g” Uses the “e” or “f” format for output. The “e” format is used when the exponent
resulted in the “e” format conversion is less than –4 or larger than the specified
precision. A decimal point is not attached unless it is followed by a numeral.
Invalid leading zeros are not output.
“o” Converts the output value to an octal numeral. Precision is specified using the
minimum number of output digits — 1 is assumed when omitted.
“s” Receives the output value as a character string and outputs all characters in the
string or as many characters as specified by “precision.”
“x” Converts the output value to a lowercase hexadecimal numeral without sign and “$.”
Precision is specified using the minimum number of output digits — 1 is assumed
when omitted.
“X”Converts the output value to a uppercase hexadecimal numeral without sign and “$.”
Precision is specified using the minimum number of output digits — 1 is assumed
when omitted.
EXAMPLE:
Converting 14-character string “YOKOGAWA SEBOL” using “%s” (output range is
identified using a pair of colons):
:%s: :YOKOGAWA SEBOL:
:%10s: :YOKOGAWA SEBOL:
:%.10s: :YOKOGAWA S:
:%–10s: :YOKOGAWA SEBOL:
:%20s: : YOKOGAWA SEBOL:
:%.20s: :YOKOGAWA SEBOL:
:%–20s: :YOKOGAWA SEBOL :
:%20.10s: : YOKOGAWA S:
:%–20.10s: :YOKOGAWA S :

IM 33G3C20-11E 9-17
9.8.1 “format” Statement
A “format” statement is used to format a character string and store the formatted string
to a local value.

format <formatting string>[,<data>…];<storage variable>

<formatting string>: See the preceding section 9.8 for details.


<data>: Specifies up to eight numeric expressions or character strings for the data
to be formatted.
<storage variable>: Specifies a character string-type local variable to store the formatted
character string.

Figure 9.11 “format” Statement

EXAMPLE:
Formatting a date and time string:
sebolblock sample
integer year,mon,day
integer hour,min,sec
char*80 str
......
getdate(year,mon,day) ! Built-in function to get date.
gettime(hour,min,sec) ! Built-in function to get time.
......
format ”%2d :%2d :%2d (%02d :%02d :%02d )”,
year,mon,day,hour,min,sec;str
......
end

When this sample program is executed, the variable “str” is assigned with a character
string stating the date and time ”95 : 3 :14 (08 :12 :07 )”, for example.
Because the date conversion is specified as “%2d,” one-digit data is added with a
leading null character making it two-digit. For the time conversion, which is specified
as “%02d,” one-digit data is added with a leading zero.

9-18 IM 33G3C20-11E
9. Message Statements

9.9 Message Restrictions


The number of messages that can be output using message statements is restricted as
follows:
(1) One SFC/SEBOL block can output up to three messages in each basic scan period.
(2) All SFC/SEBOL blocks in one control area can output up to 30 messages in each
basic scan period.
• When the total number of the message statement-generated messages and SEBOL
error messages reaches either one of the above restrictions in one basic scan period,
the SFC/SEBOL block will be delayed one scan period and any additional message
statements will be executed in the next scan period; as to the SFC/SEBOL block that
has output an error message for a continuable error, the block will also be delayed
one scan period but the error message is output in the current scan period.
• The messages subject to the restrictions and the actions of SFC/SEBOL block when
there are additional messages are shown in Table 9.4.

Table 9.4 Message Restriction & Block Action

Message Output Block Action

“opeguide” statement
“dialogue” statement
“message” statement
“history” statement
“request” statement
“sysalarm” statement The SFC/SEBOL block is delayed one scan period if the
“sysalarm recover” statement output of a message is attempted exceeding the restriction
“prcsalarm” statement (*1) and the message will be output in the next scan period.
“prcsalarm recover” statement (*1)
unit prscalarm statement (*3)
unit prscalarm recover statement (*3)
urload (built-in function) (*4)
urassign (built-in function) (*4)
rpreserve (built-in function) (*5)

Error messages are output in the basic scan period in which


the errors have been detected. If the error permits the
SEBOL error message continuation of execution and the number of error messages
exceeds the restrictions the SFC/SEBOL block will be
delayed one scan period before continuing execution. (*2)

*1: There is an additional restriction for process alarms that only one process alarm can be output in one scan
period.
*2: If the error does not permit the continuation of execution, the system forcibly terminates the SFC/SEBOL
block. See 10.3, Classified Error Codes, for details. 2.
*3: In addition to this restriction, only one unit process alarm can be output in one cycle of the scan period.
*4: The results of manipulation of unit recipes by urload and urassign are posted to the operation and
monitoring functions as messages.
*5: The recipe setup request by rpreserve is sent to the operation and monitoring function as a message.

IM 33G3C20-11E 9-19
Limitations that apply where CPU time is exclusively allocated as with a “nopreempt”
statement (see Chapter 12, “Allocating CPU Time”) are summarized below. CPU time
is exclusively allocated on the following three occasions:

• Between “nopreempt begin” and “nopreempt end” (See Chapter 12, “Allocating CPU
Time.”)
• SEBOL one-shot execution step in an SFC block (Refer to SFC Block Function
Manual (IM 33G3C31-11E).)
• Status change preprocessing in an SFC block (Refer to SFC Block Function Manual
(IM 33G3C31-11E).)

Messages that can be output while CPU time is exclusively allocated are subject to the
following limitations:
(A) A total of up to three messages can be output with the “opeguide” statement,
“message” statement, “history” statement, “request” statement, “sysalarm” state-
ment, and “sysalarm recover” statement. An attempt to output a fourth message
would cause a runtime error to occur (*1). If CPU time is exclusively allocated
with a “nopreempt” statement or to a SEBOL one-shot execution step, the fourth
message is output in the next period. In status change preprocessing, the fourth
message would be abandoned.
(B) An attempt to execute a “dialogue” statement would cause a runtime error to occur
(*1). If CPU time is exclusively allocated with a “nopreempt” statement or to a
SEBOL one-shot execution step, the “dialogue” statement is executed next time
CPU time has been allocated. In status change preprocessing, the dialog message
would be abandoned.
(C) Only one message can be output with a “prcsalarm” or “prcsalarm recover”
statement while CPU time is exclusively allocated with a “nopreempt” statement or
to a SEBOL one-shot execution step. An attempt to output a second message
would cause a runtime error to occur (*1). The second message is output in the
next period.
(D) The “prcsalarm” statement and “prcsalarm recover” statement cannot be executed in
status change preprocessing. An attempt to execute these statements would cause a
runtime error to occur, with the message being abandoned.

The relationship between limitation (A) and limitations (1) and (2) that apply where
CPU time is not exclusively allocated is explained below. The up to three messages that
can be output while CPU time is exclusively allocated do not include messages that may
have been output prior to the exclusive allocation of CPU time in the same control
period, though the messages that are output during the exclusive allocation of CPU time
are included as part of the messages mentioned in (1) and (2).
The SFC/SEBOL block would be delayed by one period if the total number of messages
output (including those output prior to the exclusive allocation of CPU time) exceeds
limitation (1) or (2) when the exclusive allocation of CPU time with a “nopreempt”
statement or to a SEBOL one-shot execution step is canceled, but not after status change
preprocessing.

9-20 IM 33G3C20-11E
9. Message Statements

Regarding limitation (C), if the SFC/SEBOL block has already executed a “prcsalarm”
or “prcsalarm recover” statement in the same period when it starts running with CPU
time exclusively allocated, that is, on executing a “nopreempt” statement or on starting
the execution of a SEBOL one-shot execution step, it would be delayed by one period,
so it would execute the operation to which CPU time is exclusively allocated in the next
period.

*1 Even though error/errorsub or common error handling routines are specified, a SEBOL error message is
output without branching control to these routines.

IM 33G3C20-11E 9-21
10. Error Processing

10. Error Processing


A program that has been compiled and is supposed to be free of errors may still cause
errors when it is executed. An error in the logic, for example, can cause operation
overflows, operation errors, or array subscript errors. Or an error can be caused when
accessing another station if it is not turned on or its CPU is not operating.
This chapter explains the action of a SEBOL program when an error is caused during
execution and the description of error processing. There are two types of error process-
ing description:
(a) Description of error processing for each statement that involves input/output or
communication, such as “drive” and “dialogue” statements.
(b) Description of error processing for errors, such as operation overflows, using
common error processing definition.
If an error is caused in a statement that has no error-processing instruction or common
error-processing definition, the system outputs the SEBOL error message as a system
alarm — the execution of the program will then continue or stop depending on the
nature of the error. See 10.3, Classified Error Codes, for more information.

10.1 Individual Statement Error-Processing Description


For statements that involve input/output or communication, such as “drive” and “dia-
logue” statements, error processing can be described for each statement either to check
the error variable or specify a branching destination.
The checking of the error variable can be used when error processing must be described
for every line of a statement. The specification of a branching destination can be used
when applying the same error-processing instruction to a number of lines.
The statements for which error processing can be described for each statement are listed
in Table 10.1.

Table 10.1 Error Processing-Describable Statements

Statement Operation
[] Group assignment.
drive Changes output status of motor and switch instruments
compare Group comparison.
seqtable Operates sequence tables.
logicchart Operates logic charts.
wait until Holds operation until condition is satisfied.
dialogue Controls interactive operation.
signal Outputs signals.
qsigcancel Cancels queing signals.
qsigmove Shifts queing signals.
semlock Locks semaphores.
semunlock Unlocks semaphores.
wait for qsignal Waits for reception of a queued signal.

IM 33G3C20-11E 10-1
10.1.1 Error Variable
The checking of the error variable is recommended if each line of the statement requires
different error processing.
When an error variable is specified, it is set to 0 if the statement ends normally or to an
error code if the statement abnormally. If the detailed code is 0, a classified error code
is set in the error variable;: if the detailed code is not 0, it is set in the error variable.
For more information on the classified error codes, detailed codes, and whether detailed
codes are available or not, see Appendix 1, “Error Codes.”
If an error variable is specified, no error message is output even when a runtime error
occurs. (An error message would be output, however, if fatal errors occur.) An error
message is output if an error, such as an array subscript out of limits occurs when an
error code is set in the error variable.
The syntax of the error-processing instruction is shown in Figure 10.1 (note that the
semicolon in front of the error variable is not entered in the function block group
statement).

[;<error variable>][; error <label>,[<error identifier>]]


errorsub

Figure 10.1 Syntax of Error-Processing Instruction

• The error variable must be an integer- or long-type local variable. Function block
data cannot be used.
• The error identifier must be a constant or local variable.

10-2 IM 33G3C20-11E
10. Error Processing

EXAMPLE 1:
Error processing specified for “drive” statements:
sebolblock example1
#define OPEN 2
block SIO-22 SWITCH01,SWITCH02,SWITCH03
integer errval
......
drive [SWITCH01 = OPEN] errval ! Error variable.
if (errval <> 0) then
* - - - Error processing description - - -
endif
......
drive [SWITCH02 = OPEN];error ERR000,2 ! Branching.
......
drive [SWITCH03 = OPEN];errorsub ERR010,3 ! Branching.
......
exit
......
ERR000: ! - - - Branching destination. - - -
message ”drive error:line=%d %d-%x ID=%d\n”,\
err1(), errc(), errce(), lerrorid()
exit -1
......
ERR010: ! - - - Branching destination. - - -
message ”drive error:line=%d %d-%x ID=%d\n”,\
err1(), errc(), errce(), lerrorid()
ereturn
end
In the above example, zero or an error code is returned to the error variable in the first
“drive” statement, the returned value is checked using the following “if” statement, and
then in the case of an error the instruction to process the error can be written.
The error variable can also be used to ignore errors — that is, errors are ignored if the
value of the variable is not checked after a value is returned. It is not desirable to ignore
errors, however, it may be useful when using a “semunlock” statement to securely keep
the semaphore unlocked in a program involving a semaphore operation.
EXAMPLE 2:
Ignoring errors:
sebolblock example2
integer junk
......
* Conditionally locking SEMNAME.
......
semunlock ”SEMNAME” junk
* Unconditionally unlocking SEMNAME and unchecking error variable.
......
end

IM 33G3C20-11E 10-3
10.1.2 Branching Destination
When a common error-processing instruction is applicable to a number of lines, a
branching destination can be specified for every line so that the lines branch to the same
destination when errors occur.
The syntax of the error-processing instruction is shown in Figure 10.2.

[<error variable>][; error <label>,[<error identifier>]]


errorsub

<error variable>: Specifies an integer-type local variable to which the error code is returned when an error is
caused or zero is returned if no error is caused.
<label>: Specifies the branching destination when an error is caused.
<error identifier>: Specifies an integer-, real number-, or character string-type constant or local variable to
identify the location of the error. In the case of a character string, the leading 16 bytes are
valid and the remaining bytes are ignored.

Figure 10.2 Syntax of Error-Processing Instruction

• If an error is caused with a line for which the branching destination is specified,
branching is executed without outputting any error message.
• The branching specification does not affect values returned to the error variable —
zero when no error is caused and the error code when an error is caused.
• The branching destination is specified using “error” for simple branching and error
processing; or “errorsub” for branching, error processing, and resuming execution
from the line following the line that has caused the error according to the “ereturn”
statement.

<label>:

<error processing at branched destination>

ereturn

Figure 10.3 “ereturn” Statement

An example of using “error” and “errorsub” is shown in Example-1 in 10.1.1. The


“error” branching processes the error and then terminates the SFC/SEBOL block — if
“error” is written in a function, the “return” instruction is effected after error processing.
In the example, the error information is output as a message at the branched end and the
“exit” instruction terminates the SEBOL block. The “errorsub” branching processes the
error and returns the program to the line that caused the error and thus the execution of
the SFC/SEBOL block will be resumed.

10-4 IM 33G3C20-11E
10. Error Processing

In both “error” and “errorsub” branching, built-in functions “cerrorid,” “lerrorid,” and
“derrorid” permit to obtain the value of the specified error identifier for the line that
caused an error.

cerrorid()
lerrorid()
derrorid()

Figure 10.4 Built-In Functions

These char*16-type (cerrorid), long-type (lerrorid), and double-type (derrorid) built-in


function can be selectively used according to the type of the specified error identifier.

10.1.3 Group Statements and Error Processing


In group assignment, “drive,” and “compare” statements, which permit to access
multiple data at the same time, the error variable is assigned a local variable array.
Because an array error variable consumes time in checking, it is recommended to
describe error processing using “error” or “errorsub” for branching. To describe error
processing according to the checked value of the error variable, the following user-
defined function is needed:
*** Return 0 if error variable array elements are all zero,
*** or return the number of first element that detected error.
integer function errcheck(val,v)
integer val[*] ! Error variable array
integer n ! Number of array elements
integer i
for i = 1 to n
if (val [i] <> 0) then
return i
end if
next@
return 0
end
This user-defined function “errcheck” is used following a group statement as shown
below:
sebolblock example3
#define NUMBLOCK 3
block SIO-22 SWITCH01,SWITCH02,SWITCH03
integer errval[NUMBLOCK]
integer errcheck() ! User-defined function
......
drive [SWITCH01,SWITCH02,SWITCH03 = 2,2,2] errval[*]
if (errcheck(errval,NUMBLOCK) <> 0) then
* - - - Error-processing instruction - - -
endif
......
end

IM 33G3C20-11E 10-5
10.2 Common Error-Processing Definition
When an error is caused in a line that does not allow individual error-processing routine
or if the instruction has not been written, the error can be processed if a common error-
processing instruction has been defined.
In SFC blocks, common error handlers are described in a common error handling SFC.
In SEBOL blocks, common error handlers are defined with an entry error statement.

entry error

<common error-processing>

return

Figure 10.5 Common Error-Processing Definition

• Only one common error handler is allowed in one SFC or SEBOL block definition.
The presence of two entry error statements in one SEBOL block, for example, would
cause a compile error to occur.
• Control branches to a redefined common error handler when an error occurs, but no
SEBOL error message is output by the system at this time. Execution is resumed
with the line next to the line in error upon completion of the common error handler
SFC for an SFC block or upon completion of the common error handler after reaching
the return statement for a SEBOL block.
Example 3 shows an example of using a common error handler for a SEBOL block.
In Example 3, two errors, overflow and division by zero, are caused to occur inten-
tionally. Running this program would run the common error handler twice, with an
error message being output by the message statement twice.
EXAMPLE 3:
Common error-processing in SEBOL block:
sebolblock example4
integer i,j,k
long x,y,z
......
x = 10000
y = 10000
i = x * y ! Causing overflow exceeding 32767.
z = 100
j = 0
k = z/j ! Causing zero-division error.
......
exit
......
entry error
message ”error line=%d %d-%x\n”,errl(),errc(),errce()
return
end

10-6 IM 33G3C20-11E
10. Error Processing

In Example-3, overflow and zero-division errors are caused on purpose. Common error
processing will be executed twice when this program is run, outputting error messages
twice according to the “message” statement.
Table 10.2 shows a list of built-in functions used to get error-caused line numbers and
error codes.

Table 10.2 Built-In Functions Used in Error-Processing

Function Type Description


errl() long Obtains the line number for the line that caused the last error.
errc() long Obtains the classified error code for the last caused error.
errce() long Obtains the detail error code for the last caused error.
Obtains the name of the function that caused the last error
errf() char*8
— a null-character string in the case of the “main” program.
errs() long Obtains the number of the step in which the last error occurred
errp() long Obtains the number of the plane in which the last error occurred

• Functions “errl,” “errc,” and “errce” return 0 if no errors have been caused since the
SFC/SEBOL block was started. The “errf” function returns a null-character string.
The “errce” function returns 0 if an error that has no detail code, such as overflow,
has been caused.
• errp and errs are built-in functions dedicated to SFC blocks. errp returns the number
of the plane in which an error occurs. errs returns the number of step in which an
error occurs. For additional details on these built-in functions, see Section 6.6.11,
“Error Functions.”
• These built-in functions are used for individual and common error processing and can
be called anywhere in the program.

IM 33G3C20-11E 10-7
When an error occurs during execution of a user-defined function, control branches to a
predefined common error handler. A common error handler cannot be defined for each
individual function, but only one can be defined in one SFC or SEBOL block. The
common error handler defined for the main program is run when errors occur during the
execution of any function.

EXAMPLE 4:
Common Error Handler
Main program

sebolblock example4
long func1()
char*8 fname
long x,y

x = 10000
y = 10000
func1(x,y)

......
exit

!...Common error handler...


entry error
fname = errf()
message "Error present func=%s line=%d %d-%x\n", fname,\
err1(), errc(), errce()
return
end

Function func1

long func1(x,y)
integer i
long m

i = x * y

!If x and y are 10000, x*y would exceed 32767, resulting in an overflow
......

return m
end

If both arguments x and y in the line i=x*y in the function func1 are 10000, an overflow
error would occur. Information on the error, such as the name of the function in error,
posted by errf() during the common error handler defined for the main program is output
in a message by the message statement before execution is resumed with the line next to
the line i=x*y in the function func1.

10-8 IM 33G3C20-11E
10. Error Processing

10.3 Classified Error Codes


Classified error codes used with SEBOL programs are determined according to the three
types of errors as shown in Table 10.3. Actions when errors are caused are different
among these three types of errors as described below.

Table 10.3 Error Types & Classified Error Codes

Error Type Classified Error Code


Execution-continuable errors 1 thru 19999
Fatal errors 20000 thru 32767
Internal errors –100 thru –32767

(1) Execution-Continuable Errors


When an error that permits to carry on the program execution is caused, branching is
made if it is specified by a common error-processing instruction, “error,” or “errorsub.”
If error processing or an error variable is not specified, the system outputs a SEBOL
error (system alarm) message and resumes execution from the line next to the error-
caused line. (See 10.5 for more information.)
In order to prevent repetitive branching to the error-processing routine in an infinite
loop, program execution is resumed following the output of a SEBOL error message
without branching if an error is caused within the common error-processing instruction,
or without further branching if an error is caused between “errorsub” and “ereturn.”
If an error variable is specified but “error” and “errorsub” are not specified in an
individual error-processing instruction, the error code is returned to the error variable but
the error message is not output even if an error is caused within the common error-
processing instruction or between “errorsub” and “ereturn.” When a SEBOL error
message outputs, it does not trigger a buzzer output.

(2) Fatal Errors


Fatal errors include such errors as an attempt to execute an “ereturn” statement that has
no returning destination and a nesting of function calls exceeding three levels, which do
not permit further program execution. A SEBOL error message is output uncondition-
ally and the execution of the SFC/SEBOL block is terminated. When a SEBOL error
message outputs, it triggers a buzzer output.

(3) Internal Errors (or insufficient area errors)


SEBOL error messages are output unconditionally and the execution of the SFC/SEBOL
block is terminated when these errors are caused. When a SEBOL error message
outputs, it triggers a buzzer output.

IM 33G3C20-11E 10-9
10.4 Substitution of Values
An error-caused variable or expression is substituted with a correct value to resume the
execution of the SFC/SEBOL block in which an execution-continuable error has been
caused. The substitution is made as described below.

(1) Operation Errors


Overflow and zero-division are operation errors. Values that substitute the operation
result when these errors are caused are shown in Table 10.4.

Table 10.4 Substitution Values

Error Substitution Value


Overflow Double-type absolute maximum value with the same sign as the operation result.
Zero-division Double-type absolute maximum value with the same sign as the dividend.

Table 10.5 Absolute Maximum Values — see (4) below.

Type Positive absolute maximum value Negative absolute maximum value


integer 32767 –32768
long 2147483647 –2147483648
float 3.402823*10ˆ38 –3.402823*10ˆ38
double 1.79769313486231*10ˆ308 –1.79769313486231*10ˆ308

In a division operation using the “/” operator, an invalid operation error is caused
terminating the operation if either or both operands are real numbers and zero is divided
by zero. The execution of the SFC/SEBOL block continues, however.

(2) Array-Subscript Out-of-Range Errors


If an array-subscript out-of-range error is caused, the error-caused statement is termi-
nated without making an assignment or outputting a message.
When processing multiple data in one line of a group assignment, “drive,” or “compare”
statement, the processing of remaining variables is terminated if a variable has an out-of-
range array-subscript.
The array-subscript out-of-range error is an execution-continuable error and thus the
execution of the SFC/SEBOL block continues.

(3) Function-Block Data-Reference Errors


If a communication error is caused when function-block data are being referenced, for
example, the error-caused statement is terminated without making an assignment or
outputting a message.
When processing multiple data in one line of a group assignment, “drive,” or “compare”
statement, remaining variables are processed although the processing of the error-caused
data (variable) is terminated.
The function-block data-reference error, which has a classified error code of 100, is an
execution-continuable error and thus the execution of the SFC/SEBOL block continues.

10-10 IM 33G3C20-11E
10. Error Processing

(4) Type Conversion Errors — see Table 10.5 above.


When an overflow error is caused in a type conversion, an absolute maximum value
with the same sign is substituted, which will then be used for further calculation of the
expression. For errors caused in a type conversion that involves assignment, see (5)
below.

(5) Assignment Errors


When an overflow or zero-division error is caused on the right-hand side of an assign-
ment statement, the assigned variable is substituted with a correct value if it is a local
variable — the substitution is not made if it is a function-block data.
If an overflow error is caused in the type conversion when substituting the local vari-
able, an absolute maximum value with the same sign is substituted — the substitution is
not made if it is a function-block data.

(6) Character String-Numeric Compatibility Errors


The data type is not checked in compilation if an undefined tag name or the tag name of
a control station that is not the current SFC/SEBOL block is specified in the program
created using implicit tag type declaration. If this program has an error, an error can be
caused when executed assigning character-string data to a numeric variable.
If a character-string variable is used in the operand for an operator applied to numeric
values, such as arithmetic operators, an error is caused, terminating the error-caused
statement without outputting a message or making an assignment.
When processing multiple data in one line of a group assignment, “drive,” or “compare”
statement, the processing of remaining variables is terminated if a variable has a
character string-numeric incompatibility.
The character string-numeric compatibility error is an execution-continuable error and
thus the execution of the SFC/SEBOL block continues.

IM 33G3C20-11E 10-11
10.5 Conditional Expression Errors
Execution-continuable errors caused during the conditional-expression calculation in
control statements are handled as shown in Figure 10.6.

“if” statement: The condition is assumed to be not satisfied.

“for” statement: The execution is resumed from the statement following the “next” statement.

“while” statement: The condition is assumed to be not satisfied.

“until” statement: The condition is assumed to be satisfied.

“wait until” statement: Branching is executed if specified by “error” or “errorsub” — if not, the
execution is resumed from the next statement.

“switch” statement: The execution is resumed from the line next to “otherwise” if it is present —
if not, from the statement following the “end switch” statement.

Figure 10.6 Handling of Conditional Expression Errors

10-12 IM 33G3C20-11E
10. Error Processing

10.6 Sequence Table/Logic Chart Errors


The steps in an SFC block can be defined in SEBOL or in a sequence table or logic
chart. When a runtime error is detected while executing a sequence table or logic chart
in which steps are defined, the SFC block is aborted, entering the ABRT block status.
Errors detected in the transition conditions of steps defined in a sequence table or logic
chart are handled the same way as the steps defined in SEBOL. The SFC block is not
aborted. The transition conditions are assumed false.
Table 10.6 lists the actions that take place when errors occur. The column ABRT
indicates that the SFC block is aborted, entering the ABRT block status. In status
change preprocessing, the status is only assumed unchangeable and the block status of
the SFC block does not change.

Table 10.6 Sequence Table/Logic Chart Errors

Program Type
Step Type
Status Change Status Change Interrupt Signal
Main Program
Processing Postprocessing Handling

ST step ABRT — ABRT ABRT

ST oneshot ABRT Unchangeable ABRT ABRT

LC step ABRT — ABRT ABRT

LC oneshot ABRT Unchangeable ABRT ABRT

—: ST/LC steps cannot be used in status change preprocessing.

10.7 Transition-Condition Errors


If an error caused during computation of the SFC block transition condition permits
continuation of the operation, the transition condition is assumed false.

IM 33G3C20-11E 10-13
11. Use of Variables and Expressions

11. Use of Variables and Expressions


SEBOL can use function blocks and function calls in expressions and as operands
although the use has some restrictions; for example, only local variables and constants
can be used in array scripts. This chapter describes these restrictions.

11.1 Classification of Functions


There are built-in functions and user-defined functions. Built-in functions are further
classified into two types, which can be called in the same manner but the description of
type-2 built-in functions has restrictions as explained in 11.6.
Table 11.1 shows a list of built-in functions and their types. For the details of built-in
functions, see Chapter 6.

Table 11.1 Built-In Functions

Function Type Function Type Function Type


labs 1 chr 1 getname 2
dabs 1 len 1 boot 1
lmax 1 cat 1 dscheck 1
lmin 1 index 1 ckstep 1
dmax 1 left 1 ckstepcl 1
dmin 1 right 1 lreadpara 1
power 1 mid 1 dreadpara 1
int 1 snum 1 creadpara 1
bitpstn 2 (*1) getdate 2 lcmread 2
bitpstn 1 gettime 2 dcmread 2
bitsrch 2(*1) timems 1 ccmread 2
bitsrch 1 errc 1 cmwrite 2
sin 1 errce 1 urload 2
cos 1 errl 1 urassign 2
tan 1 errf 1 timegmt 1
atan 1 errorval 1 localtime 2
sqrt 1 cerrorid 1 llimit 1

exp 1 lerrorid 1 dlimit 1


log 1 derrorid 1 errp 1
ichr 1 gettagno 1 errs 1

*1: The type changes to Type 2 when a variable other than simple variables is assigned to the first argument.

IM 33G3C20-11E 11-1
11.2 Classification of Expressions
Expressions can be classified into three categories:
[Category 1] Right-hand side of an assignment expression and conditional expression,
such as an “if” statement
Expressions falling into this category
• Right-hand side of an assignment expression
• Conditional expression, such as “if” statement, “repeat-until” statement, “wait until”
statement, “switch” statement, and “wait for qsignal” statement
• Expression of the initial value, terminal value, and increment in a “for” statement

[Category 2] Statement operand


Expression written as an operand of a statement.
Example: Specify two expressions, FIC001.PV/1000 (divided by 1000) and
FIC003.PV, in a “message” statement
sebolblock example1
integer i
block PID FIC001, FIC003
......
delay i*1000
message ”weight=%d KG, temperature=%d degree\n”, FIC001.\
PV/1000, FIC003.PV
......
end

[Category 3] Array subscript expression


Expression representing the elements of an array enclosed in brackets ([]).
Example:
integer function setpv(tag,n,data,sec)
argblock PID tag[*]
integer n,sec
double data
......
tag[n].SV = data ! n is a subscript expression.
wait until (tag[n].PV - data <= 0.5) time\
sec;error ERR000
return 0
......
ERR000:
return -1
end

• With Category 1 expressions, or the right-hand side of an assignment expression or


conditional expressions, such as an “if” statement, up to three of user-created func-
tions and type 2 built-in functions can be called (total of the initial value, terminal
value, and increment in a “for” statement). A compile error occurs when this limit is
exceeded.

11-2 IM 33G3C20-11E
11. Use of Variables and Expressions

• User-created functions and type 2 built-in functions are not allowed in Category 2
expressions. Type 1 built-in functions can be called from Category 1 and 2 expres-
sions. As many functions as desired can be called, provided, however, that built-in
functions that return a character string cannot be used in Category 2 expressions. The
value that a built-in function returns must be assigned to a character string local
variable before the character string is specified as a statement operand.
• Category 3 subscript expressions consist of integer or long type local variables
(including formal arguments of a function) and integer constants.

Table 11.2 lists the types of variables that can be used in the different categories of
expressions. Function block data is allowed in Category 1 and 2 expressions. Up to 32
expressions of function block data can be used in one statement. (If a single statement
contains multiple expressions, the total number of expressions in all the statements may
not exceed 32.)

Table 11.2 Variables Allowed in Expressions

Function Block Data Local Variables Type-1 Type-2


User-Created
Simple Array Simple Array Constants Built-in Built-in
Functions
Variables Elements Variables Elements Functions Functions

Category 1 ● ● ● ● ● ● ● ●

Category 2 ● ● ● ● ● × ● ×

Category 3 × × ● × ● × × ×

Where a local variable can be used in a user-created function, a formal argument that
has a local variable as its corresponding real argument can be written. Where a function
block can be written, a formal argument that has a function block as its corresponding
real argument can be written.

IM 33G3C20-11E 11-3
11.3 Special Operands
SEBOL uses special operands shown in Table 11.3. These operands can only use local
variables, or formal arguments of which actual arguments are local variables.

Table 11.3 Special Operands

Use Type Used Statement Used Remarks


Error variable (error array) I, L See Table 10.1.
Error identifier I, L, F, D, C See Table 10.1. Constants can also be used.
Formal arguments of which
Control variable in “for” statement I, L, F, D “for-next” actual arguments are local
variables cannot be used.
“compare”
“time” value I, L, F, D “wait-until” Constants can also be used.
“dialogue”
Input variable in “dialogue” statement I, L, F, D, C “dialogue”
Character-string storage variable in C “format”
“format” statement
group
Plant name in group assignment statement C assignment Constants can also be used.
statement
Sequence-table check result I, L, F, D “seqtable”
Sequence-table manipulated signal I, L, F, D “seqtable”
Logic-chart manipulated signal parameter “logicchart”
“wait for
Signal-name storage variable C qsignal”
Queue-signal cancels I, L, F, D “qsigcancel”
Queue-signal move result I, L, F, D “qsigmove”
ssread data status storage variable I, L, F, D “ssread”
ssread data storage variable I, L, F, D,C “ssread”
sswrite variable I, L, F, D,C “sswrite”

I: integer L: long F: float D: double C: char*n

11-4 IM 33G3C20-11E
11. Use of Variables and Expressions

11.4 Built-In Function Actual Arguments


An expression like “i+1” or a function call cannot be written to the actual argument of
built-in functions; only a variable or constant can be written. Variables that can be used
as actual arguments are shown in Table 11.4, and special actual arguments used with
built-in functions that have stricter restrictions are shown in Table 11.5. As to user-
defined functions, refer to 6.3, Function Arguments.
For user-defined functions that permit function block data, formal arguments of which
actual arguments are function block data can be written. Also for user-defined functions
that permit local variables, formal arguments of which actual arguments are local
variable can be written.

Table 11.4 Variables Used as Built-In Function Actual Arguments

Function Block Data Local Variables


Built-in
Function Simple Array Simple Array Constant
Array Array
Variable Element Variable Element
Type 1 — —
Type 2 (*1) × (*1) (*1)

● : Can be used ×: Cannot be used


*1: Local variable arrays can only be used as the first arguments of “bitpstn” and “bitsrch,” to which function
block array elements and arrays cannot be used, however.

Table 11.5 Special Actual Arguments

Function Block Data Local Variables Function Block


Built-in Function Simple Array Simple Array Constant Simple Array
Array Array
Variable Element Variable Element Variable Element
“a,b,c” in
getdate(a,b,c) × × × × × × ×
gettime(a,b,c)
b, c, d, e, f, and g
in localtime × × × × × × ×
(a, b, c, d, e, f, g)
“a” in bitpstn(a,b)
bitscrch(a,b) (*3) × × (*3) (*3) × ×
(*2)
“a” in dscheck(a,b) (*4) (*4) × (*5) (*5) × × × ×
“a” in getname(a) × × × × × × × (*6) (*6)

● : Can be used ×: Cannot be used


*2: Type-2 built-in functions and an array or array element is used as the first argument (See Section 11.1).
To type-1 built-in functions, Table 11.4 applies.
*3: Type-1 built-in functions.
*4: Data items attached with “#,” such as in “<function block>.#<data item>”, can only be used.
*5: Long-type variables can only be used.
*6: Function blocks declared using a “block,” “genname,” “unit genname” or “argblock” statement can be
used. An alias must be used as the actual argument when “alias” is specified in the “block” statement
(See Section 5.2.1). “getname” returns a tag name that corresponds to the alias. If % is specified,
getname returns the tag number of the local block.

IM 33G3C20-11E 11-5
12. Allocating CPU Time

12. Allocating CPU Time


(nopreempt Statement)
Multiple SFC/SEBOL blocks run in parallel in a field control station. The system
allocates CPU time to each SFC/SEBOL block.

12.1 Monopolizing CPU Time


When multiple SFC/SEBOL blocks run in parallel, the system allocates CPU time to
each SFC/SEBOL block so it will run 20 lines at time. If an access is made to data in a
remote station or a statement that waits for completion of a communication session, such
as a “dialogue” statement, is run during execution of the 20 lines, the SFC/SEBOL block
is left waiting and the CPU time is allocated to the next SFC/SEBOL block.
If a SFC/SEBOL block continues to access only data in the local station, sets of 20 lines
are normally run in sequence at the same timing. Users, however, cannot know where
these sets of 20 lines are delimited from one another precisely. This ignorance can be of
concern, for example, when users want to run two particular statements at the same
timing. Since an interrupt handler is invoked on receipt of any interrupt signal or status
change command, the execution of multiple lines at the same timing becomes unpredict-
able, since the statements before and after the interrupt handler are not necessarily run at
the same timing.
SEBOL provides a “nopreempt” statement to allow a single SFC/SEBOL block to
monopolize CPU time.

nopreempt begin

<Write statements to be run in sequence here>

nopreempt end

Figure 12.1

• The SFC/SEBOL block monopolizes CPU time to run the statements intervening
between the “nopreempt begin” statement and the “nopreempt end” statement. No
interrupt handler is invoked on receipt of any interrupt signal or status change
command in the meantime, until the “nopreempt end” statement is run, thus assuring
that the statements intervening between the two statements will be run at the same
timing.
• A runtime error occurs if a “nopreempt begin” statement is run between the
“nopreempt begin” statement and the “nopreempt end” statement, with the CPU time
being deallocated. If a “nopreempt begin” statement is run when no “preempt begin”
statement has been run, it invokes no error but is simply ignored.
• SEBOL one-shot execution steps in an SFC blocks are run by monopolizing CPU
time exactly the same way as they would be enclosed between the “nopreempt begin”
statement and the “nopreempt end” statement.

IM 33G3C20-11E 12-1
• If a “nopreempt” statement is run during a common error routine in a SEBOL block
or during an interrupt handler in an SFC block, then the interrupt handler is termi-
nated by running a “return” statement instead of a “nopreempt end” statement, the
CPU time is deallocated.
• The CPU time remains monopolized if a function is terminated by running a “return”
statement.
• The CPU time monopolized by an SFC block is deallocated if a step action is
terminated with a “quit” statement in the SFC block.
• If an SFC/SEBOL block that monopolizes CPU time continues running or enters a
wait state, the CPU time would be available for allocation to remote SFC/SEBOL
blocks in the same control station. Hence, the statements that can be run between the
“nopreempt begin” statement and the “nopreempt end” statement are subject to the
limitations listed below. A runtime error occurs if any of these limitations is ex-
ceeded.
• A statement longer than 20 lines invokes a runtime error. These 20 lines do not
include the “nopreempt begin” statement and the “nopreempt end” statement. Line 21
and subsequent lines are run without monopolizing the CPU time next time it is
allocated to the SFC/SEBOL block. Even if an error/errorsub destination or common
error handler is encountered on line 21, a SEBOL error message is output at all times,
without control branching to the error handler.
• An attempt to access data in a remote station causes a runtime error to occur. The
data is neither read nor written. Data in other control areas in the local station is
accessible, though.
• If the condition specified by the “compare” statement does not hold true in a single
run, the statement functions the same as it would do when the time specified by the
time option expires.
• The “drive” statement cannot be used.
• The drive vpmon and drive vpmoff statements are not available. For details, see Valve
Pattern Monitor Package Manual (IM33G3C22-11E)”.
• The drivewait option of the “seqtable” statement and the “logicchart” statement
cannot be used.
• “while” to “wend,” “repeat” to “until,” and “for” to “next” involving iterations with
delays cannot be used, but “while” to “wend@,” “repeat” to “until@,” and “for” to
“next@” can be used since they do not involve a delay for each iteration.
• The “wait until” statement cannot be used.
• The “delay” statement and the “delaycycle” cannot be used.
• Signals cannot be sent to remote stations, but can be sent to SFC blocks/units in
other control areas in the local station.
• The “qsigcancel” statement and the “qsigmove” statement cannot be used for SFC
blocks in remote stations, but can be used for SFC blocks in other control areas in the
local station.
• The “dialogue” statement cannot be used.
• The nopreempt begin” statement cannot be used.
• The “semlock wait” statement cannot be used. (A “semlock” statement without the
wait option can be used, though.)
• The “wait for qsignal” statement cannot be used.
• ssdtwrite and ssdtwritebit statement cannot be used.

12-2 IM 33G3C20-11E
12. Allocating CPU Time

Table 12.1 lists the statements that are limited. Failure to observe these limitations
could cause a runtime error, such as an overblow, to occur. The CPU time is
deallocated if a runtime error occurs during execution of any statement intervening
between the “nopreempt begin” statement and the “nopreempt end” statement (*1).
Even if an error variable has been specified, the CPU time would be deallocated upon
detection of a runtime error.
The CPU time would also be deallocated if control branches to a error/errorsub destina-
tion or common error handler as specified. The error recovery action that takes place is
the same except that the CPU time is deallocated. See Chapter 10 for relevant informa-
tion.
If an interrupt signal is received anywhere between the “nopreempt begin” statement and
the “nopreempt end” statement, no interrupt handler invoked run until the “nopreempt
end” statement is run (*2). Likewise, if a status change command is received, no status
change processing is run until the “nopreempt end” statement is run (*2). (Status
change preprocessing and status changes are executed after execution of the “nopreempt
end” statement.)
If an interrupt signal is sent to the local SFC block between the “nopreempt begin”
statement and the “nopreempt end” statement, an interrupt handler is invoked after
execution of the “nopreempt end” statement (*3).

.....
nopreempt begin
.....
signal ”SG1” ! Send an interrupt signal to the local SFC bock
opeguide OG, 2
.....
nopreempt end

In the example above, “opeguide OG,2” and the subsequent lines continue to monopo-
lize the CPU time after the execution of signal “SG1”. The “SG1” interrupt procedure
is not run until after execution of “nopreempt end” statement is completed.

IM 33G3C20-11E 12-3
*1: The CPU time is not monopolized in the execution of the remaining part of the program after the
occurrence of the error.
*2: Interrupt signal/status change command from a remote station. While the SFC/SEBOL block monopo-
lizes the CPU time, other SFC/SEBOL blocks in the same station are prevented from running “signal” or
other statements.
*3: This also holds true when a sequence table (logic chart) that has run a “seqtable” statement (“logicchart”
statement) by one-shot execution sends an interrupt signal to the local SFC block via %EV.
Even if the local SEBOL block is changed to the STOP block status between the
nopreempt begin and the nopreempt end statement, it continues running with the CPU
monopolized until it encounters the nopreempt end statement. The SEBOL block ends
on reaching the nopreempt end statement. Its block status changes at the timing of
execution of %BSTS=“STOP” (*4).
.....
nopreempt begin
.....
%.BSTS = "STOP" ! % denotes a local block.
.....
nopreempt end

Even if the local SFC block is changed to the STOP block status between the nopreempt
begin and the nopreempt end statement (or in a SEBOL one-shot execution step), it
continues running with the CPU monopolized until it encounters the nopreempt end
statement. Its block status changes when any status change preprocessing is executed at
the timing of execution of %BSTS=“STOP”. When the SFC block reaches the
nopreempt end statement, it executes any status change preprocessing, if defined, with
the CPU time being deallocated. The SFC block ends when the status change process-
ing is finished. If no status change preprocessing is defined, the SFC block ends on
reaching the nopreempt end statement.
Even if the local SFC block is changed to the PAUS block status between the nopreempt
begin and the nopreempt end statement (or in a SEBOL one-shot execution step), it
continues running with the CPU monopolized until it encounters the nopreempt end
statement. Its block status changes when any status change preprocessing is executed at
the timing of execution of %BSTS= “PAUS”. When the SFC block reaches the
nopreempt end statement, it executes any status change preprocessing, if defined, with
the CPU time being deallocated. The SFC block ends when the status change process-
ing is finished. If no status change preprocessing is defined, the SFC block ends on
reaching the nopreempt end statement.
.....
nopreempt begin
.....
%.BSTS = "PAUS" ! % denotes a local block.
.....
nopreempt end

*4: A similar operation would also take place if a sequence table (logic chart) run by one-shot execution with
a *** statement (*** statement) has changed the block status of the SFC or SEBOL block.

12-4 IM 33G3C20-11E
12. Allocating CPU Time

12.2 Counting Run Lines


SFC/SEBOL blocks can run up to 20 lines by monopolizing CPU time with a
“nopreempt” statement. The number of run lines is counted in the following ways:
• The number of run lines is not that of lines in a source file but that of lines to be run.
• A line continued with “//” or “\” is also counted as one line.
• The number of run lines is incremented on each iteration of “while” to “wend@,”
“repeat” to “until@,” or “for” to “next@.” Each iteration of the “while” statement,
“wend@” statement, “until@” statement, or “next@” statement is counted as one line.
The “for” statement is counted as one line when it is run only for the first time (that
is, the initial value, terminal value, and increment in the “for” statement are evaluated
only once when it is run for the first time).
• “if” statement with “then”, “else if” statement, “switch” statement and “goto” state-
ment are counted as one line.
• “if” statement without “then” is counted as two lines when the condition is TRUE
while is counted as one line when condition is FALSE.
Example:
The following command line with “if” statement, runs “opeguide” command when flag is
equal to 1. In this case, both “if” and “opeguide” are executed, counted as two lines.
if (flag <> 0) opeguide "Valve error."
while, when the flag is equal to zero, the condition is not TRUE, so that “opeguide”
command will not be executed, only one line, “if” statement only, is counted.
• The “end if” statement, “else” statement, “repeat” statement, “case” statement, and
“otherwise” statement are not counted as run lines, for they are simply used to
determine where control should be branched by a control statement.
• The “nopreempt begin” statement and the “nopreempt end” statement are not counted
as run lines.

IM 33G3C20-11E 12-5
Table 12.1 Limitations on Monopolization of CPU Time
Statement Limitation Remarks
Expressions, assignment statements, and
Data in remote stations not accessible *1
built-in functions
drive Not available *2
drive vpmon *1 Not available *2
drive vpmoff *1 Not available *2
compare Compares only once *1
seqtable Drivewait option not permitted *2
logicchart Drivewait option not permitted *2
for~next Delay assumed an error *3
while~wend Delay assumed an error *3
repeat~until Delay assumed an error *3
wait until Not available *2
delay Not available *2
delaycycle Not available *2
dialogue Not available *2
signal Cannot sent signals to remote stations *1
SFC block in a remote station not
qsigcancel *1
manipulatable
SFC block in a remote station not
qsigmove *1
manipulatable
semlock wait Not available *2
nopreempt begin Not available *2
wait for qsignal Not available *2

*1 For details on the drive vpmon and drive vpmoff statements, see “Valve Pattern Monitor Package Manual
(IM33G3C22-11E)”.

The action that takes place when a runtime error occurs as a result of failure to observe
these limitations is divided into the following three courses:
*1 Control branches to an error/errorsub destination or common error handler if one is defined. (No SEBOL
error message is output when control branches to an error handler.) Next time CPU time is allocated to
the SFC/SEBOL block, execution is resumed with the line next to the line in error (or with an error
handler if one is defined).
*2 Control does not branch even if an error/errorsub destination or common error handler is defined. (A
SEBOL error message is output at all times.) Next time CPU time is allocated to the SFC/SEBOL block,
execution is resumed with the line in error; that is, the line in error is retried.
*3 Control branches to a common error handler if one is defined. (No SEBOL error message is output when
control branches to an error handler.) Next time CPU time is allocated to the SFC/SEBOL block,
execution is resumed with the statement next to the “next,” “wend,” or “until” statement (or with an error
handler if one is defined).

12-6 IM 33G3C20-11E
13. Managing Shared Resources

13. Managing Shared Resources


Multiple SFC/SEBOL blocks run in parallel in a field control station. In SEBOL, a
scheme of management, called a logical semaphore (or binary semaphore), is used to
synchronize the SFC/SEBOL blocks in the same control area. Where multiple SFC/
SEBOL blocks share one resource, the semaphore allows one SFC/SEBOL block to
exclusively use the resource by preventing all other SFC/SEBOL blocks from accessing
it.
Assume that there is a hazardous zone in the course of a railway as shown in Figure
13.1. Only one train can pass the hazardous zone at a time. When a train enters the
hazardous zone, the semaphore at the entrance of the hazardous zone falls to keep the
next train from entering the hazardous zone. When the train passes the exit of the
hazardous zone, the Semaphore rises to allow the next train to enter the hazardous zone.
The semaphore thus rises or falls to allow only one train in the hazardous zone at a time.
Trains pass the hazardous zone in the order of their arrival at the semaphore.

Exit Semaphore

Hazardous zone

Figure 13.1

This hazardous zone may be likened by analogy to a shared resource, trains to SFC/
SEBOL blocks. Given a means to manipulate the semaphore, multiple SFC/SEBOL
blocks can be synchronized to access a shared resource. Hereafter, the operation of
lowering the semaphore is called locking the semaphore, and that of raising the sema-
phore is called unlocking the semaphore.
• Users can name a semaphore with a character string not exceeding 8 bytes. This
name is called a semaphore name.
• Multiple SFC/SEBOL blocks (*1) in the same control area can be synchronized with
one another by performing semaphore operations on the same semaphore name. Users
can define 0 to 64 semaphores in one control area at the same time (*2). The default
is 10. A runtime error occurs when the number of semaphores permitted per control
area is exceeded. Add to the number of semaphores as needed. Changing the number
of semaphores defined requires regeneration of the control area as a whole. The
number of semaphores defined cannot be altered by online maintenance.

IM 33G3C20-11E 13-1
• Only SFC/SEBOL blocks (*1) in the same control area can be synchronized by the
use of semaphores.
*1: These are independently started blocks and not unit-started operation sequences.
*2: The semaphore area cannot be established unless SFC/SEBOL blocks are residing in the control area.
And it is necessary to specify more than one blocks for “Number of SEBOL blocks” or “SFC/SEBOL
block executable number” in the control area. See Appendix 5, Application Size, for more information.

• SFC/SEBOL blocks in different control areas or control stations a cannot be synchro-


nized by the use of semaphores.
• If semaphores with the same name are used in multiple control areas, they are handled
as a different semaphore each.
• For SFC blocks executed as the unit’s operation sequences, semaphores are managed
in relation to the control area in which the unit resides. (If the operation sequences
and the unit belong to different control areas, semaphores are managed in the control
area in which the unit resides.) Thus operation sequences are synchronized even when
the SFC block started as an operation sequence is in a different control area. In
Figures 13.1(a) and (b), the operation sequence SFC101 in control area-1 and SFC201
in control area-2 are executed in parallel. SFC101 and SFC201 can be synchronized
using semaphore SEM-A, which is in control area-1, because UNIT101 is in control
area-1 and SFC201 shares the same semaphore with SFC101.

UNIT101

5 SFC101 6 SFC201

Figure 13.1(a) Unit & Operation Sequences

Control area 1 Control area 2

Semaphore

UNIT101

SFC101 SEM-A SFC201

Figure 13.1(b) Semaphore & Control Areas

13-2 IM 33G3C20-11E
13. Managing Shared Resources

Figure 13.2 shows an example of controlling the semaphore “SEM0” from two SEBOL
blocks, prog1 and prog2.

prog1

Lock “SEM0” Unlock “SEM0”

prog2

Wait, in an attempt Resume execution, released


to lock “SEM0” from the state of waiting for “SEM0”

Figure 13.2 Program Operation under Semaphore Management

IM 33G3C20-11E 13-3
13.1 “semlock” Statement and “semunlock” Statement
A semaphore is locked with a “semlock” statement and unlocked with a “semunlock”
statement. When SFC/SEBOL block runs a “semlock” statement with the wait option
specified, it waits for the semaphore to be unlocked if it has already been locked.
Running a “semlock” statement without the wait option specified will invoke an error
immediately if the semaphore has already been locked.

semlock[wait]<semaphore name>[;<error variable>][; error <label>[,<error identifier>]]


errorsub

semunlock<semaphore name>[;<error variable>][; error <label>[,<error identifier>]]


errorsub

<semaphore name>: Specifies the name of a semaphore with a character string constant or character string variable
not exceeding 8 bytes. If the character string exceeds 8 bytes, only the first 8 bytes are accepted.
<error variable>: Specifies the local variable in which an error code is set when errors occur. It is set to 0 in the
absence of errors.
<label>: Specifies where control should branch when errors occur.
<error identifier>: Specifies a constant or local variable to identify the location of an error during an error handler.

Figure 13.3

• A runtime error occurs when a single SFC/SEBOL block attempts to lock the same
semaphore in duplicate (even if the wait option is specified).
• A runtime error also occurs when a SFC/SEBOL block attempts to unlock a sema-
phore that it has not locked.
• Once a SFC/SEBOL block enters a state of waiting for a semaphore to be unlocked
by running a “semlock wait” statement, the program would not go any farther unless
the semaphore is unlocked. If a SFC/SEBOL block receives an interrupt signal while
waiting for the semaphore to be unlocked, it executes interrupt signal receive process-
ing. SFC/SEBOL block can receive status change commands while they are waiting
for semaphores to be unlocked. When the SFC/SEBOL block receives a status
change command, status change preprocessing/postprocessing is executed, thereby
changing the block status (if such change is permitted). The “semlock wait” state-
ment cannot be used during interrupt signal handling, status change postprocessing,
and common error handling routines, but a “semlock” statement and a “semunlock”
statement without the wait option specified can be used. The “semlock,” “semlock
wait,” and “semunlock” statements cannot be used in status change preprocessing.
• If there is any SFC/SEBOL block that has been waiting for a semaphore to be
unlocked when the semaphore is unlocked with a “semunlock” statement, the SFC/
SEBOL block is released from the state of waiting to resume its execution. If more
than SFC/SEBOL block has been waiting for semaphores to be locked, the sema-
phores are unlocked in the order in which the blocks have started waiting for the
semaphores to be unlocked.

13-4 IM 33G3C20-11E
13. Managing Shared Resources

• When an SFC/SEBOL block that has locked a semaphore is halted (thereby entering
the STOP or ABRT block status), the system unlocks the semaphore.
• Even when an SFC block that has locked a semaphore pauses (thereby entering the
PAUS block status), the semaphore is not unlocked. If an SFC block pauses with a
semaphore locked, the SFC/SEBOL blocks that have been waiting for the semaphore
to be unlocked would be left waiting. In this case, use the “semunlock” statement to
unlock the semaphore with a status change postprocessing for the status change
command PAUS. Figure 13.4 shows a typical application.
• SFC/SEBOL blocks have the system-fixed data item SEMA. The name of the
semaphore that has been locked with a “semlock” or “semlock wait” statement is set
in SEMA by the system. If a single SFC/SEBOL block locks more than semaphore,
the name of the first semaphore locked is set in SEMA. SEMA is set to ”” (a
character string with a length of 0) when there are no locked semaphores since all
have been unlocked with a “semunlock” statement.

1 Initialization semlock wait "SEM01"

SEM01 is unlocked by status change


2 Phase 1 postprocessing to prevent the block from
pausing with SEM01 locked.

semunlock "SEM01"
3 Phase 2

Pause
Main program

Pause status change postprocessing

1 Pause processing integer err


....
semunlock "SEM01" ; err
The semaphore SEM01 is unlocked unconditionally. An
error code is simply set in the error variable err specified
and no SEBOL error message is output even if the
semaphore has not been locked. (See Section 10.1.1,
“Error Variables”.

Figure 13.4 Unlocking a Semaphore While Paused

IM 33G3C20-11E 13-5
13.2 Deadlocks and Their Prevention
When a single SFC/SEBOL block attempts to lock two or more semaphores at the same
time, protection against deadlocks should deserve special consideration.
Consider locking the two semaphores, SEM1 and SEM2, from the two SEBOL blocks,
sebol1 and sebol2, for example. If sebol1 and sebol2 run “semlock” statements with the
wait option, the former to lock SEM1 and SEM2 in this order and the latter to lock
SEM2 and SEM1 in this order, both SEBOL blocks could wait for semaphore unlocking
at the same time, depending on the timing. This state is called a deadlock.
The only way to resolve the deadlock is to abort either SEBOL block. (The semaphores
that have been locked by the SEBOL block thus aborted are unlocked, thereby allowing
the other SEBOL block to be released from the state of semaphore waiting.

Deadlock

sebol1 sebol2

semlock wait “SEM1”


Lock “SEM1”

semlock wait “SEM2”


Lock “SEM2”

semlock wait “SEM2”


Wait for “SEM2” to be unlocked.

semlock wait “SEM1”


Time Wait for “SEM1” to be unlocked.

Figure 13.5 Deadlock

13-6 IM 33G3C20-11E
13. Managing Shared Resources

To prevent deadlocks, observe these precautions in using semaphores:


• One SFC/SEBOL block should not use more than one semaphore at the same time.
• When one SFC/SEBOL block has to use more than one semaphore at the same time,
avoid specifying the wait option.
• If locking more than one semaphore with the wait option is unavoidable, ensure that
all the SFC/SEBOL blocks lock the semaphores in the same order.

IM 33G3C20-11E 13-7
14. Subsystem Communication

14. Subsystem Communication


SEBOL supports data access with subsystems, such as programmable controllers that are
connected to the field control station by way of telecommunications. Statements
available for reading and writing subsystem data help write application programs to
process subsystem data and transmit commands to the subsystems.
SEBOL statements are used as described below to access subsystem data (Figure 14.1):
● Accessing DDC/SEQ data:
The subsystem I/O image (DDC/SEQ data area) at the control station can be accessed
according to the process I/O builder-defined DDC/SEQ. Communication between
the subsystem data area and the control station DDC/SEQ data area periodically
equalizes these two areas. The ssread statement is used for reading and sswrite and
sswritebit statements for writing (“1” and “2” in Figure 14.1).
● Accessing monitor data:
The subsystem data defined by the process I/O builder for monitor declaration are
kept being monitored at all times. When the subsystem data change, data in the
monitor declaration data area at the control station are updated. The subsystem data
in the control station’s monitor declaration data area are read when monitor data are
accessed. Monitor data can be written directly in the subsystem data area by commu-
nication. The ssread statement is used for reading and ssdtwrite and ssdtwritebit
statements for writing (“3” and “4” in Figure 14.1).

IM 33G3C20-11E 14-1
Control station

ssdtwrite ssread sswrite


ssdtwirtebit sswirtebit

PI/O library

(4) (3) (2) (1)

Monitor declaration DDC/SEQ


data area data area

PI/O image

PI/O driver

Data area

Subsystem

Figure 14.1 DDC/SEQ & Monitor Data Access

The manners of accessing subsystem data are summarized in Table 14.1:

Table 14.1 SEBOL Statements to Access Subsystem Data

DDC/SEQ Data Monitor Data


Read ssread ssread
Write sswrite ssdtwrite
Bit-field write sswritebit ssdtwritebit
ACM1 Permitted Not permitted
ACM2 Permitted Not permitted

14-2 IM 33G3C20-11E
14. Subsystem Communication

14.1 Accessing DDC/SEQ Data


The statements used to access DDC/SEQ data are:
• “ssread” statement to read the subsystem data,
• “sswrite” statement to write the subsystem data, and
• “sswritebit” statement to write the subsystem data bit-field.
To access DDC/SEQ data, it is necessary to have the subsystem data image defined by
the process I/O builder as follows:
■ , 128 words (256 bytes) at maximum for each block of data, and
• ACM1■
■ , 1024 words (2048 bytes) at maximum for each block of data.
• ACM2■
The I/O module builder defines the correspondence between the DDC/SEQ definition
(process I/O terminal number, %Z******) and the individual data in the block.
The ssread statement permits reading more than one set of data in a single block by
itself. The sswrite statement permits writing more than one set of data in a single block
by itself. The ssread or sswrite statement cannot access multi-block data alone.
A line number, a card number, and a access number identify a particular block of
subsystem data. The line number and card number determine the ACM card that
intervenes between the field control station and the subsystem, and the access number
determines the block of the ACM card concerned.
The location of data in a block is determined as a relative position.

IM 33G3C20-11E 14-3
14.1.1 Reading Subsystem Data
The ssread statement reads subsystem data from the subsystem I/O image (DDC/SEQ
data area) at the control station.

ssread<line number>,<card number>,<access number>,<relative position>[,<option>]


;<data status storage variable>
[;<data storage variable>:<data type>[,<data storage variable>:<data type>...]
[;<error variable>][; error <label>[,<error identifier>]]
errorsub

<line number> Specifies the line number of the ACM card as an integer constant or
variable.
<card number> Specifies the card number of the ACM card as an integer constant or
variable.
<access number> Specifies the number of the block (DDC/SEQ definition) as an integer
constant or variable.
<relative position> Specifies the relative position from the beginning of the block (DDC/SEQ
definition) (in words) as an integer constant or variable.
<option> Specifies a read option. See Section 14.3 for the description of options.
<data status storage variable> Specifies a double-length integer variable into which the data status is
read. The data status of the specified block is stored here.

<data storage variable> Specifies a local variable into which data is read. It may be a simple
variable, array element or entire array.

<data type> Specifies the data type of the subsystem data. This data type is that of
the subsystem data and not that of a SEBOL variable.

<error variable> Specifies a local variable that is loaded with an error code when an error
occurs. 0 is set when no error is present.

<label> Specifies where control branches when errors occur.

<error identifier> Specifies a constant or variable that identifies the occurrence of an error
to the error handler.

Figure 14.2

Table 14.2 Range of Numbers

ACM1 ACM2
line number 1~2 1~2
card number 1~6 21~24
access number 1~30 1~60
relative position 0~127 0~1023

The ssread statement reads data from the block of subsystem data that is identified by
<line number>, <card number>, and <access number>. It retrieves data of <data type>
starting at <relative position> in the block and reads it into the corresponding <data
storage variable>. Up to 32 sets of <data storage variable>:<data type> can be speci-
fied.
If <error variable> is specified, it is loaded with 0 when no error is present or with an
error code when an error occurs. <Label> may specify where control should branch
when errors occur. <Error identifier> identifies the location of an error to the error
handler as it occurs. Built-in functions enable the error handler to get the value of
<error identifier>. For more details on error handling, see Chapter 10, “Error Process-
ing.”

14-4 IM 33G3C20-11E
14. Subsystem Communication

• When the execution of the ssread statement results in a subsystem communication


error (classified error code 500), data is not read into any <data storage variable> at
all. <Data storage variable> would remain with the value in effect prior to the
execution of the ssread statement.
• Data in excess of the range of one block cannot be read with a single run of the
ssread statement.
• If the data to read from has the data type DI specified by the DDC/SEQ definition, it
would be read from an I/O image, not a DI image.
• Remember that, if the data to read from has the data type DI/DO specified by the
DDC/SEQ definition, it would be read without bit inversion, regardless of whether bit
inversion is specified or not.
• Specify one simple variable or array element as an error variable. An entire array
cannot be specified. The error variable defined in the ssread statement does not post
an error code for each set of <data storage variable>:<data type>, but only one error
code across the ssread statement.
Table 14.3 lists the data types that are supported.

Table 14.3 Data Types

Data Type Meaning

integer 16-bit integer data


uinteger 16-bit unsigned integer data
long 32-bit integer data

ulong 32-bit unsigned integer data


float 32-bit floating-point data
char4 4-byte (2-word) character
char8 8-byte (4-word) character
char16 16-byte (8-word) character
char32 32-byte (16-word) character

IM 33G3C20-11E 14-5
14.1.2 Data Statuses
Each block of subsystem data has a data status. Table 14.4 indicates the bit patterns of
the data statuses that the ssread statement may post. The most significant (leftmost) bit
position is 1, and the least significant (rightmost) bit position is 32. All bits other than
bits 20 to 22 are always 0.

Table 14.4 Data Statuses

Bit Symbol Name

1 BAD Bad data value


20 NRDY PI/O not ready
21 PFAL PI/O power failure

22 LPFL Extended PI/O power failure

Table 14.5 lists the possible combinations of the data statuses of subsystem data and the
associated statuses of the card. If a block of subsystem data is in the data status NRDY,
it can neither be read with the ssread statement nor written with the sswrite or sswritebit
statement.

Table 14.5 Data Status Combinations

Data Status Data


Card Status Available
BAD NRDY PFAL LPFL or Not
0 0 0 0 Both card and subsystem communication normal Yes
0 1 0 0 Card normal but subsystem communication incomplete No

1 1 1 1 Card or subsystem communication abnormal No

The data status obtained with the ssread statement can be tested with the built-in
function dscheck().
For information how to use dscheck(), see Section 7.4.1, “Checking Data Status.”
EXAMPLE 1:
The subsystem data read by the ssread statement can be judged for applicability by
verifying the NRDY data status. In this example, the data status returned to local
variable “ds” by the ssread statement is verified using built-in function “dscheck()”.
sebolblock example1
long ds
integer i1, i2, i3

ssread 1, 1, 10, 0; ds; i1:integer, i2:integer, i3:integer


if (dscheck(ds, "NRDY") <> 0) then
!Execute data status NRDY processing
!Data read into i1, i2, and i3 cannot be used.
.....
end if
.....
end

14-6 IM 33G3C20-11E
14. Subsystem Communication

EXAMPLE 2:
To judge normalcy of the card or the communication with the subsystem, a check is
made for data status “BAD” in this example.
sebolblock example2
long ds
integer i1,i2,i3

ssread 1,1,10,0;ds;i1:integer,i2:integer,i3:integer
if (dscheck(ds,”BAD”) <> 0) then
!Executes processing if data status is BAD.
!Card or subsystem communication abnormality detected.
.....
end if
.....
end

IM 33G3C20-11E 14-7
14.1.3 Writing Subsystem Data
The sswrite statement writes subsystem data in words, while the sswritebit statement
writes to bit fields. The sswrite and sswritebit statements end normally when writing to
the I/O image of a subsystem in the field control station is complete.

● Writing in words

sswrite <line number>,<card number>,<access number>,<relative position>[,<option>]


;<variable>:<data type>, <variable>:<data type>...]
[;<error variable>][; error <label>[,<error identifier>]]
errorsub

● Writing to bit fields

sswritebit <line number>,<card number>,<access number>,<relative position>[,<option>]


;<bit position>,<bit length>,<bit field data>
[;<error variable>][; error <label>[,<error identifier>]]
errorsub

<line number> Specifies the line number of the ACM card as an integer constant or
variable.
<card number> Specifies the card number of the ACM card as an integer constant or
variable.
<access number> Specifies the number of the block (DDC/SEQ definition) as an integer
constant or variable.
<relative position> Specifies the relative position from the beginning of the block (DDC/SEQ
definition) (in words) as an integer constant or variable .
<option> Specifies a write option. See Section 14.3 for the description of options.
<variable> Specifies a local variable containing to the data to write. It may be a simple
variable, array element or entire array.
<data type> Specifies the data type of the subsystem data. This data type is that of the
subsystem data and not that of a SEBOL variable.
<bit position> Specifies the bit position from the most significant bit as an integer
constant or variable (1 to 32). The most significant (leftmost) bit position is
1, and the least significant (rightmost) bit position is 32.
<bit length> Specifies the length of the bits to write as an integer constant or variable (0
to 32).
<bit field data> Specifies an integer constant or variable containing the data (bits) to write,
right-justified. A lower address means a lower bit.
<error variable> Specifies a local variable that is loaded with an error code when an error
occurs. 0 is set when no error is present.
<label> Specifies where control branches when errors occur.
<error identifier> Specifies a constant or variable that identifies the occurrence of an error to
the error handler.

Figure 14.3

14-8 IM 33G3C20-11E
14. Subsystem Communication

Table 14.6 Range of Numbers

ACM1 ACM2
line number 1~2 1~2
card number 1~6 21~24
access number 1~30 1~60
relative position 0~127 0~1023

The sswrite statement writes data to the block of subsystem data that is identified by
<line number>, <card number>, and <access number>. SEBOL <variable> is converted
to <data type> to write the data starting at <relative position> in the block. Up to 32
sets of <data storage variable>:<data type> can be specified.
The sswritebit statement writes data to a specified bit field in 32-bit integer data starting
at <relative position> in the block of subsystem data that is identified by <line number>,
<card number>, and <access number>. If <bit position> is m and <bit length> is n, data
like that shown in Figure 14.4 is written to the I/O image of subsystem data.
1 32
SEBOL <bit field data> 1 2 ....... n

1 m m+n+1 32
Data set in the subsystem 1 2 ....... n

Figure 14.4 Writing Bit Field Data

Locations other than the bit field specified (in Figure 14.4, bit 1 to bit (m-1) and bit
(n+m) to bit 32) would remain with the values in effect prior to the execution of the
sswritebit statement.
For both the sswrite and sswritebit statements, if <error variable> is specified, it is
loaded with 0 when no error is present or with an error code when an error occurs.
<Label> may specify where control should branch when errors occur. <Error identifier>
identifies the location of an error to the error handler as it occurs. Built-in functions
enable the error handler to get the value of <error identifier>. For more details on error
handling, see Chapter 10, “Error Processing.”

Precautions in using the sswrite statement are summarized below.


• Data can be written only to blocks that have the data type DO or AO*** specified by
the DDC/SEQ definition and not to those having DI or AI*** specified.
• When the execution of the ssread statement results in a subsystem communication
error (classified error code 500), data is not written at all. The subsystem data would
remain with the values in effect prior to the execution of the sswrite statement.
• Remember that, if the data to write to has the data type DO specified by the DDC/
SEQ definition, the value of <variable> would be written without bit inversion,
regardless of whether bit inversion is specified or not.
• Data in excess of the range of one block cannot be written with a single run of the
sswrite statement.
• Specify one simple variable or array element as an error variable. An entire array
cannot be specified. The error variable defined in the sswrite statement does not post
an error code for each set of <data storage variable>:<data type>, but only one error
code across the sswrite statement.

IM 33G3C20-11E 14-9
Precautions in using the sswritebit statement are summarized below.
• Data can be written only to blocks that have the data type DO or AO*** specified by
the DDC/SEQ definition.
• Specify an integer from 1 to 32 as <bit length>. A value higher than 32 or a negative
value is assumed an error. If a value of 0 is specified, it does not cause an error but
is not written either.
• Remember that, if the data to write to has the data type DO specified by the DDC/
SEQ definition, the value of <variable> would be written without bit inversion,
regardless of whether bit inversion is specified or not.
• Specify a multiple of 2 (4-byte boundary) as <relative position>.
• An error occurs when more than 33 sets of <bit position> and <bit length> are
specified.

14-10 IM 33G3C20-11E
14. Subsystem Communication

14.1.4 Example
An example of defining blocks of subsystem data and accessing them with SEBOL
statements is described below. A line number of 1 and an ACM card number of 5 are
assumed in this example.

Table 14.7 Example


Definition Station Size Bit
IO Number Address Data Type
Number Number (Words) Inversion
1 %Z171101 1 D0000 16 AII16 —
2 %Z171301 1 R0000 8 AOI16 —
3 .....

It is assumed that data is arranged in the block with definition number 1 as shown in
Figure 14.5. Numbers found on the left side indicate a relative position (in words) each.

0 integer
1 integer
2
long

4
long

6
float

char8

12

char8

Figure 14.5

It is assumed that eight 16-bit signed integers are arranged in the block with definition
number 2.

0 integer
1 integer
2 integer
3 integer
4 integer
5 integer
6 integer
7 integer

Figure 14.6

IM 33G3C20-11E 14-11
(1) Read two sets of data from the block with definition number 1 each as a 16-bit
signed integer, from the beginning of the block (relative position 0) downwards.
sebolblock sample1
integer data1, data2
long dSts

ssread 1, 5, 1, 0 ; dSts ; data1:integer, data2:integer


.....
end
(2) Read four sets of data from the block with definition number 1, starting at relative
position 2 (byte 4).
sebolblock sample2
long n1, n2
float f1
char*8 str8
long dSts
ssread 1, 5, 1, 2 ; dSts ; n1:long, n2:long, f1:float,
str8:char8
.....
end
(3) Write 10, 20, 30 and 40 to the four sets of data in the block with definition number
2, starting at relative position 3 (byte 6). If an entire array is specified (in the
example, data[*]), data is written in the number of array elements involved.
sebolblock sample3
integer data[4]

data[1] = 10
data[2] = 20
data[3] = 30
data[4] = 40

sswrite 1, 5, 2, 3; data[*]:integer
.....
end
(4) Read three sets of data from the block with definition number 2, starting at relative
position 4 (byte 8). If an entire array is specified (in the example, data[*]), data is
read in the number of array elements involved.
sebolblock sample4
integer data [3]

ssread 1, 5, 2, 4; data [*]:integer


.....
end

14-12 IM 33G3C20-11E
14. Subsystem Communication

14.2 Accessing Monitor Data


The statements used to access monitor data are:
• “ssread” statement to read the subsystem data of monitor declaration,
• “ssdtwrite” statement to write the subsystem data by communication, and
• “ssdtwritebit” statement to write the subsystem data bit-field by communication.
(1) Reading monitor data
To read the subsystem data of monitor declaration, which has been defined by the
process I/O builder. Up to 1024 words (2048 bytes) can be used to define each block
of data(*1). A single execution of the ssread statement reads multiple units of data
residing in one block, but it cannot access data extending over a number of blocks.
*1: The block of monitor declaration data described in this Section should be distinguished from function
blocks.

(2) Writing monitor data


The monitor declaration subsystem data are not written in the control station data
area. When data are written, subsystem communication is executed to write and set
the data in the subsystem. The ssdtwrite or ssdtwritebit statement is used for this
writing by communication. These statements are not completed until the communi-
cation is finished, requiring a certain period of time before executing any successive
statement. The ssdtwrite statement can also be used to transmit a command other
than subsystem data writing. For the data writing, builder definitions such as
monitor declaration are not required.

IM 33G3C20-11E 14-13
14.2.1 Reading Subsystem Data
The ssread statement reads subsystem data from the monitor declaration data area of the
control station.

ssread <line number>,<card number>,<access number>,<relative position>[,<option>]


;<data status storage variable>
;<data storage variable>:<data type>[,<data storage variable>:<data type>...]
[;<error variable>][; error <label>[,<error identifier>]]
errorsub

<line number> Specifies the ACM card line number using an integer constant or
variable (1 to 2).
<card number> Specifies the ACM card number using an integer constant or variable
(21 to 24).
<access number> Specifies an access number using an integer constant or variable
obtained by adding 1000 to the block number specified in the monitor
declaration (1001 to 1128).
<relative position> Specifies the relative position (in word units) from the start of the monitor
declaration-specified block using an integer constant or variable
(0 to 1023).
<option> Specifies a read option. See Section 14.3 for the description of options.
<data storage variable> Specifies a local variable into which data is read. The variable may be a
simple variable, array element, or entire array.
<data type> Specifies the subsystem data type — not a SEBOL variable type.
<data status storage variable> Specifies a double-length integer variable into which the data status of
the specified block is read and stored.
<error variable> Specifies a local variable into which the error code is loaded when an
error occurs. 0 is set when no error is present.
<label> Specifies the control branching destination in the case of an error.
<error identifier> Specifies a constant or variable that identifies the occurrence of an error
to the error handler.

Figure 14.7 “ssread” Statement

The ssread statement reads the monitor declaration data identified by <line number>,
<card number>, and <access number>. <line number> and <card number> determines
the ACM card through which communication is carried out between the control station
and the subsystem. <access number> determines the block of the ACM card, <relative
position> determines the position of the data, and <data type> fetches the data, which
are then read into the variable specified by <data storage variable>. Up to 32 sets of
<data storage variable>:<data type> can be specified.

14-14 IM 33G3C20-11E
14. Subsystem Communication

<error variable> loads in the specified local variable 0 when no error is present or an
error code when an error occurs. <label> specifies where control branches when an error
occurs. <error identifier> identifies the location of error to the error handler, which
obtains the <error identifier> data by means of a built-in function. See Chapter 10,
Error Processing, for the description of error handling.
Precautions in using the ssread statement are summarized below:
• If the ssread statement results in a subsystem communication error (classified error
code: 500), data are not read into any <data storage variable> at all. In this case, the
<data storage variable> data prior to the execution of the statement remain un-
changed.
• A single execution of the ssread statement cannot read data that exceed the range of
one block.
• One simple variable or array element should be specified as an error variable — an
entire array cannot be specified. The error variable in a ssread statement is not
returned with an error code for each set of <data storage variable>:<data type> but
only with one error code for that ssread statement.
• The data status is the same as in accessing DDC/SEQ data. See Subsection 14.1.2,
Data Status, for details.
• If I/O is separated in the test function, 0 is returned to the numeric <data storage
variable>, a null character string to the character string <data storage variable>, and 0
to data status.

IM 33G3C20-11E 14-15
14.2.2 Writing Subsystem Data
The ssdtwrite statement writes data in units of words to the subsystem. The ssdtwritebit
statement writes the bit fields. These statements execute communication to the sub-
system to write and set the data in the subsystem. They are properly terminated when
the communication is finished completing the writing.

● “ssdtwrite” statement

ssdtwrite <line number>,<card number>,<station number>,<address>[,<option>]


;<variable>:<data type>[,<variable>:<data type>...]
[;<error variable>][; error <label>[,<error identifier>]]
errorsub

● “ssdtwritebit” statement

ssdtwritebit <line number>,<card number>,<station number>,<address>[,<option>]


;<bit position>,<bit length>,<bit field data>
[;<error variable>][; error <label>[,<error identifier>]]
errorsub

<line number> Specifies the ACM card line number using an integer constant or variable
(1 to 2).
<card number> Specifies the ACM card number using an integer constant or variable
(21 to 24).
<station number> Specifies the station number for the subsystem, to which data are written,
using an integer constant or variable.
<address> Specifies the address of the data to write using a character string constant
or variable. The address can be a device number, etc., and represented
by an alphanumeric character string using up to 8 bytes — an error occurs
if the number of bytes is exceeded. Different addresses are used in
different subsystems.
<option> Specifies a write option. See Section 14.3 for the description of options.
<variable> Specifies a local variable in which the written data is stored using a simple
variable, array element, or entire array.
<data type> Specifies the subsystem data type — not a SEBOL variable type.
<bit position> Sets the bit position at 1 using a constant or variable.
<bit length> Specifies the length of the bits to write using an integer constant or variable
(0 to 32).
<bit field data> Specifies an integer constant or variable to store the data bits written right-
justified. A smaller address represents a lower bit.
<error variable> Specifies a local variable into which the error code is loaded when an error
occurs. 0 is set when no error is present.
<label> Specifies the control branching destination in the case of an error.
<error identifier> Specifies a constant or variable that identifies the occurrence of an error to
the error handler.

Figure 14.8 “ssdtwrite” & “ssdtwritebit” Statements

14-16 IM 33G3C20-11E
14. Subsystem Communication

The ssdtwrite statement converts <variable> to <data type> and then writes the data in
position starting at <address>. <line number> and <card number> specify the position
of the ACM card, and <station number> identifies the subsystem connected to the ACM
card. <address> specifies the position of the data in the subsystem — every subsystem
has a unique address.
The ssdtwritebit statement writes data in the specified bit fields of 32-bit integer data at
the subsystem’s <address> determined by <line number>, <card number>, and <station
number>. <bit position> is fixed at 1. When <bit length> is n, the data are set in the
subsystem as shown in Figure 14.9:

1 32
SEBOL <bit field data> 1 2 ...... n

1 n 32
Data set in subsystem 1 2 ...... n

Figure 14.9 Writing Bit Field Data

Locations other than the bit field specified (bits n+1 to 32 in Figure 14.9) retain data in
effect prior to the execution of the ssdtwritebit statement.
When <error variable> is specified for both ssdtwrite and ssdtwritebit statements, the
variable is loaded with 0 if no error is present or with an error code if an error occurs.
<label> specifies where control branches when an error occurs. <error identifier>
identifies the location of error to the error handler, which obtains the <error identifier>
data by means of a built-in function. See Chapter 10, Error Processing, for the descrip-
tion of error handling.
Precautions in using the ssdtwrite statement are summarized below:
• If the ssdtwrite statement results in a subsystem communication error (classified error
code: 500), data are not written at all. The subsystem data prior to the execution of
the statement remain unchanged.
• No more than 32 words (64 bytes) per line of data can be written in a single execu-
tion of the ssdtwrite statement.
• One simple variable or array element should be specified as an error variable — an
entire array cannot be specified. The error variable in a ssdtwrite statement is not
returned with an error code for each set of <data storage variable>:<data type> but
only with one error code for that ssdtwrite statement.
Precautions in using the ssdtwritebit statement are summarized below:
• An integer within a range of 1 to 32 should be specified to <bit length>. An error
occurs if the range is exceeded or a negative value is specified. Specifying 0 does not
cause an error but not data will be written.

IM 33G3C20-11E 14-17
The following precautions apply to both the ssdtwrite and ssdtwritebit statements:
• Even when the ssdtwrite or ssdtwritebit statement has been completed, the ssread
statement will not be able to read the written data until they are copied from the
subsystem data area to the monitor declaration data area of the control station. The
time required for the copying is dependent on the subsystem, communication defini-
tion, and transmission rate.
• A time-out error occurs for the ssdtwrite or ssdtwritebit statement if no response is
received from the ACM card within 60 seconds of the writing communication.
• If I/O is separated in the test function, data are not written but the ssdtwrite or
ssdtwritebit statement will be properly terminated.
• If more than 32 ssdtwrite or ssdtwritebit statements are executed at the same time
within the same control station, an error occurs when the 33rd statement is executed.

14-18 IM 33G3C20-11E
14. Subsystem Communication

14.2.3 Using Interrupt Programs


Precautions in using SFC block interrupt processing with the ssdtwrite and ssdtwritebit
statements are described. (For the description of SFC block interrupt processing, refer
to SFC Block Function Manual (IM 33G3C31-11E).
When a signal or a status change command is received while the ssdtwrite or
ssdtwritebit statement is being executed, the SFC block interrupt processing will not be
executed until the statement is completed as described below:
In an example shown in Figure 14.10, an interrupt signal is received during the execu-
tion of the ssdtwrite statement. When the statement is executed in the main program, a
write request is sent to the subsystem (1) and the statement will be kept being executed
until the subsystem returns the response (3). Meanwhile an interrupt signal is received
(2) during the execution but the signal will not be executed until the statement is
completed (4).

Main program Interrupt signal processing

(1)
Write request
(2)
Interrupt signal

ssdtwrite
Subsystem executed
(3) (4)
Response

Figure 14.10 Interrupt Signal & “ssdtwrite” Statement

• The received interrupt signal is not processed until the data are written by the
ssdtwrite or ssdtwritebit statement and set in the subsystem.
• The execution of the ssdtwrite or ssdtwritebit statement takes several seconds. The
time required to complete the writing is dependent on the subsystem.
• The execution of an SFC block interrupt signal or a post status-change processing is
delayed until immediately after completing the execution of the ssdtwrite or
ssdtwritebit statement.
• The SFC block pre-status-change processing is executed instantly when a status
change command is received.
• The SEBOL block or the SFC block that has no post-STOP status-change processing
immediately stops when the STOP command is received during or before completing
the execution of the ssdtwrite or ssdtwritebit statement.
• No precautions are required in using the ssdtwrite and ssdtwritebit statements with
SEBOL blocks since they do not allow the description of interrupt processing.

IM 33G3C20-11E 14-19
If it is absolutely necessary to have an interrupt signal processed while the ssdtwrite or
ssdtwritebit statement is being executed, an SFC block that processes the interrupt signal
and an SFC/SEBOL block that writes data in the subsystem should be used in combina-
tion as described below.
In an example shown in Figure 14.11, an SFC block (SFCINTR) used for interrupt
processing stops another SFC block (SFCSBSYS) used for writing data in the sub-
system. SFCINTR does not use the ssdtwrite or ssdtwritebit statement and is thus able
to execute the interrupt program immediately upon receiving a signal or a status change
command. SFCINTR also stops SFCSBSYS in the post-status-change processing when
the STOP status change command is received.

SFCINTR

1 Initialize Post-PAUSE process *Processing when stopped


. . . . .
. . . . .
if (SFCSBSYS.BSTS == "RUN") then
2 Interrupt wait Post-STOP process
SFCSBSYS.BSTS = "STOP"
end if
. . . . .
SFCSBSYS return
1 Initialize

. . . . .
2 Data setting ssdtwrite 1,3,3, "SM0a", 0; 10:integer
. . . . .

Figure 14.11 Interrupt Processing

14-20 IM 33G3C20-11E
14. Subsystem Communication

14.3 Options
Options that can be used with some SEBOL subsystem statements are described. These
options are 32-bit integers and used as shown in Table 14.8.

Table 14.8 Options

Value Use (1) (2) (3) (4) (5)


$00000001 Generates error when data status is BAD. ● × × × ×
$00000002 Generates error when RIO momentary power failure. × × × ● ●

(1) ssread statement


(2) sswrite statement
(3) sswritebit statement
(4) ssdtwrite statement
(5) ssdtwritebit statement
●: Applicable ×: Not applicable

• $00000001
When this option is used with the ssread statement, an error is caused if the data
status becomes BAD during the execution of the statement. Otherwise no error
occurs and the statement properly ends even when the data status is BAD.
• $00000002
When this option is used with the ssdtwrite or ssdtwritebit statement , an error is
caused if the subsystem power momentarily fails during the execution of the state-
ment. Otherwise no error occurs and the statement rewrites data.

IM 33G3C20-11E 14-21
15. Signaling Operation

15. Signaling Operation


This chapter highlights the “signal” statement, which sends signals, and statements that
control signal receive processing.
For relevant information, refer to SFC Block Function Manual (IM 33G3C31-11E).

15.1 Signal Names and Signal Parameters


The signals SFC blocks receive are assigned signal names, which are character strings
not exceeding 8 bytes. Up to eight signal parameters can be appended to signals.
Signal parameters are of the type integer, long, float, double, and character string.
Signal parameters of the type character string are up to 16 bytes.

15.2 Queued Signals and Interrupt Signals


SFC blocks can handle two kinds of signals, queued signals and interrupt signals.
Queued signals are queued as they are received, so they will be dequeued for signal
handling later at any timing convenient to the main program. Signals that interrupt the
main program as an interrupt program for handling are called interrupt signals.
Whether a particular signal is a queued signal or interrupt signal is determined by the
definition of the SFC block that executes signal receive processing. If the signal name
has been defined in the “queue signal” statement in the initial step in the SFC block, the
signal is a queued signal. If the signal name has been defined at the entry of an inter-
rupt signal handler, the signal is an interrupt signal. The signal type is not specified at
signal transmission time.

IM 33G3C20-11E 15-1
15.3 “signal” Statement
The “signal” statement allows SFC/SEBOL blocks to send both queued signals and
interrupt signals to SFC blocks.
It also can transmit signals to units. For details, refer to SFC Block Function Manual
(IM 33G3C31-11E), Section 4.5, Signals to Unit Instruments.

(1) Sending to the local SFC block

signal <signal name>[,<signal parameter>…]


[;<error variable>] [; error <label>[,<error identifier>]]
errorsub

(2) Sending to a remote SFC block

signal <signal name>[,<signal parameter>…]to<tag name>


[return<return signal name>]
[;<error variable>] [; error <label>[,<error identifier>]]
errorsub

(3) Sending to another plant's SFC block

signal <signal name>[,<signal parameter>…]to<tag name>,<plant name>


[return<return signal name>]
[;<error variable>] [; error <label>[,<error identifier>]]
errorsub

<signal name> Specifies the signal name with a character string constant or
character string variable not exceeding 8 bytes.
<signal parameter> Specifies a signal parameter with a numeric expression or charac-
ter string. The signal parameter is of the type integer, long, float,
double, and character string. If the character string exceeds 16
bytes, only the first 16 bytes are accepted. Up to eight signal
parameters can be specified.
<tag name> Specifies the tag name of the signal recipient SFC block. It is the
tag name declared in a “block” statement, local generic name
declared in a “genname” statement, or a function block with the
formal argument declared in an “argblock” statement.
<plant name> Specifies the plant name with a character string constant or
character string variable not exceeding 8 bytes.
<return signal name> Name of the signal that the SFC block, on receiving a queued
signal, returns to start signal handling.
<error variable> Specifies the local variable in which an error code is set when
errors occur. It is set to 0 in the absence of errors.
<label> Specifies where control should branch when errors occur.
<error identifier> Specifies a constant or local variable to identify the location of an
error during an error handler.

15-2 IM 33G3C20-11E
15. Signaling Operation

The “signal” statement in format (1) sends a signal to the SFC block that has executes
the “signal” statement. Using this format in a SEBOL block program would invoke a
compile error, since SEBOL blocks cannot receive signals.
The “signal” statement in format (2) sends a signal to the SFC block having a specified
tag name even when it exists in a control station separate from the SFC/SEBOL block
that executes the “signal” statement.
In both formats (1) and (2), the “signal” statement causes a runtime error to occur if the
signal recipient SFC block cannot receive the signal.
The tag name of the signal recipient SFC block can be altered as desired by using a
local generic name in format (2). Assume that a return signal name is specified in the
first parameter of the signal that an SFC block has received, with the tag name character
string of the SFC block to which the signal is to be returned in the second parameter.
The program below retrieves the signal name and the recipient SFC block tag name with
the “creadpara” built-in function. The SFC block, on receiving the signal, associates the
local generic name, gen001, with the tag name of the recipient SFC block using the
“assign” statement, then returns the signal to that recipient SFC block.

......
genname SFC gen001
char*16 signame,tagname
......
signame = creadpara(1)
tagname = creadpara(2)
assign tagname to gen001
signal signame to gen001
......

The “signal” statement in format (3) sends a signal to an SFC block existing in another
plant.
If return<return signal name> is specified when a queued signal is sent to a remote SFC
block, the queued signal recipient SFC block returns the signal with <return signal
name> to the SFC block that executed the “signal” statement at the timing at which it
starts signal receive processing by exiting from the “wait for qsignal” statement.
The first parameter of the return signal is of the type long and assumes one of the values
listed in Table 15.1.

Table 15.1 First Parameter of Return Signal

Value Meaning
0 Signal handling has started
1 Signal canceled (*1)
2 SFC block aborted before the start of signal handling (*2)
3 Error detected while dequeuing a queued signal

*1: If the SFC block that has sent the signal cancels the signal by itself, no return signal is sent.
*2: An SFC block returns a return signal when it stops and not when it halted by a fatal error or ABRT
command (thereby entering the ABRT block status).

IM 33G3C20-11E 15-3
The execution of a “signal” statement with the return option would invoke a runtime
error in the following situations:
• The “signal” statement with the return option is run in a SEBOL block.
• The SFC block that ran the “signal” statement does not have an interrupt signal
handler with <return signal name> defined and <return signal name> has not been
defined in the “queue signal” statement either.
• The signal name has not been defined in the “queue signal” statement in the signal
recipient SFC block.

Since the signal that is sent by a “signal” statement with the return option is a queued
signal, an error would result even if an interrupt signal handler with the signal name is
defined in the signal recipient SFC block. The signal is discarded without being
received.
On receiving the queued signal, the SFC block returns the signal with <return signal
name> to the SFC block that executed the “signal” statement at the timing at which it
starts signal receive processing (*2). If the SFC block that executed the “signal”
statement is unable to receive the return signal (*3), a SEBOL error message is output
for the SFC block that attempted to send the return signal (*4). The execution of the
SFC block to which return signal transmission was attempted, however, is unaffected in
any way, except that the SEBOL error message is output. Control does not branch even
if a common error handler is defined.

*2: The timing at which the signal recipient SFC block exists from the “wait for qsignal” statement. For
more details, refer to SFC Block Function Manual (IM 33G3C31-11E).
*3: Once the maximum number of queued signals has been received, no more signal can be received.
*4: The system sends a return signal when a queued signal is canceled or the queued signal receiving SFC
block is halted. If this transmission results in an error, the line and step numbers in the resultant SEBOL
error message indicate the position of the “wait for qsignal” statement.

15-4 IM 33G3C20-11E
15. Signaling Operation

15.4 Manipulating Queued Signals


The “qsigcancel” statement and the “qsigmove” statement manipulates queued signals on
a local or remote SFC block (but not interrupt signals). The “qsigcancel” statement
dequeues a signal and cancels it. The “qsigmove” statement moves a specified signal to
the top of the queue. Using the “qsigmove” statement allows users to select the next
signal to process.
The “qsigcancel” statement and the “qsigmove” statement manipulate signals queued for
processing. Signals that have been put into process by the “wait for qsignal” statement
is unaffected in any way by the execution of the “qsigcancel” or “qsigmove” statement.

qsigcancel[to<tag name>[,<plant name>]]result<number of signals canceled>


[;<error variable>] [; error <label>[,<error identifier>]]
errorsub

qsigcancel <signal name>[,<signal parameter number>.<signal parameter>]


[to<tag name>[,<plant name>]]result<move result>
[;<error variable>] [; error <label>[,<error identifier>]]
errorsub

qsigmove <signal name>[,<signal parameter number>,<signal parameter>]


[to<tag name>[,<plant name>]]result<move result>
[;<error variable>] [; error <label>[,<error identifier>]]
errorsub

<signal name> Specifies the queued signal name with a character string
constant or character string variable not exceeding 8
bytes.
<signal parameter number> Specifies a signal parameter number with a numeric
expression.
<signal parameter> Specifies a signal parameter with a numeric expression
or character string. The signal with its signal parameter
<signal parameter number> matching the <signal
parameter> is controlled.
<tag name> Specifies the tag name of the SFC block on which to
manipulate queued signals. It is the tag name declared
in a “block” statement, local generic name declared in a
“genname” statement, or a function block with the
formal argument declared in an “argblock” statement.
Omit this parameter when manipulating queued signals
on the local SFC block.
<plant name> Specifies the plant name with a character string constant
or character string variable not exceeding 8 bytes.
<number of signals canceled> Specifies the name of an integer local variable in which
the number of signals dequeued is set.
<move result> Specifies the name of an integer local variable in which
the move result is set. 1 is returned if the specified
signal is placed on top of the queue. 0 is returned if the
specified signal is not found in the queue.

IM 33G3C20-11E 15-5
To manipulate a queued signal on the local SFC block, run the “qsigcancel” or
“qsigmove” statement without specifying a tag name. To manipulate a queued signal on
a remote SFC block, run the “qsigcancel” or “qsigmove” statement with the tag name
specified.
SEBOL blocks can manipulate queued signals on remote SFC blocks. SEBOL blocks
cannot use a “qsigcancel” or “qsigmove” statement without having a tag name specified.
A plant name specification is also needed to manipulate SFC blocks in other plants.
If the “qsigcancel” statement is run without parameters specified, all the signals queued
for processing on the current SFC block are canceled. If the “qsigcancel” statement is
run with <signal name> specified, all the signals having the <signal name> are canceled.
The number of dequeued signals is returned to <number of signals canceled>. 0 is
returned if none have been canceled. (The “qsigcancel” statement ends normally.) If
the signal name has not been defined in the “queue signal” statement in the initial step
in the SFC block, the “qsigcancel” statement results in a runtime error. The scope of
signals that are manipulated can be narrowed by specifying <signal parameter number>
and <signal parameter>
Writing

qsigcancel “SIG1”,1, “HI” result ncancel

will cancel signals with the signal name “SIG1” having the “HI” as their first parameter,
with the number of signals thus canceled being returned to the variable ncancel.
Writing

qsigcancel “SIG2”,2,5 result ncancel

will cancel signals with the signal name “SIG2” having 5 as their second parameter.
Figure 15.1 shows a sample run of the “qsigcancel” statement.
If a numeric signal parameter is used to narrow the scope of signals that are manipu-
lated, use one of the type integer (integer or long). A signal parameter of the type real
(float or double) should deserve special notice, for data of the type real could be
evaluated as being a mismatch due to errors. Because data of the type real has a finite
precision, it is bound to produce a negligible error on calculation or type conversion
from double to float. Comparing with a value involving an error results in a mismatch.

15-6 IM 33G3C20-11E
15. Signaling Operation

The “qsigmove” statement moves a specified signal to the top of the queue. Only one
signal can be manipulated. Even if there is more than one applicable signal, only the
signal closest to the top of the queue is manipulated. Figure 15.2 shows a sample run
of the “qsigmove” statement.

Signal queue

SG2 SG1 SG1 SG3 SG1

5 3 7 0 3

Run qsigcancel ”SG1”, 1, 3 result ncancel.

Signal queue

SG2 SG1 SG3

5 7 0

Figure 15.1 Sample Run of “qsigcancel” Statement

IM 33G3C20-11E 15-7
Signal queue

SG2 SG1 SG1 SG3 SG1

5 3 7 0 3

Run qsigmove ”SG1”, 1, 3 result nmove.

Signal queue

SG1 SG2 SG1 SG3 SG1

3 5 7 0 3

Figure 15.2 Sample Run of “qsigmove” Statement

15-8 IM 33G3C20-11E
15. Signaling Operation

15.5 Masking Interrupt Signal Handling


Interrupt signal handling can be masked with the “isigmask” statement and unmasked
with the “isigunmask” statement.

isigmask
isigunmask

The “isigmask” statement and the “isigunmask” statement have effect on all the interrupt
signals in the current SFC block.
Interrupt signals cannot be masked individually by name. Interrupt signals are not
masked by default.
Even if an interrupt signal is received while interrupt signals are masked, an interrupt
signal handler is not invoked. Interrupt signals that are received while interrupt signals
are masked are stored, so that control will pass to an interrupt signal handler as soon as
the interrupt signals are unmasked.
The execution of the “isigmask” or “isigunmask” statement does not affect the interrupt
signal handler in progress in any way.

IM 33G3C20-11E 15-9
Appendix

Appendix 1 Error Codes


This appendix lists classified error codes and their descriptions. Those that have detailed
error code information are so noted.

App. 1.1 Classified Error Codes


(1) Operation Errors, etc.

Decimal Hexadecimal Detailed Code Description


1 $0001 Operation overflow.
2 $0002 Type-conversion overflow.
3 $0003 Zero division.
4 $0004 Underflow (reserved).
5 $0005 Invalid operation.
6 $0006 Array-subscript calculation overflow.
10 $000A Out-of-range array-subscript.
11 $000B Assigning value to a constant attempted.
Character-string array specified where only numeric
12 $000C
array accepted.
Numeric data specified where only character-string
13 $000D
data accepted.
14 $000E Numeric and character-string data used mixedly.
20020 $4E34 Operation stack overflow.
20021 $4E35 Character-string range exceeded.
30 $001E Out-of-range array-subscript in error variable.

31 $001F Type-conversion overflow in error-variable setting.

32 $0020 Error-variable setting error.

(2) Function Block-Related Errors (expressions and statements)

Decimal Hexadecimal Detailed Code Description


100 $0064 Available Function block-data access error.
101 $0065 Function block-data type invalid.
102 $0066 “compare” statement produced inconsistent
results.
103 $0067 Null brand-name string.
104 $0068 Numbers of LH- and RH-side data not equal.
105 $0069 Number of LH-side data less than RH-side data.
Number of LH-side data greater than RH-side
106 $006A
data.
107 $006B Number of error-arry elements less than number
of data.
108 $006C Number of data exceeded 32.
109 $006D Number of data exceeded 16.

118 $0076 Non-standard floating point data set as function-


block data.
Infinite floating point data set as function-block
119 $0077
data.

IM 33G3C20-11E Appendix 1-1


(3) “drive” Statement Errors

Decimal Hexadecimal Detailed Code Description


120 $0078 Specified function-block cannot be used.
121 $0079 Specified block mode cannot be used.
122 $007A Other than 0, 1, and 2 entered.
123 $007B Block mode changed during execution of statement.
124 $007C MV changed during execution of statement.
125 $007D MV changed after answerback check completed.
126 $007E ANS– alarm caused during execution of statement.
127 $007F ANS+ alarm caused during execution of statement.
128 $0080 PERR alarm caused during execution of statement.

(4) Local Generic Name Errors

Decimal Hexadecimal Detailed Code Description


141 $008D Unassigned local generic name used.
142 $008E Available “assign” statement error
148 $0094 Null tag number character string
Generic name marked by an asterisk (*) used (No error
149 $0095
message is output.)
Actual argument not generic name (%, %%, block-
150 $0096
declared tag name, etc.)

*1: These classified error codes indicate an error that occurred in a unit sequence being run in the same unit
as the unit sequence in which the “assign” statement was executed.

(5) “seqtable”, “oneshot” and “logicchart” Statement Errors

Decimal Hexadecimal Detailed Code Description


160 $00A0 Available Error in execution of statement.
161 $00A1 Function block in another control area
162 $00A2 Function block other than a sequence table
163 $00A3 Function block other than a logic chart
164 $00A4 Function block unable to run cyclically
165 $00A5 Function block unable to run by one-shot execution
SFC block aborted due to an error detected in a
20166 $4EC6
sequence table step or logic chart step
“oneshot” statement cannot start sequence table or logic
167 $00A7
chart.

(6) Process Management

Decimal Hexadecimal Detailed Code Description


180 $00B4 Available Common block data access error
20181 $4ED5 Batch ID not specified
182 $00B6 Available urload or urassign execution error
183 $00B7 Invalid unit recipe number
184 $00B8 Available rpreserve() execution error
185 $00B9 Recipe group number error
186 $00BA Length of Batch ID string is 0.

Appendix 1-2 IM 33G3C20-11E


Appendix

(7) “time” and Other Specification Errors

Decimal Hexadecimal Detailed Code Description


220 $00DC “time” specification counted up.

221 $00DD Negative value specified in “delay” or “delaycycle”


statement.

(8) “dialogue” Statement Errors

Decimal Hexadecimal Detailed Code Description


250 $00FA Available Error in execution of statement.
251 $00FB “retry” executed without executing statement.
Number of statement that control station can
252 $00FC
simultaneously execute exceeded.
Number of statements that SFC/SEBOL block can
253 $00FD
simultaneously execute exceeded.
Type of input variable in reentry-type statement not
255 $00FF compatible with input variable in data entry-type
statement.

(9) Message-Related Errors

Decimal Hexadecimal Detailed Code Description


270 $010E Available “snapshot” execution error.
271 $010F No output value for formatting string conversion.
272 $0110 Non-standard floating-point data (nan)
280 $0118 Available Message output failure.
281 $0119 Out-of-range message number.
282 $011A Out-of-range parameter value.
291 $0123 NR specified in process alarm string.
292 $0124 Process alarm string not builder-defined.
293 $0126 Null process-alarm string.

295 $0127 Attempt to output more than three messages while CPU
time was monopolized.
Attempt to output more than one process alarm while
296 $0128
CPU time was monopolized.

IM 33G3C20-11E Appendix 1-3


(10) Event-Related Errors

Decimal Hexadecimal Detailed Code Description


Communication error in signal/status/mode change
300 $012C Available instruction for another control station.

301 $012D Available Communication error in signal/status/mode change


instruction for present control station.
302 $012E Function block with a model name beyond manipulation

303 $012F Attempt to execute a “signal” statement with a return


specification in a SEBOL block
Signal receive procedure with a return signal name not
304 #0130 existing in the SFC block in which the “signal” statement
was executed.
305 $0131 Available %EV signal send error

306 $0132 Attempt to execute a “qsigcancel/qsigmove” statement


without a tag number specified in a SEBOL block
307 $0133 Signal parameter number out of limits
308 $0134 Available Return signal send error (Transmission to another station
Return signal send error (Transmission within the local
309 $0135 Available
station)
310 $0136 Available “wait for qsignal” statement execution error

311 $0137 Attempt to execute a “wait for qsignal” statement in a


SEBOL block
312 $0138 Available Error detected while canceling a queued signal

313 $0139 Available “signal” statement execution error (Signal to the


operation and monitoring functions)
314 $013A Null program name character string
315 $013B Invalid station number
316 $013C Invalid domain number
317 $013D Operation and monitoring function signal receive error

Appendix 1-4 IM 33G3C20-11E


Appendix

(11) SFC/SEBOL Block Control Errors

Decimal Hexadecimal Detailed Code Description


Cannot change the block mode to O/S in the RUN block
331 $014B status
332 $014C Cannot change the block status from ABRT to STOP
333 $014D Cannot change the block status from ABRT to RUN
Cannot receive the status change command RSET in the
334 $014E RUN block status
335 $014F Cannot change the block status from STOP to ABRT
336 $0150 Cannot change the block status in O/S block mode
337 $0151 Available Error detected while changing BSTS or STEPNO
Cannot receive the status change command RSET in the
338 $0152 PAUS block status
339 $0153 Unable to change the block status from ABRT to PAUS

341 $0155 Cannot change the block mode to SEMI due to the
specification of the SEMI mode operation
Cannot change the block status while change preprocessing
342 $0156
is in progress

343 $0157 Cannot change the block status while status change
postprocessing is in progress
Cannot change the block status while SEBOL/SFC
344 $0158 block termination processing is in progress

345 $0159 Cannot run an SFC block while the function block type
definition is under online maintenance
Cannot run an SFC/SEBOL while an SFC sequence or
346 $015A SEBOL block main program is under online
maintenance
Cannot find the database associated with a specified
20347 $4F7B SFC sequence name

20348 $4F7C SFC sequence or SEBOL block main program not


existing
20349 $4F7D SEBOL station common database not existing
350 $015E Status unchangeable in status change preprocessing
351 $015F Error detected in status change preprocessing

352 $0160 Maximum number of lines of status change


preprocessing exceeded

353 $0161 Cannot change the block mode while status change
preprocessing is in progress

354 $0162 Cannot change the block mode while status change
postprocessing is in progress
Cannot change the block mode while SEBOL/SFC
355 $0163 block termination processing is in progress

356 $0164 Online maintenance of the SFC sequence or SEBOL block


main program yet to be completed
20357 $4F85 SEBOL area database not existing

358 $0166 Cannot run an SFC/SEBOL block because it is under online


maintenance
360 $0166 Interrupt handling step number specified
361 $0167 Non-existing step number specified
Cannot change STEPNO except in the PAUS block
362 $0168
status
Cannot change STEPNO while status change
363 $0169 preprocessing is in progress

364 $016A Cannot change STEPNO while status change


postprocessing is in progress

IM 33G3C20-11E Appendix 1-5


(12) Operation
Decimal Hexadecimal Detailed Code Description
Cannot change block status of the operation with
380 $017C
“independent” option.
381 $017D Cannot run an operation when not from a unit
“independent” statement used in the SFC block is
382 $017E not an operation SFC

(13) Execution Control Errors

Decimal Hexadecimal Detailed Code Description


20411 $4FBB “entry error” directly reached.
20412 $4FBC Interrupt signal handling directly reached.
20413 $4FBD Status change preprocessing directly reached.
20414 $4FBE Status change postprocessing directly reached.

20420 $4FC4 Execution of statement that main program cannot


execute attempted.
Attempt to run a statement unexecutable in an interrupt
20421 $4FC5 handling routine.

20423 $4FC7 Attempt to run a statement unexecutable by status


change command preprocessing.
20425 $4FC9 Execution of statement unexecutable by function attempted.
20430 $4FCE Execution of unsupported statement attempted.
20431 $4FCF Execution of unsupported built-in function attempted.
20432 $4FD0 Access to unsupported variable attempted.
20433 $4FD1 Use of unsupported operator attempted.
Execution of delayed statement attempted using function
440 $01B8 called in conditional expression of “wait until” statement.
Attempt to run a statement not executable while CPU
450 $01C2
time was monopolized.

451 $01C3 Maximum number of lines exceeded while CPU


time was monopolized.
452 $01C4 Delay attempted while CPU time was monopolized.

(14) Subsystem Communication

Decimal Hexadecimal Detailed Code Description


500 $01F4 Available Subsystem communication execution error
501 $01F5 Total data size in excess of 128 words

502 $01F6 Nonstandard floating-point data read from the


subsystem
Overflowing floating-point data read from the
503 $01F7
subsystem
504 $01F8 Total data size in excess of 1024 words
505 $01F9 Total data size in excess of 64 words
Number of ssdtwrite/ssdtwritebit statements in excess
506 $01FA
of upper limit executable at station
507 $01FB Address characters in excess of 8 bites

Appendix 1-6 IM 33G3C20-11E


Appendix

(15) User-Defined Function

Decimal Hexadecimal Detailed Code Description


20600 $5078 User function calls nested at more than six levels.
Attempt to execute an “ereturn” statement without a
20601 $5079 return address.
20602 $507A Function not existing in the database.
20603 $507B Function not builder-defined.
604 $025C Return value not received.
20605 $507D Accessed function-block data exceeds 32767.
Forcibly terminating SFC/SEBOL block beacause online
20606 $507E maintenance of function is not terminated.
20607 $507F Forcibly terminating SFC/SEBOL block because online
function loading is not terminated.
Waiting for completion of online maintenance of function
608 $0260 (*1).
609 $0261 Waiting for completion of online function loading (*1).
Overflow or zero-division detected in calculation of actual
20610 $5082 argument array subscript expression.
20620 $508C Numbers of formal and actual arguments not in agreement.
Formal argument is a simple local variable, disallowing
20621 $508D *2 assignment of entire local variable array to actual argument.
Formal argument is a simple local variable, disallowing
20622 $508E *2 assignment of function block to actual argument.
Formal argument is an entire local variable array,
20623 $508F *2 disallowing assignment of simple local variable or constant
to actual argument.
Formal argument is an entire local variable array,
20624 $5090 *2 disallowing assignment of local variable array element to
actual argument.
Formal argument is an entire local variable array,
20625 $5091 *2 disallowing assignment of function block to actual
argument.
Formal argument is a simple function block, disallowing
20626 $5092 *2 assignment of entire function-block array to actual
argument.
Formal argument is a simple function block, disallowing
20627 $5093 *2 assignment of local variable or constant to actual argument.
Formal argument is an entire function-block array,
20628 $5094 *2 disallowing assignment of simple function block to actual
argument.
Formal argument is an entire function-block array,
20629 $5095 *2 disallowing assignment of function-block array element to
actual argument.
Formal argument is an entire function-block array,
20630 $5096 *2 disallowing assignment of local variable or constant to
actual argument.
Formal argument is a character-string local variable,
20631 $5097 *2 disallowing assignment of numeric local variable or
constant to actual argument.
Formal argument is a numeric local variable, disallowing
20632 $5098 *2 assignment of character-string local variable or constant to
actual argument.
Formal argument is a character-string local variable array,
20633 $5099 *2
disallowing numeric local variable array to actual argument.
Formal argument is a local variable array, disallowing
20634 $509A *2 assignment of character-string local variable array to actual
argument.
Formal and actual arguments are both numeric local arrays
20635 $509B *2 but data types are different.

*1: If online maintenance is completed before fatal error 20606 or 20607 is caused, the SFC/SEBOL block
properly calls functions to continue operation even when error 608 or 609 has been caused.
*2: Detailed error codes use the numbers of arguments, counting 1, 2, 3, and so on from the left.

IM 33G3C20-11E Appendix 1-7


(16) Semaphores

Decimal Hexadecimal Detailed Code Description


Number of semaphores exceeded builder-defined for
701 $02BD
control area
Specified semaphore is locked by another SFC/SEBOL
702 $02BE
block.
703 $02BF Specified semaphore is already locked by SFC/SEBOL
block concerned.
704 $02C0 SFC/SEBOL block concerned is waiting for unlocking
of specified semaphore.
705 $02C1 Specified semaphore is not locked by SFC/SEBOL
block concerned.
706 $02C2 Semaphore has null-character-string name.
Number of semaphores builder-defined for control area
707 $02C3
is negative or exceeds 64.
708 $02C4 Detailed Semaphore execution error.

(17) Valve Pattern Monitor

Decimal Hexadecimal Detailed Code Description


730 $02BA Detailed Valve patter monitor execution error.
Generic name with * specification specified in vpmstart
731 $02BB
statement.
732 $02BC Parameter out of range.
733 $02BD time specification value out of range.
Data is not registered in valve pattern monitor because
734 $02BE an error was detected in other data on the same line.
Data is not deleted from valve pattern monitor because
735 $02BF an error was deteccted in other data on the same line.
Data is not registered in valve pattern monitor because
736 $02C0 output value of drive vpmon statement is 1. (The drive
statement works.)
Signal transmission error (from valve pattern monitor to
20740 $5104 Detailed unit) (This error message is output by valve pattern
monitor.)

Appendix 1-8 IM 33G3C20-11E


Appendix

(18) Built-In Function-Related Errors


Decimal Hexadecimal Detailed Code Description
800 $0320 Calculation overflow within function.
801 $0321 Zero division in calculation within function.
Square-root calculation of negative value attempted
802 $0322
within function.
803 $0323 Error in “power()” or log()” argument.
Absolute value in trigonometric function argument too
804 $0324
large to calculate.
805 $0325 Error caused in calculation of arithmetic function.
Error in character-string length or character position
806 $0326
(left/right/mid function).
807 $0327 Low-limit value larger than high-limit value.
810 $032A Error in number of arguments.
811 $032B Error in argument type.
830 $033E Unset error identifier referenced.
Cannot reference an error identifier because of an error
831 $033F
committed during its setting
850 $0352 Signal parameter number out of limits
851 $0353 Signal parameter type not matching the function type
creadpara, Ireadpara, or dradpara executed in a commo
852 $0354
error handling routine
Cannot get a signal parameter because there is no
853 $0355
queued signal in process
854 $0356 ckstep executed in a SEBOL block
855 $0357 ckstepcl executed in a SEBOL block
870 $0366 Non-existing data status specified.

(19) Other Errors

Decimal Hexadecimal Detailed Code Description

20901 $51A5 SFC/SEBOL block cannot be started due to dynamic


area insufficiency.
20903 $51A7 Function cannot be called due to dynamic area
insufficiency.
905 $0389 Unsupported foreign language used
Insufficient dynamic area remaining (informed by
910 $038E *1
message when SFC/SEBOL block started) *2.
Insufficient dynamic area remaining (informed by
911 $038F *1
message when function called) *3.

*1: The detailed error code is a control area number.


*2: The tag number accompanying this message indicates that the remaining area available for dynamic
allocation has fallen to below 10% since the invocation of the function block..
*3: The function name accompanying this message indicates that the remaining area available for dynamic
allocation has fallen to below 10% since the invocation of the function block.

IM 33G3C20-11E Appendix 1-9


App. 1.2 Detailed Error Codes
Decimal Hexadecimal Description
16 $0010 FCS or V-net at destination failed.
19 $0013 Timeout (no response from FCS at destination)
Attempt to set data other than the character string ACK in the data item name
8194 $2002
AFLS
Equalization of the tag information on the old FCS to be referenced or set up
8196 $2004
yet to be completed
8226 $2022 Tag name to be referenced or set up not existing in the BCV
Invalid connection destination information on an instrument, such as a batch
8244 $2034
data set unit
Required data item wanting in the connection destination tag of an instrument,
8245 $2035
such as a batch data set unit
8246 $2036 More than eight frames specified for transmission to HF
8247 $2037 Failed station with the tag to be referenced or set up
8249 $2039 Communication between the RCV and old FCS aborted
8261 $2045 Setup error due to an undefined status name
8262 $2046 Setup validity check error due to an undefined status name
8273 $2051 Validity check for setting up data in a data item name without status or batch data
8704 $2200 Attempt to set up data in an illegal data item name
Attempt to set up CAL in a tag that does not support the status name CAL in an
8705 $2201
XL instrument
Attempt to set up CAL in a tag that does not support the status name CAL in a CFCD
8706 $2202
instrument
Attempt to set up NCL in a tag that does not support the status name CAL in a CFCD
8707 $2203
instrument
Attempt to set up START or STOP as TM or CT that does not support START
8708 $2204
or STOP in a CFCD instrument
8709 $2205 Attempt to set up an undefined status name as TM in a CFCD instrument
8710 $2206 Attempt to set up CMP in the loop of an XL instrument without a CMP mark
Attempt to set up SPC or DDC in the loop of a CFCD instrument without a CMP
8713 $2209
mark
Status change to a CFCD instrument attempted while status changes were not
8714 $220A
permitted
8715 $220B Status name not existing in the current tag set up in an XL instrument
8718 $220E Status name not existing in the current tag set up in a CFCD instrument
Status change to a CFCD instrument attempted while status changes were not
8720 $2210
permitted
8725 $2215 Setup validity check made for a non-status data item
8770 $2242 Data type of the setup data not supported by BCV
8771 $2243 Data type of the setup data not supported by BCV
8772 $2244 Data type of the setup data not supported by BCV
8773 $2245 Data type of the setup data not supported by BCV
8774 $2246 Data type of the setup data not supported by BCV
8775 $2247 Data type of the setup data not supported by BCV
8776 $2248 Setup data out of limits
8777 $2249 Data type of the setup data not supported by BCV
8778 $224A Setup data out of limits
8779 $224B Data type of the setup data not supported by BCV
8780 $224C Setup data out of limits
8781 $224D Setup data out of limits
8782 $224E Setup data out of limits
8783 $224F Setup data out of limits
8784 $2250 Data type of the setup data not supported by BCV
8785 $2251 Data type of the setup data not supported by BCV
8786 $2252 Data type of the setup data not supported by BCV
8787 $2253 Data type of the setup data not supported by BCV
8788 $2254 Data type of the setup data not supported by BCV

Appendix 1-10 IM 33G3C20-11E


Appendix

Decimal Hexadecimal Description


8789 $2255 Data type of the setup data not supported by BCV
8790 $2256 Data type of the setup data not supported by BCV
8791 $2257 Data type of the setup data not supported by BCV
Data item name not existing in the instrument having the tag name to be set
9216 $2400
up or referenced
Setup in the data item name ASET, RSV, or RMV attempted while the status
9472 $2500
did not permit setup
SV (or MV) less than the current SV (or MV) set up in the data item name
9473 $2501
ASET, RSV, or RMV while the status was CLP–
SV (or MV) greater than the current SV (or MV) set up in the data item name
9474 $2502
ASET, RSV, or RMV while the status was CLP+
SV (or MV) less than the current SV (or MV) set up in the data item name
9475 $2503
ASET, RSV, or RMV while the status was CLP–
SV (or MV) greater than the current SV (or MV) set up in the data item name
9476 $2504
ASET, RSV, or RMV while the status was CLP+
SV (or MV) less than the current SV (or MV) set up in the data item name
9477 $2505
ASET, RSV, or RMV while the status was CLP–
SV (or MV) greater than the current SV (or MV) set up in the data item name
9478 $2506
ASET, RSV, or RMV while the status was CLP+
SV (or MV) less than the current SV (or MV) set up in the data item name
9479 $2507
ASET, RSV, or RMV while the status was CLP–
SV (or MV) greater than the current SV (or MV) set up in the data item name
9480 $2508
ASET, RSV, or RMV while the status was CLP+
Setup in the data item name ASET, RSV, or RMV attempted while the status did
9481 $2509
not permit setup
9732 $2604 Timeout (no response from the destination station)
9760 $2620 Mail daemon inactive at the destination station
9761 $2621 Receive buffer full at the destination station
33026 $8102 Area access denied at present
33039 $810F System element access to which is requested for data not supported at present
33041 $8111 Non-existing area number specified
33044 $8114 Database access to which is requested for data now under online maintenance
33124 $8164 Block access to which is requested for data having an undefined header
33127 $8167 Block number higher than the maximum limit upon data access request
33137 $8171 Invalid station number upon data access request
33201 $81B1 Invalid system element name upon data access request
33207 $81B7 Data type conversion disabled (exceeding the maximum)
33208 $81B8 Data type conversion disabled (falling below the minimum)
33209 $81B9 Nonnumeric type specified for data type conversion
33211 $81BB Unconvertible data type specified
33215 $81BF Invalid data type of a set variable requested to be set up
33216 $81C0 Request to set up data that cannot be set up
Inability to set up determined by a setup validity check (e.g., data outside the
33217 $81C1
range of the scale)
33295 $820F System element access to which is requested for data not supported at present
33310 $821E Set variable out of scale limits
33311 $821F Invalid data type upon status change request
33312 $8220 Invalid data size upon status change request
33313 $8221 Invalid status change command
33314 $8222 Status change request unacceptable to the current instrument
333803 $8264 Block access to which is requested for data having an undefined header
33390 $826E Invalid data type upon data setup request
33461 $82B5 Undefined data item name address upon data access request
33553 $8311 Non-existing area number specified
33556 $8314 Database access to which is requested for data now under online maintenance

IM 33G3C20-11E Appendix 1-11


Decimal Hexadecimal Description
33646 $836E Invalid data type upon data setup request
33648 $8370 Global switch number exceeding the maximum
33649 $8371 Global switch station number exceeding the station maximum
33712 $83B0 Undefined global switch
33714 $83B2 Remote station global switch data specified
33726 $83BE Cannot set remote station global switch data by the specified access code
33904 $8470 Invalid common switch number
34065 $8511 Non-existing area number specified
34078 $851E Set variable out of scale limits
34160 $8570 Invalid annunciator switch number
34321 $8611 Non-existing area number
34330 $861A Access to a function block in O/S mode
34331 $861B Access to a function block in complex O/S mode
34404 $8664 Block access to which is requested for data having an undefined header
34577 $8711 Non-existing area number
34586 $871A Access to a function block in O/S mode
34587 $871B Access to a function block in complex O/S mode
34595 $8723 Status change request unacceptable to the current block
34596 $8724 Prohibited change to the data status
34670 $876E Invalid data type upon data setup request
35352 $8A18 Switch block switch in OFF state (single-point side)
35438 $8A6E Invalid data type upon data setup request
35608 $8B18 Switch block switch in OFF state
35694 $8B6E Invalid data type upon data setup request
35760 $8BB0 Switch block switch in OFF state (multi-point side)
36280 $8DB8 Data access request communication in excess of the maximum limit
36353 $8E01 FCS database access denied at present
36354 $8E02 Area access denied at present
36367 $8E0F System element access to which is requested for data not supported at present
36369 $8E11 Non-existing area number specified
36370 $8E12 Negative number of data access parameters or too many parameters
36371 $8E13 Invalid data item modifier upon data access request
36389 $8E25 Array elements specified upon data access request out of defined limits
36390 $8E26 Array element specified to scalar data upon data access request
36536 $8EB8 Access request to data having no entity in memory
36537 $8EB9 Data that does not permit 0 to 100% conversion on the scale
36538 $8EBB Remote station access denied (Tag number not existing in the local station specified)
36540 $8EBC Destination FCS or V-net down
36541 $8EBD Tag name not existing in the plant
36542 $8EBE Access rejected by an access ID security check
36549 $8EC5 Invalid tag name upon data access request
36550 $8EC6 Invalid data item name upon data access request
Only single-precision floating point data acceptable for data setup in the range
36551 $8EC7
0 to 100%
Data access request communication in excess of the maximum limit (High-speed
36599 $8EF7
data access facility)
37126 $9106 Up to 32 dialog requests acceptable per control station
37130 $910A Retry request received while there is no dialog request
37131 $910B Cannot send a dialog cancellation request to the operation and monitoring functions
37132 $910C Cannot send a dialog retry request to the operation and monitoring functions
37133 $910D Cannot send a dialog confirmation request to the operation and monitoring functions
37134 $910E Cannot send a dialog entry request to the operation and monitoring functions
37138 $9112 Dialog time specification timeout
37142 $9116 Cannot identify a C task name in dialog send processing
38161 $9511 Non-existing area number specified

Appendix 1-12 IM 33G3C20-11E


Appendix

Decimal Hexadecimal Description


38320 $95B0 Switch position in a switch block different from the last access
38929 $9811 Non-existing area number specified
40193 $9D01 Access disabled because of an I/O change in progress due to online maintenance
40194 $9D02 Writing to input (DI) disabled while I/O is not disconnected
40209 $9D11 Undefined ACM card database (No DI definition)
40210 $9D12 Undefined ACM card database
40211 $9D13 Undefined ACM card database
40212 $9D14 Undefined ACM card database
40213 $9D15 Undefined ACM card database (No DI definition)
40214 $9D16 Undefined ACM card database (No DI/DO definition)
40215 $9D17 Undefined ACM card database (No DI definition)
40220 $9D1C Node number out of limits
40221 $9D1D Out of the range of ACM unit numbers (1 to 8)
40222 $9D1E Out of the range of ACM unit numbers (1 to 4)
40223 $9D1F Out of the range of ACM pin numbers (1 to 64)
40224 $9D20 Virtual node not found (ACM card number error)
40225 $9D21 ACM card database error
40226 $9D22 ACM card database error
40227 $9D23 ACM card database error
40228 $9D24 ACM card database error
40229 $9D25 Data type not matching the I/O data type
40230 $9D26 ACM card database error
40231 $9D27 Write width in excess of 16
40235 $9D2B Even-numbered pin access for 32-bit data not available
40246 $9D36 Non-existing area number specified
40247 $9D37 Database error
40248 $9D38 Database error
40249 $9D39 Database error
40250 $9D3A Database error
40251 $9D3B Database error (ADM card count not defined)
40252 $9D3C Database error (Pushbutton count not defined)
40253 $9D3D Database error
40254 $9D3E Database error
40255 $9D3F Database error
40256 $9D40 Database error
40257 $9D41 Database error
40272 $9D50 System count out of defined limits
40273 $9D51 System not defined
40278 $9D56 No I/O definition
40279 $9D57 Node number out of limits
40280 $9D58 Unit number out of limits
40281 $9D59 Slot number out of limits
40282 $9D5A Pin number out of limits
40283 $9D5B Node not defined
40284 $9D5C Unit not defined
40285 $9D5D Card not defined
40286 $9D5E Card at a specified point or its operation mode not defined
40287 $9D5F Database error
40288 $9D60 Database error
40289 $9D61 Database error
40290 $9D62 Database error
40291 $9D63 Database error
40292 $9D64 Database error
40293 $9D65 Data item name not existing
40294 $9D66 Database error
40295 $9D67 Database error

IM 33G3C20-11E Appendix 1-13


Decimal Hexadecimal Description
40296 $9D68 Database error
40297 $9D69 Database error
40298 $9D6A Data type not matching the I/O data type
40299 $9D6B Data size not matching the I/O data size
40300 $9D6C Size of %Z[Y]XXXXXX in excess of eight characters
40301 $9D6D System other than %Z/%Y
40302 $9D6E Nonnumeric character string specified for an element number node number
40303 $9D6F Nonnumeric character string specified for an element number unit number
40304 $9D70 Nonnumeric character string specified for an element number slot number
40305 $9D71 Nonnumeric character string specified for an element number pin number
40306 $9D72 Element kind other than %Z/%Y
Access denied to analog I/O, pulse width output, and time-proportioning ON/OFF
40307 $9D73
output
40308 $9D74 Element number + size in excess of the limit of the number of card points (PV16)
40309 $9D75 All the specified 16 points undefined (PV16)
40310 $9D76 Cannot read pulse width output from even-numbered pins
40311 $9D77 Single setting for a dual analog output device
40312 $9D78 Database error
40316 $9D7C Cannot specify the read width
40317 $9D7D Cannot specify the read width
40318 $9D7E Cannot specify the read width
40319 $9D7F Cannot specify the read width
40320 $9D80 Read size not matching the I/O data type
40321 $9D81 Read data type not matching the I/O data type
40322 $9D82 Database error
40323 $9D83 Card at a specified point or its operation mode not defined
40324 $9D84 Dual database error
40325 $9D85 Database error
40326 $9D86 Database error
40327 $9D87 Database error
40328 $9D88 Pin number in excess of the number of points supported on the card
40329 $9D89 Database error
40330 $9D8A Database error
40331 $9D8B Cannot specify the width for reading pushbutton counter values
40332 $9D8C Excessive data read range
40333 $9D8D Element number + size in excess of the limit of the number of card points (PV16)
40334 $9D8E All the specified 16 points undefined (PV16)
40335 $9D8F Read error (Internal error)
40336 $9D90 Cannot write because of a data status error
40337 $9D91 Database error
40338 $9D92 Database error
40339 $9D93 Database error
40340 $9D94 Database error
40341 $9D95 Cannot specify the write width
40342 $9D96 Excessive write size
40343 $9D97 Excessive write size
40344 $9D98 Flashing output disabled
40345 $9D99 Cannot specify the flashing output width
40346 $9D9A Write size specified in excess of the limits of IOM
40347 $9D9B Intermixed operation modes (SO/PO) or no points defined for writing
40348 $9D9C Database error
40349 $9D9D Database error
40350 $9D9E Cannot specify the pulse width output width
40351 $9D9F Excessive pulse width output time setting
40352 $9DA0 Negative time setting for time-proportioning ON/OFF output
40369 $9DB1 Internal error
40722 $9F12 Destination function block under online maintenance

Appendix 1-14 IM 33G3C20-11E


Appendix

Decimal Hexadecimal Description


40723 $9F13 Destination function block in O/S block mode
40725 $9F15 Destination function block unable to run by one-shot execution
40726 $9F16 Level of function block call nesting in excess of the definition
40834 $9F82 Parameter error in “oneshot” statement or configuration error
40930 $9FE2 Execution step named in the called sequence table not existing
41808 $A350 Internal error
41809 $A351 ACM card number out of limits
41810 $A352 Definition number out of limits
41811 $A353 No communication definition point found for a specified point
41812 $A354 Relative position (offset) out of limits
41813 $A355 Access to subsystem out of limits of the DDC/SEQ definition
41814 $A356 Cannot write to input
41815 $A357 Odd-numbered relative position (offset) specification
41816 $A358 Bit position out of limits
41817 $A359 Bit count out of limits
41108 $A35A Bit position + bit count error out of data limits
41819 $A35B Cannot write to invalid data status data
41825 $A361 FIFO size exceeded
41826 $A362 Power failure or other abnormality during a write request
41827 $A363 Abnormal card or node, or extended power failure
41828 $A364 Excessive number of write requests
41829 $A365 Internal error
41830 $A366 Abnormal time-setting for transmission-completion monitoring
41831 $A367 Out-of-range time-setting for transmission-completion monitoring
41832 $A368 Write transmission wait time-up
41833 $A369 Write transmission completion wait time-up
41841 $A371 SEBOL specification not set (zero UPFIFO size)
41842 $A372 SEBOL specification not set (zero DOWNFFO size)
41843 $A373 Subsystem SEBOL type not supported
When the number of queued SEBOL WRITE requests exceeds limit (16) (only for
41857 $A381
GC1000), such as when $A369 error code repeatedly occurred for more than 16 times.
41873 $A391 RS communication error (communication driver busy)
41874 $A392 RS communication error (communication line busy)
41875 $A393 RS communication error (communication line not ready)
41876 $A394 RS communication error (excessively large transmission size)
41877 $A395 RS communication error (communication port specification not declared)
41879 $A397 RS communication error (underline error)
41880 $A398 RS communication error (inter-character monitoring time-out)
41881 $A399 RS communication error (receiving buffer overflow)
41882 $A39A RS communication error (receiving data parity error)
41883 $A39B RS communication error (receiving overrun error)
41884 $A39C RS communication error (receiving framing error)
41885 $A39D RS communication error (out-of-range number of characters received)
41887 $A39F RS communication error (miscellaneous)
41904 $A3B0
to to RS communication errors (refer to function specifications of connected subsystem)
41983 $A3BF

IM 33G3C20-11E Appendix 1-15


Hexadecima
Decimal Description
l
42001 $A411 Non-existing area number specified
42010 $A41A Access to a function block in O/S mode
42011 $A41B Access to a function block in complex O/S mode
42019 $A423 Status change request unacceptable to the current block
42020 $A424 Prohibited change to the data status
42094 $A46E Invalid data type upon data setup request
43521 $AA01 Undefined CP213 communication function option
43522 $AA02 Writing to input (DI) disabled while I/O is not disconnected
43577 $AA39 Read width out of limits
43578 $AA3A Write width out of limits
43579 $AA3B Write width out of the write range
43580 $AA3C Writing not permitted by the data
43581 $AA3D Invalid element type
43582 $AA3E Invalid element name
43583 $AA3F Register number out of limits
43584 $AA40 Invalid bit position
43585 $AA41 Element number out of limits
43586 $AA42 Data item name not existing
43587 $AA43 Invalid data type
43588 $AA44 Unassigned register number
43793 $AB11 Non-existing area number specified
44211 $ACB3 Local station system element specified for a remote plant specification
44305 $AD11 State transition disabled
44306 $AD12 Initialization unit sequence in progress
44307 $AD13 Invalid data item name
44308 $AD14 Interrupt handler running
44309 $AD15 Non-existing generic name used or non-existing area number specified
44310 $AD16 Invalid tag number specified in a unit sequence name
44311 $AD17 Unmatched left- and right-side data types in a transition condition
44312 $AD18 Cannot change the block status in O/S block mode
44313 $AD19 Constant appearing on the left-hand side of a transition condition
44314 $AD1A Invalid tag number used as a step transition condition
44315 $AD1B Invalid tag number used as a parallel transition condition
44317 $AD1D Cannot run a unit because it is under online maintenance
44338 $AD32 Cannot execute status change preprocessing for a unit sequence
44339 $AD33 Cannot execute status change postprocessing for a unit sequence
44340 $AD34 Cannot post a signal to a unit sequence
44341 $AD35 Cannot post a signal to a unit sequence
44343 $AD37 Cannot convert a unit sequence generic name to a tag number
44344 $AD38 Too many steps concurrently
44345 $AD39 Too many operations run in parallel concurrently
44346 $AD3A To many stages run in parallel concurrently
44347 $AD3B Cannot get a unit dynamic management area

Appendix 1-16 IM 33G3C20-11E


Appendix

Decimal Hexadecimal Description


44348 $AD3C Cannot get a state transition matrix or transition destination not defined
44349 $AD3D Cannot get a unit procedure
44354 $AD42 EXECERR operation not defined for a state transition matrix
44357 $AD45 Unit recipe start request issued for a memory-resident unit
44418 $AD82 State transition matrix not existing
44421 $AD85 Unit status name not builder-defined
44423 $AD87 Status change command name not defined with the builder
44426 $AD8A Target status name not defined with the builder
44427 $AD8B State transition prohibited in the state transition matrix
44430 $AD8E Unit procedure under online maintenance
44431 $AD8F Unit procedure not existing
44434 $AD92 Unit procedure not specified
Unit allocation dynamic area not allocated (average number of units to be run in
44435 $AD93
the station definition or the number of unit instruments in the area definition is 0)
44437 $AD95 Available unit dynamic work area falling below 5%
44438 $AD96 No unit dynamic work area available
44451 $ADA3 Unit already active
44452 $ADA4 Unit already inactive
44467 $ADB3 Process alarm character string not defined with the builder
44469 $ADB5 Non-existing generic name
44470 $ADB6 Out of bounds of the generic name array subscript, or invalid array dimension
44471 $ADB7 Null character string assigned to a generic name as a tag number
44512 $ADE0 The unit does not allocate valve pattern monitor
Cannot allocate the valve pattern monitor because the block status of the unit is
44513 $ADE1
END
Cannot allocate the valve pattern monitor because the block status of the unit is
44514 $ADE2 ABORTED
44515 $ADE3 The unit has already allocated another valve pattern monitor.
44543 $ADFF Unsupported function
44547 $AE03 The batch ID recipe does not exist (*1)
Cannot receive the specified status modification command with the current unit
44549 $AE05
recipe status
44552 $AE08 Cannot cancel or load the unit recipe for unit recipe No.1
44553 $AE09 Incorrect common block name
44554 $AE0A Incorrect common data item name
44557 $AE0D Incorrect status modification command name
44566 $AE16 Cannot activate unit recipe because recipe status is not ACTIVE
44803 $AF03 Remote station common data
44804 $AF04 Invalid batch ID
44805 $AF05 Invalid common block name
44806 $AF06 Invalid common data item name
44811 $AF0B Attempt to set up reference-only data
44812 $AF0C Inability to set up determined by a setup validity check
44813 $AF0D Array element specified to scalar data
44814 $AF0E Array element specification wanting for scalar
44815 $AF0F Two-dimensional element specification for a one-dimensional array
44816 $AF10 Too many request array elements specified din the item definition
44822 $AF16 Negative number of request parameters or too many parameters
45057 $B001 Unassigned generic name
45058 $B002 Generic name marked by an asterisk (*) used (No error message is output.)
45072 $B010 Attempt to run a sequence table or logic chart in drivewait state in duplicate
45073 $B011 Sequence table or logic chart in drivewait state entering the O/S block mode
% (local block) not allowed in a group assignment statement with a plant name
45074 $B012
specified
%% (local unit) not allowed in a group assignment statement with a plant name
45075 $B013
specified
45104 $B030 Access to a remote station while CPU time was monopolized
*1 Even when the recipe is reserved by the recipe operation monitoring function with the batch ID, detailed error
$AE03 occurs if recipe is not downloaded to the control station. For other occurrence conditions of the
detailed error, see subsection 5.5.3, “Common Block Data Access Conditions” in “SFC Block Function
Manual (IM33G3C31-11E)”.
IM 33G3C20-11E Appendix 1-17
Decimal Hexadecimal Description
45311 $B0FF Unsupported function
45314 $B102 Signal destination other than an SFC block, unit sequence, or unit
45315 $B103 Signaling operation illegal for a unit
45316 $B104 Destination block halted due to a database error
45317 $B105 Destination block not running
Signal procedure with the specified signal name not defined at the signal recipient
45318 $B106
SFC block
Neither signal procedure with the specified signal name not queued signal
45319 $B107 procedure
defined at the signal recipient SFC block
45320 $B108 Illegal operation for an interrupt signal
Cannot send a signal a return signal to the designation SFC block since an
45321 $B109 interrupt
signal receive procedure has already been defined there
Cannot receive signals since the number of signal parameters exceeds the
45322 $B10A maximum
number of signal parameters
Cannot receive signals since the maximum number of signals that can be received
45323 $B10B
has already been queued
Cannot receive signals since the maximum number of signals that can be received
45324 $B10C
has already been queued (including those in return signal handling)
45325 $B10D "wait for qsignal" executed in a program other than a main program

45326 $B10E Maximum number of queued signals that can be received is 0


45327 $B10F ICS signal frame size error
45328 $B110 ICS signal frame parameter error
45329 $B111 ICS signal frame option error
45330 $B112 ICS signal frame signal parameter type error
45360 $B130 Internal error at the signal destination
45569 $B201 Function permitted only in a unit sequence
45571 $B203 Has not been run from a unit
45572 $B204 SEBOL/SFC blocks not existing at all

45573 $B205 Attempt to run a block other than a unit sequence from a block

45574 $B206 Cannot change the block status of a unit sequence in O/S block mode

45575 $B207 Being run from another unit


45576 $B208 Cannot change the block status while status change preprocessing is in progress
45577 $B209 Cannot change the block status while status change postprocessing is in progress

45578 $B20A Database associated with the SFC sequence name not found

45579 $B20B SFC sequence or SEBOL block main program under online maintenance
45580 $B20C Inability to change status determined by status change preprocessing
45581 $B20D Error detected during status change preprocessing
Status change preprocessing in excess of the maximum number of lines that can
45582 $B20E
be run
45583 $B20F SFC sequence or SEBOL block main program not existing
Online maintenance of the SFC sequence or SEBOL block main program yet to be
45584 $B210
completed
45585 $B211 SEBOL database not existing
45586 $B212 Cannot run a unit sequence because no dynamically allocated area is available
Cannot change the block status while unit sequence termination processing is
45587 $B213
in progress
45616 $B230 Internal error in a unit sequence
Cannot run an SFC/SEBOL block because no dynamically allocated area is
46081 $B401
available
46097 $B411 Cannot change STEPNO except in the PAUS block status
Cannot change a step to an interrupt program step (interrupt program step number
46098 $B412
cannot be set to STEPNO)
46100 $B414 Cannot change STEPNO while status change preprocessing is in progress
46101 $B415 Cannot change STEPNO while status change postprocessing is in progress
46113 $B421 Cannot change the block mode to O/S except in the STOP or ABRT block status

Appendix 1-18 IM 33G3C20-11E


Appendix

Decimal Hexadecimal Description


46114 $B422 Cannot change the block status in O/S block mode
46115 $B423 Cannot receive the status change command RSET in the RUN block status
46116 $B424 Cannot receive the status change command ABRT in the STOP block status
46117 $B425 Cannot receive the status change command RSET in the PAUS block status
46118 $B426 Cannot receive the status change command RUN in the ABRT block status
46119 $B427 Cannot receive the status change command PAUS in the ABRT block status
46120 $B428 Cannot receive the status change command STOP in the ABRT block status
46121 $B429 Cannot change the block status while status change preprocessing is in progress
46122 $B42A Cannot change the block status while status change postprocessing is in progress
46124 $B42C Cannot change the block mode to SEMI due to the specification of the SEMI
mode operation
46125 $B42D Cannot change the block status of a monitoring unit sequence
46126 $B42E Cannot run a unit sequence from other than a unit
46127 $B42F SEBOL/SFC block termination processing in progress
46128 $B430 Inability to change status determined by status change preprocessing
46129 $B431 Error detected in status change preprocessing
46130 $B432 Maximum number of lines of status change preprocessing exceeded
46131 $B433 Cannot change the block status while change preprocessing is in progress
46132 $B434 Cannot change the block status while status change postprocessing is in progress
46133 $B435 Cannot change the block mode while SEBOL/SFC block termination processing
in progress is in progress
46161 $B451 SFC sequence or SEBOL block main program not existing
46162 $B452 SEBOL station common database not existing
46163 $B453 SFC sequence database not found
46164 $B454 Online maintenance of the SFC sequence or SEBOL block main program yet to
be completed
Cannot run an SFC/SEBOL block while the SFC sequence or SEBOL block
46165 $B455
main program is under online maintenance
46166 $B456 SEBOL area database not existing
49936 $C310 No response from the destination station
49938 $C312 Destination station CPU not ready
49939 $C313 Destination station A timer over
49940 $C314 No receiving process on the destination station
49943 $C317 Destination station C timer over
50577 $C591 ACM12/22 database not defined
50578 $C592 ACM12/22 database not defined
50579 $C593 ACM12/22 database not defined
50580 $C594 ACM12/22 database not defined
50581 $C595 ACM12/22 database not defined
50582 $C596 ACM12/22 database not defined
50583 $C597 ACM12/22 database not defined
50593 $C5A1 Database has abnormality
50594 $C5A2 Database has abnormality
50595 $C5A3 Specified size exceeds data area
50596 $C5A4 Database has abnormality
50597 $C5A5 Database has abnormality
50598 $C5A6 Database has abnormality
50599 $C5A7 Database has abnormality
50600 $C5A8 Database has abnormality
50601 $C5A9 Database has abnormality
50602 $C5AA Zero ACM cards
50603 $C5AB Specified point not defined
50604 $C5AC Node not defined
50605 $C5AD Specified node not a communication node
50606 $C5AE Abnormal card number
50607 $C5AF Database has abnormality

IM 33G3C20-11E Appendix 1-19


Decimal Hexadecimal Description
50608 $C5B0 Data type not defined
50641 $C5D1 Abnormal FIFO data size
50676 $C5F4 Internal error
50696 $C608 Tag name not found in plant
53249 $D001 Mismatched reference value and data
53250 $D002 Alarm status (ALRM) is not NR
53251 $D003 Abnormal data status
53264 $D010 Cannot collect data item ALRM
53280 $D020 Cannot change the block mode to O/S because of RUN block status
53281 $D021 Cannot change the block mode to O/S because of PAUS block status
53282 $D022 Cannot get the valve pattern monitor because of O/S block mode
53283 $D023 Cannot change the block status because of O/S block mode
53284 $D024 Cannot receive the RUN status change command because of STOP block status
53285 $D025 Cannot receive the PAUS status change command because of STOP block status
53312 $D040 The valve pattern monitor is under online maintenance.
53313 $D041 The valve pattern monitor is allocated in another unit.
53314 $D042 Different control area for the valve pattern monitor and the unit
53315 $D043 The specified function block is not a valve pattern monitor
53376 $D080 The number of registered items exceeds the limit
53377 $D081 Cannot register data item ALRM
53499 $D0FB Abnormal data item name for the drive vpmon statement
Will abort because an error was detected in initialization processing of system
53500 $D0FC
definitions
53501 $D0FD A function not supported was used
53502 $D0FE Internal error
53503 $D0FF The valve pattern monitor is not registered optionally
53504 $D100 Cannot monitor undefined data type
53512 $D108 Cannot monitor string type
53532 $D11C Cannot monitor single precision floating number
53533 $D11D Cannot monitor single precision floating number with data status
53535 $D11F Cannot monitor single precision floating number with data status/range
53536 $D120 Cannot monitor double precision floating number
53537 $D121 Cannot monitor double precision floating number with data status
53540 $D124 Cannot monitor alarm type
53544 $D128 Cannot monitor bit type
53548 $D12C Cannot monitor indirect type
53556 $D134 Cannot monitor data combination information
53560 $D138 Cannot monitor dynamic data type
53564 $D13C Cannot monitor data item name
53568 $D140 Cannot monitor because of undecided data type
53569 $D141 Cannot monitor I/O data not connected
53631 $D17F Cannot monitor ICS reservation type

Appendix 1-20 IM 33G3C20-11E


Appendix

Appendix 2 Variable Declarations


The number of variable declarations is restricted, and a compile error is caused if they
exceed a predetermined limit. The number of variable declarations, which include
implicitly declared local variables and tag names, allowed for every program unit is
shown in Table A2.1.

Table A2.1 Maximum Number of Variable Declarations

Variable Declaration Description No. of Names Total Elements (*1)

integer, long, float,


Local variables Total of all types. 1024 (*2)
double, char*n

Including an implicit declaration (*3).


In an SFC block, the total number of tag
names in the global block and block
declarations. The same tag name
Tag names block 256 256
block-declared in more than one step
is counted as one. The tag names
declared but not accessed are not
included in the count.

In an SFC block, the total number of


local generic names in the global
genname and genname declarations.
The same local generic name genname-
Local generic name genname 128 256
declared in more than one step is
counted as one. The local generic names
declared but not accessed are not
included in the count.

In an SFC block, the total number of


generic names in the global unit
genname and unit genname declarations.
The same generic name unit genname-
Generic name unit genname 256 512
declared in more than one step is
counted as one. The generic names
declared but not accessed are not
included in the count.

*1: A total of array elements in one program unit counting a simple variable as one.
*2: A compile error is caused if the size of the local variable area exceeds 2147483646($7FFFFFFE) bytes
— this area contains an area for alignment. See Table A2.2 for the alignment of variables.

Table A2.2 Variable Alignment

Variable Type Alignment


integer 2
long 4
float 4
double 8
char*n 2

*3: Including the tag names of the actions that are described in the sequence tables/logic charts in the SFC
block. The present block (%) and the present unit (%%) are not included in the count.

The size of a dummy argument array is determined by the actual argument — thus there
are no restrictions other than that the maximum number of dummy arguments usable in
a function is 32.

IM 33G3C20-11E Appendix 2-1


Appendix

Appendix 3 Maximum Values


Variable declarations have other restrictions in addition to their number:

Table A3.1 Variable Declaration Maximum Values

Description Max. Value Remarks


Line length 511 bytes
Line number 9999
Program size 65535 bytes
Function-block data used in expressions 32
Number of operators used in one expression 64
#define 2048 In one compile unit.
#include 16 In one compile unit.
Object size 100K bytes In one compile unit.

Table A3.2 SFC Block-Related Maximum Values

Description Max. Value Remarks

Number of steps in one SFC (*1) 99


Total number of steps in one SFC block (*2) 300
Number of interrupt programs 31
Step number 2000
SEBOL step size 65535 bytes
Number of transitions in one step 8

*1: Up to 99 SFC steps in the main program and interrupt program each.
*2: Up to 300 SFC programs across the main program and interrupt program in one SFC block.

IM 33G3C20-11E Appendix 3-1


Appendix

Appendix 4 Reserved Words


The identifiers listed in Table A4.1 are reserved for use by the compiler and cannot be
used for other purposes. Where these reserved words are used in a program are indi-
cated in parentheses. (“D” indicates a declaration, “S” a statement, “B” a built-in
function, “O” an operator, “CALC” a word reserved for a calculation expression
descriptor, “XL” a reserved word for SEBOL in CENTUM-XL, and “N” none of these.)
PV, MV and other data item names used with function-block data are not reserved
words and can be used as local and other variable names. However, the use makes the
program hard to read and thus it is not recommended to use data item names as variable
names.

Table 4.1a
ACOS (B) CKMODE (XL) DOUBLE (D) GETNAME (B)
ACTION (N) CKSTATUS (XL) DREADPARA (B) GETOPNAME (XL)
ALIAS (D) CKSTEP (B) DRIVE (S) GETPROC (XL)
AND (O) CKSTEPCL (B) DRIVEWAIT (S) GETTAGNO (B)
ARGBLOCK (D) CMWRITE (B) DSBREAD (XL) GETTASK (XL)
ASIN (B) CMWRITEBID (B) DSBWRITE (XL) GETTIME (B)
ASSIGN (S) COMMON (SL) DSCHECK (B) GETUNIT (XL)
ASTM1 ( CALC) COMPARE (S) DUDREAD (XL) GETURNO (XL)
ASTM2 ( CALC) CONDITION (XL) DUDWRITE (XL) GLOBAL (D)
ASTM3 ( CALC) CONFIRM (N) EFFECTIVE (XL) GOTO (S)
ASTM4 ( CALC) COS (B) ELSE (S) GROUP (XL)
ATAN (B) CP (N) END (S) HISTORY (S)
BASIC (XL) CREADPARA (B) ENTRY (S) HOLD (XL)
BEGIN (S) CRPGET (XL) EOR (O) ICHR (B)
BITPSTN (B) CRPPUT (XL) ERETURN (S) IDLE (XL)
BITSRCH (B) CSBREAD (XL) ERRC (B) IF (S)
BLOCK (D) CSBWRITE (XL) ERRCE (B) INDEPENDENT (S)
BOOT (B) CUBGET (XL) ERRF (B) INDEX (B)
CASE (S) CUBPUT (XL) ERRL (B) INEFFECTIVE (XL)
CAT (B) CUDGET (XL) ERROR (S) INITIAL (N)
CCMREAD (B) CUDREAD (XL) ERRORSUB (N) INSTRUMENT (XL)
CCMREADBID (B) CUDWRITE (XL) ERRORVAL (B) INT (B)
CCMWRITE (XL) CURGET (XL) ERRP (B) INTEGER (D)
CERRORID (B) CURPUT (XL) ERRS (B) INTERVAL (XL)
CHANGE (N) DABS (B) ESTEP (N) INVALIDATE (XL)
CHAR (D) DCMREAD (B) EVENT (N) ISIGMASK (S)
CHAR16 (N) DCMREADBID (B) EXIT (S) ISIGUNMASK (S)
CHAR32 (N) DCMWRITE (XL) EXP (B) ISTEP (N)
CHAR4 (N) DELAY (S) FLOAT (D) IUDGET (XL)
CHAR8 (N) DELAYCYCLE (S) FOR (S) LABS (B)
CHECK (S) DERRORID (B) FORMAT (S) LCMREAD (B)
CHMODE (XL) DIALOGUE (S) FUNCTION (S) LCMREADBID (B)
CHR (B) DLIMIT (B) GENERIC (XL ) LCMWRITE (XL)
CHSTATUS (XL) DMAX (B) GENNAME (D) LEFT (B)
CISTEP (N) DMIN (B) GETDATE (B) LEN (B)

IM 33G3C20-11E Appendix 4-1


Table 4.1b
LERRORID (B) OPKILL (XL) SEBOL (N) TIMEMS (B)
LEVEL (S) OPNAME (XL) SEBOLBLOCK (S) TIMER (XL)
LLIMIT (B) OPSTAT (XL) SECTION (XL) TO (N)
LMAX (B) OPSTATCL (XL) SELECT (XL) TPC (CALC)
LMIN (B) OR (O) SEMLOCK (S) TPCF (CALC)
LOCALTIME (B) OTHERWISE (S) SEMUNLOCK (S) TPCFP (CALC)
LOG (B) PARALLEL (XL) SEQTABLE (S) TPCKP (CALC)
LOGICCHART (S) PC (CALC) SFCBLOCK (N) TPCMP (CALC)
LONG (D) PCKP (CALC) SIGEVENT (XL) TPCP (CALC)
LREADPARA (B) PCMP (CALC) SIGNAL (S) TRACE (XL)
LRPGET (XL) PCP (CALC) SIN (B) TRANSITION (XL)
LRPPUT (XL) PERIODIC (XL) SNAPSHOT (S) UINTEGER (N)
LSBREAD (XL) PMODE (XL) SNSEVENT (XL) ULONG (N)
LSBWRITE (XL) POWER (B) SNUM (B) UNIT (S)
LUBGET (XL) PR (N) SQRT (B) UNITMODEL (XL)
LUBPUT (XL) PRCSALARM (S) SSCANCEL (XL) UNITNAME (XL)
LUDGET (XL) PROCEDURE (XL) SSDTWRITE (N) UNTIL (S)
LUDREAD (XL) PROCESS (XL) SSDTWRITEBIT (N) URASSIGN (B)
LUDWRITE (XL) PROGRAM (CALC) SSMONITOR (XL) URASSIGNBID (B)
LURGET (XL) PSTATUS (XL) SSREAD (S) URDELETE (XL)
LURPUT (XL) QSIGCANCEL (S) SSWRITE (S) URKILL (XL)
M3 (N) QSIGMOVE (S) SSWRITEBIT (S) URLOAD (B)
M6 (XL) SQSIGNAL (S) STARTSTEP (N) URLOADBID (B)
MASK (S) QUEUE (D) STEP (N) URNONEXIST (XL)
MESSAGE (S) QUIT (S) STSEVENT (XL) URSTART (XL)
MID (B) RECOVER (S) SUSPEND (XL) URSTATUS (XL)
MOD (O) REPEAT (S) SWITCH (S) VALIDATE (XL)
MODEVENT (XL) REQUEST (S) SYSALARM (S) VM (N)
MSTEP (N) RESTART (XL) TAN (B) VPMOFF (S)
NEXT (S) RESULT (N) TASK (XL) VPMON (S)
NOPREEMPT (S) RESUME (XL) TASKMODEL (XL) VPMRESET (S)
NOT (O) RETRY (N) TASKNAME (XL) VPMSTART (S)
NOTCHECKARG (N) RETURN (S) TC (CALC) WAIT (S)
OG (N) RIGHT (B) TCF (CALC) WEND (S)
ONESHOT (S) RISTEP (N) THEN (S) WHEN (S)
OPEGUIDE (S) RPRESERVE (B) TIME (XL) WHILE (S)
OPERATION (XL) RQ (N) TIMEGMT (B)

Appendix 4-2 IM 33G3C20-11E


Appendix

Appendix 5 Application Size


To determine the application size of SFC/SEBOL blocks, station-common items (Table
A5.1) and control area dependent-definition items (Table A5.2) are specified.

Table A5.1 Station-Common Items

Item Default Maximum


Number of SFC sequences 0 512/FCS
Number of functions 0 512/FCS

Table A5.2 Control Area-Dependent Items

Item Default Maximum


Number of SEBOL blocks 0 128/control area
Number of SFC/SEBOL blocks run 0 256/control area

(1) Number of SFC sequences


An SFC sequence is an SFC and step program for an SFC block. SFC sequences are
shared by all the control areas in a control station. The number of SFC sequences is
therefore defined as a station-common item. Offline generation of the control station is
needed to change the number of SFC sequences. Which SFC blocks use which SFC
sequences is defined with the builder for each SFC block. If the same SFC sequence
name is specified for multiple SFC blocks, the SFC sequence is shared by all these SFC
blocks.
The number of SFC sequences is used to determine the size of the application area for
SFC blocks. Solving the following equation determines the total size of the application
area:
Total SFC sequence area size = Number of SFC sequences x 8192 bytes
This size represents the size of the text area (*1) of the application. A generation error
occurs when the total size of the SFC sequences exceeds this size. If the area runs short,
add more SFC sequences and execute offline station generation again.

*1: The text area is an object generated by compiling run lines, such as i=i+1 and FIC001.PV=10.0. Adding
to run lines increases the size of the text area. Variable areas, as for local variables, are not included in
the text area. (Precisely speaking, declaring variables generates an object for managing the variables,
with the result of an increased text area size.)

IM 33G3C20-11E Appendix 5-1


(2) Number of functions
Functions are shared by all the control areas in a control station. The number of
functions is therefore defined as a station-common item. Offline generation of the
control station is needed to change the number of functions. If the same function is
called from multiple SFC/SEBOL blocks, the function is shared by all these SFC blocks.
The number of functions is used to determine the size of the application area for
functions. Solving the following equation determines the total size of the application
area:
Total function area size = Number of functions x 4,096 bytes
This size represents the size of the text area (*1) of the application. A generation error
occurs when the total size of the functions exceeds this size. If the area runs short, add
more functions and execute offline station generation again.

*1: The text area is an object generated by compiling run lines, such as i=i+1 and FIC001.PV=10.0. Adding
to run lines increases the size of the text area. Variable areas, as for local variables, are not included in
the text area. (Precisely speaking, declaring variables generates an object for managing the variables,
with the result of an increased text area size.)

(3) Number of SEBOL blocks


The number of SEBOL blocks specifies how many of the function blocks in a control
area are to be used as SEBOL blocks. The number of SEBOL blocks may not exceed
the number of function blocks. SEBOL blocks, when generated, are counted as part of
the number of function blocks.
The number of SEBOL blocks is used to determine the size of the main program area
for SEBOL blocks in the control area. Solving the following equation determines the
total size of the main program area:
Total main program area size = Number of SEBOL blocks x 4096 bytes
This size represents the size of the text area of the program. The SEBOL block main
program area is allocated as part of a write-inhibited area on the function block. If the
write-inhibited area on the function block runs short as a result of adding to the size of
the SEBOL block main program, add more SEBOL blocks and regenerate the control
area (*2).

*2: If the number of SEBOL blocks in every control area is 0, changing the number of SEBOL blocks in a
control area from 0 to any larger value requires offline generation of the control station.

Appendix 5-2 IM 33G3C20-11E


Appendix

(4) SFC/SEBOL block executable number


The SFC/SEBOL block executable number specifies the maximum number of SEBOL
and SFC blocks that run concurrently in the control area. It is used to determine the size
of dynamically allocated areas, which include local variable areas for SFC/SEBOL
blocks and the area in which the system runs the SFC/SEBOL blocks. When functions
are used, dynamically allocated area are used as a local variable area and an area in
which the system manages functions.
Solving the following equation determines the size of a dynamically allocated area in the
control area. This area is hard by the SFC/SEBOL blocks in the control area.
Dynamcally allocated area size = SFC/SEBOL block executable number x 4096 bytes
When the system starts an SFC/SEBOL block, it allocates a dynamcally allocated area to
the SFC/SEBOL block; when the system terminates the SFC/SEBOL block, it
deallocates the dynamcally allocated area. Table A5.3 gives the relationship between a
dynamically allocated area and the block status.

Table A5.3 Dynamically Allocated Area and Block Status

Using a Dynamically Allocated Area Not Using a Dynamically Allocated Area


SFC block RUN, PAUS STOP, ABRT
SEBOL block RUN STOP, ABRT

The system assigns to the SEF/SEBOL block a dynamically allocated area in which
functions are executed when the system calls a function. The system deassigns the area
as soon as the function is completed with the “return” statement.
If an area needed to run an SFC/SEBOL block is not available when it is started, the
error message “Cannot run an SFC/SEBOL block because of an insufficient area” is
displayed. In this case, add to the number of more SFC/SEBOL blocks run and regener-
ate the control area, or terminate the SFC/SEBOL blocks that need not be run to create
more space in the dynamically allocated area.
Similarly, if a sufficient area is not available when a function is called, the same error
message as in the above case is also displayed. In this case, increase the SFC/SEBOL
block executable number and off-line generate the control area, or terminate the SFC/
SEBOL blocks that need not be run to create more space in the dynamically allocated
area.
The SFC/SEBOL block executable number provides a clue to determining the dynami-
cally allocated area requirement. If a sufficient dynamically allocated area is allocated,
SFC/SEBOL blocks in excess of the SFC/SEBOL block executable number can be run
concurrently. If a sufficient dynamically allocated area is not available (because SFC/
SEBOL blocks that use a large area are running), however, SFC/SEBOL blocks can only
be run below the SFC/SEBOL block executable number.

IM 33G3C20-11E Appendix 5-3


Appendix

Appendix 6 Differences from XL-BATCH


This appendix explains differences of SFC blocks from XL-BATCH operations (hereaf-
ter simply called operations).

(1) SFCs
While operations would be created as text using a text editor, SFC block programs are
created graphically in SFCs. Parallel runs as described in the parallel statement in
operations cannot be used in SFC blocks. For more information on the SFCs of SFC
blocks, refer to SFC Block Function Manual (IM 33GC31-11E).

(2) Interrupt program


In SFC blocks, interrupt handling procedures for handling status changes and signals are
created in an SFC separate from the main program, called an interrupt program. In
operations, a program that began with a statement marking the beginning of an interrupt,
such as an entry change statement or entry event statement, would be created as part of
the main program. For more information on the interrupt programs, refer to SFC Block
Function Manual (IM 33GC31-11E).

(3) Online maintenance


Operations would allow the addition of only a few lines within certain limits of the
system and no variables. With SFC blocks, however, more run lines and variables can
be added by online maintenance.

(4) Function block operation


Operations could not be run without units; they did not have modes or status of their
own since they were always run from units. SFC blocks, on the other hand, have their
own modes and status since they work as function blocks. They can be run indepen-
dently without needing units.
Operation data would be defined as batch data, while SFC blocks do not batch data
since they have data items for themselves.

(5) Queued signals


SFC blocks can handle two kinds of signals, queued signals and interrupt signals. SFC
bock interrupt signal handling, like operation signal handling, is executed as interrupt
handling. Queued signals are queued as they are received, so they will be dequeued for
signal handling later at any convenient timing. Queued signals help simplify applica-
tions since they do not need interrupts.
For more information on queued signals, refer to SFC Block Function Manual (IM
33GC31-11E).

(6) Sequence tables and logic charts


SFC blocks provide a capability not available with operations - running sequence tables
(logic charts) by one-shot execution with a “seqtable (logicchart)” statement. For more
information on sequence tables and logic charts, see Section 7.6, “Sequence Tables,” and
7.7, “Logic Charts.”

(7) Monopolization of CPU time


SFC blocks provide a capability not available with operations - running up to 20 lines at
the same timing by using a “nopreempt” statement or SEBOL one-shot step. For more
information on CPU time allocation, see Chapter 12, “Allocating CPU Time.”

IM 33G3C20-11E Appendix 6-1


(8) Scope of writing variables
SFC blocks ease the operations’ constraints on the scope of writing function block data
and expressions. For the scope of writing variables, see Chapter 11, “Scope of Writing
Variables and Expressions.”

Appendix 6-2 IM 33G3C20-11E


Appendix

Table A6.1 lists the differences in variable declarations between CENTUM CS and XL-
BATCH.

Table A6.1 Differences in Variable Declarations

XL-BATCH CENTUM CS Explanation


integer ← No change
long ← No change
float ← No change
double ← No change
char*n ← No change
instrument block Only reserved word changed
generic instrument genname Only reserved word changed (Local generic name)
Formal argument and local generic name reserved word
generic instrument argblock
differentiated
unit generic instrument unit genname Different in precisely but similar in usage
unitmodel None
group None
trace block None
unitname block CS unit having a tag number
common block None
opname None
timer None
None global integer Global variable
None global long Global variable
None global float Global variable
None global double Global variable
None global char*n Global variable
None global block Global declaration of a tag number
None global genname Declaration of a global generic name
None global unit genname Global declaration of a generic name
modevent None
stsevent Written in an SFC Specified as an attribute of a called sequence table comment
sigevent Written in an SFC Specified as an attribute of a called sequence table comment
None queue signal Declaration of a queued signal

IM 33G3C20-11E Appendix 6-3


Correspondence of statement is shown in Table A6.2.

Table A6.2 Differences in Statements (1/2)

XL-BATCH CENTUM CS Explanation


Assignment statement ← No change
Group assignment
statement ← CS allows function block data to be written on both sides.

compare ← CS allows function block data to be written on both sides.


Different data item names to access. With CS, the "drive" statement does not
drive ← detect CAL, for it is detected as a data status of PV.
assign ← No change
None seqtable Including one-shot execution of a sequence table
None logicchart Including one-shot execution of a logic chart
None oneshot Oneshot execution of a function block
if ← No change
while~wend ← No change
for~next ← No change
repeat~until ← No change
switch ← No change
goto ← No change
delay ← No change
delaycycle ← No change
exit ← No change
return ← No change (Validity checking for status change preprocessing altered)
suspend None
resume None
opeguide ← No change
dialogue ← Specification of a confirm type confirmation result variable not supported by CS
message ← Specification with parameters supported by CS
None history Message that is simply stored in a historical file without printing
request ← CS does not provide M6 available from XL, but provides CP.
sysalarm ← No change
prcsalarm ← Process alarms are reflected in the data item ALRM of SFC/SEBOL blocks.
None unit prcsalarm Unit process alarms are generated or reset.
snapshot ← No change
None format Character string format
step~condition Written in an SFC Pictorial, not textual representation, by CS
step~select Written in an SFC Pictorial, not textual representation, by CS
parallel None Parallel execution not supported by CS
validate None
invalidate None
trace begin None
trace end None
CS supports return signals, permitting the specification of an SFC block as a
signal ← destination, but does not support the specification of a unit recipe number as a
destination.
None qsigcancel Queued signal cancellation
None qsigmove Queued signal move
None wait for qsignal Start of queued signal handling
ckmode None
chmode Assignment For CS, <tag-number>.MODE=<mode-change-command>
ckstatus None
chstatus Assignment For CS, <tag-number>.BSTS=<status-change-command>

Appendix 6-4 IM 33G3C20-11E


Appendix

Table A6.2 Differences in Statements (2/2)


XL-BATCH CENTUM CS Explanation
effective None
ineffective None
isigmask
mask level isigunmask Only interrupt signal masking supported by CS

opkill Assignment For CS, <tag-number>.BSTS="STOP"


opkill * None Complete terminal of unit sequences not supported by CS
CS keeps independent unit sequences running even after the unit
independent ← shutdown.
ssmonitor None
sscancel None
ssread ← Syntax altered
sswrite ← Syntax altered
sswritebit ← Syntax altered
None ssdtwrite Subsystem data writing by communication
None ssdtwritebit Subsystem data bit-field writing by communication
interval timer None
periodic timer None
hold timer None
restart timer None
None nopreempt Monopolization of CPU time

None semlock Semaphore management


semunlock
vpmstart
vpmon
None vpmoff Valve pattern monitor operation
vpmreset
drive vpmon
drive vpmoff

Table A6.3 lists the differences in interrupt handling between CENTUM CS and XL-
BATCH.

Table A6.3 Differences in Interrupt Handling

XL-BATCH CENTUM CS Explanation


entry error ← SEBOL blocks similar to XL
entry error Written in an SFC SFC block common error handling
entry event Written in an SFC SFC block interrupt signal handling
entry change Written in an SFC SFC block status change preprocessing
entry check Written in an SFC SFC block status change postprocessing

Table A6.4 lists the differences in program writing between CENTUM CS and XL-
BATCH.

Table A6.4 Differences in Program Writing

XL-BATCH CENTUM CS Explanation


procedure None CS does not allow procedures to be written in SEBOL.
operation None SFC blocks are created in an SFC.
SEBOL blocks begin with sebolblock, which is omissible,
sebolblock
though.

IM 33G3C20-11E Appendix 6-5


Table A6.5 lists the differences in compiler control instructions between CENTUM CS
and XL-BATCH.

Table A6.5 Differences in Compiler Control Instructions

XL-BATCH CENTUM CS Explanation


#include ← Include files provided by the system
#define No change
None #implicit Implicit declaration

Appendix 6-6 IM 33G3C20-11E


Appendix

Tables A6.6 list the differences in built-in functions between CENTUM CS and XL-
BATCH.

Table A6.6 Differences in Built-in Functions (1/2)

XL-BATCH CENTUM CS Explanation


labs ← No change
dabs ← No change
lmax ← No change
dmax ← No change
lmin ← No change
dmin ← No change
power ← No change
bitpstn ← No change
bitsrch ← No change
sin ← No change
cos ← No change
tan ← No change
atan ← No change
sqrt ← No change
exp ← No change
log ← No change
ichr ← No change
chr ← No change
len ← No change
cat ← No change
index ← No change
left ← No change
right ← No change
mid ← No change
snum ← No change
None llimit
High and low limits
None dlimit
snsevent None
With CS, a specification of 0 gets the signal name; char*8
creadpara ←
type for XL and char*16 type for CS.
lreadpara ← No change
dreadpara ← No change
getdate ← No change
gettime ← No change
timems ← No change
None timegmt Gets serial GMT seconds.
Converts serial GMT seconds to a year, month, date, hour,
None localtime
minute, and second format.
None dscheck Data status check
lubget None
cubget None CS maintains management information in unit instrument
lubput None data.
cubput None
lrpget None
crpget None CS maintains recipe management information in common
lrpput None block data.
crpput None
lurget None
curget None CS maintains part management information in common
lurput None block data.
curput None
CS identifies a unit name from the common block data
iudget None UNITNAME and gains access to the unit instrument data
cudget None if the unit name is associated with a local generic name
by an "assign" statement.

IM 33G3C20-11E Appendix 6-7


Table A6.6 Differences in Built-in Functions (2/2)

XL-BATCH CENTUM CS Explanation


pmode None
pstatus None
ludread None
dudread None
cudread None The local unit can access unit instrument data if %% is used in
ludwrite None place of a tag number (as in %%MODE).
dudwrite None
cudwrite None
lcmread ← No change
dcmread ← No change
ccmread ← No change
lcmreadbid
None dcmreadbid Reads common block data with batch ID specification.
ccmreadbid
lcmwrite cmwrite CS allows converting the argument <data> to a common block
dcmwrite cmwrite data type, thereby reducing the number of setup functions required
ccmwrite cmwrite to only one.
None cmwritebid Writes common block data with batch ID specification.
errc ← No change
errce ← No change
errl ← No change
None errs Step number of the latest error
None errp Plane number of the latest error
errf ← No change
errorval No change
cerrorid No change

lerrorid No change
derrorid No change
getunit None CS identifies a unit name from the SFC block data
UNITNAME.
getopname None
None gettagno Gets the tag number of the local SFC/SEBOL block.
geturno None CS supports PARTNO (unit recipe number) as unit
instrument data.
urload ←
None urloadbid Downloads unit recipe with batch ID specification.
urstart None
urkill None Writing to the common block data STATUS enables CS to
urnoexist None implement to these functions.
urdelete None
None urassign Dynamic unit assignment
None urassignbid Assigns the dynamic unit with batch ID specification.
With CS, the common block data STATUS is unit recipe
urstatus None
status.
None rpreserve Recipe setup
getname ← No change
boot ← Different return value
opstat None
opstatcl None
ckstep ← Different return value
ckstepcl ← No change

Appendix 6-8 IM 33G3C20-11E


Appendix

[Other changes]
(1) Identifier %
CS supports the use of % as an identifier, as in %SW0001. Consequently, the modulo
operator has been changed from % for XL to mod for CS.

(2) Function strings that return a character string


CS does not support function strings that return a character string. Character strings
should be handled as function arguments.

(3) Error variables


CS supports the specification of error variables and does not output SEBOL error
messages unless an error branch destination is specified. XL would output SEBOL error
messages.

(4) Signal parameters


In parallel with the change in the tag number length to up to 16 bytes, the character
string parameter has been changed from the char*8 type to the char*16 type.

IM 33G3C20-11E Appendix 6-9


Appendix

Appendix 7 System-Fixed Include Files


(1) stdh.h
stdh.h is a system-fixed include file with default labels defined. It defines default values
as #define by names, such as OPEN, CLOSE, RUN, and STOP.

***** for loop ((loop)*****


#define TRUE 1
#define FALSE 0

***** for valve (valve opening/closing)*****


#define OPEN 2
#define CLOSE 0

***** for pump (pump startup/shutdown)*****


#define RUN 2
#define STOP 0

***** for sequence element (sequence element) *****


#define ON 1
#define OFF 0

***** for judgment (judgment) *****


#define OK 1
#define NG 0

***** for timer (TM operation) *****


#define TMSTOP 1
#define TMSTAT 2
#define TMCONT 3

#define TMPAUS 4

IM 33G3C20-11E Appendix 7-1


(2) smode.h
smode.h is a system-fixed include file used to reference block modes individually. It
defines the mask patterns of basic block modes as #define. For how to reference block
modes individually, see Section 7.3.1, “Reading Block Modes Individually.”

***** block mode *****


#define MD_OS $80000000 ! 1bit OS
#define MD_IMAN $08000000 ! 5bit
#define MD_TRK $04000000 ! 6bit
#define MD_SEMI $01000000 ! 8bit
#define MD_MAN $00800000 ! 9bit
#define MD_AUT $00400000 ! 10bit
#define MD_CAS $00200000 ! 11bit
#define MD_PRD $00100000 ! 12bit
#define MD_RCAS $00080000 ! 13bit

#define MD_ROUT $00040000 ! 14bit

Appendix 7-2 IM 33G3C20-11E


Appendix

(3) sbsts.h
sbsts.h is a system-fixed include file used to reference block statuses individually. It
defines the mask patterns of basic block statuses as #define. For how to reference block
statuses individually, see Section 7.3.3, “Block Statuses.”

***** block status *****


#define BS_PAUS $80000000 ! 1bit
#define BS_ANCK $80000000
#define BS_ERR $80000000

#define BS_FAIL $40000000 ! 2bit

#define BS_ABRT $20000000 ! 3bit

#define BS_IDLE $10000000 ! 4bit


#define BS_ABORT $10000000 ! (ABORTED)

#define BS_SIML $08000000 ! 5bit

#define BS_OFF $00800000 ! 9bit


#define BS_PALM $00800000
#define BS_HI $00800000

#define BS_LOCK $00400000 ! 10bit


#define BS_CTUP $00400000
#define BS_LO $00400000

#define BS_NR2 $00200000 ! 11bit (NR priority 2)

#define BS_SIM $00008000 ! 17bit


#define BS_STRT $00008000
#define BS_RUN $00008000

#define BS_NR1 $00004000 ! 18bit (NR priority 1)


#define BS_STOP $00004000
#define BS_IBCH $00004000

#define BS_STUP $00002000 ! 19bit

#define BS_STDY $00001000 ! 20bit


#define BS_HOLD $00001000

#define BS_ERLY $00000800 ! 21bit


#define BS_WAIT $00000800

#define BS_PBCH $00000400 ! 22bit

#define BS_END $00000200 ! 23bit

#define BS_NCNT $00000100 ! 24bit

#define BS_RSET $00000080 ! 25bit


#define BS_SDWN $00000080

#define BS_EMST $00000040 ! 26bit


#define BS_ESD $00000040

#define BS_EEMS $00000020 ! 27bit

#define BS_RSTR $00000010 ! 28bit

IM 33G3C20-11E Appendix 7-3


(4) salarm.h
salarm.h is a system-fixed include file used to manipulate or reference alarm statuses
individually. For how to manipulate alarm statuses individually, see Section 7.5.2,
“Data Items AF, AOFS, and AFLS.” For how to reference alarm statuses individually,
see Section 7.5.3, “Referencing Alarm Statuses Individually.”

***** alarm status mask patern *****


#define AL_AFL $80000000 ! 1bit
#define AL_AOF $40000000 ! 2bit
#define AL_AF $20000000 ! 3bit

#define AL_NR $00800000 ! 9bit


#define AL_OOP $00400000 ! 10bit
#define AL_SGNL $00400000
#define AL_IOP $00200000 ! 11bit
#define AL_VPTN $00200000
#define AL_IOPM $00100000 ! 12bit IOP-
#define AL_DATA $00100000
#define AL_HH $00080000 ! 13bit
#define AL_NPLS $00080000
#define AL_TRIP $00080000
#define AL_HALM $00080000
#define AL_ESTP $00080000
#define AL_TYPE $00080000
#define AL_LL $00040000 ! 14bit
#define AL_DV2 $00040000
#define AL_OUTS $00010000 ! 16bit
#define AL_HI $00008000 ! 17bit
#define AL_EMST $00008000
#define AL_END $00008000
#define AL_MALM $00008000
#define AL_LO $00004000 ! 18bit
#define AL_PRE $00004000 DV+
#define AL_LEAK $00002000 ! 19bit BDV+
#define AL_DVP $00000800 ! 21bit
#define AL_BDVP $00000800 !
#define AL_DV1 $00000800
#define AL_PERR $00000800
#define AL_CERR $00000800 DV-
#define AL_LALM $00000800 BDV-
#define AL_DVM $00000400 ! 22bit VEL+
#define AL_BDVM $00000400 ! ANS+
#define AL_VELP $00000080 ! 25bit
#define AL_ANSP $00000080 !
#define AL_HDV $00000080
#define AL_RALM $00000080 VEL-
#define AL_TRP $00000080 ANS-
#define AL_VELM $00000040 ! 26bit
#define AL_ANSM $00000040 !
#define AL_LDV $00000040
#define AL_BEND $00000040
#define AL_SCBL $00000040
#define AL_MHI $00000020 ! 27bit
#define AL_BPRE $00000020
#define AL_INT $00000020
#define AL_MLO $00000010 ! 28bit
#define AL_ERR $00000010
#define AL_CNF $00000001 ! 32bit

***** alarm status change command *****


#define AOF_NR "AL09OF"
#define AON_NR "AL09ON"
#define AOF_OOP "AL10OF"
#define AON_OOP "AL10ON"
#define AOF_SGNL "AL10OF"
#define AON_SGNL "AL10ON"
#define AOF_IOP "AL11OF"
#define AON_IOP "AL11ON"
#define AOF_VPTN "AL11OF"
#define AON_VPTN "AL11ON"
#define AOF_IOPM "AL12OF" ! IOP-
#define AON_IOPM "AL12ON" ! IOP-
#define AOF_DATA "AL12OF"
#define AON_DATA "AL12ON"
#define AOF_HH "AL13OF"
#define AON_HH "AL13ON"
#define AOF_NPLS "AL13OF"
#define AON_NPLS "AL13ON"
#define AOF_TRIP "AL13OF"
#define AON_TRIP "AL13ON"
#define AOF_HALM "AL13OF"
***** conti'd to *****

Appendix 7-4 IM 33G3C20-11E


Appendix

***** conti'd from *****


#define AON_HALM "AL13ON"
#define AOF_ESTP "AL13OF"
#define AON_ESTP "AL13ON"
#define AOF_TYPE "AL13OF"
#define AON_TYPE "AL13ON"
#define AOF_LL "AL14OF"
#define AON_LL "AL14ON"
#define AOF_DV2 "AL14OF"
#define AON_DV2 "AL14ON"
#define AOF_OUTS "AL16OF"
#define AON_OUTS "AL16ON"
#define AOF_HI "AL17OF"
#define AON_HI "AL17ON"
#define AOF_EMST "AL17OF"
#define AON_EMST "AL17ON"
#define AOF_END "AL17OF"
#define AON_END "AL17ON"
#define AOF_MALM "AL17OF"
#define AON_MALM "AL17ON"
#define AOF_LO "AL18OF"
#define AON_LO "AL18ON"
#define AOF_PRE "AL18OF"
#define AON_PRE "AL18ON"
#define AOF_LEAK "AL19OF"
#define AON_LEAK "AL19ON"
#define AOF_DVP "AL21OF" ! DV+
#define AON_DVP "AL21ON" ! DV+
#define AOF_BDVP "AL21OF" ! BDV+
#define AON_BDVP "AL21ON" ! BDV+
#define AOF_DV1 "AL21OF"
#define AON_DV1 "AL21ON"
#define AOF_PERR "AL21OF"
#define AON_PERR "AL21ON"
#define AOF_CERR "AL21OF"
#define AON_CERR "AL21ON"
#define AOF_LALM "AL21OF"
#define AON_LALM "AL21ON"
#define AOF_DVM "AL22OF" ! DV-
#define AON_DVM "AL22ON" ! DV-
#define AOF_BDVM "AL22OF" ! BDV-
#define AON_BDVM "AL22ON" ! BDV-
#define AOF_VELP "AL25OF" ! VEL+
#define AON_VELP "AL25ON" VEL+
#define AOF_HDV "AL25OF"
#define AON_HDV "AL25ON" ! ANS+
#define AOF_ANSP "AL25OF" ! ANS+
#define AON_ANSP "AL25ON"
#define AOF_RALM "AL25OF"
#define AON_RALM "AL25ON"
#define AOF_TRP "AL25OF"
#define AON_TRP "AL25ON"
#define AOF_VELM "AL26OF" ! VEL-
#define AON_VELM "AL26ON" ! VEL-
#define AOF_LDV "AL26OF"
#define AON_LDV "AL26ON"
#define AOF_BEND "AL26OF"
#define AON_BEND "AL26ON"
#define AOF_ANSM "AL26OF" ! ANS-
#define AON_ANSM "AL26ON" ! ANS-
#define AOF_SCBL "AL26OF"
#define AON_SCBL "AL26ON" !
#define AOF_MHI "AL27OF"
#define AON_MHI "AL27ON"
#define AOF_BPRE "AL27OF"
#define AON_BPRE "AL27ON"
#define AOF_INT "AL27OF"
#define AON_INT "AL27ON"
#define AOF_MLO "AL28OF"
#define AON_MLO "AL28ON"
#define AOF_ERR "AL28OF"
#define AON_ERR "AL28ON"
#define AOF_CNF "AL32OF"
#define AON_CNF "AL32ON"

IM 33G3C20-11E Appendix 7-5


◆ Reader’s Comment Form
We welcome your comments or suggestions that will help us improve our manuals for
the CENTUM CS system. We would like to recommend that you copy this form to
note your comments or suggestions. We ask that you be as specific as possible when
making comments or suggestions.
Please fill in the form and send it to the following address via facsimile.

Attention : Solution Center


IA Systems Business Div.
Yokogawa Electric Corporation
Facsimile No. : 81-422-52-9802
From : (Name may be omitted.)
Name Date
Company
Div. & Sect.
Address

Phone No. Ext.


Fax. No.

● Manual No. : IM 33G3C20-11E (6th Edition)


● Title : SEBOL Function Manual

Pages Line Comments and Suggestions

.........................................................................................................................................................................................................................................

.........................................................................................................................................................................................................................................

.........................................................................................................................................................................................................................................

.........................................................................................................................................................................................................................................

.........................................................................................................................................................................................................................................

.........................................................................................................................................................................................................................................

.........................................................................................................................................................................................................................................

.........................................................................................................................................................................................................................................

.........................................................................................................................................................................................................................................

.........................................................................................................................................................................................................................................
◆ Revision Record
● Manual No. : IM 33G3C20-11E
● Title : SEBOL Function Manual

Edition Date Revised Item Release No.*


First edition Jan. 1995 Newly published R2.01 or later
Section 7.3.3, "Block Statuses,"
Second edition May 1995 Section 7.5, "Alarm Statuses," and R2.02 and later
Chapter 14, "Subsystem Communication," added

Corrections, and additions of 6.4.2, “assign” Statement; 6.5.4, Unit


Third edition Aug. 1995 R2.03 and later
Generic Names;.error codes to Appendix 1; and so on.
Additions: rpreserve built-in function; oneshot statement; and
Fourth edition Jan. 1996 R2.05 and later
Section 14.2, Accessing Monitor Data
Additions: Built-in functions with batch ID specification; detailed
Fifth edition Jul. 1996 R2.06 and later
error code; reserved words
Corrections and additions of 8.5, “ “wait until” Statement” ; 10.3,
Sixth edition Apr. 2000 “Classified Error Codes” ; 11.2, “Classification of Expressions” ; 12.2, R2.10 and later
“Counting Run Lines” ; and Appendix 1, “Error Codes.”

* : Denotes the release number of the software corresponding to the contents of this instruction manual.
The revised contents are valid until the next edition is issued.

Written by Solution Center


IA Systems Business Div.
Yokogawa Electric Corporation

Published by Yokogawa Electric Corporation


2-9-32 Nakacho, Musashino-shi, Tokyo 180-8750, JAPAN

Printed by Yokogawa Graphic Arts Co., Ltd.

IM 33G3C20-11E i

You might also like