0% found this document useful (0 votes)
358 views

ABB Procontic, PC331 Programming-Software - 7

Library of Programming System Connection Elements provides overviews and descriptions of blocks for ABB Advant Controller 31 and ABB Procontic CS31 programmable logic controllers. The document contains two lists of blocks - one organized by function and one alphabetically by call name. Each block description includes the block name, brief description, and call name in ladder logic and instruction list programming.

Uploaded by

fathazam
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
0% found this document useful (0 votes)
358 views

ABB Procontic, PC331 Programming-Software - 7

Library of Programming System Connection Elements provides overviews and descriptions of blocks for ABB Advant Controller 31 and ABB Procontic CS31 programmable logic controllers. The document contains two lists of blocks - one organized by function and one alphabetically by call name. Each block description includes the block name, brief description, and call name in ladder logic and instruction list programming.

Uploaded by

fathazam
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/ 524

Library of Programming System

Connection Elements
Advant Controller 31
ABB Procontic CS31

907 PC 331
Programming and Test Software

ABB Schalt-
und Steuerungstechnik
Overview of blocks arranged alphabetically according to call names
Depending on the different families of the AC31 / CS31 basic units (series 30, 40, 50 and series 90), two libraries are used
and called in the editor "Project menu". If the CE is called in the FBD/LD or IL editor, it is automatically displayed, if the
CE is available or not.

CEs for 07 KR 91, 07 KT 92 up to 07 KT 94 (series 90)

& 01-01 AWTB 05-18 EMASm 10-09 MOK 16-01 VGLD see =?D
* 01-03 AWTD 06-01 EMASmVT 11-01 MRK 16-04 VGRD see >D
*: 01-05 BCDBIN see ESV 11-03 MUL2N 16-06 VKLD see <D
*D 01-07 BCDDUAL FCDEL 11-06 MUL2ND 16-10 VRZ 21-16
+ 01-09 BCDDUAL 06-03 FCRD 11-08 MULD see *D VRZD 21-19
+D 01-11 BCDDUALD 06-07 FCWR 11-11 MULDI see *: VVZ 22-01
– 01-13 BCDDW see FDEL 11-14 MUXR 16-14 WAES 22-04
–D 01-15 BCDDUALD FEHSU 11-16 MUXRD 16-17 WAND 22-06
/ 01-17 BEG 06-10 FIFO 11-19 NEGD 17-01 WDEC 22-08
: 01-19 BEGD 06-12 FKG 11-23 NOTBIT 17-03 WDW 22-11
:D 02-01 BETR 06-14 FRD 11-26 PACK 17-06 WOL 22-13
< 02-04 BETRD 06-16 FWR 12-01 PACKD 17-08 WOR 22-15
<= 02-06 BINBCD see HLG 12-04 PDM 17-10 WOS 22-17
<D 02-08 DUALBCD I– 12-10 PE 17-13 WRB 23-01
= 02-10 BITSU 06-18 I+ 12-13 PI 17-15 WRDW 23-04
=1 02-12 BMELD 07-01 IDENT 12-15 PIDT1 18-01 WRW 23-08
=? 02-14 CALLUP 07-04 IDL see IDLm PT1 18-08 WUMC 23-11
=?D 02-16 COPY 07-08 IDLB 12-17 RDB 18-11 WWDW 23-14
=D 02-18 COS1 07-10 IDLm 12-20 RDDW 18-14 WXOR 23-15
=PE 03-01 COUNTB 07-11 IDS see IDSm RDW 18-17 ZUDKW 23-17
=R 03-03 COUNTW 07-13 IDSB 13-01 RS 19-01 ZUWD see =D
=S 03-05 CS31CO 07-17 IDSm 13-04 SETB 19-03
=W 03-07 CS31QU 07-25 If then 13-07 SFEHSU 19-05
> 03-09 CS31TE 07-26 If then word 13-08 SHIFT 19-09
<> 03-11 DIN 08-01 INITS 13-09 SIN1 19-14
>< 03-13 DIVD see :D INITV 13-12 SINIT 19-15
>= 03-15 DMUX 08-02 INTK 13-15 SPBM 20-01
>D 03-17 DMUXD 08-05 IOCON 13-19 SQRT 20-04
5F_ARC 03-19 DOUT 08-09 IOR 14-01 SR 20-06
5F_ARC94 03-19 DRUCK 08-10 IOW 14-03 SUBD see –D
ABORT 04-01 DT1 09-01 LDT 14-05 TESTB 20-08
ADAPT 04-03 DUALBCD 09-04 LIFO 14-08 UHR 20-16
ADDD see +D DUALBCDD 09-08 LIZU 14-12 UNPACK 20-20
ADRWA 04-10 DWAES 09-11 LZB 14-15 UNPACKD 20-22
AINIT 04-15 DWAND 09-13 MAJ 14-17
AMELD 04-17 DWBCD see MASKE 14-19 UNPAD see
AMELDD 04-20 DUALBCDD MASKED 15-01 UNPACKD
ANAI4_20 05-01 DWOL 09-15 MAX 15-04 USM 20-24
APOLL 05-03 DWOR 09-17 MAXD 15-06 UST 20-26
AREC 05-04 DWOS 09-19 MAZ 15-08 USTD 21-01
ASEND 05-07 DWUMC 10-01 MAZD 15-10 USTR 21-03
ASEND+ s. ASEND DWW 10-04 MIN 15-12 USTRD 21-05
ASV 05-11 DWWW 10-06 MIND 15-14 VGL3P 21-07
AWM 05-14 DWXOR 10-07 MOA 15-16 VGLEH 21-10
AWT 05-16 EMAS s. EMASm MODBUS *) 15-21 VGLUH 21-13

*) CE MODBUS only for series 30, 40, 50


The list of valid CEs for series 30, 40, 50 can be found on the following page.

907 PC 331 / Issued: 08.99 0-1 Overview of blocks


7
CEs for series 30, 40, 50

& 01-01 AWTB 05-18 EMASm 10-09 MUL2N 16-06 VRZ 21-16
* 01-03
*: 01-05 BCDBIN see ESV 11-03
BCDDUAL MULDI see *:
+ 01-09 BCDDUAL 06-03 WAND 22-06

– 01-13 WDW 22-11


NPULSE 17-04
/ 01-17 BEG 06-10 PACK 17-06
: 01-19 WOL 22-13
BETR 06-14 PDM 17-10 WOR 22-15
< 02-04 PE 17-13
<= 02-06 BINBCD see PI 17-15
DUALBCD I– 12-10 PIDT1 18-01
= 02-10 I+ 12-13
=1 02-12 BMELD 07-01
=? 02-14 CALLUP 07-04 IDL see IDLm
COPY 07-08 WXOR 23-15
IDLm 12-20 RS 19-01 ZUDKW 23-17
=PE 03-01 IDS see IDSm
=R 03-03
=S 03-05 CS31CO 07-17 IDSm 13-04 SINIT 19-15
=W 03-07 CS31QU 07-25 If then 13-07 SPBM 20-01
> 03-09 CTU 07-30 If then word 13-08 SR 20-06
<> 03-11 CTUH 07-32 TOF 20-10
>< 03-13 DI 0 07-35 TON 20-12
>= 03-15 TP 20-14
DMUXD 08-05
DO 08-08
DRUCK 08-10 UHR 20-16
LIZU 14-12 UNPACK 20-20
DUALBCD 09-04

MAX 15-04

MIN 15-12
MOA 15-16
DWW 10-04 MOAT 15-19
ASV 05-11 MODBUS 15-21
MOK 16-01
AWT 05-16 EMAS s. EMASm MRK 16-04

7 Overview of blocks 0-2 907 PC 331 / Issued: 08.99


Notes

____________________________________________________________________________________________
This catalog of blocks provides you first of all with two
overviews of all blocks,

● one arranged according to function groups and


● the other arranged alphabetically according to the
call names in FBD/LD and IL.

CAUTION!
In this catalog the blocks are sorted alphabetically ac-
cording to their block names. They are not sorted accord-
ing to the call names in FBD/LD or IL!
The description of each block is structured as follows:
Block name Brief description
Call name in FBD
ALLOCATION SET MEMORY =S
A binary variable is set in latching form with this con- nection
element.
FBD IL Representations in FBD,
A state 1 at the input sets the operand at the output to a state 1. A
state 0 at the input has no influence on the operand at the output. LD and IL (input/output
! E1 designations which are
=S =S A1
E1 A1 not displayed on the
screen are given in italics
in the description.)
LD

E1 A1
S

Parameters:
Parameters
E1 BINARY E, M, A, S, K Set condition
Inputs, outputs / data
A1 BINARY M, A Storage variable type / permissible
operands / meaning of
CE Data Series 90 Series 30, 40, 50
Runtime:
the parameter
Basic runtime: 4.3 µs 15 µs
Additional runtime: 2.3 µs per additional output (A3...An) 9 µs Miscellaneous data of
Output updating: yes yes the block
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51

Description
A state 1 at the input sets the operand at the output to a state 1. A
state 0 at the input has no influence on the operand at the output.
Detailed description
IMPORTANT:
This CE must only be used as an output CE, i. e. in the FBD it must
not be connected further by a line on the output side. An operand
(M or A) must be specified at the output.

The output A1 can be duplicated (A2...An). The input E1 can be


inverted.

3–5 907 PC 331/Issued: 10.95

Page number

907 PC 331/Issued: 11.98 0–3


Block name
Call name in FBD
ALLOCATION SET MEMORY =S

Example
Example
FBD IL

! E 00,00
=S =S A 02,00
E 00,00 A 02,00

LD

E 00,00 A 02,00
S

CE FBD Definition CE definitions


Formal definition of CE (These serve to define
the graphical symbol and
=S
E1 A1 as a specification for
translating the graphical
symbol to the IL; see
also 907 PC 33
Param. Param. Param. Inv. Occupation Displ. Param. Dupli.
Group Type Screen Block Type description, General
E1 E L Y P N 0 0 Part, Chapter 15 (library/
A1 A L N P N 1 0 Creating the graphics/
Writing the program run)
CE IL Definition
00000 ! PP 0 E1 Input BINARY
1
00002 =S PP 1 A1 Output BINARY (capable of duplication)
1

Operand comment (long text)


Symbolic operand
Formal operand
Operator
Occupied program memory word
address
907 PC 331/Issued: 10.95 3–6

Further explanations CE FBD Definition

CE Data (See also 907 PC 33 description, General Part, Chapter


15 (library/Creating the graphics/Writing the program
Runtime: run))
Basic runtime: Runtime without duplication
Additional runtime: Runtime with duplication Param.:
Information on the inputs and outputs (symbolic name).
Output updating
This specifies whether or not the outputs are re–allocated Param. group:
in each cycle. If ”no”, a direct connection to a line leading Information on the parameter group (E = variable capable
to further CEs is not possible. In this case, a flag must be of interrogation, A =variable capable of allocation, S=spe-
assigned that is not used multiply. cial variable, K=constant, X=all).

Param. type:
Information on the data type (L=bit, B = byte, W = word, D
= double word, F = floating, A = analog, T = text constant,
Z = time constant, S = miscellaneous, X = all).

0–4 907 PC 331/Issued: 11.98


Inv.: Notes on the extended IL
Information on whether or not the input/output can be in-
verted. In the extended IL, all PLC functions can be called by way
of a selection menu. This menu is the same as in the case
Allocation: of the FBD/LD. When a function is called, a mask appears
Only P allowed. on the screen in which all inputs and outputs have the
same designations as in the FDB/LD. The user then plans
Displ. Screen: the operands he requires at the inputs and outputs of the
Information on whether or not the parameter name is dis- mask.
played in the CE on the screen.

Param. block:
Information on whether or not the input can be duplicated
(input cannot be duplicated: 0;
input can be duplicated: > 0).

Dupli. type:
Information on the type of duplication
(single = 0, in blocks = 1).

Abreviations
You will find abbreviations used on Page 0–3 of the binder
entitled “907 PC 33, General Part”.

907 PC 331/Issued: 11.98 0–5


Overview of blocks arranged alphabetically according to function groups

Function group Call name in


Block name FBD/LD, / IL 1)
comf. IL /

Binary functions Page


AND & 2) 01-01
OR / 2) 01-17
Exclusive Or =1 2) 02-12
Majority MAJ 14-17
Allocation = 2) 02-10
Testing number of bits in word/double word COUNTB 07-11
Set binary variable in word/double word SETB 19-03
Test bit in word/double word TESTB 20-08

Memory functions Page


Allocation Set Memory =S 2) 03-05
Allocation Reset Memory =R 2) 03-03
Set Memory, Dominating RS 2) 19-01
Reset Memory, Dominating SR 2) 20-06

Arithmetical functions, Word Page


Addition + 2) 01-09
Subtraction – 2) 01-13
Multiplication * 2) 01-03
Division : 2) 01-19
Multiplication with division *: / MULDI 01-05
Multiplication by 2 to the power of n MUL2N 16-06
Absolute value generator BETR 06-14
Allocation Word =W 2) 03-07
Square Root SQRT 20-04
Allocation direct constant to word variable ZUDKW 23-17

Arithmetical functions, Double Word Page


Addition double word +D / ADDD 01-11
Subtraction double word –D / SUBD 01-15
Multiplication double word *D / MULD 01-07
Division double word :D / DIVD 02-01
Multiplication by 2 to the power of n, double word MUL2ND 16-10
Negation double word NEGD 17-01
Absolute value generator, double word BETRD 06-16
Allocation double word =D / ZUWD 02-18
Square Root SQRT 20-04
Cosine COS1 07-10
Sine SIN1 19-14

1) If calling in IL is different from calling in FBD/LD and comf. IL, this is additionally noted separated by /.
2) This function is realized in IL using a sequence of commands and/or blocks.

7 Overview of blocks 0-6 907 PC 331 / Issued: 08.99


Function group Call name in
Block name FBD/LD, / IL 1)
comf. IL /

Comparison functions Page


Greater than > 2) 03-09
Greater than or Equal to >= 2) 03-15
Equal =? 2) 02-14
Not Equal >< 2) 03-13
Not Equal <> 2) 03-11
Less than or Equal to <= 2) 02-06
Less than < 2) 02-04
Comparator with 3-point response VGL3P 21-07
Comparator with unilateral hysteresis VGLEH 21-10
Comparator with asymmetrical hysteresis VGLUH 21-13

Comparison functions, double word Page


Greater than, double word >D / VGRD 03-17
Less than, double word <D / VKLD 02-08
Equal, double word =?D / VGLD 02-16

Time Functions Page


ON Delay ESV 11-03
ON Delay TON 20-12
OFF Delay ASV 05-11
OFF Delay TOF 20-10
Variable delay element VVZ 22-01
Monostable element "Abort" MOA 15-16
Monostable element "Abort" MOAT 15-19
Monostable element "Constant" MOK 16-01
Monostable element "Constant" TP 20-14

Counting functions Page


Fast counter COUNTW 07-13
Up-down counter VRZ 21-16
Up-down counter, double word VRZD 21-19
Up counter CTU 07-30
Fast counter CTUH 07-32

Program control functions Page


MODBUS master MODBUS 15-21
Conditional jump to label SPBM 20-01
Target label MRK 16-04
Program end PE 17-13
Conditional program end =PE 2) 03-01
Call assembler subroutine CALLUP 07-04
Run number block LZB 14-15
Program abort ABORT 04-01

1) If calling in IL is different from calling in FBD/LD and comf. IL, this is additionally noted separated by /.
2) This function is realized in IL using a sequence of commands and/or blocks.

907 PC 331 / Issued: 08.99 0-7 Overview of blocks


7
Function group Call name in
Block name FBD/LD, / IL 1)
comf. IL /

Program control functions Page


Configuration of in- and outputs IOCON 13-19
Read direct inputs DIN 08-01
Write direct outputs DOUT 08-09
Read direct inputs DI 07-35
Write direct outputs DO 08-08

Format conversion Page


BCD to DUAL conversion BCDDUAL / BCDBIN 06-03
DUAL to BCD conversion DUALBCD / BINBCD 09-04
Pack binary variables in word PACK 17-06
Unpacking a word into binary variables UNPACK 20-20
Word to double word conversion WDW 22-11
Converter 2 words to double word WWDW 23-14
Converter double word to 2 words DWWW 10-06
Double word to word conversion DWW 10-04
BCD to DUAL conversion, double word BCDDUALD / BCDDW 06-07
DUAL to BCD conversion, double word DUALBCDD / DWBCD 09-08
Pack binary variables in double word PACKD 17-08
Unpacking a double word into binary variables UNPACKD / UNPAD 20-22

Pulse Page
Pulse (positive edge) I+ 2) 12-13
Pulse (negative edge) I– 2) 12-10

Logical functions with word variables Page


AND, word WAND 22-06
OR, word WOR 22-15
Exclusive OR, word WXOR 23-15
Mask MASKE 14-19
Shift block SHIFT 19-09

Logical functions with double word variables Page


AND, double word DWAND 09-13
OR, double word DWOR 09-17
Exclusive OR, double word DWXOR 10-07
Mask, double word MASKED 15-01
Shift block SHIFT 19-09

Access to EPROM / SmartMedia Card Page


Delete data segment in Flash EPROM FDEL 11-14
Read data segment from Flash EPROM FRD 11-26
Write data segment to Flash EPROM FWR 12-01
Delete data segment in SmartMedia Card FCDEL 11-06
Read data segment from SmartMedia Card FCRD 11-08
Write data segment to SmartMedia Card FCWR 11-11

1) If calling in IL is different from calling in FBD/LD and comf. IL, this is additionally noted separated by /.
2) This function is realized in IL using a sequence of commands and/or blocks.

7 Overview of blocks 0-8 907 PC 331 / Issued: 08.99


Function group Call name in
Block name FBD/LD, / IL 1)
comf. IL /

Access to physical addresses Page


Read word with enabling WOL 22-15
Write word with enabling WOS 22-19
Write word in the event of value change WAES 22-04
Copying memory areas COPY 07-08

Double word access to physical addresses Page


Read double word with enabling DWOL 09-13
Write double word with enabling DWOS 09-17
Write double word in the event of value change DWAES 09-11

Access to physical addresses (I/O ports) Page


Read byte value of I/O address IOR 14-01
Write byte value to I/O address IOW 14-03

ARCNET Page
Initialization of the ARCNET controller AINIT 04-15
Send data packages to ARCNET APOLL 05-03
Receive ARCNET data packages AREC 05-04
Send ARCNET data packages ASEND 05-07
Coupling visualization via ARCNET (for 07 KT 92 and 07 KT 93) 5F_ARC 03-19
Coupling visualization via ARCNET (for 07 KT 94) 5F_ARC94 03-19

Functions of higher order Page


Word decoder WDEC 22-08
Word recoder WUMC 23-11
Double word recoder DWUMC 10-01
Selection gate binary AWTB 05-18
Selection gate word AWT 05-16
Selection gate double word AWTD 06-01
Switchover gate UST 20-26
Switchover gate with reset USTR 21-03
Switchover gate double word USTD 21-01
Switchover gate with reset, double word USTRD 21-05
Maximum value generator MAX 15-04
Maximum value generator, double word MAXD 15-06
Maximum value generator MIN 15-12
Maximum value generator, double word MIND 15-14
Maximum value generator as a function of time MAZ 15-08
Maximum value generator as a function of time, double word MAZD 15-10
Limiter BEG 06-10
Limiter double word BEGD 06-12
Ramp function generator HLG 12-04
Function generator FKG 11-23

1) If calling in IL is different from calling in FBD/LD and comf. IL, this is additionally noted separated by /.
2) This function is realized in IL using a sequence of commands and/or blocks.

907 PC 331 / Issued: 08.99 0-9 Overview of blocks


7
Function group Call name in
Block name FBD/LD, / IL 1)
comf. IL /

Functions of higher order Page


Stack memory last in/first out LIFO 14-08
Stack memory first in/first out FIFO 11-19
Error searcher with automatic deletion FEHSU 11-16
Error searcher with storage SFEHSU 19-05
List allocator LIZU 14-12
Address selection ADRWA 04-10
Selection multiplexer AWM 05-14
Switchover multiplexer USM 20-24
Analog value change annunciator AMELD 04-17
Analog value change annunciator double word AMELDD 04-20
Read in analog value 4...20 mA (07 KT 92) ANAI4_20 05-01
Binary value change annunciator BMELD 07-01
Bit searcher BITSU 06-18
Demultiplexer DMUX 08-02
Demultiplexer double word DMUXD 08-05
Multiplexer with reset MUXR 16-14
Multiplexer with reset, double word MUXRD 16-17
Read binary variable, indexed IDLB 12-17
Write binary variable, indexed IDSB 13-01
Read word variable, indexed IDLm / IDL 12-20
Write word variable, indexed IDSm / IDS 13-04
Illumination pushbutton control LDT 14-05
Clock UHR 20-16
Initialize memory area in the operand memory with zero INITS 13-09
Initialize variables INITV 13-12

1) If calling in IL is different from calling in FBD/LD and comf. IL, this is additionally noted separated by /.
2) This function is realized in IL using a sequence of commands and/or blocks.

7 Overview of blocks 0-10 907 PC 331 / Issued: 08.99


Function group Call name in
Block name FBD/LD, / IL 1)
comf. IL /

Control engineering functions Page


Differentiator with delay of the 1st order DT1 09-01
Integrator (extended) INTK 13-15
Proportional integral controller PI 17-15
PT1 element PT1 18-08
PIDT1 controller PIDT1 18-01
Pulse duration modulator PDM 17-10
Adaption for adaptive temperature regulation ADAPT 3) 04-03
Pulse generator for stepper motors NPULSE 17-04

Communication via serial interface Page


Initialization and configuration of the serial interfaces SINIT 19-15
Output of ASCII characters and Hex values via a serial interface DRUCK 08-10
Reception of characters EMASm / EMAS 10-09
Additional comparison telegrams for EMASm EMASmVT 4) 11-01

Historical values Page


Read binary values from historical value memory RDB 18-11
Write binary values in historical value memory WRB 23-01
Read word values from historical value memory RDW 18-17
Write word values in historical value memory WRW 23-08
Read double word values from historical value memory RDDW 18-14
Write double word values in historical value memory WRDW 23-04

CS31 functions Page


Configure CS31 modules CS31CO 07-17
Acknowledge CS31 errors CS31QU 07-25
Testing of CS31 remote modules (master only) CS31TE 07-26
Identification IDENT 12-15

Special functions Page


If Then not supported / 2) 13-07
If Then word not supported / 2) 13-08
Not Bit not supported / 2) 17-03

1) If calling in IL is different from calling in FBD/LD and comf. IL, this is additionally noted separated by /.
2) This function is realized in IL using a sequence of commands and/or blocks.
3) Call only possible in IL.
4) Call not possible in IL.

907 PC 331 / Issued: 08.99 0-11 Overview of blocks


7
7 Overview of blocks 0-12 907 PC 331 / Issued: 08.99
AND &

This connection element realizes a logical AND combina-


tion of the operands at the inputs. The result is allocated
to the operand at the output. FBD IL

! E1
& & E2
E1 = A1
E2 A1

LD

E1 E2 A1
][ ][ ()

____________________________________________________________________________________________

Parameters
E1 BINARY E, M, A, S, K Operand 1 of the AND combination

E2 BINARY E, M, A, S, K Operand 2 of the AND combination, capable


of duplication

A1 BINARY M, A, S Result of the AND combination


____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 6.6 µs 20 µs
Additional runtime: 2.3 µs per additional input
6 µs
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
This connection element realizes a logical AND combina-
tion of the operands at the inputs. The result is allocated
to the operand at the output.

The input E2 is capable of duplication. All inputs and the


output are capable of inversion.
Truth table:

E1 E2 A1
0 0 0
1 0 0
0 1 0
1 1 1

907 PC 331/Issued: 11.98 1–1


& AND

Example

FBD IL

! E 00,00
& & E 03,11
E 00,00 = A 02,00
E 03,11 A 02,00

LD

E 00,00 E 03,11 A 02,00


][ ][ ()

CE FBD Definition

&
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E L Y P N 0 0
E2 E L Y P N 1 0
A1 A L Y P N 0 0

CE IL Definition

00000 ! PP 0 E1 Input BINARY


[ 1
00002 & PP 1 E2 Input BINARY (capable of duplication)
] 1
00004 = PP 0 A1 Output BINARY

1–2 907 PC 331/Issued: 11.98


MULTIPLICATION *

The values of the operands at the inputs of this connec-


tion element are multiplied by each other and the result is
allocated to the operand at the output. FBD/LD IL

! E1
* * E2
E1 = A1
E2 A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Multiplicand
E2 WORD EW, MW, AW, KW Multiplier; The input is capable of duplication
A1 WORD MW, AW Result (Product)
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: < 30 µs
Additional runtime: 23 µs per additional input (E3 ... En)
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description In the two’s complement arithmetic, the value 8000H


(–32768) lies outside of the number range and is neither
The values of the operands at the inputs of this connec- generated nor processed correctly by the PLC. If this for-
tion element are multiplied by each other and the result is bidden value reaches the PLC
allocated to the operand at the output.
Input E2 is capable of duplication (E2...En). All inputs and ● by bit manipulations of the user or
the output are capable of negation.
● by being read from outside the PLC or
Number range
Integer word (16 Bit) ● by an indirect word constant

The following specially applies here to the non–negated under no circumstances may negation or subtraction be
inputs E1 and E2: carried out on this value.
Low limit: 8000 H (–32768)
The following generally applies: An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
● Low limit: 8001H –32767
● High limit: 7FFFH +32767 On allocation (=), the forbidden value 8000H (–32768) is
● Inadmissible value: 8000H ––– corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 1–3


* MULTIPLICATION

Example

FBD/LD IL

! EW 00,00
* * MW 00,00
EW 00,00 = AW 02,00
MW 00,00 AW 02,00

CE FBD Definition

*
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W Y P N 0 0
E2 E W Y P N 1 0
A1 A W Y P N 0 0

CE IL Definition

00000 ! PP 0 E1 Input WORD


[ 1
00002 * PP 1 E2 Input WORD (capable of duplication)
] 1
00005 = PP 0 A1 Output WORD

1–4 907 PC 331/Issued: 11.98


MULTIPLICATION WITH DIVISION *:

The value of the operand at the input Z1 is multiplied by


the value of the operand at the input Z2, the intermediate
result is divided by the value of the operand at the input Z3 FBD/LD IL
and then the result is allocated to the operand at the out-
put A1.
!BA 0
*: MULDI
Z1* Z1*
Z2: Z2:
Z3 A1 Z3
A1

____________________________________________________________________________________________

Parameters

Z1* WORD EW, MW, AW, KW Multiplicand


Z2: WORD EW, MW, AW, KW Multiplier
Z3 WORD EW, MW, AW, KW Divisor
A1 WORD MW,AW Result
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 84 µs 1430 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description Number range


Integer word (16 Bits)
The value of the operand at the input Z1 is multiplied by
● Low limit: 8001H – 32767
the value of the operand at the input Z2, the intermediate ● High limit: 7FFFH + 32767
result is divided by the value of the operand at the input Z3 ● Inadmissible value: 8000H –––
and then the result is allocated to the operand at the out-
put A1. In the two’s complement arithmetic, the value 8000H
(–32768) lies outside of the number range and is neither
generated nor processed correctly by the PLC. If this for-
Internally, this function block operates with double word
bidden value reaches the PLC
accuracy (32 bits) when multiplying and dividing. Only
when allocating the result to the output A1 is the value lim- ● by bit manipulations of the user or
ited to word accuracy (16 bits). The result is rounded up if ● by being read from outside the PLC or
the remainder of division is > 0.5. If a number overflow oc- ● by an indirect word constant
curs during division (e. g. division by 0), the limit value of under no circumstances may negation or subtraction be
the number range is allocated to the output A1 with the carried out on this value.
correct sign.
An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
The inputs and the output can neither be duplicated nor On allocation (=), the forbidden value 8000H (–32768) is
negated. corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 1–5


*: MULTIPLICATION WITH DIVISION

Example

FBD/LD IL

!BA 0
*: MULDI
EW 00,00 Z1* EW 00,00
MW 03,11 Z2: MW 03,11
EW 00,00 Z3 A1 AW 02,00 EW 00,00
AW 02,00

CE FBD Definition

*:
Z1*
Z2:
Z3 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1* E W N P Y 0 0
Z2: E W N P Y 0 0
Z3 E W N P Y 0 0
A1 A W N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 MULDI
00002 PP 0 Z1* Input WORD
00003 PP 0 Z2: Input WORD
00004 PP 0 Z3 Input WORD
00005 PP 0 A1 Output WORD

1–6 907 PC 331/Issued: 11.98


MULTIPLICATION, DOUBLE WORD *D

The value of the operand at the input E1 is multiplied by


the value of the operand at the input E2 and the result is
allocated to the operand at the output A1. FBD/LD IL

The result is limited to the maximum or minimum value of


the number range. If limiting has taken place, a 1 signal is !BA 0
allocated to the binary operand at the output Q. If no limit- *D MULD
ing has taken place, a 0 signal is allocated to the binary E1 E1
operand at the output Q. E2 A1 E2
Q A1
Q

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Multiplicand
E2 DOUBLE WORD MD, KD Multiplier
A1 DOUBLE WORD MD Result (Product)
Q BINARY A,M Result limited
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 117 ... 120 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Number range


The value of the operand at the input E1 is multiplied by Integer double word (32 Bits)
the value of the operand at the input E2 and the result is
allocated to the operand at the output A1.
The following specially applies here to inputs E1 and E2:
The result is limited to the maximum or minimum value of
● Low limit: 8000 0000H –2 147 483 648
the number range. If limiting has taken place, a 1 signal is
allocated to the binary operand at the output Q. If no limit-
ing has taken place, a 0 signal is allocated to the binary The following generally applies:
operand at the output Q.
● Low limit: 8000 0001H – 2 147 483 647
The inputs and outputs can neither be duplicated nor ne- ● High limit: 7FFF FFFFH + 2 147 483 647
gated. ● Inadmissible value: 8000 0000H –––

907 PC 331/Issued: 11.98 1–7


*D MULTIPLICATION, DOUBLE WORD

Example

FBD/LD IL

!BA 0
*D MULD
MD 00,00 MD 00,00
KD 03,11 MD 00,00 KD 03,11
Q A 02,00 MD 00,00
A 02,00

CE FBD Definition

*D
E1
E2 A1
Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
E2 E D N P N 0 0
A1 A D N P N 0 0
Q A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 MULD
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 E2 Input DOUBLE WORD
00004 PP 0 A1 Output DOUBLE WORD
00005 PP 0 Q Output BINARY

1–8 907 PC 331/Issued: 11.98


ADDITION +

The values of the operands at the inputs of the connection


element are added and the result is allocated to the oper-
and at the output. FBD/LD IL

! E1
+ + E2
E1 = A1
E2 A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Summand 1
E2 WORD EW, MW, AW, KW Summand 2; The input can be duplicated
A1 WORD MW, AW Total
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: < 12 µs < 46 µs
Additional runtime: 5 µs per additional input (E3 ... En)
18 µs per additional input (E3 ... En)
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description The following generally applies:

● Low limit: 8001H –32767


The values of the operands at the inputs of the connection
● High limit: 7FFFH +32767
element are added and the result is allocated to the oper- ● Inadmissible value: 8000H –––
and at the output.
In two’s complement arithmetic, the value 8000H
The input E2 can be duplicated (E2 ... En). The input E1 (–32768) lies outside of the number range and is neither
and the output A1 can be negated. generated nor processed correctly by the PLC. If this for-
bidden value should reach the PLC
Number range
● through bit manipulations by the user or
Integer Word (16 Bits) ● by reading in from outside the PLC or
● by an indirect word constant
The following applies particularly here for the non–ne-
gated input E1: under no circumstances may a negation or subtraction be
carried out on this value.
If the inadmissible value 8000H (–32768) is present at E1,
A permissible value is generated again by means of an al-
it is corrected automatically to the permissible value
location (=), addition (+), multiplication (*) or division (:).
8001H (–32767) before it is processed.
In the case of allocation (=), the forbidden value 8000H
The following particularly applies here to the non–ne- (–32768) is corrected to the allowed value 8001H
gated input E2: low limit: 8000H (–32768) (–32767).

907 PC 331/Issued: 11.98 1–9


+ +ADDITION

Example

FBD/LD IL

! EW 00,00
+ MW 00,00
EW 00,00 = AW 02,00
MW 00,00 AW 02,00

CE FBD Definition

+
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W Y P N 0 0
E2 E W N P N 1 0
A1 A W Y P N 0 0

CE IL Definition

00000 ! PP 0 E1 Input WORD


[ 1
00002 + PP 1 E2 Input WORD (Duplication possible)
] 1
00005 = PP 0 A1 Output WORD

1–10 907 PC 331/Issued: 11.98


ADDITION DOUBLE WORD +D

The value of the operand at the input E1 is added to the


value of the operand at the input E2 and the result is allo-
cated to the operand at the output A1. FBD/LD IL

The result is limited to the maximum or minimum value of


the number range. If limiting has taken place, a one signal !BA 0
is allocated to the binary operand at the output Q. If no lim- +D ADDD
iting has taken place, a zero signal is allocated to the E1 E1
binary operand at the output Q. E2 A1 E2
Q A1
Q

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Summand 1
E2 DOUBLE WORD MD, KD Summand 2
A1 DOUBLE WORD MD Total
Q BINARY A, M Total, limited
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 49 ... 52 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Number range


The value of the operand at the input E1 is added to the Integer, double word (32 bits).
value of the operand at the input E2 and the result is allo-
cated to the operand at the output A1. The following particularly applies here to the inputs E1
and E2:
The result is limited to the maximum or minimum value of
the number range. If limiting has taken place, a 1 signal is ● Low limit: 8000 0000H – 2 147 483 648
allocated to the binary operand at the output Q. If no limit-
ing has taken place, a 0 signal is allocated to the binary The following generally applies:
operand at the output Q.
● Low limit: 8000 0001H –2 147 483 647
The inputs and outputs cannot be duplicated, nor can ● High limit: 7FFF FFFFH +2 147 483 647
they be negated. ● Inadmissible value: 8000 0000H –––

907 PC 331/Issued: 11.98 1–11


+D ADDITION DOUBLE WORD

Example

FBD/LD IL

!BA 0
+D ADDD
MD 00,00 MD 00,00
KD 03,11 MD 00,00 KD 03,11
Q A 02,00 MD 00,00
A 02,00

CE FBD Definition

+D
E1
E2 A1
Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
E2 E D N P N 0 0
A1 A D N P N 0 0
Q A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 ADDD
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 E2 Input DOUBLE WORD
00004 PP 0 A1 Output DOUBLE WORD
00005 PP 0 Q Output BINARY

1–12 907 PC 331/Issued: 11.98


SUBTRACTION –

The value of the operand at the input E2 is subtracted


from the value of the operand at the input E1 and the re-
sult is allocated to the operand at the output A1. FBD/LD IL

! E1
– – E2
E1 = A1
E2 A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Minuend
E2 WORD EW, MW, AW, KW Subtrahend; the input can be duplicated
A1 WORD MW, AW Result (difference)
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: < 12 µs < 49 µs
Additional runtime: 5 µs per additional input (E3 ... En)
21 µs per
additional input (E3 ... En)
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description The following generally applies:

The value of the operand at the input E2 is subtracted ● Low limit: 8001H –32767
from the value of the operand at the input E1 and the re- ● High limit: 7FFFH +32767
sult is allocated to the operand at the output A1. ● Inadmissible value: 8000H –––

The input E2 is capable of duplication (E2...En). If it is du- In the two’s complement arithmetic, the value 8000H
plicated, all values of the operands at the inputs E2...En (–32768) lies outside of the number range and is neither
are subtracted from the operand at the input E1. generated nor processed correctly by the PLC. If this for-
bidden value reaches the PLC
The input E1 and the output A1 can be negated. ● by bit manipulations of the user or
● by being read from outside the PLC or
Number range ● by an indirect word constant

Integer word (16 bits) under no circumstances may negation or subtraction be


carried out on this value.
The following specially applies here to non–negated input An admissible value is generated again by means of an
E1: allocation (=), addition (+), multiplication (*) or division (:).
If the inadmissible value 8000H (–32768) is present at E1,
it is automatically corrected to the permissible value On allocation (=), the forbidden value 8000H (–32768) is
8001H (–32767) before processing. corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 1–13


– SUBTRACTION

Example

FBD/LD IL

! EW 00,00
– – MW 00,00
EW 00,00 = AW 02,00
MW 00,00 AW 02,00

CE FBD Definition


E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W Y P N 0 0
E2 E W N P N 1 0
A1 A W Y P N 0 0

CE IL Definition

00000 ! PP 0 E1 Input WORD


[ 1
00002 – PP 1 E2 Input WORD (capable of duplication)
] 1
00005 = PP 0 A1 Output WORD

1–14 907 PC 331/Issued: 11.98


SUBTRACTION, DOUBLE WORD –D

The value of the operand at the input E2 is subtracted


from the value of the operand at the input E1 and the re-
sult is allocated to the operand at the output A1. FBD/LD IL

The result is limited to the maximum or minimum value of


the number range. If limiting has taken place, a 1 signal is !BA 0
allocated to the binary operand at the output Q. If no limit- –D SUBD
ing has taken place, a 0 signal is allocated to the binary E1 E1
operand at the output Q. E2 A1 E2
Q A1
The value of the operand at the input E2 is checked be- Q
fore subtraction to determine whether or not it lies outside
of the permissible number range (8000 0000H). If this is
the case, calculation is done with the value –2 147 483
647 (8000 0001H) instead of this inadmissible value.
____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Minuend
E2 DOUBLE WORD MD, KD Subtrahend
A1 DOUBLE WORD MD Result (difference)
Q BINARY A, M Result, limited
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 50 ... 55 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Number range


The value of the operand at the input E2 is subtracted Integer double word (32 bits).
from the value of the operand at the input E1 and the re-
sult is allocated to the operand at the output A1. The following especially applies here to the input E1:

The result is limited to the maximum or minimum value of ● Low limit: 8000 0000H – 2 147 483 647.
the number range. If limiting has taken place, a 1 signal is The following generally applies:
allocated to the binary operand at the output Q. If no limit-
ing has taken place, a 0 signal is allocated to the binary Integer double word (32 bits)
operand at the output Q. ● Low limit: 8000 0001H – 2 147 483 647
● High limit: 7FFF FFFFH + 2 147 483 647
The value of the operand at the input E2 is checked be- ● Inadmissible value: 8000 0000H –––
fore subtraction to determine whether or not it lies outside
of the permissible number range (8000 0000H). If this is
the case, calculation is done with the value –2 147 483
647 (8000 0001H) instead of this inadmissible value.
The inputs and outputs can neither be duplicated nor ne-
gated.

907 PC 331/Issued: 11.98 1–15


–D SUBTRACTION, DOUBLE WORD

Example

FBD/LD IL

!BA 0
–D SUBD
MD 00,00 MD 00,00
KD 03,11 MD 00,00 KD 03,11
Q A 02,00 MD 00,00
A 02,00

CE FBD Definition

–D
E1
E2 A1
Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
E2 E D N P N 0 0
A1 A D N P N 0 0
Q A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 SUBD
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 E2 Input DOUBLE WORD
00004 PP 0 A1 Output DOUBLE WORD
00005 PP 0 Q Output BINARY

1–16 907 PC 331/Issued: 11.98


OR /

This connection element realizes a logical OR combina-


tion of the operands at the inputs. The result is allocated
to the operand at the output. FBD IL

! E1
/ / E2
E1 = A1
E2 A1

KOP

E1 A1
][ ()
E2
][

____________________________________________________________________________________________

Parameters
E1 BINARY E, M, A, S, K Operand 1 of the OR combination

E2 BINARY E, M, A, S, K Operand 2 of the OR combination, capable of


duplication

A1 BINARY M, A, S Result of the OR combination


____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 6.6 µs
Additional runtime: 2.3 µs per additional input
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This connection element realizes a logical OR combina-
tion of the operands at the inputs. The result is allocated
to the operand at the output.

The input E2 is capable of duplication. All inputs and the


output can be inverted.
Truth table:

E1 E2 A1
0 0 0
1 0 1
0 1 1
1 1 1

907 PC 331/Issued: 11.98 1–17


/ OR

Example

FBD IL

! E 00,00
/ / E 03,11
E 00,00 = A 02,00
E 03,11 A 02,00

KOP

E 0,00 A 02,00
][ ()
E 03,11
][

CE FBD Definition

/
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E L Y P N 0 0
E2 E L Y P N 1 0
A1 A L Y P N 0 0

CE IL Definition

00000 ! PP 0 E1 Input BINARY


[ 1
00002 / PP 1 E2 Input BINARY (capable of duplication)
] 1
00004 = PP 0 A1 Output BINARY

1–18 907 PC 331/Issued: 11.98


DIVISION :

The value of the operand at the input E1 is divided by the


value of the operand at the input E2 and the result is allo-
cated to the operand at the output A1. FBD/LD IL

The result of division is always a whole number. Rounding


(inclusion of the digits after the decimal point) does not ! E1
take place. : : E2
E1 = A1
E2 A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Dividend
E2 WORD EW, MW, AW, KW Divisor
A1 WORD MW, AW Result (quotient)
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: < 31 µs < 781 µs
Additional runtime: 24 µs per additional input (E3 ... En)
753 µs
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description The following generally applies:

The value of the operand at the input E1 is divided by the ● Lower limit: 8001H –32767
value of the operand at the input E2 and the result is allo- ● High limit: 7FFFH +32767
cated to the operand at the output A1. ● Inadmissible value: 8000H –––

The result of division is always a whole number. Rounding In twos complement arithmetic, the value 8000H
(inclusion of the digits after the decimal point) does not (–32768) lies outside the number range and is neither
take place. generated nor processed correctly by the PLC. If this for-
bidden value reaches the PLC
The input E2 can be duplicated (E2...En). The following
● by bit manipulations on the part of the user or
applies if it is duplicated:
● by reading in from outside the PLC or
E1 : E2 : E3 ... : En = A1.
● by an indirect word constant
All inputs and the output can be negated.
under no circumstances may a negation or substraction
be done on this value.
Number Range
A permissible value is generated again by an allocation
Integer word (16 bits) (=), addition (+), multiplication (*) or division (:).

The following applies here particularly to the non–ne- In the event of allocation (=), the forbidden value 8000H
gated inputs E1 and E2: (–32768) is corrected to the allowed value 8001H
Lower limit: 8000H (–32768) (–32767).

907 PC 331/Issued: 11.98 1–19


: DIVISION

Example

FBD/LD IL

! EW 00,00
: : MW 00,00
EW 00,00 = AW 02,00
MW 00,00 AW 02,00

CE FBD Definition

:
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W Y P N 0 0
E2 E W Y P N 1 0
A1 A W Y P N 0 0

CE IL Definition
00000 ! PP 0 E1 Input WORD
[ 1
00002 : PP 1 E2 Input WORD (capable of duplication)
] 1
00005 = PP 0 A1 Output WORD

1–20 907 PC 331/Issued: 11.98


DIVISION, DOUBLE WORD :D

The value of the operand at the input E1 is divided by the


value of the operand at the input E2 and the result is allo-
cated to the operand at the output A1, the remainder be- FBD/LD IL
ing allocated to the operand at the output REST. If a re-
mainder is produced, the result will always be rounded
down. If the result lies outside of the permissible number !BA 0
range, it will be limited to the maximum or minimum value :D DIVD
of the number range. If limiting has taken place, a 1 signal E1 E1
is allocated to the binary operand at the output Q and the E2 A1 E2
value 0 is allocated to the output REST. If no limiting has REST A1
taken place, a 0 signal is allocated to the binary operand Q REST
at the output Q. Q

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Dividend
E2 DOUBLE WORD MD, KD Divisor
A1 DOUBLE WORD MD Result (quotient)
REST DOUBLE WORD MD Rest
Q BINARY A, M Result limited
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 300 ... 324 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Remainder handling


The value of the operand at the input E1 is divided by the If division results in a remainder, this is available at the
value of the operand at the input E2 and the result is allo- double word output REST. The result of division is always
cated to the operand at the output A1, the remainder be- rounded down if a remainder occurs.
ing allocated to the operand at the output REST. If a re-
mainder is produced, the result will always be rounded
down. If the result lies outside of the permissible number Example: 3:3=1 Remainder 0
range, it will be limited to the maximum or minimum value 4:3=1 Remainder 1
of the number range. If limiting has taken place, a 1 signal
5:3=1 Remainder 2
is allocated to the binary operand at the output Q and the
value 0 is allocated to the output REST. If no limiting has 6:3=2 Remainder 0
taken place, a 0 signal is allocated to the binary operand
at the output Q. As the remainder is available at the output REST, the user
can compare this to the divisor and can round the result at
Division by “zero” is therfore also signalled at the binary the output A1 to suit his own requirements.
output Q.
Example:
The inputs and outputs can neither be duplicated nor ne-
gated. Remainder > divisor/2 –> round up the result at A1.

907 PC 331/Issued: 11.98 2–1


:D DIVISION, DOUBLE WORD

Division by ”zero” Number range


If the divisor has the value “zero”, the positive or ne-gative Integer double word (32 bits)
limit of the number range is allocated to the output A1.
The following applies to division by “zero”: Here, the following particularly applies to the inputs E1
and E2:
A1 = –2 147 483 647 (8000 0001H) if the dividend is nega-
tive. ● Low limit: 8000 0000H –2 147 483 648
A1 = +2 147 483 647 (7FFF FFFFH) if the dividend is posi-
tive. The following generally applies:

REST = 0 Output for the remainder ● Low limit: 8000 0001H –2 147 483 647
Q=1 Output to signal that the value at the output ● High limit: 7FFF FFFFH +2 147 483 647
A1 has been limited ● Inadmissible value: 8000 0000H –––

Invalid result value


If the invalid value 8000 0000H is the result of division, this
will be corrected to the permissible limit 8000 0001H
(–2 147 483 647), the binary output Q will be set to the val-
ue 1 and the output REST will be set to the value 0.

2–2 907 PC 331/Issued: 11.98


DIVISION, DOUBLE WORD :D

Example

FBD/LD IL

!BA 0
:D DIVD
MD 00,00 MD 00,00
KD 03,11 MD 01,00 KD 03,11
REST MD 00,00 MD 01,00
Q A 02,00 MD 00,00
A 02,00

CE FBD Definition

:D
E1
E2 A1
REST
Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
E2 E D N P N 0 0
A1 A D N P N 0 0
REST A D N P Y 0 0
Q A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 DIVD
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 E2 Input DOUBLE WORD
00004 PP 0 A1 Output DOUBLE WORD
00005 PP 0 REST Output DOUBLE WORD
00005 PP 0 Q Output BINARY

907 PC 331/Issued: 11.98 2–3


< LESS THAN

The value of the operand at the input Z1< is compared to


the value of the operand at the input Z2.
FBD/LD IL
If the value at Z1< is less than the one at Z2, the state 1 is
allocated to the operand at the output Q. The state 0 is
allocated to Q if Z1< is equal to or greater than Z2. ! Z1<
< < Z2
Z1< = Q
Z2 Q

____________________________________________________________________________________________

Parameters
Z1< WORD EW, MW, AW, KW Value to be compared
Z2 WORD EW, MW, AW, KW Comparison value
Q BINARY A, M, S Result of the comparison
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: < 12 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The following generally applies:


● Low limit: 8001H –32767
● High limit: 7FFFH +32767
The value of the operand at the input Z1< is compared to ● Inadmissible value: 8000H /////
the value of the operand at the input Z2.
In the two’s complement arithmetic, the value 8000H
If the value at Z1< is less than the one at Z2, the state 1 is (–32768) lies outside of the number range and is neither
allocated to the operand at the output Q. The state 0 is generated nor processed correctly by the PLC. If this for-
allocated to Q if Z1< is equal to or greater than Z2. bidden value reaches the PLC
● by bit manipulations of the user or
The inputs can be negated, but not duplicated. The output
can be inverted, but not duplicated. ● by being read from outside the PLC or
● by an indirect word constant
Number range under no circumstances may negation or subtraction be
Integer word (16 Bit) carried out on this value.
An admissible value is generated again by means of an
The following specially applies here to the non–negated allocation (=), addition (+), multiplication (*) or division (:).
inputs:
● Low limit 8000H –32768 On allocation (=), the forbidden value 8000H (–32768) is
● High limit 7FFFH +32767 corrected to the allowed value 8001H (–32767).

2–4 907 PC 331/Issued: 11.98


LESS THAN <

Example

FBD/LD IL

! MW 00,00
< < AW 02,00
MW 00,00 Z1< = M 00,00
AW 02,00 Z2 Q M 00,00

CE FBD Definition

<
Z1<
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1< E W Y P Y 0 0
Z2 E W Y P Y 0 0
Q A L Y P Y 0 0

CE IL Definition

00000 ! PP Z1< Input WORD


00002 < PP Z2 Input WORD
00004 = PP Q Output BINARY

907 PC 331/Issued: 11.98 2–5


<= LESS THAN OR EQUAL

The value of the operand at the input Z1<= is compared to


the value of the operand at the input Z2.
FBD/LD IL
The state 1 is allocated to the operand at the output Q if
the value at Z1<= is less than or equal to the value at Z2.
The state 0 is allocated to Q if Z1<= is greater than Z2. ! Z1<=
<= <= Z2
Z1<= = Q
Z2 Q

____________________________________________________________________________________________

Parameters
Z1<= WORD EW, MW, AW, KW Value to be compared
Z2 WORD EW, MW, AW, KW Comparison value
Q BINARY A, M, S Result of the comparison
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: < 12 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The following generally applies:


● Low limit: 8001H –32767
The value of the operand at the input Z1<= is compared to ● High limit: 7FFFH +32767
the value of the operand at the input Z2. ● Inadmissible value: 8000H –––
In the two’s complement arithmetic, the value 8000H
The state 1 is allocated to the operand at the output Q if (–32768) lies outside of the number range and is neither
the value at Z1<= is less than or equal to the value at Z2. generated nor processed correctly by the PLC. If this for-
The state 0 is allocated to Q if Z1<= is greater than Z2. bidden value reaches the PLC

The inputs can be negated, but not duplicated. The output ● by bit manipulations of the user or
can be inverted, but not duplicated.
● by being read from outside the PLC or
● by an indirect word constant
Number range
under no circumstances may negation or subtraction be
Integer word (16 Bit) carried out on this value.
An admissible value is generated again by means of an
The following specially applies here to the non–negated allocation (=), addition (+), multiplication (*) or division (:).
inputs:
● Low limit 8000H –32768 On allocation (=), the forbidden value 8000H (–32768) is
● High limit 7FFFH +32767 corrected to the allowed value 8001H (–32767).

2–6 907 PC 331/Issued: 11.98


LESS THAN OR EQUAL <=

Example

FBD/LD IL

! MW 00,00
<= <= AW 02,00
MW 00,00 Z1<= = M 00,00
AW 02,00 Z2 Q M 00,00

CE FBD Definition

<=
Z1<=
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1<= E W Y P Y 0 0
Z2 E W Y P Y 0 0
Q A L Y P Y 0 0

CE IL Definition
00000 ! PP 0 Z1<= Input WORD
00002 < PP 0 Z2 Input WORD
00004 = PP 0 Q Output BINARY

907 PC 331/Issued: 11.98 2–7


<D LESS THAN, DOUBLE WORD

The value of the operand at the input Z1< is compared to


the value of the operand at the input Z2. If the value at Z1<
is less than the one at Z2, the state 1 is allocated to the FBD/LD IL
operand at the output Q. The state 0 is allocated to Q if
Z1< is equal to or greater than Z2.
!BA 0
<D VKLD
Z1< Z1<
Z2 Q Z2
Q

____________________________________________________________________________________________

Parameters
Z1< DOUBLE WORD MD, KD Value to be compared
Z2 DOUBLE WORD MD, KD Comparison value
Q BINARY A, M, Result of the comparison
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 35 ... 36 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description

The value of the operand at the input Z1< is compared to


the value of the operand at the input Z2. If the value at Z1<
is less than the one at Z2, the state 1 is allocated to the
operand at the output Q. The state 0 is allocated to Q if
Z1< is equal to or greater than Z2.

The inputs can be negated, but not duplicated. The output


can be inverted, but not duplicated.

Number range
Integer double word (32 Bit)
The following specially applies here to the inputs Z1< and
Z2:
● Low limit: 8000 0000H –2 147 483 648
● High limit: 7FFF FFFFH +2 147 483 647

The following generally applies:


● Low limit: 8000 0001H –2 147 483 647
● High limit: 7FFF FFFFH +2 147 483 647
● Inadmissible value: 8000 0000H –––

2–8 907 PC 331/Issued: 11.98


LESS THAN, DOUBLE WORD <D

Example

FBD/LD IL

!BA 0
<D VKLD
MD 00,00 Z1< MD 00,00
KD 01,00 Z2 Q A 02,00 KD 01,00
A 02,00

CE FBD Definition

<D
Z1<
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1< E D N P Y 0 0
Z2 E D N P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 VKLD
00002 PP 0 Z1< Input DOUBLE WORD
00003 PP 0 Z2 Input DOUBLE WORD
00004 PP 0 Q Output BINARY

907 PC 331/Issued: 11.98 2–9


= ALLOCATION

This connection element allocates the value of the oper-


and at the input to the operand at the output.
FBD IL

! E1
= = A1
E1 A1

LD

E1 A1
][ ()

____________________________________________________________________________________________

Parameters
E1 BINARY E, M, A, S, K Source
A1 BINARY M, A, S Target, output capable of duplication
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 4.3 µs 14 µs
Additional runtime: 2.3 µs per additional output (A2 ... An)
8 µs
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
This connection element allocates the value of the oper-
and at the input to the operand at the output.

The output A1 is capable of duplication. The input and the


output are capable of inversion.

2–10 907 PC 331/Issued: 11.98


ALLOCATION =

Example

FBD IL

! E 00,00
= = A 02,00
E 00,00 A 02,00

LD

E 00,00 A 02,00
][ ()

CE FBD Definition

=
E1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E L Y P N 0 0
A1 A L Y P N 1 0

CE IL Definition
00000 ! PP 0 E1 Input BINARY
[ 1
00002 = PP 1 A1 Output BINARY (capable of duplication)
] 1

907 PC 331/Issued: 11.98 2–11


=1 EXCLUSIVE OR

This connection element realizes a logical EXCLUSIVE


OR combination of the operands at the inputs. The result
is allocated to the operand at the output. FBD/LD IL

! E1
=1 &N E2
E1 /N E1
E2 A1 & E2
= A1

____________________________________________________________________________________________

Parameters
E1 BINARY E, M,A,S,K Operand 1 of the XOR combination

E2 BINARY E,M,A,S,K, Operand 2 of the XOR combination

A1 BINARY M,A,S Result of the XOR combination


____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 10.9 µs 32 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
This connection element realizes a logical EXCLUSIVE
OR combination of the operands at the inputs. The result
is allocated to the operand at the output.

Inverting and duplication of the inputs and of the output is


not possible.

Truth table:

E1 E2 A1
0 0 0
1 0 1
0 1 1
1 1 0

2–12 907 PC 331/Issued: 11.98


EXCLUSIVE OR =1

Example

FBD/LD IL

! E 00,00
=1 &N E 03,11
E 00,00 /N E 00,00
E 03,11 A 02,00 & E 03,11
= A 02,00

CE FBD Definition

=1
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E L N P N 0 0
E2 E L N P N 0 0
A1 A L N P N 0 0

CE IL Definition
00000 ! PP 0 E1 Input BINARY
00002 &N PP 0 E2 Input BINARY
00004 /N PP 0 E1 Input BINARY
00006 & PP 0 E2 Input BINARY
00008 = PP 0 A1 Ouput BINARY

907 PC 331/Issued: 11.98 2–13


=? EQUAL

The value of the operand at the input Z1=? is compared to


the value of the operand at the input Z2. If the value at
Z1=? is equal to the one at Z2, the state 1 is allocated to FBD/LD IL
the operand at the output Q. The state 0 is allocated to Q if
Z1=? is unequal to Z2.
! Z1=?
=? =? Z2
Z1=? = Q
Z2 Q

____________________________________________________________________________________________

Parameters
Z1=? WORD EW, MW, AW, KW Value to be compared
Z2 WORD EW, MW, AW, KW Comparison value
Q BINARY A, M, S Result of the comparison
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: < 12 µs < 47 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description In the two’s complement arithmetic, the value 8000H


(–32768) lies outside of the number range and is neither
generated nor processed correctly by the PLC. If this for-
The value of the operand at the input Z1=? is compared to bidden value reaches the PLC
the value of the operand at the input Z2. If the value at
Z1=? is equal to the one at Z2, the state 1 is allocated to
the operand at the output Q. The state 0 is allocated to Q if ● by bit manipulations of the user or
Z1=? is unequal to Z2.
The inputs can be negated but cannot be duplicated. The ● by being read from outside the PLC or
output can be inverted but cannot be duplicated.

● by an indirect word constant


Number range
Integer word (16 Bit)
under no circumstances may negation or subtraction be
The following specially applies here to the non–negated carried out on this value.
inputs:
● low limit 8000H –32768
● high limit 7FFFH +32767 An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
The following generally applies:
● low limit: 8001H –32767
● high limit: 7FFFH +32767 On allocation (=), the forbidden value 8000H (–32768) is
● inadmissible value: 8000H ––– corrected to the allowed value 8001H (–32767).

2–14 907 PC 331/Issued: 11.98


EQUAL =?

Example

FBD/LD IL

! MW 00,00
=? =? AW 02,00
MW 00,00 Z1=? = M 00,00
AW 02,00 Z2 Q M 00,00

CE FBD Definition

=?
Z1=?
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1=? E W Y P Y 0 0
Z2 E W Y P Y 0 0
Q A L Y P Y 0 0

CE IL Definition

00000 ! PP 0 Z1=? Input WORD


00002 =? PP 0 Z2 Input WORD
00004 = PP 0 Q Output BINARY

907 PC 331/Issued: 11.98 2–15


=?D EQUAL, DOUBLE WORD

The value of the operand at the input Z1=? is compared to


the value of the operand at the input Z2. If the vaule at
Z1=? is identical to the one at Z2, the state 1 is allocated FBD/LD IL
to the operand at the output Q. The state 0 is allocated to
Q if Z1=? is unequal to Z2.
!BA 0
=?D VGLD
Z1=? Z1=?
Z2 Q Z2
Q

____________________________________________________________________________________________

Parametes
Z1=? DOUBLE WORD MD, KD Value to be compared
Z2 DOUBLE WORD MD, KD Comparison value
Q BINARY A, M Result of the comparison
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 35 ... 37 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description

The value of the operand at the input Z1=? is compared to


the value of the operand at the input Z2. If the vaule at
Z1=? is identical to the one at Z2, the state 1 is allocated
to the operand at the output Q. The state 0 is allocated to
Q if Z1=? is unequal to Z2.

The inputs can neither be duplicated nor negated. The


output can neither be duplicated nor inverted.

Number range
Integer double word (32 Bit)
The following specially applies here to the inputs Z1=?
and Z2:
● low limit: 8000 0000H –2 147 483 648
● high limit: 7FFF FFFFH +2 147 483 647
The following generally applies:
● low limit: 8000 0001H –2 147 483 647
● high limit: 7FFF FFFFH +2 147 483 647
● inadmissible value: 8000 0000H –––

2–16 907 PC 331/Issued: 11.98


EQUAL, DOUBLE WORD =?D

Example

FBD/LD IL

!BA 0
=?D VGLD
MD 00,00 Z1=? MD 00,00
KD 01,00 Z2 Q A 02,00 KD 01,00
A 02,00

CE FBD Definition

=?D
Z1=?
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1=? E D N P Y 0 0
Z2 E D N P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 VGLD
00002 PP 0 Z1=? Input DOUBLEWORD
00003 PP 0 Z2 Input DOUBLEWORD
00004 PP 0 Q Output BINARY

907 PC 331/Issued: 11.98 2–17


=D ALLOCATION, DOUBLE WORD

The value of the operand at the input E1 is allocated to the


operand at the output A1.
FBD/LD IL

!BA 0
=D ZUWD
E1 A1 E1
A1

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Source
A1 DOUBLE WORD MD Target
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 31 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Number range


The value of the operand at the input E1 is allocated to the Integer double word (32 bits)
operand at the output A1.
● Low limit: 8000 0001H – 2 147 483 647
If the inadmissible value 8000 0000H should appear at the ● High limit: 7FFF FFFFH + 2 147 483 647
input for any particular reason, the permissible value ● Inadmissible value: 8000 0000H –––
8000 0001H (–2 147 483 647) will be allocated to the out-
put A1. Therefore, the inadmissible value will be cor-
rected.

The input and the output can neither be duplicated nor ne-
gated.

2–18 907 PC 331/Issued: 11.98


ALLOCATION, DOUBLE WORD =D

Example

FBD/LD IL

!BA 0
=D ZUWD
MD 00,00 MD 02,00 MD 00,00
MD 02,00

CE FBD Definition

=D
E1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
A1 A D N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 ZUWD
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 A1 Output DOUBLE WORD

907 PC 331/Issued: 11.98 2–19


=D ALLOCATION, DOUBLE WORD

2–20 907 PC 331/Issued: 11.98


CONDITIONAL PROGRAM END =PE

The conditional program end may be planned within a


PLC program. Depending on the status of the operand at
the input BED, processing of the PLC program is ended or FBD/LD IL
is not ended here.

! BED
=PE = PE
BED

____________________________________________________________________________________________

Parameters
BED BINARY E, M, A, S, K Condition for program end
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 2 µs 4 µs
Additional runtime: ––– –––
Output updating: not applicable not applicable
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
The conditional program end may be planned within a
PLC program. Depending on the status of the operand at
the input BED, processing of the PLC program is ended or
is not ended here.

The following applies to the condition at the BED input:

BED = 0: Processing of the PLC program is continued


BED = 1: The PLC program is processed only up to
this point. The subsequent part of the
PLC program is not processed.

The input can neither be duplicated nor inverted.

907 PC 331/Issued: 11.98 3–1


=PE CONDITIONAL PROGRAM END

Example

FBD/LD IL

! M 01,03
=PE = PE
M 01,03 BED

CE FBD Definition

=PE
BED

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

BED E L N P Y 0 0

CE IL Definition
00000 ! PP 0 BED Condition for program end (BINARY)
00002 =PE

3–2 907 PC 331/Issued: 11.98


ALLOCATION RESET MEMORY =R

This connection element resets a stored binary variable.

A state 1 at the input sets the operand at the output to a FBD IL


state 0. A state 0 at the input has no influence on the oper-
and at the output.
! E1
=R =R A1
E1 A1

LD

E1 A1
][ (R)

____________________________________________________________________________________________

Parameters
E1 BINARY E, M, A, S, K Reset condition
A1 BINARY M, A Store variable
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 4.3 µs 15 µs
Additional runtime: 2.3 µs per additional output (A3 ... An)
9 µs
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
A state 1 at the input sets the operand at the output to a
state 0. A state 0 at the input has no influence on the oper-
and at the output.

IMPORTANT:
This CE must only be used as an output CE, i. e. in the
FBD it must not be connected further by a line on the out-
put side. An operand (M or A) must be specified at the out-
put.

The output A1 can be duplicated (A2...An). The input E1


can be inverted.

907 PC 331/Issued: 11.98 3–3


=R ALLOCATION RESET MEMORY

Example

FBD IL

! E 00,00
=R =R A 02,00
E 00,00 A 02,00

LD

E 00,00 A 02,00
][ (R)

CE FBD Definition

=R
E1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E L Y P N 0 0
A1 A L N P N 1 0

CE IL Definition

00000 ! PP 0 E1 Input BINARY


[ 1
00002 =R PP 1 A1 Output BINARY (capable of duplication)
] 1

3–4 907 PC 331/Issued: 11.98


ALLOCATION SET MEMORY =S

A binary variable is set in latching form with this connec-


tion element.
FBD IL
A state 1 at the input sets the operand at the output to a
state 1. A state 0 at the input has no influence on the oper-
and at the output. ! E1
=S =S A1
E1 A1

LD

E1 A1
][ (S)

____________________________________________________________________________________________

Parameters
E1 BINARY E, M, A, S, K Set condition
A1 BINARY M, A Storage variable
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 4.3 µs 15 µs
Additional runtime: 2.3 µs per additional output (A3 ... An) 9 µs
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51

____________________________________________________________________________________________

Description
A state 1 at the input sets the operand at the output to a
state 1. A state 0 at the input has no influence on the oper- Example:
and at the output.

IMPORTANT: =S
This CE must only be used as an output CE, i. e. in the E1 A1 A1 not allowed
FBD it must not be connected further by a line on the out- A2
put side. An operand (M or A) must be specified at the out-
put. =S
E1 A1
The output A1 can be duplicated (A2...An). The input E1 & not allowed
can be inverted.

=S
E1 A1
A2
A1
A2
correct

907 PC 331/Issued: 11.98 3–5


=S ALLOCATION SET MEMORY

Example

FBD IL

! E 00,00
=S =S A 02,00
E 00,00 A 02,00

LD

E 00,00 A 02,00
][ (S)

3–6 907 PC 331/Issued: 11.98


ALLOCATION, WORD =W

This connection element allocates the value of the oper-


and at the input to the output capable of duplication.
FBD/LD IL

! E1
=W = A1
E1 A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Source
A1 WORD MW,AW Target; output capable of duplication
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 7 µs 28 µs
Additional runtime: 5 µs per additional output
14 µs
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description In the two’s complement arithmetic, the value 8000H


(–32768) lies outside of the number range and is neither
This connection element allocates the value of the oper- generated nor processed correctly by the PLC. If this for-
and at the input to the output capable of duplication. bidden value reaches the PLC
The output A1 can be duplicated (A2...An). The input and
the output can be negated. ● by bit manipulations of the user or

Number range ● by being read from outside the PLC or

Integer word (16 bits).


● by an indirect word constant
The following especially applies here to the non–negated
input E1: If the inadmissible value 8000H (–32768) is under no circumstances may negation or subtraction be
present at the input E1, the permissible value 8001 H carried out on this value.
(–32767) is allocated to the output A1.

The following generally applies: An admissible value is generated again by means of an


allocation (=), addition (+), multiplication (*) or division (:).
● Low limit: 8001H –32767
● High limit: 7FFFH +32767 On allocation (=), the forbidden value 8000H (–32768) is
● Inadmissible value: 8000H ––– corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 3–7


=W ALLOCATION, WORD

Example

FBD/LD IL

! EW 00,00
=W = AW 02,00
EW 00,00 AW 02,00

CE FBD Definition

=W
E1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W Y P N 0 0
A1 A W Y P N 1 0

CE IL Definition
00001 ! PP 0 E1 Input WORD
[ 1
00002 = PP 1 A1 Output WORD (capable of duplication)
] 1

3–8 907 PC 331/Issued: 11.98


GREATER THAN >

The value of the operand at the input Z1> is compared to


the value of the operand at the input Z2.
FBD/LD IL
If the value at Z1> is greater than the one at Z2, the state 1
is allocated to the operand at the output Q. The state 0 is
allocated to Q if Z1> is equal to or less than Z2. ! Z1>
> > Z2
Z1> = Q
Z2 Q

____________________________________________________________________________________________

Parameters
Z1> WORD EW, MW, AW, KW Value to be compared
Z2 WORD EW, MW, AW, KW Comparison value
Q BINARY A, M, S Result of the comparison
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: < 12 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description In the two’s complement arithmetic, the value 8000H


(–32768) lies outside of the number range and is neither
The value of the operand at the input Z1> is compared to generated nor processed correctly by the PLC. If this for-
the value of the operand at the input Z2. bidden value reaches the PLC
If the value at Z1> is greater than the one at Z2, the state 1
is allocated to the operand at the output Q. The state 0 is ● by bit manipulations of the user or
allocated to Q if Z1> is equal to or less than Z2.
The inputs can neither be negated nor duplicated. The ● by being read from outside the PLC or
output can be inverted, but cannot be duplicated.

Number range ● by an indirect word constant

Integer word (16 Bit)


under no circumstances may negation or subtraction be
The following specially applies here to the non–negated carried out on this value.
inputs:
● low limit 8000H –32768
● high limit 7FFFH +32767 An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
The following generally applies:
● low limit: 8001H –32767
● high limit: 7FFFH +32767 On allocation (=), the forbidden value 8000H (–32768) is
● inadmissible value: 8000H ––– corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 3–9


> GREATER THAN

Example

FBD/LD IL

! MW 00,00
> > AW 02,00
MW 00,00 Z1> = M 00,00
AW 02,00 Z2 Q M 00,00

CE FBD Definition

>
Z1>
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1> E W Y P Y 0 0
Z2 E W Y P Y 0 0
Q A L Y P Y 0 0

CE IL Definition
00000 ! PP 0 Z1> Input WORD
00002 > PP 0 Z2 Input WORD
00004 = PP 0 Q Output BINARY

3–10 907 PC 331/Issued: 11.98


UNEQUAL <>

The value of the operand at the input Z1<> is compared to


the value of the operand at the input Z2.
FBD/LD IL
If the value at Z1<> is greater than or less than the one at
Z2, the state 1 is allocated to the operand at the output Q.
The state 0 is allocated to Q if Z1<> is equal to Z2. ! Z1<>
<> <> Z2
Z1<> = Q
Z2 Q

____________________________________________________________________________________________

Parameters
Z1<> WORD EW, MW, AW, KW Value to be compared
Z2 WORD EW, MW, AW, KW Comparison value
Q BINARY A, M, S Result of the comparison
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: < 12 µs < 49 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description In the two’s complement arithmetic, the value 8000H


(–32768) lies outside of the number range and is neither
The value of the operand at the input Z1<> is compared to
generated nor processed correctly by the PLC. If this for-
the value of the operand at the input Z2.
bidden value reaches the PLC
If the vaue at Z1<> is greater than or less than the one at
Z2, the state 1 is allocated to the operand at the output Q. ● by bit manipulations of the user or
The state 0 is allocated to Q if Z1<> is equal to Z2.
The inputs are capable of negation, but cannot be dupli-
● by being read from outside the PLC or
cated. The output can be inverted, but cannot be dupli-
cated.
● by an indirect word constant
Number range
Integer word (16 bits)
under no circumstances may negation or subtraction be
The following specially applies here to the non– carried out on this value.
negated inputs:
● Low limit 8000H –32768
● High limit 7FFFH +32767 An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
The following generally applies:
● Low limit: 8001H –32767
● High limit: 7FFFH +32767 On allocation (=), the forbidden value 8000H (–32768) is
● Inadmissible value: 8000H ––– corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 3–11


<> UNEQUAL

Example

FBD/LD IL

! MW 00,00
<> <> AW 02,00
MW 00,00 Z1<> = M 00,00
AW 02,00 Z2 Q M 00,00

CE FBD Definition

<>
Z1<>
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1<> E W Y P Y 0 0
Z2 E W Y P Y 0 0
Q A L Y P Y 0 0

CE IL Definition

00000 ! PP 0 Z1<> Input WORD


00002 <> PP 0 Z2 Input WORD
00004 = PP 0 Q Output BINARY

3–12 907 PC 331/Issued: 11.98


UNEQUAL ><

The value of the operand at the input Z1>< is compared to


the value of the operand at the input Z2.
FBD/LD IL
If the value at Z1>< is greater than or less than the one at
Z2, the state 1 is allocated to the operand at the output Q.
The state 0 is allocated to Q if Z1>< is equal to Z2. ! Z1><
>< <> Z2
Z1>< = Q
Z2 Q

____________________________________________________________________________________________

Parameters
Z1<> WORD EW, MW, AW, KW Value to be compared
Z2 WORD EW, MW, AW, KW Comparison value
Q BINARY A, M, S Result of the comparison
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: < 12 µs < 49 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description The following generally applies:


● Low limit: 8001H –32767
The value of the operand at the input Z1>< is compared to ● High limit: 7FFFH +32767
the value of the operand at the input Z2. ● Inadmissible value: 8000H –––
If the value at Z1>< is greater than or less than the one at
In the two’s complement arithmetic, the value 8000H
Z2, the state 1 is allocated to the operand at the output Q.
(–32768) lies outside of the number range and is neither
The state 0 is allocated to Q if Z1>< is equal to Z2.
generated nor processed correctly by the PLC. If this for-
The inputs are capable of negation, but cannot be dupli- bidden value reaches the PLC
cated. The output can be inverted, but cannot be dupli-
cated. ● by bit manipulations of the user or
Note:
● by being read from outside the PLC or
For reasons of compatability (graphical symbol and sym-
bols) with ABB Procontic b, in FBD the call >< is used for ● by an indirect word constant
“unequal” interrogation although the operand in IL is <>.
under no circumstances may negation or subtraction be
Number range carried out on this value.
Integer word (16 bits)
An admissible value is generated again by means of an
The following specially applies here to the non–negated allocation (=), addition (+), multiplication (*) or division (:).
inputs:
● Low limit 8000H –32768 On allocation (=), the forbidden value 8000H (–32768) is
● High limit 7FFFH +32767 corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 3–13


>< UNEQUAL

Example

FBD/LD IL

! MW 00,00
>< <> AW 02,00
MW 00,00 Z1>< = M 00,00
AW 02,00 Z2 Q M 00,00

CE FBD Definition

><
Z1><
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1>< E W Y P Y 0 0
Z2 E W Y P Y 0 0
Q A L Y P Y 0 0

CE IL Definition

00000 ! PP 0 Z1>< Input WORD


00002 <> PP 0 Z2 Input WORD
00004 = PP 0 Q Output BINARY

3–14 907 PC 331/Issued: 11.98


GREATER THAN OR EQUAL TO >=

The value of the operand at the input Z1>= is compared to


the value of the operand at the input Z2. The state 1 is al-
located to the operand at the output Q if the value at Z1>= FBD/LD IL
is greater than or equal to the value at Z2. The state 0 is
allocated to Q if Z1>= is less than Z2.
! Z1>=
>= >= Z2
Z1>= = Q
Z2 Q

____________________________________________________________________________________________

Parameters
Z1>= WORD EW, MW, AW, KW Value to be compared
Z2 WORD EW, MW, AW, KW Comparison value
Q BINARY A, M, S Result of the comparison
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: < 12 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description In the two’s complement arithmetic, the value 8000H


(–32768) lies outside of the number range and is neither
The value of the operand at the input Z1>= is compared to generated nor processed correctly by the PLC. If this for-
the value of the operand at the input Z2. The state 1 is al- bidden value reaches the PLC
located to the operand at the output Q if the value at Z1>=
is greater than or equal to the value at Z2. The state 0 is
allocated to Q if Z1>= is less than Z2. ● by bit manipulations of the user or

The inputs can be negated, but not duplicated. The output


● by being read from outside the PLC or
can be inverted, but not duplicated.
Number range ● by an indirect word constant
Integer word (16 Bit)
The following specially applies here to the non–negated under no circumstances may negation or subtraction be
inputs: carried out on this value.
● low limit: 8000H –32768
● high limit: 7FFFH +32767 An admissible value is generated again by means of an
The following generally applies: allocation (=), addition (+), multiplication (*) or division (:).
● low limit: 8001H –32767
● high limit: 7FFFH +32767 On allocation (=), the forbidden value 8000H (–32768) is
● inadmissible value: 8000H ––– corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 3–15


>= GREATER THAN OR EQUAL TO

Example

FBD/LD IL

! MW 00,00
>= >= AW 02,00
MW 00,00 Z1>= = M 00,00
AW 02,00 Z2 Q M 00,00

CE FBD Definition

Z1>=
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1>= E W Y P Y 0 0
Z2 E W Y P Y 0 0
Q A L Y P Y 0 0

CE IL Definition

00000 ! PP 0 Z1>= Input WORD


00002 >= PP 0 Z2 Input WORD
00004 = PP 0 Q Output BINARY

3–16 907 PC 331/Issued: 11.98


GREATER THAN, DOUBLE WORD >D

The value of the operand at the input Z1> is compared to


the value of the operand at the input Z2.
FBD/LD IL
The state 1 is allocated to the operand at the output Q if
the value at Z1> is greater than the one at Z2. The state 0
is allocated to Q if Z1> is equal to or less than Z2. !BA 0
>D VGRD
Z1> Z1>
Z2 Q Z2
Q

____________________________________________________________________________________________

Parameters
Z1> DOUBLE WORD MD, KD Value to be compared
Z2 DOUBLE WORD MD, KD Comparison value
Q BINARY A, M Result of the comparison
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 35 – 37 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description

The value of the operand at the input Z1> is compared to


the value of the operand at the input Z2.

The state 1 is allocated to the operand at the output Q if


the value at Z1> is greater than the one at Z2. The state 0
is allocated to Q if Z1> is equal to or less than Z2.
The inputs can neither be duplicated nor negated. The
output can neither be duplicated nor inverted.

Number range
Integer double word (32 Bit)
The following specially applies here to the inputs Z1> and
Z2:
● low limit: 8000 0000H –2 147 483 648
● high limit: 7FFF FFFFH +2 147 483 647

The following generally applies:


● low limit: 8000 0001H –2 147 483 647
● high limit: 7FFF FFFFH +2 147 483 647
● inadmissible value: 8000 0000H –––

907 PC 331/Issued: 11.98 3–17


>D GREATER THAN, DOUBLE WORD

Example

FBD/LD IL

!BA 0
>D VGRD
MD 00,00 Z1> MD 00,00
KD 02,00 Z2 Q A 00,00 KD 02,00
A 00,00

CE FBD Definition

>D
Z1>
Z2 Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

Z1> E D N P Y 0 0
Z2 E D N P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (presest to 0)


00001 VGRD
00002 PP 0 Z1> Input DOUBLE WORD
00003 PP 0 Z2 Input DOUBLE WORD
00004 PP 0 Q Output BINARY

3–18 907 PC 331/Issued: 11.98


COUPLING VISUALIZATION VIA ARCNET 5F_ARC, 5F_ARC94

The function block coordinates the data transfer between


PC and PLC via ARCNET. 5F_ARC (for 07 KT 92/93)
5F_ARC94 (for 07 KT 94)
FREI
T_I1 T_O1

ERR
OP0

Parameters
FREI BIT Enabling
SEC WORD 1. User data flag reception
T_O1 WORD 1. User data flag reception
ERR WORD Error
OP0 1. Operand in operand memory

Description
To get a simple and effective data transfer to visualization In addition to this protocol, communication between the
systems, a protocol according to MODBUS was realized. PLCs can be realized according to the block descriptions
ASEND, ASEND+ and AREC.
Apart from the ARCNET blocks AINIT, AREC, ASEND,
ASEND+ and APOLL, the connection element 5F_ARC In the PLC program, a range of 125 flag words each must
(for 07 KT 92/93) or 5F_ARC94 (for 97 KT 94) is used in be reserved for sending as well as for receiving. The tele-
the PLC program. The functionality of the connection ele- grams consist of an ARCNET head (CP, DIN, JOB_NR)
ments 5F_ARC and 5F_ARC94 is identical. and the MODBUS telegram, which may use these 125
words as a maximum. All telegrams are sent with the DIN
These connection elements call a C subroutine via the block identifier 5F and the user data length (AREC/ASEND) 125
CALLC which interprets the received data. The protocol (maximum length). The ARCNET address of the correspond-
works in accordance to a master/slave principle. The PC ing subscriber is always used as job number. This job num-
always works as master and the PLC always as slave. ber is entered at the ASEND or ASEND+ block and at the
Which data should be sent or received is configured in the AREC block.
PC. In the PLC always a "standard program" is used.
Example: If the master (PC) has ARCNET address 1 and
It is possible to couple several masters with a PLC. In this the PLC has ARCNET address 2, the job number = 1 must
case, the PLC program must be expanded with several be used at the blocks AREC and ASEND in the PLC pro-
5F_ARC or 5F_ARC94 blocks. gram.

Structure of the ARCNET telegram (see also block documentation AREC)


Sender Receiver CP DIN MASTER Low MASTER High Counter Counter SLAVE FCT User data
03 5F xx 00 aa aa yy zz
0 1 2 3 4 5 6 7 8 9 10-256

xx = ARCNET address of the master = job number at the AREC/ASEND block


yy = ARCNET address of the slave, here starts the MODBUS telegram
aa = Counter, is updated by the master and reflected by the slave, to avoid telegram doubling. This counter is not used
for the checksum.
FCT = Function code

907 PC 331 / Issued: 08.99 3-19


7
5F_ARC, 5F_ ARC94 COUPLING VISUALIZATION VIA ARCNET

The counter is the 1. word in the telegram received. This The 1. operand in the operand memory (KW00,00) has to
word has to be assigned to the 1. word in the response be assigned at output OP0. With this, the operand memo-
telegram. ry address is identified.
With the 2. word, the actual user data telegram begins. FCT 1: Read n bits
This word has to be applied to T_I1 of block 5F_ARC. The FCT 3: Read n words
block interprets the telegram and outputs a response at FCT F: Write n bits
T_O1 (2. word in the response telegram). If the telegram FCT 10: Write n words
was a "write instruction", the corresponding bit, word or
double word flags are overwritten by the block. If the tele- Bits to be transferred are packed. Bit and word transfers
gram was a "read instruction", the content of the flags to are differentiated via the function code.
be read are entered in the response telegram. If a faulty Caution:
telegram was received, the error number is output at ERR, High and low byte are exchanged as in the MODBUS tele-
additionally to this, an error telegram is entered starting at gram. The MODBUS CRC checksum is also sent. Several
T_O1. The flags starting at T_O1 contain always the cor- masters are possible because they can be identified. The
rect response after a block execution. Afterwards, the re- response to a request is always sent back to the right
sponse has to be sent to the master via ASEND or ASEND+. master.
The enabling input FREI at block 5F_ARC must only be Additionally to this protocol, user defined telegrams can
set if a telegram containing the DIN identifier 5F has been also be programmed as usual via other DIN identifiers.
received at AREC of the corresponding master.

7 3-20 907 PC 331 / Issued: 08.99


COUPLING VISUALIZATION VIA ARCNET 5F_ARC, 5F_ARC94

Addresses
The addresses are defined as follows (see also 07 KR 31 documentation):

Binary operands
Step chains must only be read.

Address Operand
0000H E00,00 binary inputs
0001H E00,01
0002H E00,02
03FFH E63,15
1000H A00,00 binary outputs
1001H A00,01
1002H A00,02
13FFH A63,15
2000H M000,00 binary flags
2001H M000,01
2002H M000,02
2FFFH M255,15
3000H S00,00 step chains
3001H S00,01
3002H S00,02
37FFH S127,15

Word operands:
Indirect constants are only overwritten in operand range, i.e. after restarting the PLC program, it is switched back to the
original set value.

Address Operand
0000H EW00,00 word inputs
0001H EW00,0
0002H EW00,02
007FH EW07,15
1000H AW00,00 word outputs
1001H AW00,01
1002H AW00,02
107FH AW07,15
2000H MW000,00 word flags
2001H MW000,01
2002H MW000,02
2FFFH MW255,15
3000H KW00,00 indirect constants
3001H KW00,01
3002H KW00,02
327FH KW39,15
4000H MD00,00 double word flags
41FFH MD31,15
5000H KD00,00 double word constant
507FH KD7,15

907 PC 331 / Issued: 08.99 3-21


7
5F_ARC, 5F_ ARC94 COUPLING VISUALIZATION VIA ARCNET

Structure of the telegram on the basis of examples

The ARCNET telegram is structured according to the description of the blocks ASEND/AREC, with DIN identifier 5FH and
a user data length of 125 words.
The user data field is structured as follows:

Example: Read n bits

Request:
Response:
02 01 000F 0010 xxxx
02 01 000F 0010 xxxx
CRC checksum CRC checksum
16 bit 16 user data bits are sent
from E000,15 in 2 bytes

Read Number of bytes


Function code
From slave 2
Slave code

Example: Read n words

Request: Response:
02 03 000F 0005 xxxx 02 03 0A 0001 0002 0003 0004 0005 xxxx
CRC check-
CRC checksum
sum
5 words 5 user data words are sent in
read from E000,15 10 bytes
Number of bytes
Read
Function code
from slave 2 Slave code

Example: Write n bits


Request:
02 0F 100F 0010 02 0000 xxxx
CRC checksum
User data bytes
Number of user data bytes = 2
Number of user data bits = 16
from A000,15 - address 100FH
Read
from slave 2

7 3-22 907 PC 331 / Issued: 08.99


COUPLING VISUALIZATION VIA ARCNET 5F_ARC, 5F_ARC94

Response:
02 0F 100F 0004 xxxx
CRC checksum
Number of user data bytes * 2

Address
Function code
Slave address

Example: Write n words

Write:
02 10 100F 0005 0A 01 0002 0003 0004 0005 00 xxxx
CRC checksum
User data
Number of user data bytes = 10
Number of user data words = 5
from AW00,15 - address 100FH
Read
from slave 2

Response:
02 10 100F 0014 xxxx
CRC checksum
CRC Number of user data bytes * 2 = 20 (decimal)
Address
Function code

Slave address

907 PC 331 / Issued: 08.99 3-23


7
5F_ARC, 5F_ ARC94 COUPLING VISUALIZATION VIA ARCNET

7 3-24 907 PC 331 / Issued: 08.99


PROGRAM ABORT ABORT

The function block serves to abort a PLC program. All out-


puts are set to 0 if the PLC program is aborted.
FBD/LD IL

!BA 0
ABORT ABORT
FREI FREI

____________________________________________________________________________________________

Parameters
FREI BINARY E, M, A, K Block enable
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 10 µs
Additional runtime: –––
Output updating: –––
Number of historical values: none
Available as of: ABB Procontic CS31 / Communication Processor 07 KP 62
____________________________________________________________________________________________

Description
The function block serves to abort a PLC program. All out-
puts are set to 0 if the PLC program is aborted.
The block can be used in particular for aborting the PLC
program if a specific error of error class 3 occurs.
The function block is activated by a 1 signal at its enable
input FREI. If a 0 signal is applied to the enable input, the
function block has no effect. The following thus applies:
FREI = 0: ––> the block has no effect
FREI = 1: ––> the block aborts the program

907 PC 331/Issued: 11.98 4–1


ABORT PROGRAM ABORT

Example

FBD/LD IL

!BA 0
ABORT ABORT
M 255,13 FREI M 255,13

4–2 907 PC 331/Issued: 11.98


Call in FBD/LD not defined ADAPTION FOR ADAPTIVE TEMPERATURE CONTROL

The adaption block serves to determine optimized con-


troller parameters for the controller block PIDT1. This
block can be used for temperature controlled systems in FBD/LD IL
process engineering and in the plastics–processing in-
dustry.
not defined *) !BA 0
The adaption block does not serve to continuously deter- ADAPT
W
mine the controller parameters and only determines them
X
whenever required (pushbutton adaption).
YR
START
READY
ERROR
Y
INIT
KP
TN/TZ
TV/TZ
T1/TZ
D–FREI
KS
TU
*) Note: A CE can be defined for the adaption block. TG
See 907 PC 33 description, general part,
Chapter 15 (library).
____________________________________________________________________________________________

Parameters
W WORD EW, AW, MW, KW Command variable (setpoint)
X WORD EW, AW, MW, KW Controlled variable (actual value)
YR WORD EW, AW, MW, KW Manipulated variable of the controller at the starting
time of adaption
START BINARY E, A, M, S Start of adaption
READY BINARY E, A, M Adaption completed message
ERROR WORD AW, MW Error messages
Y BINARY A, M Excitation signal (manipulated variable) during
adaption
INIT WORD AW, MW Initial value for the controller
KP WORD AW, MW Proportional coefficient
TN/TZ WORD AW, MW Integral action time, scaled to PLC cycle time TZ
TV/TZ WORD AW, MW Derivative action time, scaled to PLC cycle time TZ
T1/TZ WORD AW, MW Returning time, scaled to PLC cycle time TZ
D–FREI BINARY A, M Enable for the controller’s D component
KS WORD AW, MW Gain of the controlled system
TU WORD AW, MW Delay time of the controlled system
TG WORD AW, MW Stabilization time of the controlled system
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: not available
Additional runtime: not available
Output updating: no; recommendation: Allocate the output directly to a flag or use a global
intermediate flag; see volume 3, chapter 2.5.3
Number of historical values: 70 words
Available as of: ABB Procontic CS31 / 907 PC 331

907 PC 331/Issued: 11.98 4–3


ADAPTION FOR ADAPTIVE TEMPERATURE CONTROL Call in FBD/LD not defined

Description Adaption is only ever permissible when the control loop


has stabilized. Adaption can be realized both when start-
Note: Modified in comparison with PLC version V6.0. As ing up the process (initial setting) and also whenever the
from PLC version V7.0, the controlled system parameters command variable changes. This enables adaption of the
Ks, Tu and Tg are available as additional outputs. controller parameters if the process has to be run at vari-
The adaption block serves to determine optimized con- ous operating points and a fixed setting of the controller
troller parameters for the controller block PIDT1. This parameters does not result in the required control re-
block can be used for temperature controlled systems in sponse. In this case, an actuation degree change (com-
process engineering and in the plastics–processing in- mand variable change/gain of the controlled system) of at
dustry. The dynamics of these thermal processes can be least 20% is presumed. The identification of the con-
approximated adequately by means of the characteristic trolled system leads to inexact controller parameters in
quantities the event of actuation degree changes below 20% which
result in larger–scale overshoot.
Tu: Delay time
Tg: Stabilization time During adaption, the adaption block controls the process
Ks: Transfer factor (controlled system gain) and the controller is isolated from it.

which can be defined on the basis of the transfer function. Starting/aborting adaption
In this process, the actual progression of the transfer Adaption begins by a 0/1 edge at the START input. A run-
function is replaced by the tangent placed at its reversing ning adaption is aborted by means of a 1/0 edge at the
point. START input.
Carrying out adaption
x During adaption, the output Y supplies the binary manipu-
lated variable for the controlled system. The PIDT1 con-
troller is inactive, i.e. the controller must not influence the
Tg system. This must be ensured by a control logic in the
Ks PLC program.
At the start of adaption the block requires the initial values
x(t)
of the currently available controlled and manipulated vari-
ables. These initial values are only known exactly when
set for the first time (controlled variable = ambient temper-
ature, manipulated variable = 0).
In the event of adaption in controlled mode (resetting in
the event of a setpoint change), the initial value of the ma-
nipulated variable is defined by the actuation output of the
Reversing tangent PIDT1 controller. Owing to the planned control structure
(PIDT1 followed by a PDM block), the PIDT1 controller
does not supply a stationary manipulated variable. Con-
Tu t
tinuous oscillation of the controller’s manipulated variable
sets in, preventing exact measurement of the constant
The above figure shows the transfer function, its revers- component. Low pass filtering of the controller’s manipu-
ing tangent and the resulting characteristic quantities in lated variable is therefore recommended in order to pro-
aperiodic processes. vide the initial value of the manipulated variable for the
adaption block (PT1 block, time constant > 10 s).
The adaption block is designed especially for processes
whose characteristic quantities fulfill the following condi- As the result of continuous oscillation of the controller’s
tions: manipulated variable, the controlled variable also suffers
continuous oscillation. However, this oscillation is atte-
5 < Tg/Tu < 100 nuated very substantially by the low pass response of the
20 sec < Tu < 300 sec controlled system. Additional filtering of the controlled
0.25 < Ks <2 variable is therefore not necessary.

4–4 907 PC 331/Issued: 11.98


Call in FBD/LD not defined ADAPTION FOR ADAPTIVE TEMPERATURE CONTROL

Monitoring adaption Termination of adaption

The adaption block contains a monitoring level. This per-


forms a plausibility check on the identified controlled sys- READY = 1 indicates that adaption has been terminated
tem parameters and the input variables. Correct termina- in the regular fashion.
tion or discrepancies detected during adaption are re-
ported through the ERROR output. In this case, a distinc-
tion is made between errors and warnings. The following controller parameters are then present at
the block’s outputs
Errors:

These always lead to premature aborting of adaption. No ● INIT


controller parameters are computed and the actuation
● KP
output Y is set to “0”. The READY signal remains set to
“0”. ● TN/TZ
● TV/TZ
Warnings: ● T1/TZ
These indicate that the computed controlled system pa- ● D–FREI
rameters lie outside of the permissible value range. How-
ever, adaption is still terminated in the regular fashion
(READY = 1). Nevertheless, a satisfactory control re- and the controlled system parameters
sponse cannot be guaranteed. The control response
must be checked for its usefulness during commission-
ing. ● KS
● TU
● ERROR = 0; no error, no warning. ● TG
● ERROR = 1: error
At the start of adaption, the controlled variable difference
The controlled system parameters KS, TU and TG are
is less than the minimum value MINXD = 3843. Adaption
is aborted. only of significance for the specialist and normally do not
Remedy: Increase the initial controlled deviation. need to be evaluated by the user.

● ERROR = 2: error
Less than 16 interpolation points were available for calcu- The D–FREI output indicates whether or not a PI or a
lation of the reversing tangent. Adaption is aborted. Rem- PIDT1 controller is necessary.
edy: Reduce the cycle time.

● ERROR = 3: error
The following applies:
The delay time TU lies outside of the permissible value
range (TU < 0). Adaption is aborted.
Remedy: Consult ABB.

● ERROR = –1: warning D–FREI Meaning


The actuation degree change lies below the required
minimum value. Adaption is terminated in the regular 0 DT1 component is deactivated –>
fashion. However, a satisfactory control response cannot PI controller
be guaranteed. 1 DT1 component is connected –>
Remedy: Check the control response on commissioning. PIDT1–controller
Consult ABB if this is unsatisfactory.

● ERROR = –2: warning


The ratio TU/TG is greater than the permissible maximum
value. Adaption is terminated in the regular fashion. How- An adjustment value for switchover from the adaption
ever, a satisfactory control response cannot be guaran- block to the controller is available at the INIT output.
teed.
Remedy: Check the control response on commissioning.
Consult ABB if this is unsatisfactory. The Y output is set to “0” after termination of adaption.

907 PC 331/Issued: 11.98 4–5


ADAPTION FOR ADAPTIVE TEMPERATURE CONTROL Call in FBD/LD not defined

PLANNING ● The following blocks must be run with a cycle time


which is at least 5 times lower than that of the controller
and adaption block
Temperature control with switching actuators – Pulse width modulator (PDM)
– Selection gate (AWT) for the actuating signals of the
controller and adaption block.
In ABB Procontic T300, the following controller structure
This is achieved by virtue of the fact that all blocks and
is used for temperature control with switching actuators:
instructions belonging to adaptive control, with the ex-
ception of the pulse width modulator (PDM) and the se-
lection gate (AWT) are processed within one running
number block (LZB) with a running number equal to 5
W Xd Yk Yb controlled X and are therefore only processed in every 5th program
PIDT1 PDM system
cycle.
X
● The PIDT1 controller must be skipped when adaption
is active. This is achieved by virtue of the fact that the
negated READY signal of the adaption block is taken
W: Command variable (setpoint)
as a jump condition.
X: Controlled variable (actual value)
Xd: Controlled deviation
● Either the manipulated variable of the adaption or of the
Yk: Continuous manipulated variable
closed–loop control block is selected with the selection
Yb: Binary manipulated variable
gate (AWT). This ensures that the controlled system is
run either only by the controller (closed–loop control
As the result of the pulse width modulator (PDM), residual mode) or only by the adaption block (adaption mode).
oscillation of the controlled variable at the operating point The selection gate is switched with the READY signal
occurs in contrast to a continuous actuator. This residual of the adaption block.
oscillation is defined by the cycle ratio TA/TZ of the PDM
block. In this case, TA is the period and TZ the cycle time ● The current manipulated variable of the controller is
with which the PDM block is processed. needed when adaption begins. As this is subject to a
continuous oscillation in controlled mode, it must be fed
Recommended settings: to the adaption block through a PT1 element. The PT1
element’s time constant must be at least 10 seconds.
TZ (PDM) = 100 ms: cycle time of the PDM
TA/TZ (PDM) = 5: cycle ratio of the PDM ● The adjustment value (INIT) supplied by the adaption
TZ(PIDT1) = 500 ms: cycle time of the PIDT1 block can be transferred to the controller as follows:
– A binary flag is set to the value “1” for one cycle with
the 0/1 edge of the READY signal of the adaption
block. This binary flag is applied to the input S of the
Configuration of controller and adaption block controller as a setting condition. It is best to disable
the controller’s D component during setting (see
A few elementary points must be observed in respect of also block PIDT1, “setting and resetting the control-
planning: ler”).

4–6 907 PC 331/Issued: 11.98


Call in FBD/LD not defined ADAPTION FOR ADAPTIVE TEMPERATURE CONTROL

Planning overview of the controller and adaption block

RUNNING NUMBER BLOCK


Running number = 5
LABEL 1

W READY
X ERROR
Ypt1 ADAPT Y
START
CONTROLLER PARAMETERS
KP
TN/TZ
TV/TZ
T1/TZ

JUMP D–FREI PT1


T > 10 s
READY (negated)
LABEL 1
W
X PIDT1
D–FR
INIT
S Yk

LABEL 1 AWT
Yk Y

READY
(negated)

PDM Ys
TA/TZ = 5 Yb

W: Command variable Yk: Continuous manipulated variable


X: Controlled variable Ys: Manipulated variable for controlled system
Ypt1: Filtered Yk READY: ADAPT–ready message
Yb: Binary manipulated variable in START: Start of adaption
closed–loop control mode D–FREI: DT1 component enabled for PIDT1 controller
Y: Manipulated variable during adaption

907 PC 331/Issued: 11.98 4–7


ADAPTION FOR ADAPTIVE TEMPERATURE CONTROL Call in FBD/LD not defined

W WORD ● ERROR = –2: Warning


The ratio TU/TG is greater than the permissible maximum
Command variable (setpoint). value. Adaption is terminated in the regular fashion. How-
ever, a satisfactory control response cannot be guaran-
X WORD teed.
Remedy: Check the control response on commissioning.
Controlled variable (actual value). Consult ABB if this is unsatisfactory.

Y BINARY
YR WORD
Current manipulated variable of the controller at the start Excitation signal (manipulated variable) for the controlled
of adaption. system during adaption.

INIT WORD
START BINARY
Start input. Initial value for the controller after termination of adaption.

KP WORD
0/1–edge: start of adaption.
1/0–edge: abort adaption.
Proportional coefficient: This is output as a percentage.

READY BINARY TN/TZ WORD

Ready message. Integral action time, scaled through the PLC cycle time
TZ.
1–Signal reports regular termination of adaption.
TV/TZ WORD
ERROR WORD
Derivative action time, scaled to the PLC cycle time TZ.
Fault message.
T1/TZ WORD
● ERROR = 1: Error
At the start of adaption the controlled variable difference Returning time, scaled to the PLC cycle time TZ.
is less than the minimum value MINXD = 3843. Adaption
is aborted. D–FREI BINARY
Remedy: Increase the initial controlled deviation.
Enabling for the controller’s D component. This output is
● ERROR = 2: Error
used to decide whether a PI or PIDT1 controller is re-
Less than 16 interpolation points were available for calcu-
quired.
lation of the reversing tangent. Adaption is aborted. Rem-
D–FREI = 0 –> PI controller
edy: Reduce the cycle time.
D–FREI = 1 –> PIDT1 controller
● ERROR = 3: Error
The delay time TU lies outside the permissible value KS WORD
range (TU < 0). Adaption is aborted.
Remedy: Consult ABB. Gain of the controlled system.

● ERROR = –1: Warning TU WORD


The actuation degree change lies below the required
minimum value. Adaption is terminated in the regular Delay time of the controlled system.
fashion. However, a satisfactory control response cannot
be guaranteed. TG WORD
Remedy: Check the control response on commissioning.
Consult ABB if this is unsatisfactory. Stabilization time of the controlled system.

4–8 907 PC 331/Issued: 11.98


Call in FBD/LD not defined ADAPTION FOR ADAPTIVE TEMPERATURE CONTROL

EXAMPLE

FBD/LD IL

not defined *) !BA 0


ADAPT
KW 01,00
EW 00,03
MW 05,11
E 00,08
M 04,07
MW 05,12
M 04,08
MW 06,00
MW 06,01
MW 06,02
MW 06,03
MW 06,04
M 04,04
MW 06,05
MW 06,06
MW 06,07

CE FBD Definition
not defined *)

CE IL Definition

not defined *)

*) Note: A CE can be defined for the adaption block.


Refer to 907 PC 32 description, general part,
Chapter 15 (library, CE editor/ CE instruction
editor).

907 PC 331/Issued: 11.98 4–9


ADRWA ADDRESS SELECTION

One of the operands planned at the inputs AT0 ... ATn–1


is selected with this function block. Of this selected oper-
and, the indirect address is generated and is provided at FBD/LD IL
the output ADR.

!BA 0
ADRWA ADRWA
E E
#n #n
EC0 E=EC EC0
AT0 ADR AT0
E=EC
ADR

____________________________________________________________________________________________

Parameters
E WORD EW, AW, MW, KW Input value
#n DIRECT #, #H Quantity EC or AT
CONSTANT
EC0 WORD EW, AW, MW, KW Input code; input can be duplicated
AT0 WORD EW, AW, MW, KW Output table, input is also duplicated with EC0
E=EC BINARY A, M Input value = input code
ADR WORD AW, MW indirect address
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 44 µs
Additional runtime: 8 µs per operand EC0..ECn–1
Output updating: no; recommendation: Allocate the output directly to a flag or use a global
intermediate flag; see volume 3, chapter 2.5.3
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Advantages of indirect addressing:

One of the operands planned at the inputs AT0 ... ATn–1


is selected with this function block. Of this selected oper- – In suitable applications, the PLC program is simplified
and, the indirect address is generated and is provided at substantially, thus reducing the planning effort.
the output ADR.
– Access to any number of operands (multiplex function)
The inputs and outputs cannot be negated/inverted. The is achieved with only one block (AWM or USM). In this
input EC0 can be duplicated, whereby the input AT0 is process, the ADRWA block represents a powerful tool
also duplicated automatically. with which the operands to be accessed can be se-
lected in a very flexible manner.
Reading/writing operands indirectly
The function blocks AWM or USM use the indirect ad-
dress generated by the block ADRWA in order to read or Selecting an operand from the output table
write the operand selected with the block ADRWA. There- AT0 ... ATn–1
fore, the block ADRWA and the block AWM or USM is
needed to read or write operands indirectly. To do this, the The block compares the value at the input E successively
operands to be read or written are listed at the inputs against the values at the inputs EC0 ... ECn–1. The com-
AT0...ATn–1 of the ADRWA block and the read or write parison is restarted each time the block is called, i.e. it be-
access is then performed by the AWM or USM block. gins with the input EC0.

4–10 907 PC 331/Issued: 11.98


ADDRESS SELECTION ADRWA

● If the value at the input E agrees with one of the values ● If the value at the input E agrees with one of the values
at the inputs EC0 ... ECn–1: at the inputs EC0...ECn–1:
– The output E=EC is set to 1 (hit), – The output E=EC is set to 1 (hit).
– The allocated operand is selected from the output – The allocated operand is selected from the output
table AT0...ATn–1. table AT0...ATn–1 and its indirect address is gene-
rated.
● If the value at the input E does not agree with one of the
values at the inputs EC0...ECn–1: ● If the value at the input E does not agree with one of the
– The output E=EC is set to 0 (no hit) values at the inputs EC0...ECn–1:
– no operand is selected from the output table – the output E=EC is set to 0 (no hit)
AT0...ATn–1: – no operand is selected from the output table AT0...
ATn–1 and accordingly no indirect address is genera-
Convention for allocation between EC0...ECn–1 and
ted either.
AT0...ATn–1:
EC0 –> AT0 #n DIRECT CONSTANT
EC1 –> AT1 The number of the planned inputs EC0...ECn–1 is speci-
. . fied at the input #n. It is specified as a direct constant.
. . Example: The following are planned: EC0, EC1, EC2 –>
ECn–1 –> ATn–1 #n = 3.

Generation of the indirect address ECO...ECn–1 WORD


The indirect address of an operand is generated if it has The operands for the comparison values are specified at
been selected from the output table AT0...ATn–1. This is the inputs EC0...ECn–1. The input EC0 can be dupli-
done by taking the address of the selected operand and cated. The value at the input E is compared against these
by allocating it as a value to the operand specified at the comparison values and is checked for conformity. If they
ADR output. The value of the operand specified at the agree, the allocated operand is selected from the output
ADR output is therefore the address of the operand se- table AT0...ATn–1 and its indirect address is generated.
lected from the output table AT0...ATn–1. Def.: An in- The values at the inputs EC0...ECn–1 are variable be-
direct address is an operand whose value cause they are normal operands. This is why the function
is the address of another operand. for comparison between the value at the input E and the
values at the inputs EC0...ECn–1 is very flexible and pow-
Use of an indirect address erful.
The function blocks AWM and USM access operands
with indirect addressing. Therefore, the blocks AWM and Affiliations between EC0...ECn–1 and AT0...ATn–1:
USM require the indirect address generated by the ADR-
WA block at the inputs. EC0 –––> AT0
EC1 –––> AT1
E WORD . .
One of the operands is selected from the output table . .
AT0...ATn–1 with the aid of the operand specified at the ECn–1 –––> ATn–1
input E and the operands specified at the inputs
EC0...ECn–1 and its indirect address is then generated. AT0...ATn–1 WORD
To do this, the block compares the value at the input E The operands whose indirect addresses are to be gener-
successively against the values at the inputs EC0... ated are specified at the outputs AT0...ATn–1. When the
ECn–1. The comparison restarts each time the block is input EC0 is duplicated, the input AT0 is also duplicated
called, i.e. beginning with the input EC0. automatically.

907 PC 331/Issued: 11.98 4–11


ADRWA ADDRESS SELECTION

E=EC BINARY
The output E=EC indicates whether or not the value at the
input E agrees with one of the values at the inputs
EC0...ECn–1.
E=EC = 0 –> No agreement
E=EC = 1 –> The value at the input E agrees with
one of the values at the inputs
EC0...ECn–1.

ADR WORD
Together with its value, the operand at the ADR output
represents an indirect address. This is the indirect ad-
dress of the operand selected from the output table
AT0...ATn–1. The indirect address is produced by virtue
of the fact that the address of the selected operand is allo-
cated as a value to the operand at the output ADR.
If no agreement between the input E and the inputs
EC0...ECn–1 is determined during comparison, then no
indirect address is generated either. Therefore, no value
is allocated to the ADR output. In this case, the ADR out-
put is not updated.

4–12 907 PC 331/Issued: 11.98


ADDRESS SELECTION ADRWA

Example: Indirect reading of the flag MW 3,2

ADRWA
E
#n
MW 3,2 is EC0 AWM
selected EC1
EC2 E=EC
ADR Indirect address ADR
MW 3,1 AT0 of MW 3,2 Value of
–> MW 3,2 AT1 A
MW 3,2
MW 4,5 AT2
The value of the
flag MW 3,2 is
read by indirect
addressing and
is output through
the output A

Example: Indirect writing of the flag MW 4,5

ADRWA
E
#n
MW 4,5 is EC0 USM
selected EC1
EC2 E=EC
ADR Indirect address ADR
MW 3,1 AT0 of MW 4,5
MW 3,2 AT1
–> MW 4,5 AT2

Value to be
allocated to E
MW 4,5

The value at
the input E is
allocated to the
flag MW 4,5 by
means of
indirect
addressing

907 PC 331/Issued: 11.98 4–13


ADRWA ADDRESS SELECTION

Example

FBD/LD IL

!BA 0
ADRWA ADRWA
EW 02,00 E
EW 02,00
# 3 #n
# 3
MW 08,00 EC0 E=EC A 00,01
MW 08,00
MW 08,01 EC1 ADR AW 01,00
MW 08,02 EC2 MW 08,01
MW 09,00 AT0 MW 08,02
MW 09,01 AT1 MW 09,00
MW 09,02 AT2 MW 09,01
MW 09,02
A 00,01
AW 01,00

CE FBD Definition

ADRWA
E
#n
EC E=EC
AT ADR

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E W N P Y 0 0
#n K W N P Y 0 0
EC E W N P Y 1 0
AT E W N P Y 1 0
E=EC A L N P Y 0 0
ADR A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 ADRWA
00002 PP 0 E Input WORD (Input value)
00003 PP 0 #n Input WORD (Number of ECs and ATs)
[ 1
00004 PP 0 EC Input WORD (Input code)
] 1
[ 1
00005 PP 0 AT Input WORD (output table)
] 1
00006 PP 0 E=EC Output BINARY (Input value=Ecode)
00007 PP 0 ADR Output WORD (operand address)

4–14 907 PC 331/Issued: 11.98


Initialization of the ARCnet controller AINIT

FBD/LD IL

!BA 0
AINIT AINIT AINIT
0/1 DONE M 00,00 0/1 DONE A 00,00 M 00,00
TO ERR KW 01,00 TO ERR A 00,01 KW 01,00
NODE NODE MW 00,00 A 00,00
STAT STAT MW 00,01 A 00,01
DIAG DIAG MW 00,02 MW 00,00
TOS TOS A 00,02 MW 00,01
TOND TOND MW 00,03 MW 00,02
TOJN TOJN MW 00,04 A 00,02
LEV LEV MW 00,05 MW 00,03
RECO RECO M 01,00 MW 00,04
MW 00,05
M 01,00

Parameters
0/1 BINARY E, M, A, K, S Initialization of the ARCnet controller with 0/1 edge
TO WORD EW, MW, AW, KW Timeout in ms when sending data packages
DONE BINARY A, M Initialization terminated
ERR BINARY A, M Error has occurred
NODE WORD AW, MW Own node number (station address)
STAT WORD AW, MW Status register of the ARCnet controller
DIAG WORD AW, MW Diagnosis register of the ARCnet controller
TOS BINARY A, M Timeout has occurred during send operation
TOND WORD AW, MW Node number of lost data package after timeout
TOJN WORD AW, MW Job number of lost data package after timeout
LEV WORD AW, MW Level of the send buffer
RECO BINARY A, M Network reconfiguration is running (after loss of token)

The outputs STAT, DIAG, TOS, TOND, TOJN, LEV and RECO are updated after a successful initialization with each
block call.
____________________________________________________________________________________________

Description There are no problems, if


● the capacity utilization is less than 80 % before
The function block AINIT initializes the ARCnet controller making changes to a running program or if
in the following way: ● the program length is less than 2 k instructions.
– Interrupt after reception of a data package
– Only short packages (a short package = 256 bytes) 0/1 BINARY
– Data packages to all stations (broadcasts) A 0/1 edge at the input 0/1 causes a single initialization of
the ARCnet controller. As long as the initialization has not
been terminated (DONE = 0), a new 0/1 edge at the input
Important note: 0/1 is ignored.
If a PLC is used with an ARCnet interface, a certain sec-
tion of the PLC TURBO program memory No. 2 is reser- TO WORD
ved for ARCnet. The timeout waiting time for sending data packages is
If programs with more than 2 k instructions are executed, specified in ms at the input TO. If a data package cannot
the system-dependent capacity utilization can possibly be sent within this period, the sending operation of this
be increased by reason of the reduced TURBO memory data package is aborted and the package is lost. The out-
No. 2 when changes are made to a running program. put TOS indicates the loss of the package.

907 PC 331/Issued: 11.98 4–15


AINIT Initialization of the ARCnet controller

DONE BINARY TOS BINARY


The output DONE indicates that the initialization has The output TOS indicates that the sending of a data pak-
been terminated. This output has always to be conside- kage was not feasible within the timeout period (input TO)
red together with the output ERR. and that the data package is lost. Both the node number
and the job number of the lost data package are available
The following applies: at the outputs TOND and TOJN, respectively.
DONE = 1 and ERR = 0: The initialization has been
terminated. No error has
occurred. TOND WORD
DONE = 1 and ERR = 1: An error has occurred during The output TOND indicates the node number of the lost
initialization. The ARCnet data package after the timeout period has elapsed.
controller has not responded
within a period of 100 ms.
TOJN WORD
ERR BINARY The output TOJN indicates the job number of the lost data
The output ERR indicates that the ARCnet controller has package after the timeout period has elapsed.
not responded after an initialization command within a pe-
riod of 100 ms. This output has always to be considered
together with the output DONE. LEV WORD
If an error has occurred, the following applies: The output LEV indicates the level of the sending buffer
DONE = 1 and ERR = 1. after a successful initialization.

NODE WORD RECO BINARY


The output NODE indicates the node number (station ad- The output RECO indicates that the network is reconfigu-
dress) of its own after a successful initialization. ring itself (RECO = 1) after a loss of token. The transition
from RECO = 1 to 0 means that the reconfiguring proce-
STAT WORD dure has been terminated.
The output STAT indicates the content of the status regi-
ster of the ARCnet controller after a successful initializa- The outputs STAT, DIAG, TOS, TOND, TOJN, LEV and
tion. RECO are updated after a successful initialization with
each block call.

DIAG WORD
The output DIAG indicates the content of the diagnosis
register of the ARCnet controller after a successful initiali- The inputs and outputs can neither be duplicated nor in-
zation. verted.
____________________________________________________________________________________________

CE data
Runtime: 07 KT 92 / 07 KT 63
Basic runtime: 73...161 µs, typ. 93 µs
Additional runtime: none
Updating of the outputs: yes
Number of the historical values: 1 word
Available as of: ABB Procontic CS31, 07 KT 92 R262, 07 KT 93 R171

4–16 907 PC 331/Issued: 11.98


ANALOG VALUE CHANGE ANNUNCIATOR AMELD

This function block monitors the analog values present at


the input E0 capable of duplication for a change.
FBD/LD IL

!BA 0
AMELD AMELD
FREI FREI
R NR R
#n A #n
E0 ÄND E0
NR
A
ÄND

____________________________________________________________________________________________

Parameters
FREI BINARY A, E, M, S, K Block enabling
R BINARY A, E, M, S, K Reset
#n DIRECT #, #H Number of input values
CONSTANT
E0 WORD EW, AW, MW, KW Input values: Input can be duplicated
NR WORD AW, MW Number of the input value
A WORD AW, MW Current input value
ÄND BINARY A, M Change detected
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 57 µs
Additional runtime: 31 µs per input E0...En–1
Output updating: yes, if FREI = 1
Number of historical values: #n + 3 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Each time the block is processed, a change at one input


This function block monitors the analog values present at only is recognized. If a change is recognized, the inputs
the input E0 capable of duplication for a change. following the one where the change was previously dis-
covered are monitored the next time the block is pro-
The inputs and outputs cannot be negated/inverted. The cessed.
input E0 can be duplicated.
Recognition of a change Initialization of historical values
Each time the block is processed, the current input values The first time the block is processed after PLC initializa-
at the inputs E0...En–1 are successively compared tion (FREI = 1) or enabling of processing after it had been
against the historical values (input values from the pre- disabled (FREI changes from 0 to 1), all current input val-
vious processing of the block). If a change is recognized ues are assumed once as historical values and all outputs
at one of the inputs E0...En–1: are set to the value 0. These initialized historical values
– this is indicated at the ÄND output now represent the starting basis for recognition of
– the number of the input where the change was recog- changes.
nized is output through the NR output
– the changing input value is output through the A out-
put

907 PC 331/Issued: 11.98 4–17


AMELD ANALOG VALUE CHANGE ANNUNCIATOR

FREI BINARY
Processing of the block is enabled with the FREI input.
FREI = 0 –> Block is not processed
FREI = 1 –> Processing of the block is enabled

If FREI = 0, the outputs of the block are also no longer up-


dated.

R BINARY
The block can be reset with the R input.
R = 0 –> No reset
R = 1 –> Reset of the block
Reset signifies:
– Adoption of the current values at the inputs
E0...En–1 as historical values.
– All outputs are set to the value 0

#n DIRECT CONSTANT
The number of values to be monitored at the inputs
E0...En–1 is specified at the input #n. The number is spe-
cified as a direct constant.
Range for #n: 1 < #n < 127

E0...En–1 WORD
The input E0 can be duplicated (E0...En–1).
The operands to be monitored for a change are specified
at the inputs E0...En–1.

NR WORD
The serial number of the input E0...En–1 where a change
has been discovered is output through the output NR.
If no output change is discovered during processing of the
block, the number of the input changing last is still output
through the output NR.
The following affiliations apply:
Change discovered at E0 –> NR = 0
Change discovered at E1 –> NR = 1
Change discovered at En–1 –> NR = n–1

A WORD
If a change is discovered at one of the inputs E0...En–1,
the changing input value is allocated to the output A.
If no change is discovered at the inputs E0...En–1 during
processing of the block, the value of the input changing
last is still output through the output A.

ÄND BINARY
The output ÄND indicates whether or not a change has
been discovered at the inputs E0...En–1.
ÄND = 0 –> No change discovered
ÄND = 1 –> Change discovered

4–18 907 PC 331/Issued: 11.98


ANALOG VALUE CHANGE ANNUNCIATOR AMELD

Example

FBD/LD IL

!BA 0
AMELD AMELD
E 00,01 FREI E 00,01
M 00,06 R NR AW 01,01 R 00,06
# 4 #n A MW 01,07 # 4
MW 09,00 E0 ÄND A 00,03 MW 09,00
MW 09,01 E1 MW 09,01
MW 09,02 E2
MW 09,02
MW 09,03 E3
MW 09,03
AW 01,01
MW 01,07
A 00,03

CE FBD Definition

AMELD
FREI
R NR
#n A
E ÄND

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
R E L N P Y 0 0
#n K W N P Y 0 0
E E W N P Y 1 0
NR A W N P Y 0 0
A A W N P Y 0 0
ÄND A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 AMELD
00002 PP 0 FREI Input BINARY (block enable)
00003 PP 0 R Input BINARY (Reset)
00004 PP 0 #n # CONSTANT (Number of input values)
[ 1
00005 PP 1 E Input WORD (input values)
] 1
00006 PP 0 NR Output WORD (No.)
00007 PP 0 A Output WORD (current input value)
00008 PP 0 ÄND Output BINARY (change detected)

907 PC 331/Issued: 11.98 4–19


AMELDD ANALOG VALUE CHANGE ANNUNCIATOR DOUBLE WORD

This function block monitors the analog values present at


the input E0 capable of duplication for changes.
FBD/LD IL

!BA 0
AMELDD AMELDD
FREI FREI
R NR R
#n A #n
E0 ÄND E0
NR
A
ÄND

____________________________________________________________________________________________

Parameters
FREI BINARY A, E, M, S, K Block enable
R BINARY A, E, M, S, K Reset
#n DIRECT #, #H Number of input values
CONSTANT
E0 DOUBLE WORD MD, KD Input values; input can be duplicated
NR WORD AW, MW Number of the input value
A DOUBLE WORD MD Current input value
ÄND BINARY A, M Change detected
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 64 µs
Additional runtime: 41 µs per input E0 ... En–1
Output updating: yes if FREI = 1
Number of historical values: (2 * #n) + 4 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Each time the block is processed, a change at one input


This function block monitors the analog values present at only is recognized. If a change is recognized, the inputs
the input E0 capable of duplication for changes. following the one where the change was previously dis-
covered are monitored the next time the block is pro-
The inputs and outputs cannot be negated/inverted. The cessed.
input E0 can be duplicated.
Recognitioin of a change Initialization of historical values
Each time the block is processed, the current input values The first time the block is processed after PLC initializa-
at the inputs E0...En–1 are successively compared tion (FREI = 1) or enabling of processing after it had been
against the historical values (input values from the pre- disabled (FREI changes from 0 to 1), all current input val-
vious processing of the block). If a change is recognized ues are assumed once as historical values and all outputs
at one of the inputs E0...En–1: are set to the value 0. These initialized historical values
– this is indicated at the ÄND output now represent the starting basis for re-cognition of
– the number of the input where the change was recog- changes.
nized is output through the NR output
– the changing input value is output through the A output

4–20 907 PC 331/Issued: 11.98


ANALOG VALUE CHANGE ANNUNCIATOR DOUBLE WORD AMELDD

FREI BINARY NR WORD


Processing of the block is enabled with the FREI input. The serial number of the input E0...En–1 where a change
FREI = 0 –> Block is not processed has been discovered is output through the output NR.
FREI = 1 –> Processing of the block is enabled If no change is discovered during processing of the block
If FREI = 0, the outputs of the block are also no longer up- the number of the input changing last is still output
dated. through the output NR.
The following affiliations apply:
R BINARY Change discovered at E0 –> NR = 0
The block can be reset with the R input. Change discovered at E1 –> NR = 1
R = 0 –> No reset Change discovered at En–1 –> NR = n–1
R = 1 –> Reset of the block A DOUBLE WORD
Reset signifies: If a change is discovered at one of the inputs E0...En–1,
– Adoption of the current values at the inputs E0...En–1 the changing input value is allocated to the output A.
as historical values. If no change is discovered at the inputs E0...En–1 during
– All outputs are set to the value 0. processing of the block, the value of the input changing
last is still output through the output A.
#n DIRECT CONSTANT
The number of values to be monitored at the inputs ÄND BINARY
E0...En–1 are specified at input #n. It is specified as a di- The output ÄND indicates whether or not a change has
rect constant. been discovered at the inputs E0...En–1.
Range for #n: 1 < #n < #63 ÄND = 0 –> No change discovered
ÄND = 1 –> Change discovered

E0...En–1 DOUBLE WORD


The input E0 can be duplicated (E0...En–1).
The operands to be monitored for a change are specified
at the inputs E0...En–1.

907 PC 331/Issued: 11.98 4–21


AMELDD ANALOG VALUE CHANGE ANNUNCIATOR DOUBLE WORD

Example

FBD/LD IL

!BA 0
AMELDD AMELDD
E 00,01 FREI E 00,01
M 00,06 R NR AW 01,01 R 00,06
# 4 #n A MD 01,00 # 4
MD 00,00 E0 ÄND A 00,03 MD 00,00
MD 00,01 E1 MD 00,01
MD 00,02 E2
MD 00,02
MD 00,03 E3
MD 00,03
AW 01,01
MD 01,00
A 00,03

CE FBD Definition

AMELDD
FREI
R NR
#n A
E ÄND

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
R E L N P Y 0 0
#n K W N P Y 0 0
E E D N P Y 1 0
NR A W N P Y 0 0
A A D N P Y 0 0
ÄND A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 AMELDD
00002 PP 0 FREI Input BINARY (block enable)
00003 PP 0 R Input BINARY (Reset)
00004 PP 0 #n # CONSTANT (number of input values)
[ 1
00005 PP 1 E Input DOUBLE WORD (input values)
] 1
00006 PP 0 NR Output WORD (No.)
00007 PP 0 A Output DOUBLE WORD (current input value)
00008 PP 0 ÄND Output BINARY (change detected)

4–22 907 PC 331/Issued: 11.98


READ ANALOG VALUE 4...20 mA (07 KT 92) ANAI4_20

FBD/LD IL

ANAI4_20 ANAI4_20 see CE–IL in the


EW AW EW 06,00 EW AW MW 100,00 software
ERR ERR M 100,00

Parameters
EW WORD EW, MW Direct analog input

AW WORD MW, AW Word variable, to which the result of the evaluation


is assigned (0...32760 = 4...20 mA)

ERR BINARY M, A Output open-circuit monitoring (1 = open circuit)

Description
The connection element ANAI4_20 is intended for read- EW WORD Direct analog input
ing current values of a 4...20 mA range. It is used with the The input EW is assigned to the analog input to be read.
direct analog inputs EW06,00...EW06,03 of the central
unit 07 KT 92. The input range of 4...20 mA is converted AW WORD Analog value in internal
into an internal numerical range of 0...32760. There is representation
also an open-circuit monitoring. The word output AW provides the analog signal con-
verted into the internal numerical range. In case of an
open circuit the output is set to 0. The diagram 1 shows
The analog inputs, which the connection element
the relationship between the input current at the direct
ANAI4_20 is used for, have to be configured as current
analog input and the output value at AW.
inputs. A separate connection element ANAI4_20 is re-
quired for each 4...20 mA current input. ERR BINARY Open-circuit monitoring
The binary output ERR indicates a signal 1 if the connec-
The analog inputs are designed for currents of 0...20 mA. tion element ANAI4_20 has detected an open-circuit. If
The analog input words EW06,00...EW06,03 generate the input current of an analog input of the 07 KT 92 is low-
values of a 0...32760 range corresponding to 0...20 mA. er than 3.6 mA, the open-circuit monitoring assumes an
The connection element ANAI4_20 transforms the nu- open-circuit (see diagram 2). AW is set to 0, if an open-cir-
merical range at EW of 6552...32760 = 4...20 mA into a cuit is detected.
numerical range of 0...32760 at AW.
One step of the output value AW then amounts to
10 = 0.004883 mA. An input value at EW which is lower
than 6552 = 4 mA leads to an output value at AW of 0.

907 PC 331/Issued: 11.98 5–1


ANAI4_20 READ ANALOG VALUE 4...20 mA (07 KT 92)

32760
Numerical value at AW

24570

16380

8190

0 4 10 15 20
Input current / mA
Diagram 1: Relationship between the input current at the direct analog input and the output value AW

1
Open-circuit
ERR 0
0 4 10 15 20
3.6 Input current / mA
Diagram 2: The output ERR indicates an open-circuit signal if the input current is lower than 3.6 mA

CE Data
Runtime:
Basic runtime: 180 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Used operands:
Local word flags: 7
Available as of: ABB Procontic CS31 / 907 PC 331 R202

5–2 907 PC 331/Issued: 11.98


Transfer data packages to the ARCnet controller APOLL

FBD/LD IL

APOLL APOLL !BA 0


APOLL

Description If several APOLL blocks are configured in the user pro-


gram, also several data packages can be sent off within
The function block APOLL is intended for the following one program cycle.
two tasks:
The ARCnet controller must have been initialized by the
function block AINIT before a data package can be
● It hands over a data package from the buffer storage handed over from the storage buffer to it by the function
to the ARCnet controller in order to send it off. The block APOLL.
data packages are stored in the buffer storage by the
function block ASEND. Important note:
If a PLC is used with an ARCnet interface, a certain sec-
tion of the PLC TURBO program memory No. 2 is re-
● It monitors whether or not this data package is sent off served for ARCnet.
within the timeout period configured in the function If programs with more than 2 k instructions are executed,
block AINIT. the system-dependent capacity utilization can possibly
be increased by reason of the reduced TURBO memory
If the data package cannot be sent off by the ARCnet con- No. 2 when changes are made to a running program.
troller within the configured timeout period, the function There are no problems, if
block aborts the sending procedure. The data package is ● the capacity utilization is less than 80 % before
lost then. The loss of the data package is indicated by the making changes to a running program or if
output TOS of the AINIT block with the next block call. ● the program length is less than 2 k instructions.
____________________________________________________________________________________________

CE data
Runtime: 07 KT 92 / 07 KT 93
Basic runtime: 40 µs
Additional runtime: 47...187 µs
Updating of the outputs: –––
Number of the historical values: 0 words
Available as of: ABB Procontic CS31, 07 KT 92 R262, 07 KT 93 R171

907 PC 331/Issued: 11.98 5–3


AREC Receive ARCnet data packages

FBD/LD IL

AREC AREC !BA 0


#JOB #1 #JOB AREC
UJOB UJOB A 00,00 #1
N0 KW 01,00 N0 A 00,00
#D0 #127 #D0 KW 01,00
#J0 #10 #J0 #127
#L0 #4 #L0 #10
MW0 JR0 MW 10,00 MW0 JR0 M 00,00 #4
MW 10,00
M 00,00

Parameters
#JOB DIRECT #, #H Total number of jobs configured in the block
CONSTANT
N0 WORD EW, MW, AW, KW Node number (station address) of the sender
#D0 DIRECT #, #H DIN identification
CONSTANT
#J0 DIRECT #, #H Job number
CONSTANT
#L0 DIRECT #, #H Number of words of the user data to be received
CONSTANT
MW0 WORD EW, MW, AW, KW First word variable, as of the received user data are
stored
UJOB BINARY A, M Unknown job received
JR0 BINARY A, M Job received

The inputs N0, #D0, #J0, #L0 and MW0 as well as the output JR0 can be duplicated as blocks.
____________________________________________________________________________________________

Description The parameter values of the received data packages are


compared to the parameter values of the configured jobs.
The operating system reads the received data packages If both values are equal, the user data of the data package
from the ARCnet controller interrupt–controlled and beginning from the word variable MW0 are stored contin-
stores them into a storage buffer. The size of the storage uously and the output JR0 is set to 1. If several data pack-
buffer is 31 data packages. ages are equal, the function block only evaluates that
data package which has been received last (the latest
The block reads the whole storage buffer contents and
data package).
assigns the data packages to the configured jobs in the
block. If no data package from the storage buffer can be as-
signed to a configured job, the output belonging to this
With the same job the receiver gets user data which be- configured job is set to 0 (JR = 0).
long together logically. For unmistakable identification of
a job the following parameters are necessary: The output UJOB indicates that a data package existing
in the storage buffer could not be assigned to a job.
Node number of the sender,
DIN identification and A user program must not contain more than one block
Job number. call of AREC.

5–4 907 PC 331/Issued: 11.98


Receive ARCnet data packages AREC

The ARCnet controller must have been initialized by the #J0 DIRECT CONSTANT
function block AINIT before data packages can be read The job number is specified for the configured job at input
from the storage buffer by the function block AREC. #J0.
The following is valid: –32767 < #J < +32767
Important note:
If a PLC is used with an ARCnet interface, a certain sec-
tion of the PLC TURBO program memory No. 2 is re- #L0 DIRECT CONSTANT
served for ARCnet. The number of user data words is specified for the confi-
If programs with more than 2 k instructions are executed, gured job at input #L0.
the system-dependent capacity utilization can possibly The following is valid: 0 < #L < 125
be increased by reason of the reduced TURBO memory MW0 WORD
No. 2 when changes are made to a running program. The starting word flag of the user data is specified for the
There are no problems, if configured job at input MW0.
● the capacity utilization is less than 80 % before
making changes to a running program or if
● the program length is less than 2 k instructions. UJOB BINARY
Output UJOB indicates that a data package was stored in
the storage buffer which could not be assigned to any job.
#JOB DIRECT CONSTANT The following applies:
The total number of jobs configured in this function block UJOB = 1: unknown job received
is assigned to the input #JOB. UJOB = 0: no unknown job received
The following is valid: 1 < #JOB
JR0 BINARY
Output JR0 (job received) indicates that a data package
N0 WORD from the storage buffer has been assigned to this job. The
The node number (station address) of the sender is speci- user data of the data package are stored continuously be-
fied for the configured job at input NO. ginning from the word variable MW0.
The following is valid: 0 < N0...Nn–1 < 255 The following applies:
JR0 = 1: job received
JR0 = 0: no job received
#D0 DIRECT CONSTANT
The DIN identification is specified for the configured job at
input #D0. Note
The following is valid: 0 < #D < 127 Neither the inputs nor the outputs can be inverted. The in-
not allowed: 111 (6FH) puts N0, #D0, #J0, #L0 and MW0 and the output JR0 can
be duplicated as a block.

907 PC 331/Issued: 11.98 5–5


AREC Receive ARCnet data packages

Structure of the ARCnet data package (short package = 256 bytes)


The ARCnet data package consists of:
– 3 bytes of control data: sender, receiver, CP (continuous pointer)
– max. 253 bytes of user data consisting of:
1 byte for DIN identification + 2 bytes for job number + 125 words for user data

LB HB LB HB LB HB
Sender Receiver CP DN
JN JN NW1 NW1 NW2 NW2
0 1 2 F9H FAH FBH FCH FDH FEH FFH
Position

Sender: Station address of the sender (05H)


Example of a configured job: Receiver: Station address of the receiver
CP: Continuous Pointer; contains the position
N0: KW 01,00 = 5 (F9H) of the first user data byte
#D0: #127 (7FH) DN: DIN identification (7FH)
#J0: #10 (0AH) LB JN: Low–byte job number (0AH)
#L0: #2 HB JN: High–byte job number (00H)
MW0: MW 10,00 = 258 (102H) LB NW1: Low–byte user data word 1 (02H)
MW 10.01 = 772 (304H) HB NW1:High–byte user data word 1 (01H)
LB NW2: Low–byte user data word 2 (04H)
HB NW2:High–byte user data word 2 (03H)

CE data
Runtime: 07 KT 92 / 07 KT 93
Basic runtime: (97 + 8 * #JOB) µs
Additional runtime: ((52...178 + 16 * #JOB) * #JOB) µs
Updating of the outputs: no
Number of the historical values: 0 words
Available as of: ABB Procontic CS31, 07 KT 92 R262, 07 KT 93 R171

5–6 907 PC 331/Issued: 11.98


Send ARCnet data packages ASEND

FBD/LD IL
!BA 0
ASEND ASEND ASEND
#JOB #3 #JOB #3
EN M 01,00 EN M 01,00
#n #1 #n #1
N0 Job 1 KW 01,00 N0 Job 1 KW 01,00
#D #127 #D #127
#J #20 #J #20
#L ST #4 #L ST M 00,00 #4
MW MW10,00 MW MW 10,00
M 00,00

M 01,00
ASEND+ ASEND+ #3
KW 01,01
EN M 01,00 EN KW 01,02
#n #3 #n KW 01,03
N0 Job 2 KW 01,01 N0 Job 2 #127
#D KW 01,02 N1 #21
#J KW 01,03 N2 #12
#L ST #127 #D ST M 00,01 MW 10,04
MW #21 #J M 00,01
#12 #L
MW10,04 MW
:
: M 01,00
ASEND+ #2
: KW 01,04
M 01,00 EN KW 01,05
#2 #n #127
ASEND+ KW 01,04 N0 Job 3 #22
KW 01,05 N1 #16
EN #127 #D MW 11,00
#n #22 #J M 00,02
#16 #L ST M 00,02
N0 Job n MW11,00 MW
#D
#J
#L ST
MW

907 PC 331/Issued: 11.98 5–7


ASEND Send ARCnet data packages

Parameters
#JOB DIRECT #, #H Total number of jobs configured in the block
CONSTANT
EN BINARY E, M, A, K, S Enable: Send job
0: do not send
0/1 edge: send
1: send only if user data have changed
#n DIRECT #, #H Number of receivers of the data package;
CONSTANT the following applies: 1 < #n < 15
N0 WORD EW, MW, AW, KW Node number (station address) of the
receiver. The input can be duplicated.
#D DIRECT #, #H DIN identification
CONSTANT
#J DIRECT #, #H Job number
CONSTANT
#L DIRECT #, #H Number of user data words to be sent
CONSTANT
MW WORD EW, MW, AW, KW First word variable of the user data words
ST BINARY A, M Job has been stored in the storage buffer

The input N0 can be duplicated.


The inputs EN, #n, N0, #D, #J, #L and MW and the output ST are the parameters, that define a job. These parameters
therefore appear both in the ASEND block and in the ASEND+ extension block.
____________________________________________________________________________________________

Description For the same reason, the output ST may not be con-
nected by a line with another CE. A variable must always
The ASEND function block is intended for sending off jobs be defined at the output ST.
(data packages) via the ARCnet network. The configured
jobs are stored in a buffer storage. From here, they are
transferred to the ARCnet controller for sending off. The ASEND+ blocks only exist in FBD. During the translation,
transport from the buffer storage to the ARCnet controller the ASEND block and all the following ASEND+ are com-
is managed by the APOLL function block. The transport is bined into one ASEND–IL function block.
also carried out by the operating system in the idle period
between two PLC cycles. The ARCnet controller must have been initialized by the
function block AINIT before data packages can be stored
The maximum size of the storage buffer is 31 data pack- in the storage buffer by the function block ASEND.
ages.
The output ST indicates that the configured job has been Important note:
stored in the storage buffer.
If a PLC is used with an ARCnet interface, a certain sec-
Important note tion of the PLC TURBO program memory No. 2 is re-
served for ARCnet.
A user program must not contain more than one block
call of ASEND. If more than one job have to be sent off,
the ASEND block must be extended by the ASEND+ If programs with more than 2 k instructions are executed,
block. For each further job, one ASEND+ must be confi- the system-dependent capacity utilization can possibly
gured in the FBD directly following ASEND. be increased by reason of the reduced TURBO memory
No. 2 when changes are made to a running program.
ASEND+ is only an extension block for ASEND, but not
autonomous. For that reason, all used ASEND+ blocks There are no problems, if
must be configured directly following an ASEND block or
then following each other. Under no circumstances may ● the capacity utilization is less than 80 % before
other CEs be inserted between ASEND and ASEND+ or making changes to a running program or if
ASEND+ and a following ASEND+ respectively. ● the program length is less than 2 k instructions.

5–8 907 PC 331/Issued: 11.98


Send ARCnet data packages ASEND

#JOB DIRECT CONSTANT #D DIRECT CONSTANT


The total number of jobs configured in the ASEND and The DIN identification is specified for the configured job at
ASEND+ function blocks is specified at the input #JOB. input #D. The value 111 (6FH) is not allowed here, be-
The following is valid: 1 < #JOB cause it is reserved for programming and test telegrams.
The following applies: 0 < #D < 127
EN BINARY
not allowed: 111 (6FH)
Dependent on the enable input EN, the configured job is
stored as a data package in the storage buffer and sent off
then. #J DIRECT CONSTANT
The following applies: The job number is specified for the configured job at input
EN = 0: The configured job is not stored in #J.
the storage buffer and thus not The following applies: –32767 < #J < +32767
sent off.
EN = 0/1 edge: The configured job is stored as a
data package in the storage #L DIRECT CONSTANT
buffer and sent off then. The number of user data words is specified for the confi-
EN = 1: The configured job is stored in the gured job at input #L.
storage buffer and sent off, only if The following applies: 0 < #L < 125
the user data of the job have
changed.
MW WORD
#n DIRECT CONSTANT
The starting word flag of the word flag area to be sent off is
The number of receivers for the configured job is speci-
specified at the input MW. The data of this flag area are
fied at the input #n. The node numbers of the receivers
sent off as user data in this job.
are configured at the inputs N0... Nn–1,
where: 1 < #n < 15
N0...Nn–1 WORD ST BINARY
If the same job has to be sent to several receivers, the The output ST (status) indicates that the configured job
node numbers (station addresses) of the receivers are has been stored in the storage buffer.
defined at the inputs N0...Nn–1. The following applies:
ST = 0: The configured job has not been stored in the
N0: Node number = 0: storage buffer.
If the node number is ”0” at the input N0, the job is sent to ST = 1: The configured job has been stored in the
all stations (Broadcast). storage buffer.
N1...Nn–1: Node number = 0:
If the node number is ”0” at the inputs N1...Nn–1, no bro-
adcast is sent. Note
The inputs and outputs cannot be inverted.
If one of the receivers is not able to receive data, the data
The input N0 can be duplicated.
package is lost for this receiver.
A variable must be specified at the output ST, i.e. the out-
The following applies: 0 < N0...Nn–1 < 255 put may not be connected by a line with another CE.

907 PC 331/Issued: 11.98 5–9


ASEND Send ARCnet data packages

Structure of the ARCnet data package (short package = 256 bytes)


The ARCnet data package consists of:
– 3 bytes of control data: sender, receiver, CP (continuous pointer)
– max. 253 bytes of user data consisting of:
1 byte for DIN identification + 2 bytes for job number + 125 words for user data

LB HB LB HB LB HB
Sender Receiver CP DN
JN JN NW1 NW1 NW2 NW2
0 1 2 F9H FAH FBH FCH FDH FEH FFH
Position

Sender: Station address of the sender (05H)


Example of a configured job: Receiver: Station address of the receiver
CP: Continuous Pointer; contains the position
N0: KW 01,00 = 5 (F9H) of the first user data byte
#D: #127 (7FH) DN: DIN identification (7FH)
#J: #10 (0AH) LB JN: Low–byte job number (0AH)
#L: #2 HB JN: High–byte job number (00H)
MW: MW 10,00 = 258 (102H) LB NW1: Low–byte user data word 1 (02H)
MW 10.01 = 772 (304H) HB NW1:High–byte user data word 1 (01H)
LB NW2: Low–byte user data word 2 (04H)
HB NW2:High–byte user data word 2 (03H)

CE data
Runtime: 07 KT 92 / 07 KT 93
Basic runtime: (21 + 22 * #JOB) µs
Additional runtime: (106...360 * #JOB) µs
Updating of the outputs: yes
Number of the historical values: #JOB words
Available as of: ABB Procontic CS31, 07 KT 92 R262, 07 KT 93 R171

5–10 907 PC 331/Issued: 11.98


OFF DELAY ASV

The 1–0 edge of the input 0I I T is delayed by the time ZD


and is output as a 1–0 edge at the output Q.
FBD/LD IL
If the input 0I IT
returns to 1 level before expiry of the
time ZD, the output Q retains 1 level.
!BA 0
ASV ASV
0 I IT 0I I T
ZD Q ZD
Q

____________________________________________________________________________________________

Parameters
0 I IT BINARY E, M, A, S, K Input signal
ZD DOUBLE WORD MD, KD Delay time
Q BINARY M, A Delayed signal
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 45 µs; max. runtime in case of 97 µs – 551 µs
edges at input 0I IT: 541 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: 1 word 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
The 1–0 edge of the input 0I I T is delayed by the time ZD
and is output as a 1–0 edge at the output Q. 0 T

If the input 0I I T returns to 1 level before expiry of the


time ZD, the output Q retains 1 level. Q
t t t
The time is specified in milliseconds. Only integral multi-
ple of 5 ms are admissible (Examples: 5 ms, 500 ms, t0 ZD t0 t<ZD t0 ZD
100 000 ms, ...). Time range which can be specified: 5 ms
... 24.8 days.
In case of the indirect constant KD the value of the delay
time is specified in the long text.
Maximum time offset at the output: < 1 cycle time

Meaningful range for ZD: > 1 cycle time.


The inputs and the output can neither be duplicated nor
inverted.

907 PC 331/Issued: 11.98 5–11


ASV OFF DELAY

General behavior Important note


● Started timers are processed by the PLC’s operating The behaviour of the timers has been changed. All run-
system and are therefore completely independent of ning timers are stopped when one of the following actions
PLC program processing. The operating system does occurs:
not issue a corresponding message to the affiliated ti-
mer block in the PLC program until the timer has elap- – Abort PLC program
sed. – RUN/STOP switch from RUN –> STOP
● Processing of a timer in the PLC’s operating system is This modification is valid as of:
not influenced by the following commands: 07 KR 91 Index g
– Abort program 07 KT 92 Index g
– Start program 07 KT 93
– Stop program
– Continue program
That is to say, if a timer has been started, it continues to
be processed in the PLC’s operating system if the affi-
liated PLC program is aborted, restarted or stopped
and then continued again.

Initialization

The timers are always initialized each time a PLC cold or


warm start is executed. Therefore, any running timer is al-
ways aborted by a cold or warm start of the PLC.
Cold start:
● KALT <CR> command
● When activating the voltage for the first time
Warm start:
● WARM <CR> command
● Activating the voltage
● RESET switch

5–12 907 PC 331/Issued: 11.98


OFF DELAY ASV

EXAMPLE

FBD/LD IL

!BA 0
ASV ASV
E 01,00 0I IT E 01,00
KD 03,00 ZD Q M 07,02 KD 03,00
M 07,02

CE FBD Definition

ASV
0I IT
ZD Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0I IT E L N P Y 0 0
ZD E D N P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 ASV
00002 PP 0 0 I IT Input BINARY (start time)
00003 PP 0 ZD Input DOUBLE WORD (time value)
00004 PP 0 Q Output BINARY (time)

907 PC 331/Issued: 11.98 5–13


AWM SELECTION MULTIPLEXER

This function block reads the value of an operand, using


the method of indirect addressing. The value read is allo-
cated to the output A. FBD/LD IL

Note: The AWM block can only be used meaningfully in


conjunction with the ADRWA block. !BA 0
AWM AWM
ADR
ADR A A

____________________________________________________________________________________________

Parameters
ADR WORD EW, AW, MW, KW Indirect address of the operand to be read
A WORD AW, MW Value of the operand read
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 26 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This function block reads the value of an operand, using
the method of indirect addressing. The value read is allo-
cated to the output A
Note: The AWM block can only be used meaningfully in
conjunction with the ADRWA block.
The value of the operand at the input ADR is interpreted
as an address of the operand to be read (indirect addres-
sing).

Therefore, the operand at the input ADR represents an in-


direct address together with its value. This indirect ad-
dress is generated by the ADRWA function block.

The input and output can neither be duplicated nor ne-


gated.
Note: An explanation of the indirect addressing method
and the possibilities of using the AWM function
block are described in the section dealing with the
ADRWA function block.

5–14 907 PC 331/Issued: 11.98


SELECTION MULTIPLEXER AWM

Example

FBD/LD IL

!BA 0
AWM AWM
AW 09,00
AW 09,00 ADR MW 00,03 MW 00,03

CE FBD Definition

AWM

ADR A

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

ADR E W N P Y 0 0
A A W N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 AWM
00002 PP 0 ADR Input WORD (operand address)
00003 PP 0 A Output WORD (operand value)

907 PC 331/Issued: 11.98 5–15


AWT SELECTION GATE, WORD

A 0 signal at the binary input 0/1 allocates the value of the


word operand at the input 0 to the word operand at the
output A1. FBD/LD IL

A 1 signal at the binary input 0/1 allocates the value of the


word operand at the input 1 to the word operand at the !BA 0
output A1. AWT AWT
0/1 0/1
0 0
1 A1 1
A1

____________________________________________________________________________________________

Parameters

0/1 BINARY E, M, A, S, K Switchover input


0 WORD EW, MW, AW, KW Word input for 0/1 = 0
1 WORD EW, MW, AW, KW Word input for 0/1 = 1
A1 WORD AW, MW Word output
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 30 µs 40 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
A 0 signal at the binary input 0/1 allocates the value of the
word operand at the input 0 to the word operand at the
output A1.

A 1 signal at the binary input 0/1 allocates the value of the


word operand at the input 1 to the word operand at the
output A1.
The inputs and the output can neither be duplicated nor
negated/inverted.

5–16 907 PC 331/Issued: 11.98


SELECTION GATE, WORD AWT

Example

FBD/LD IL

!BA 0
AWT AWT
E 01,00 0/1 E 01,00
EW 01,01 0 EW 01,01
EW 01,02 1 MW 08,15 EW 01,02
MW 08,15

CE FBD Definition

AWT
0/1
0
1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0/1 E L N P Y 0 0
0 E W N P Y 0 0
1 E W N P Y 0 0
A1 A W N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 AWT
00002 PP 0 0/1 Input BINARY (Selector)
00003 PP 0 0 Input WORD
00004 PP 0 1 Input WORD
00005 PP 0 A1 Output WORD

907 PC 331/Issued: 11.98 5–17


AWTB BINARY SELECTION GATE

A 0 signal at the binary input 0/1 allocates the status of the


operand at the input 0 to the operand at the output A1.
FBD/LD IL
A 1 signal at the binary input 0/1 allocates the status of the
operand at the input 1 to the operand at the output A1.
!BA 0
AWTB AWTB
0/1 0/1
0 0
1 A1 1
A1

____________________________________________________________________________________________

Parameters
0/1 BINARY E, M, A, S, K Switchover input
0 BINARY E, M, A, S, K Binary input for 0/1 = 0
1 BINARY E, M, A, S, K Binary input for 0/1 = 1
A1 BINARY A, M Binary output
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 32 µs 74 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
A 0 signal at the binary input 0/1 allocates the status of the
operand at the input 0 to the operand at the output A1.

A 1 signal at the binary input 0/1 allocates the status of the


operand at the input 1 to the operand at the output A1.

The inputs and the output can neither be duplicated nor


inverted.

5–18 907 PC 331/Issued: 11.98


BINARY SELECTION GATE AWTB

Example

FBD/LD IL

!BA 0
AWTB AWTB
E 01,00 0/1 E 01,00
E 01,01 0 E 01,01
E 01,02 1 M 08,15 E 01,02
M 08,15

CE FBD Definition

AWTB
0/1
0
1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0/1 E L N P Y 0 0
0 E L N P Y 0 0
1 E L N P Y 0 0
A1 A L N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 AWTB
00002 PP 0 0/1 Input BINARY (Selector)
00003 PP 0 0 Input BINARY
00004 PP 0 1 Input BINARY
00005 PP 0 A1 Output BINARY

907 PC 331/Issued: 11.98 5–19


AWTB BINARY SELECTION GATE

5–20 907 PC 331/Issued: 11.98


SELECTION GATE, DOUBLE WORD AWTD

A 0 signal at the binary input 0/1 allocates the value of the


double word operand at the input 0 to the double word op-
erand at the output A1. FBD/LD IL

A 1 signal at the binary input 0/1 allocates the value of the


double word operand at the input 1 to the double word op- !BA 0
erand at the output A1. AWTD AWTD
0/1 0/1
0 0
1 A1 1
A1

____________________________________________________________________________________________

Parameters
0/1 BINARY E, M, A, S, K Switchover input
0 DOUBLE WORD MD, KD Double word input for 0/1 = 0
1 DOUBLE WORD MD, KD Double word input for 0/1 = 1
A1 DOUBLE WORD MD Double word output
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 41 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
A 0 signal at the binary input 0/1 allocates the value of the
double word operand at the input 0 to the double word op-
erand at the output A1.

A 1 signal at the binary input 0/1 allocates the value of the


double word operand at the input 1 to the double word op-
erand at the output A1.
The inputs and the output can neither be duplicated nor
negated/inverted.

907 PC 331/Issued: 11.98 6–1


AWTD SELECTION GATE, DOUBLE WORD

Example

FBD/LD IL

!BA 0
AWTD AWTD
E 01,00 0/1 E 01,00
MD 01,01 0 MD 01,01
KD 01,02 1 MD 08,15 KD 01,02
MD 08,15

CE FBD Definition

AWTD
0/1
0
1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0/1 E L N P Y 0 0
0 E D N P Y 0 0
1 E D N P Y 0 0
A1 A D N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 AWTD
00002 PP 0 0/1 Input BINARY (Selector)
00003 PP 0 0 Input DOUBLE WORD
00004 PP 0 1 Input DOUBLE WORD
00005 PP 0 A1 Output DOUBLE WORD

6–2 907 PC 331/Issued: 11.98


BCD TO BINARY CONVERSION BCDDUAL

The positive BCD coded number at the input BCD is con-


verted to a binary number and is allocated to the operand
at the DUAL output. FBD/LD IL

!BA 0
BCDDUAL BCDBIN
BCD DUAL BCD
DUAL

____________________________________________________________________________________________

Parameters
BCD WORD EW, MW, AW, KW BCD–coded number
DUAL WORD AW,MW Binary number
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 88 µs 365 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51

907 PC 331/Issued: 11.98 6–3


BCDDUAL BCD TO BINARY CONVERSION

Description Example 1

The positive BCD coded number at the input BCD is con- BCD NUMBER HEXDEC NUMBER
verted to a binary number and is allocated to the operand
at the DUAL output.
15 11 7 3 0 BIT 15 11 7 3 0
The input and the output can neither be duplicated nor ne-
gated. 1 2 3 4 0 4 D 2

Definition:

The significance of the digits in a BCD coded number and


Z1 = 4 *1 = 4 Z1 = 2 * 1 = 2
a hexadecimal number is defined as follows: =
Z2 3 * 10 = 30 Z2 = 13 * 16 = 208
Z3 = 2 * 100 = 200 Z3 = 4 * 256 = 1024
Z4 = 1 * 1000 = 1000 Z4 = – * – =
BCD–NUMBER HEXDEC–NUMBER
+ 1234 + 1234

15 11 7 3 0 BIT 15 11 7 3 0

Example 2
Z4 Z3 Z2 Z1 Z4 Z3 Z2 Z1
BCD NUMBER HEXDEC NUMBER
Numerical value: Numerical value:
Z1 1 Z1 1 15 11 7 3 0 BIT 15 11 7 3 0
* *
Z2 * 10 Z2 * 16
Z3 * 100 Z3 * 256 A 2 F 4 2 8 7 2
Z4 * 1000 Z4 * 4096
0 < Zi < 9 0 < Zi < F

Note: Z1 = 4 *1 = 4 Z1 = 2 *1 = 2
Z2 = 15 * 10 = 150 Z2 = 7 * 16 = 112
Z3 = 2 * 100 = 200 Z3 = 8 * 256 = 2048
At the BCD input, the block additionally also accepts dig- Z4 = 10 * 1000 = 10000 Z4 = 2 * 4096 = 8192
its to which the following applies:
+ 10354 + 10354
0 < Zi < F

6–4 907 PC 331/Issued: 11.98


BCD TO BINARY CONVERSION BCDDUAL

Representation of a negative BCD number

A negative BCD number can be represented in the PLC


by separate representation of the value and the sign. In
doing so, the value of the BCD number is stored in a word
variable and the information about the sign is stored in a
binary variable.

Example:

Representation of the BCD number –7:


MW 02,00 = 7 Value of the number, BCD coded
M 01,00 = 1 Sign of the number
● Positive: 0

● Negative: 1

Conversion of a negative BCD number to a negative binary number


Example:

Sign AWT
Value BCDDUAL M 01,00 0/1
MW 02,00 BCD DUAL 0
positive BINARY

=W Signed binary number


1 MW 02,01
neg. BINARY

Example

FBD/LD IL

!BA 0
BCDDUAL BCDBIN
MW 07,02 BCD DUAL MW 07,03 MW 07,02
MW 07,03

907 PC 331/Issued: 11.98 6–5


BCDDUAL BCD TO BINARY CONVERSION

CE FBD Definition

BCDDUAL
BCD DUAL

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

BCD E W N P Y 0 0
DUAL A W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 BCDBIN
00002 PP 0 BCD Input WORD (BCD number)
00003 PP 0 DUAL Output WORD (binary number)

6–6 907 PC 331/Issued: 11.98


BCD TO BINARY CONVERSION, DOUBLE WORD BCDDUALD

The positive BCD coded number at the input BCD is con-


verted to a binary number and is allocated to the operand
at the DUAL output. FBD/LD IL

!BA 0
BCDDUALD BCDDW
BCD DUAL BCD
DUAL

____________________________________________________________________________________________

Parameters
BCD DOUBLE WORD MD, KD BCD coded number
DUAL DOUBLE WORD MD Binary number
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 310 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

907 PC 331/Issued: 11.98 6–7


BCDDUALD BCD TO BINARY CONVERSION, DOUBLE WORD

Description Note:
The positive BCD coded number at the input BCD is con- The block also accepts digits at the BCD input to which
verted to a binary number and is allocated to the operand the following applies:
at the DUAL output.
0 < Zi < F
The input and the output can neither be duplicated nor ne-
gated. Representation of a negative BCD number
See function block BCDDUAL
Definition
The significance of the digits in a BCD coded number and Conversion of a negative BCD number to a negative
a hexadecimal number is defined as follows: binary number
See function block BCDDUAL
BINARY NUMBER HEXDEC NUMBER

31 15 0 BIT 31 15 0

Z8 Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z8 Z7 Z6 Z5 Z4 Z3 Z2 Z1

Numerical value: Numerical value:

Z1 * 1 Z1 * 1
Z2 * 10 Z2 * 16
Z3 * 100 Z3 * 256
Z4 * 1000 Z4 * 4096
Z5 * 10000 Z5 * 65536
Z6 * 100000 Z6 * 1048576
Z7 * 1000000 Z7 * 16777216
Z8 * 10000000 Z8 * 268435456

0 < Zi < 9 0 < Zi < F


____________________________________________________________________________________________

Example 1: Example 2:

BCD NUMBER HEXDEC NUMBER BCD NUMBER HEXDEC NUMBER

31 15 0 BIT 31 15 0 31 15 0 BIT 31 15 0

1 2 3 4 5 6 7 8 0 0 B C 6 1 4 E 1 B 3 4 A 2 F 4 0 1 4 5 C 7 D 2

Z1 = 8 *1 = 8 Z1 =14 * 1 = 14 Z1 = 4 * 1 = 4 Z1 = 2 * 1 = 2
Z2 = 7 * 10 = 70 Z2 = 4 * 16 = 64 Z2 = 15 * 10 = 150 Z2 =13 * 16 = 208
Z3 = 6 * 100 = 600 Z3 = 1 * 256 = 256 Z3 = 2 * 100 = 200 Z3 = 7 * 256 = 1792
Z4 = 5 * 1000 = 5000 Z4 = 6 * 4096 = 24576 Z4 = 10 * 1000 = 10000 Z4 =12 * 4096 = 49152
Z5 = 4 * 10000 = 40000 Z5 =12 * 65536 = 786432 Z5 = 4 * 10000 = 40000 Z5 = 5 * 65536 = 327680
Z6 = 3 * 100000 = 300000 Z6 = 11 * 1048576 = 11534336 Z6 = 3 * 100000 = 300000 Z6 = 4 * 1048576 = 4194304
Z7 = 2 * 1000000 = 2000000 Z7 = 0 * 16777216 = 0 Z7 = 11 * 1000000 = 11000000 Z7 = 1 * 16777216 = 16777216
Z8 = 1 * 10000000 = 10000000 Z8 = 0 * 268435456 = 0 Z8 = 1 * 10000000 = 10000000 Z8 = 0 * 268435456 = 0

+ 12345678 + 12345678 + 21350354 + 21350354

6–8 907 PC 331/Issued: 11.98


BCD TO BINARY CONVERSION, DOUBLE WORD BCDDUALD

Example

FBD/LD IL

!BA 0
BCDDUALD BCDDW
KD 01,00 BCD DUAL MD 02,00 KD 01,00
MD 02,00

CE FBD Definition

BCDDUALD
BCD DUAL

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

BCD E D N P Y 0 0
DUAL A D N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 BCDDW
00002 PP 0 BCD Input DOUBLE WORD (BCD number)
00003 PP 0 DUAL Output DOUBLE WORD (binary number)

907 PC 331/Issued: 11.98 6–9


BEG LIMITER

The value of the operand at the input E1 is limited to the


range between the high and low limits.
FBD/LD IL

!BA 0
BEG BEG
E1 E1
OG OG
UG A1 UG
A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Input value
OG WORD EW, MW, AW, KW High limit
UG WORD EW, MW, AW, KW Low limit
A1 WORD AW, MW Limited value
____________________________________________________________________________________________

CE Data 07 KR 91 / 07 KT 92 / 07 KT 93 07 KR 31
Runtime:
Basic runtime: 32...35 µs 147 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
____________________________________________________________________________________________

Description A1

The value of the operand at the input E1 is limited to the OG


range between the high and low limits.

The high limit is specified by the operand at the OG input


and the low limit is specified by the one at the UG input. UG
OG E1
The following applies: A1 = UG for E1 < UG
A1 = E1 for UG < E1 < OG
A1 = OG for E1 > OG
UG
The inputs and the output can neither be duplicated nor
negated.

6–10 907 PC 331/Issued: 11.98


LIMITER BEG

Example

FBD/LD IL

!BA 0
BEG BEG
MW 05,00 MW 05,00
KW 03,01 OG KW 03,01
KW 03,02 UG MW 09,10 KW 03,02
MW 09,10

CE FBD Definition

BEG
E1
OG
UG A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
OG E W N P Y 0 0
UG E W N P Y 0 0
A1 A W N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 BEG
00002 PP 0 E1 Input WORD (input value)
00003 PP 0 OG Input WORD (high limit)
00004 PP 0 UG Input WORD (low limit)
00005 PP 0 A1 Output WORD (limited value)

907 PC 331/Issued: 11.98 6–11


BEGD LIMITER, DOUBLE WORD

The value of the operand at the input E1 is limited to the


range between the high and low limits.
FBD/LD IL

!BA 0
BEGD BEGD
E1 E1
OG OG
UG A1 UG
A1

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, Input value
OG DOUBLE WORD MD, KD High limit
UG DOUBLE WORD MD, KD Low limit
A1 DOUBLE WORD MD Limited value
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 30 ... 38 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description A1

The value of the operand at the input E1 is limited to the OG


range between the high and low limits.

The high limit is specified by the operand at the OG input


and the low limit is specified by the one at the UG input. UG
OG E1
The following applies: A1 = UG for E1 < UG
A1 = E1 for UG < E1 < OG
A1 = OG for E1 > OG
UG
The inputs and the output can neither be duplicated nor
negated.

6–12 907 PC 331/Issued: 11.98


LIMITER, DOUBLE WORD BEGD

Example

FBD/LD IL

!BA 0
BEGD BEGD
MD 05,00 MD 05,00
KD 03,01 OG KD 03,01
KD 03,02 UG MD 09,10 KD 03,02
MD 09,10

CE FBD Definition

BEGD
E1
OG
UG A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
OG E D N P Y 0 0
UG E D N P Y 0 0
A1 A D N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 BEGD
00002 PP 0 E1 Input DOUBLE WORD (input value)
00003 PP 0 OG Input DOUBLE WORD (high limit)
00004 PP 0 UG Input DOUBLE WORD (low limit)
00005 PP 0 A1 Output DOUBLE WORD (limited value)

907 PC 331/Issued: 11.98 6–13


BETR ABSOLUTE VALUE GENERATOR

The absolute value of the word operand at the input E1 is


generated and is allocated to the operand at the output
A1. FBD/LD IL

!BA 0
BETR
BETR E1
E1 A1 A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Input value
A1 WORD MW, AW Absolute value of the input value
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 28 µs 42 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description The following generally applies:


The absolute value of the word operand at the input E1 is ● low limit: 8001H –32767
generated and is allocated to the operand at the output ● high limit: 7FFFH +32767
A1. ● inadmissible value: 8000H –––
The input and the output can neither be duplicated nor ne- In twos complement arithmetic, the value 8000 H
gated. (–32768) lies outside the number range and is neither
Number range generated nor processed correctly by the PLC. If this for-
bidden value reaches the PLC
Integer word (16 bits).
● by bit manipulations on the part of the user or
The following applies here particularly to the input E1: ● by reading in from outside the PLC or
● by an indirect word constant
If the inadmissible value 8000H (–32768) is present at the under no circumstances may a negation or subtraction be
input E1, the maximum possible value 7FFFH (+32767) is done on this value.
allocated to the output A1.
An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
On allocation (=), the forbidden value 8000H (–32768) is
corrected to the allowed value 8001H (–32767).

6–14 907 PC 331/Issued: 11.98


ABSOLUTE VALUE GENERATOR BETR

Example

FBD/LD IL

!BA 0
BETR
BETR EW 00,00
EW 00,00 AW 02,00 AW 02,00

CE FBD Definition

BETR
E1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
A1 A W N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 BETR
00002 PP 0 E1 Input WORD
00003 PP 0 A1 Output WORD

907 PC 331/Issued: 11.98 6–15


BETRD ABSOLUTE VALUE GENERATOR, DOUBLE WORD

The absolute value of the operand at the input E1 is gen-


erated and the result is allocated to the operand at the
output A1. FBD/LD IL

!BA 0
BETRD
BETRD E1
E1 A1 A1

____________________________________________________________________________________________

Parameters

E1 DOUBLE WORD MD, KD Input value


A1 DOUBLE WORD MD Absolute value of the input value
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 32 ... 36 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Number range


Integer double word (32 bits)
The absolute value of the operand at the input E1 is gen-
erated and the result is allocated to the operand at the
● low limit: 8000 0001H –2 147 483 647
output A1.
● high limit: 7FFF FFFFH +2 147 483 647
● invalid value: 8000 0000H –––
If, for any particular reason, the invalid value 8000 0000H
(–2 147 483 648) is present at the input E1, the value
7FFF FFFFH (+2 147 483 697) is allocated to the output
A1. Therefore, the invalid value is 8000 0000H is first of all
corrected to the valid value 8000 0001H and only then is
the absolute value generated.

The input and the output can neither be duplicated nor ne-
gated.

6–16 907 PC 331/Issued: 11.98


ABSOLUTE VALUE GENERATOR, DOUBLE WORD BETRD

Example

FBD/LD IL

!BA 0
BETRD
BETRD MD 00,00
MD 00,00 MD 02,00 MD 02,00

CE FBD Definition

BETRD
E1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
A1 A D N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 BETRD
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 A1 Output DOUBLE WORD

907 PC 331/Issued: 11.98 6–17


BITSU BIT SEARCHER

This function block searches through a bit field for a set


bit. The bit field consists of successive word operands. If
a set bit is found, this is indicated at the block’s outputs. FBD/LD IL

!BA 0
BITSU BITSU
R R
R/V R/V
#ANZ END #ANZ
ANF NR ANF
BIT POS BIT
END
NR
POS
____________________________________________________________________________________________

Parameters
R BINARY A, E, M, S, K Reset of the block and new search
R/V BINARY A, E, M, S, K Search direction, up/down
#ANZ DIRECT #, #H Field length, number of word operands
CONSTANT
ANF WORD EW, AW, MW, KW Field start, 1st word operand
BIT WORD EW, AW, MW, KW Number of set bits to be skipped
END BINARY A, M Field end reached
NR WORD AW, MW Number of the word operand containing the set bit
POS WORD AW, MW Bit position within the word operand
____________________________________________________________________________________________
_________

CE Data
Runtime:
Basic runtime: 136 µs
Additional runtime: 26 µs per word variable
Ouput updating: yes
Number of historical values: 9 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description After the start of the PLC program (1st program cycle),
the block sets all outputs to the value 0 and immediately
This function block searches through a bit field for a set begins searching for set bits. Therefore, the search is al-
bit. The bit field consists of successive word operands. If ready active in the first program cycle.
a set bit is found, this is indicated at the block’s outputs. If the block finds a set bit, its position is indicated at the
block’s outputs and the search is ended. The next time
The inputs and outputs can neither be duplicated nor ne- the block is called in the next program cycle, it conti-nues
gated/inverted. the search, doing so at the bit position directly following
the bit found last. If the end of the bit field is reached dur-
The bit field consists of successive word operands. The ing the search, this is indicated and a new search can be
first word operand in the bit field is specified at the input started again by means of a reset signal. The new search
ANF. again begins at the start of the bit field.

6–18 907 PC 331/Issued: 11.98


BIT SEARCHER BITSU

R BINARY BIT WORD


The input R serves to reset the block and start a new The way in which the function block is to indicate the bits
search from the beginning of the bit field. set in the bit field is specified at the input BIT.
R = 0 –> No reset
R = 1 –> Reset is triggered BIT = 1 –> Each set bit in the bit field is indicated at the
A 1 signal at the input R resets all of the block’s outputs to outputs NR and POS.
the value 0 and results in immediate starting of a new BIT = 2 –> The first set bit in the bit field is indicated; of
search from the beginning of the bit field. Therefore, the
the other set bits in the bit field,
new search begins in the same processing cycle in which
only every second set bit is now indicated.
the block’s outputs are reset.
BIT = 3 –> The first set bit in the bit field is
The search within the reset cycle ends either at the first indicated; of the other set bits in the bit
set bit or, if no bit is set, at the end of the field. The next field, now only every third set bit is
time the block is called, the reset input must be set to 0 so indicated.
that the block will be able to continue searching through BIT = n –> The first set bit in the bit field is indicated; of
the bit field for set bits. The reset input is dominant with the other set bits in the bit field, now only
respect to the other inputs. every n–th set bit is indicated.

R/V BINARY
The searching direction is specified at the input R/V. – Special function: BIT = 0
R/V = 0 –> Search down If the block finds a set bit, in the next program cycle the
R/V = 1 –> Search up search is not automatically continued at the subse-
quent bit position. The search is interrupted at this point
R/V = 0 means: The start of the bit field within the mea- until the bit found has assumed the significance 0. Dur-
ning of the search is identical with the ing interruption of the search, the position of the bit
physical start of the bit field. found last continues to be indicated at the outputs. If
R/V = 1 means: The start of the bit field within the mea- the bit found last assumes the value 0, the search is
ning of the search is identical with the continued at the next bit position. If a further bit is set in
physical end of the bit field. the selected search direction, this bit’s position is indi-
cated and the search is interrupted again.
If no more bits are set in the search direction, the posi-
#ANZ DIRECT CONSTANT
tion of the bit found last is indicated. The output END
The number of word operands of which the bit field con-
sists is specified at the input #ANZ. This is specified as a (field end reached) is set to 1.
direct constant.
– If no bits are set after a reset, the block runs through the
ANF WORD bit field up to its end and stops there. The output END
The word operand with which the bit field physically be- (field end reached) is set to one. The outputs NR and
gins is specified at the input ANF. The entire bit field con- POS are set to 0.
sists of the operand at the input ANF and the subsequent
operands corresponding to the operand numbering. The
total number of word operands is specified at the input – If bits are set after a reset, the block indicates the first
#ANZ. set bit in the search direction and stops at this bit.

907 PC 331/Issued: 11.98 6–19


BITSU BIT SEARCHER

END BINARY Position of the set bit within the word operand
Whether or not the end of the bit field has been reached Numbering within a word operand is from 0...15. At the
during the search is indicated at the END output. same time, position 0 corresponds to the least significant
END = 0 –> End of the bit field not reached bit and position 15 to the most significant bit within the
END = 1 –> End of the bit field reached word operand.
Search down: The end of the bit field is defined by bit If the end of the field is reached during a search without a
position 15 in the last word operand of set bit having been found, the position of the bit found last
the physical bit field. continues to be output through the output NR and the out-
put POS. This takes place until a new search is compelled
Search up: The end of the bit field is defined by bit from the start of the bit field by a reset at the input R.
position 15 in the first word operand of
the physical bit field. If no bits are set at all within the entire bit field, the outputs
If the bit is set at the last bit position of the field and it is assume the following values at the end of the first search:
found and indicated during a search, the output END is
not yet set to the value 1. This is not done until the next END =1
processing cycle of the block. Therefore, the prerequisite NR =0
for setting the output END is that no set bit has been found POS =0
during the current search.
This state can be terminated again by a 1 signal at the in-
put R (reset).
NR, POS WORD
If the block finds a set bit in the planned bit field, its posi-
tion is indicated at the outputs NR and POS.
Meanings:
NR: Current number of the word operand in
which the set bit has been found.
POS: Position of the set bit within the word ope–
rand.
Current number of the word operand
NR = 0 –> 1st word operand of the bit field
NR = 1 –> 2nd word operand of the bit field
. . .
. . .
NR = n–1 –> nth word operand of the bit field

The word operands are numbered in the sense of the


search.
Therefore, the following applies to down searching:
First word operand first word operand of the phy-
sical bit field
Last word operand last word operand of the physi-
cal bit field

Therefore, the following applies to up searching:


First word operand last word operand of the physi-
cal bit field
Last word operand first word operand of the phy-
sical bit field

6–20 907 PC 331/Issued: 11.98


BIT SEARCHER BITSU

Example

FBD/LD IL

!BA 0
BITSU BITSU
S 01,00 R S 01,00
K 01,05 R/V K 01,05
# 2 #ANZ END A 00,01 # 2
AW 10,10 ANF NR MW 01,00 AW 10,10
KW 13,00 BIT POS AW 02,01 KW 13,00
A 00,01
MW 01,00
AW 02,01

CE FBD Definition

BITSU
R
R/V
#ANZ END
ANF NR
BIT POS

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

R E L N P Y 0 0
R/V E L N P Y 0 0
#ANZ K W N P Y 0 0
ANF E W N P Y 0 0
BIT E W N P Y 0 0
END A L N P Y 0 0
NR A W N P Y 0 0
POS A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 BITSU
00002 PP 0 R Input BINARY (reset)
00003 PP 0 R/V Input BINARY (search direction)
00004 PP 0 #ANZ DIRECT CONSTANT (#words field length)
00005 PP 0 ANF Input WORD (field start)
00006 PP 0 BIT Input WORD (number of set bits to be skipped)
00007 PP 0 END Output BINARY (field end reached)
00008 PP 0 NR Output WORD (No.)
00009 PP 0 POS Output WORD (bit position)

907 PC 331/Issued: 11.98 6–21


BITSU BIT SEARCHER

6–22 907 PC 331/Issued: 11.98


BINARY VALUE CHANGE ANNUNCIATOR BMELD

This function block monitors the binary values present at


the input E0 capable of duplication for changes.
FBD/LD IL

!BA 0
BMELD BMELD
FREI FREI
R NR R
#n A #n
E0 ÄND E0
NR
A
ÄND

____________________________________________________________________________________________

Parameters
FREI BINARY A, E, M, S, K Block enable
R BINARY A, E, M, S, K Reset
#n DIRECT #, #H Number of input values
CONSTANT
E0 BINARY A, E, M, S, K Input values; input can be duplicated
NR WORD AW, MW Number of the input value
A BINARY A, M Current input value
ÄND BINARY A, M Change detected
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 61 µs
Additional runtime: 31 µs per input E0 ... En–1
Output updating: yes if FREI=1
Number of historical values: even number of binary values: (2 + #n/2) words
odd number of binary values: (2 + (#n + 1)/2) words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Each time the block is processed, a change at only one


This function block monitors the binary values present at input is recognized. When a change is recognized, the in-
the input E0 capable of duplication for changes. puts following the input where the change was previously
discovered are monitored the next time the block is pro-
The inputs and outputs cannot be negated/inverted. The cessed.
input E0 is capable of duplication. Initialization of historical values
Detection of a change The first time the block is processed after PLC initializa-
Each time the block is processed, the current input values tion (Frei = 1) or processing is enabled after it had been
at the inputs E0...En–1 are compared to the historical val- disabled (FREI changes from 0 to 1), all current input val-
ues (input values from the previous time the block was ues are taken over once as historical values and all out-
processed). If a change is detected at one of the inputs puts are set to the value 0. These initialized historical val-
E0...En–1: ues now represent the starting basis for recognition of
– this is signalled at the output ÄND changes.
– the number of the input at which the change was
discovered is output through the output NR
– the input value that has changed is output through
the output A.

907 PC 331/Issued: 11.98 7–1


BMELD BINARY VALUE CHANGE ANNUNCIATOR

FREI BINARY NR WORD


Processing of the block is enabled with the FREI input. The serial number of the input E0...En–1 where a change
FREI = 0 –> Block is not processed has been discovered is output through the output NR.
FREI = 1 –> Processing of the block is enabled
If no change is discovered during processing of the block,
If FREI = 0, the block’s outputs are also no longer up- the number of the input that changed last continues to be
dated. output through the output NR.
The following affiliations apply:
R BINARY Change discovered at E0 –> NR = 0
The block can be reset with the R input. Change discovered at E1 –> NR = 1
R = 0 –> No reset Change discovered at En–1 –> NR = n–1
R = 1 –> Reset of the block
Reset signifies: A BINARY
– Adoption of the current values at the inputs If a change is discovered at one of the inputs E0...En–1,
E0...En–1 as historical values. the input value that has changed is allocated to the output
– All outputs are set to the value 0. A.
#n DIRECT CONSTANT
The number of values to be monitored at the inputs If no change is discovered at the inputs E0...En–1 during
E0...En–1 are specified at the #n input. This is specified processing of the block, the value of the input that has
as a direct constant. changed last continues to be output through the output A.
Range for #n: < #n < 127
ÄND BINARY
E0...En–1 BINARY The output ÄND indicates whether or not a change has
The input E0 is capable of duplication (E0...En–1). been discovered at the inputs E0...En–1.
The operands to be monitored for a change are specified ÄND = 0 –> No change discovered
at the inputs E0...En–1. ÄND = 1 –> Change discovered

7–2 907 PC 331/Issued: 11.98


BINARY VALUE CHANGE ANNUNCIATOR BMELD

Example

FBD/LD IL

!BA 0
BMELD BMELD
E 00,01 FREI E 00,01
M 00,06 R NR AW 01,01 M 00,06
# 4 #n A M 01,07 # 4
M 09,00 E0 ÄND A 00,03 M 09,00
M 09,01 E1 M 09,01
M 09,02 E2
M 09,02
M 09,03 E3
M 09,03
AW 01,01
M 01,07
A 00,03

CE FBD Definition

BMELD
FREI
R NR
#n A
E ÄND

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
R E L N P Y 0 0
#n K W N P Y 0 0
E E L N P Y 1 0
NR A W N P Y 0 0
A A L N P Y 0 0
ÄND A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 BMELD
00002 PP 0 FREI Input BINARY (block enable)
00003 PP 0 R Input BINARY (reset)
00004 PP 0 #n # CONSTANT (number of input values)
[ 1
00005 PP 1 E Input BINARY (input values)
] 1
00006 PP 0 NR Output WORD (No.)
00007 PP 0 A Output BINARY (current input value)
00008 PP 0 ÄND Output BINARY (change detected)

907 PC 331/Issued: 11.98 7–3


CALLUP SUBROUTINE CALL FOR AN ASSEMBLER PROGRAM

FBD/LD IL

CALLUP CALLUP !BA 0


FREI K 00,01 FREI CALLUP
#OFF #H 7400 #OFF K 00,01
#SEG #H 0000 #SEG #H 7400
#VGW # 0 #VGW #H 0000
#VAR # 2 #VAR # 0
E1 A1 MW 00,00 AW 02,00 # 2
MW 00,00
AW 02,00

In a subroutine, the contents of the flag word MW 01,00 are to be increm-


ented and the contents of the flag word MW 02,00 are to be decrem-
ented.

Subroutine

TEST PROC FAR

MOV BX,ES:[SI] ;address of MW 01,00 to BX


MOV AX,DS:[BX] ;load value from MW 01,00 to register AX
INC AX ;increment value
MOV DS:[BX],AX ;again write value back to MW 01,00
MOV BX,ES:[SI+2] ;address of MW 02,00 to BX
MOV AX,DS:[BX] ;load value from MW 02,00 to register AX
DEC AX ;decrement value
MOV DS:[BX],AX ;again write value back to MW 02,00
RET
TEST ENDP

The subroutine is stored in the program memory 2. In case of this exam-


ple the distance between the start of the subroutine and the start of the
user program memory amounts to 7400H byte. It must be enabled for
execution (K00,01=1). No historical values are needed and 2 variables
are used.

Parameters
FREI BINARY E, M, A, K, S Block enable
#OFF DIRECT #, #H Offset address of the subroutine
CONSTANT
#SEG DIRECT #, #H Segment address of the subroutine
CONSTANT
#VGW DIRECT #, #H Number of historical values of the subroutine
CONSTANT
#VAR DIRECT #, #H Number of input/output variables of the subroutine
CONSTANT
E1 X E, M, A, K, S, EW, MW, Input variable (capable of duplication)
AW, KW, MD, KD
A1 X M, A, MW, AW,MD Output variable (capable of duplication)

7–4 907 PC 331/Issued: 11.98


SUBROUTINE CALL FOR AN ASSEMBLER PROGRAM CALLUP

Description #VGW DIRECT CONSTANT


The function block calls a subroutine stored on the PLC in The number of historical values used in the subroutine is
INTEL machine code. The machine code must be com- specified at the input #VGW. This is specified as a direct
patible with the processor of the relevant PLC. constant.

After processing of the subroutine, the program branches #VAR DIRECT CONSTANT
back to the block. Before the subroutine is called, all reg-
isters are automatically saved and restored after the re- The total number of input and output variables of the sub-
turn. routine is specified at the input #VAR. Therefore, this is
the total of all E1...En and A1...An. This is specified as a
The input E1 and the output A1 are capable of duplication. direct constant.
The inputs and outputs can neither be negated nor in-
verted.
E1 BINARY, WORD, DOUBLE WORD
FREI BINARY
The input E1 is capable of duplication (E1...En).
Enable function block processing
FREI = 0: Block is not processed The input variables for the subroutine are specified at the
FREI = 1: Block is processed inputs E1...En. The subroutine performs “reading” ac-
cess to these variables. When the subroutine accesses
these variables, the assembler programmer must pay at-
#OFF DIRECT CONSTANT tention to the defined data format. Direct constants (value
#SEG DIRECT CONSTANT transfer) are not allowed at the inputs E1...En.
The start address of the assembler subroutine is speci-
fied at these two inputs. The start address consists of an
offset and a segment address. The offset and segment A1 BINARY, WORD, DOUBLE WORD
addresses are specified as direct constants. The output A1 can be duplicated (A1...An).

If the value “0” is specified as the segment address, the The output variables for the subroutine are specified at
block expects the subroutine to have been stored in the the outputs A1...An. The subroutine performs “writing”
user program memory. The offset address then repre- access to these variables, i.e. values calculated in the
sents the byte spacing between start of user program and subroutine are provided to the main program with the aid
start of subroutine. The subroutine is automatically saved of the output variables A1...An. The assembler program-
as well when saving the PLC program on EPROM or flash mer must pay attention to the defined data format when
EPROM. accessing these variables.

907 PC 331/Issued: 11.98 7–5


CALLUP SUBROUTINE CALL FOR AN ASSEMBLER PROGRAM

Application notes Subroutine creation


1. Register
For 07 KR 31 refer to the specific documentation
When creating the subroutine, use can be made of
Store subroutine the following registers to suit requirements:
The best possibility to store the subroutine is to store it in
the user program memory (after PE). The subroutine can AX, BX, CX, DX, BP
be loaded e. g. with a HEX file loader or the PLC monitor.
The following registers are intended for access to va-
If the value “0” is specified as the segment address, the
riables:
block expects the subroutine to have been stored in the
user program memory. The offset address then repre-
sents the byte spacing between start of user program and DS, ES, DI, SI
start of subroutine.
The subroutine is automatically saved as well when sav- However, these registers can also be changed be-
ing the PLC program on EPROM or flash EPROM. cause they are corrected again after execution of the
subroutine in the CALLUP block.
Loading the subroutine 2. Start address
The subroutine can be loaded into the PLC via the serial Subroutine’s start address must be specified at the
interface COM2 with monitor command “Read INTEL– #OFF and #SEG inputs in the call of the block. The
HEX–FILE”. (See Description of the monitor functions, offset and segment are each specified as direct con-
command “R”). This can be done only in connection with
stants.
PLCs which have two serial interfaces (e. g. 07 KT 92).
3. Access to input and output variables
Access to the variables is by way of the pointers
ES:SI and DS:BX.
When the subroutine is entered, the pointer to the ad-
dress of the first variable in the call of the block is loca-
ted in (ES:SI) and the pointer to the address of the se-
cond variable is located in (ES:SI+2) etc. Access to
the contents of these variables is then by means of

DS:BX

7–6 907 PC 331/Issued: 11.98


SUBROUTINE CALL FOR AN ASSEMBLER PROGRAM CALLUP

Example 1: sing. For each call of the subroutine, its own memory
locations are available in the historical values memo-
The values of the first two word variables in the block ry. If a subroutine is called three times, for instance, in
call are to be fetched to the registers AX and CX. total 3 times as many historical values are occupied in
the historical values memory as are specified in the
call. The number of memory
MOV BX,ES:[SI] ;Fetch address for 1st va– words used (1 word = 16 bits) in the historical values
;riable and store in BX memory must be specified as a direct constant in the
MOV AX,DS:[BX] ;fetch value to AX call of the block. If too many historical values are oc-
MOV BX,ES:[SI+2] ;fetch address for second cupied, the PLC issues an error message when the
;variable and store in BX command PA (program editing) is used or when the
MOV CX,DS:[BX] ;fetch value to CX program is started.

Example 2: The historical values are addressed by way of the


pointers
The value of the first two binary variables in the call of DS:DI
the block are to be fetched to the registers AL and CL. In doing so, DS:DI points to the first available histori-
cal value when entering the subroutine.
MOV BX,ES:[SI] ;Fetch address for 1st va–
;riable and store in BX Example:
MOV AL,DS:[BX] ;Fetch value to AL The value fetched to register AX in point 3. is to be
MOV BX,ES:[SI+2] ;Fetch address for second compared to the first word in the historical values me-
;variable and store in BX mory.
MOV CL,DS:[BX] ;Fetch value to CL CMP AX,DS:[DI] ;Compare value to
;historical value
Binary variables occupy a whole byte. This byte may
only have 0 or 1 as its contents. 5. The stack has a depth of 40 words. In this way, up
to 40 PUSH commands can be executed successive-
4. Access to historical values/RAM
ly.

If RAM space is needed in the subroutine for interme-


6. Return from the subroutine
diate values, use can be made of the historical values
memory. The return is achieved by means of RET FAR (8086
machine code: CB). RET FAR is generated by the
The intermediate values are retained and are again 8086 assembler by virtue of the fact that the subrou-
available in the next program cycle for further proces- tine is declared as PROC FAR.
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 29 µs 12 µs
Additional runtime: ––– –––
Output updating: depends on the subroutine of the user
Number of historical values: number of #VGW words number of #VGW words
Available as of: 07 KR 91 R0101, Index c, SW version V 1.1 907 PC 331 / 07 KR 31 V 2.0
07 KR 91 R0151, Index c, SW version V 1.1 07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
07 KT 92 R0101, SW version V 1.0

907 PC 331/Issued: 11.98 7–7


COPY COPYING MEMORY AREAS

This function block copies n words from a source memory


area into a target memory area.
FBD/LD IL

COPY !BA 0
FREI COPY
ANZ FREI
QOFF ANZ
QSEG QOFF
ZOFF QSEG
ZSEG ZOFF
ZSEG

____________________________________________________________________________________________
Parameters
FREI BINARY E,A,M,K,S Block enable
ANZ WORD EW,AW,MW,KW Quantity (n) of words to be copied
QOFF WORD EW,AW,MW,KW Offset address of the start of the source area
QSEG WORD EW,AW,MW,KW Segment address of the start of the source area
ZOFF WORD EW,AW,MW,KW Offset address of the start of the target area
ZSEG WORD EW,AW,MW,KW Segment address of the start of the target area
____________________________________________________________________________________________
CE Data Series 90 Series 30, 40, 50
Runtime:
Basic runtime: 59 µs 146 µs
Additional runtime: 2 µs per copied word 30 µs per copied word
Output updating: not applicable not applicable
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 2.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________
Description QOFF WORD
Offset address of the start of the source area
This function block copies n words from a source memory
area into a target memory area.
The contents of the source memory area are not QSEG WORD
changed. Segment address of the start of the source area
In each case, the start of the source and target memory
areas is specified at the block’s inputs by means of the off- ZOFF WORD
set and segment addresses. These are planned as vari-
Offset address of the start of the target area
ables or as indirect constants.
The inputs and outputs can neither be duplicated nor in-
verted/negated. ZSEG WORD
Segment address of the start of the target area
FREI BINARY
Block enable
FREI = 0 –> The block is not processed Example:
FREI = 1 –> The block is processed 128 words are to be copied from address 4000H:6 to
ANZ WORD address 5000H:4.
Quantity n of words to be copied. Number of words to be copied: 128
The following applies: 0 < n < + 8000H Offset address of the source memory: 6
n = 0: No copying Segment address of the source memory: 4000H
n = 8000H: A whole segment (64 kbytes) Offset address of the target memory: 4
is copied Segment address of the target memory: 5000H

7–8 907 PC 331/Issued: 11.98


COPYING MEMORY AREAS COPY

Note:

If the COPY function block is located in the PLC program prevented by planning the COPY block in the PLC pro-
with the lower priority, programming can be interrupted by gram with the higher priority.
the program with the higher priority. An interrupt can be

Example
FBD/LD IL

!BA 0
COPY
COPY
M 00,00 FREI
MW 09,07 ANZ M 00,00
EW 09,08 QOFF MW 09,07
MW 04,02 QSEG EW 09,08
KW 00,00 ZOFF MW 04,02
EW 09,09 ZSEG KW 00,00
EW 09,09

CE FBD Definition

COPY
FREI
ANZ
QOFF
QSEG
ZOFF
ZSEG

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
ANZ E W N P Y 0 0
QOFF E W N P Y 0 0
QSEG E W N P Y 0 0
ZOFF E W N P Y 0 0
ZSEG E W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 COPY
00002 PP 0 FREI Enable BINARY
00003 PP 0 ANZ Number of words WORD
00004 PP 0 QOFF OFFSET source WORD
00005 PP 0 QSEG SEGMENT source WORD
00006 PP 0 ZOFF OFFSET target WORD
00007 PP 0 ZSEG SEGMENT target WORD

907 PC 331/Issued: 11.98 7–9


COS1 COSINE

FBD/LD IL

COS1 COS1
!BA 0
ANG AD MW 00,02 ANG AD MD 04,00 COS1
ERR ERR M 05,00 MW 00,02
MD 04,00
M 05,00

Parameters
ANG WORD EW, AW, MW Angle 0...3600 (corresponds to 0.0o....360.0o)
AD DOUBLE WORD AD, MD Cosine of the input value
ERR BINARY M, A Error, if input value is negative or greater than 3600
____________________________________________________________________________________________

Description ERR BINARY


This output indicates whether the input value is within the
The function block calculates the cosine value from input correct range (0 < ANG < 3600).
ANG and assigns it to the output AD. The result is within
the range of –100,000 to +100,000. Input 0 < ANG < 3600
If the value at ANG is negative or greater than 3600 –> ERR = 0 and AD = COS(ANG)
(360o), the output AD is set to 0 and the error output ERR Input ANG < 0 or ANG > 3600
is set to 1. –> ERR = 1 and AD = 0
The maximum deviation of the result is + 0.5.
Examples for cosine values
ANG WORD
cos(180)=–100000
The cosine value from the input operand ANG is calcu-
lated. The result is available as the output operand at AD. cos(236)=–55919

Input values: cos(90)=0


0000 for 0 degrees cos(270)=0
0001 for 0.1 degrees
0010 for 1.0 degrees
.. cos(x)
3600 for 360.0 degrees x
cos(0)=100000
AD DOUBLE WORD cos(360)=100000
The cosine value of the input ANG is available at the out-
cos(45)=70711
put AD.
____________________________________________________________________________________________

CE data
Runtime: 07 KR 91 / 07 KT 92 / 07 KT 93 / 07 KP 62
Basic runtime: 42 – 71 µs
Additional runtime: –––
Updating of the outputs: yes
Number of historical values: 0 words
Available as of: ABB Procontic CS31 07KT92 R202/R262, 07KT93 R171
ABB Procontic T200 07KP62 R202

7–10 907 PC 331/Issued: 11.98


TESTING NUMBER OF BITS IN WORD/DOUBLE WORD COUNTB

The set bits in E (binary input W/DW = 0 → E = word, W/


DW = 1 → E = double word) are counted and output to the FBD/LD
output NUM. Additionally, at output LOW the position of
the lowest set bit is output and at output HIGH the highest COUNTB
set bit is output. W/DW NUM
E LOW
For E = 0 the following applies: HIGH
NUM = 0, LOW = 0, HIGH = 0

Parameters
W/DW BINARY E, K , M, S Switch word/double word
W/DW = 0 → E = word,
W/DW = 1 → E = double word
E WORD EW, MW Input
DOUBLE WORD MD
NUM WORD AW, MW Number of set bits
LOW WORD AW, MW Position of the lowest set bit
HIGH WORD AW, MW Position of the highest set bit

CE data
Output updating: yes
Number of historical values: none

Available as of: 07 KR 91 R2 Index c, 07 KT 92 R2 Index c,


07 KT 93 Index f, 07 KT 94

Description E WORD/DOUBLE WORD

The set bits in E (binary input W/DW = 0 → E = word, W/ The set bits in E are counted and output to output NUM.
DW = 1 → E = double word) are counted and output to the Additionally, at output LOW the position of the lowest set
output NUM. Additionally, at output LOW the position of bit is output and at output HIGH the highest set bit is out-
the lowest set bit is output and at output HIGH the highest put.
set bit is output.
For E = 0 the following applies:
For E = 0 the following applies: NUM = 0, LOW = 0, HIGH = 0.
NUM = 0, LOW = 0, HIGH = 0.

NUM WORD
W/DW BINARY At output NUM the number of set bits of E is output.
For W/DW = 0 input E is a word operand, for W/DW = 1 If E is a word operand (W/DW = 0) the following applies:
input E is a double word operand. 0 ≤ NUM ≤ 15.
If E is a double word operand (W/DW = 1) the following
applies:
0 ≤ NUM ≤ 31.

907 PC 331 / Issued: 08.99 7-11


7
COUNTB TESTING NUMBER OF BITS IN WORD/DOUBLE WORD

LOW WORD HIGH WORD


At output LOW the position of the lowest set bit of E is At output HIGH the position of the highest set bit of E is
output. output.
If E is a word operand (W/DW = 0) the following applies: If E is a word operand (W/DW = 0) the following applies:
0 ≤ LOW ≤ 15. 0 ≤ HIGH ≤ 15.
If E is a double word operand (W/DW = 1) the following If E is a double word operand (W/DW = 1) the following
applies: applies:
0≤ LOW ≤ 31. 0≤ HIGH ≤ 31.

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

COUNTB

BIT_IN Y N Y 0 00 W/DW NUM 00 0 Y N Y WORT_OUT


WORD_DW_IN Y N Y 0 00 E LOW 00 0 Y N Y WORT_OUT
HIGH 00 0 Y N Y WORT_OUT

Source

SN ZN Command / Variable Symbol Long text

00000 00000 COUNTB


00001 PP 00 W/DW
00002 PP 00 E
00003 PP 00 NUM
00004 PP 00 LOW
00005 PP 00 HIGH
00006

7 7-12 907 PC 331 / Issued: 08.99


FAST COUNTER COUNTW

The fast counter in the central unit 07 KT 94 works inde-


pendently of the user program. Therefore, the counter can FBD/LD
react to external signals fast. It can be used in seven diffe-
rent configurable operating modes. The operating mode is COUNTW
configured in the system constant KW 85,02. NO ERR
The planned operating mode is only activated in the initia- U/D STAT
lization phase (power on, cold start, warm start). The same EN CF
function block COUNTW is used for all operating modes. SET OUT
STA
END

Parameters
NO WORD EW, MW Counter number 0 or 1
U/D BINARY E, K , M, S Direction 0 = up, 1 = down
EN BINARY E, K , M, S Enabling of the counting process with EN = 1
SET BINARY E, K , M, S Set to initial value with SET = 1
STA WORD EW, MW Start value
END WORD EW, MW End value
ERR BINARY A, M Error
STAT WORD AW, MW Status
CF BINARY A, M Carry flag (1 = end value reached)
OUT WORD AW, MW Count (actual value)

CE data
Output updating: yes
Number of historical values: 1 word (2 bytes)

Available as of: 07 KT 94 Index e

Description
The fast counter in the central unit 07 KT 94 works inde- - The maximum counting frequency is 50 kHz.
pendently of the user program. Therefore, the counter can
- The counter uses the terminals 2 (E 62,00) and 3
react to external signals fast. It can be used in seven diffe-
(E 62,01) as fast inputs and also the output terminal 46
rent configurable operating modes. The operating mode is
(A 62,00) in one operating mode. It is not possible to
configured in the system constant KW 85,02.
switch off the counting function of the 07 KT 94 in order
The planned operating mode is only activated in the initia- to use all inputs and outputs for other purposes.
lization phase (power on, cold start, warm start). The same
- The counter can count up in all operating modes. It
function block COUNTW is used for all operating modes.
counts beginning with the start value (set value) up to
Independent of the operating mode the following properties the end value (maximum range from -32768 to +32767
are valid: or from 8000H to 7FFFH). If the value +32767 is excee-
ded, the counter jumps to -32768. If the counter rea-
- Either the pulses of the counter input signal are coun- ches the planned end value in the function block (END),
tedor the evaluated signals of track A and track B in output CF is set to 1 (end value reached) and stored.
case of connected synchro transmitters. When setting the counter the output CF is reset to 0.

907 PC 331 / Issued: 08.99 7-13


7
COUNTW FAST COUNTER

NO WORD
In particular operating modes 2 counters can be processed CF BINARY
independently of each other. In this case the function block If the counter reaches the planned end value END, output
is planned twice. Then the value 0 (for counter 0) has to be CF is set to 1 and the value is stored. When setting the
applied to the first function block and the value 1 (for counter counter the output CF is reset to 0.
1) to the second function block. Normally NO is planned
with the value 0. OUT WORD
The current counter value (actual value) can be retrieved at
U/D BINARY any time using the output OUT of the function block.
In some operating modes the counter can also count down. The following section describes which operating modes
If this is required, the input U/D (Up/Down) of the function can be configured, how they can be planned and how they
block has to be configured with the value 1. In this case differ from each other. The system constant KW 85,02
the counter counts beginning with the start value (set value) configures the counter operating mode. A hex value of the
up to the end value (maximum range from -32768 to +32767 low byte (bit 0 to bit 7) of KW 85,02 has the following
or from 7FFFH to 8000H). If the value -32768 is underrun meaning:
the counter jumps to +32767.
00H = no counter (default setting)
EN BINARY 01H = Mode 1, one count-up counter
The processing of the counting signals must be enabled. 02H = Mode 2, one count-up counter with release input
Depending on the operating mode this is performed using 03H = Mode 3, two count-up/count-down counters
a terminal or the input EN (Enable) of the function block 04H = Mode 4, two count-up/count-down counters, the
(EN is set to 1). second counter counts the pulses on the falling
edge
STA WORD
05H = Mode 5, one count-up/count-down counter with
The counter can be set to a start value. This start value
must be applied to the input STA (start value) of the function dynamic set input, setting at the rising edge
block. With a set signal (depending on the operating mode 06H = Mode 6, one count-up/count-down counter with
either using a terminal or the input SET of the function dynamic set input, setting at the falling edge
block) the value of the word variable is transferred to the 07H = Mode 7, one count-up/count-down counter with
counter. directional discriminator

Note: If enabling is active and the set signal is available The high byte is configured with 00H.
during several processing cycles, the processing processor
always sets the counter at the program end. During the Caution: The planned operating mode is only activated
remaining time of the processing cycle the counter counts in the initialization phase (power on, cold start, warm
pulses. start).

END WORD – Operating mode 0: No counter


If the counter reaches the planned end value END,
the binary output CF is set to 1 and the value is stored. This operating mode must be selected if the internal
counter is not required. All digital inputs and outputs
can then be used for other purposes.
ERR BINARY
The binary output ERR (error) indicates that an error code – Operating mode 1: 1 count-up counter
exists in the output word STAT (error status).
The following two terminals are reserved for the counter
and cannot be used for other purposes:
STAT WORD
The output word of the STAT output (error status) has the Terminal 2 (E 62,00): Counting input
following meaning: Terminal 46 (A 62,00): Output "End value reached"
Enabling of the counting input and the output "End va-
1...255 = selected operating mode in KW 85,02 lue reached" is performed via the function block by set-
256 = no operating mode selected (KW 85,02=0) ting EN to 1.
257 = illegal operating mode planned in KW 85,02

7 7-14 907 PC 331 / Issued: 08.99


FAST COUNTER COUNTW

– Operating mode 2: 1 count-up counter with release Note:


input via terminal Changing the counting direction (via U/D) is not plan-
ned during running operation. If U/D is switched over, at
The following three terminals are reserved for the coun- the same time the counter is set to the start value and
ter and cannot be used for other purposes: after this counting is continued in the new counting di-
Terminal 2 (E 62,00): Counting input rection.
Terminal 3 (E 62,01): Release input – Operating mode 6: 1 count-up counter with
Terminal 46 (A 62,00): Output „End value reached“ dynamic set input via terminal
The release input enables the counting input as well as This operating mode corresponds completely to opera-
the output „End value reached“. The counter is only ting mode 5 with the only exception that the dynamic
enabled if the release input is set to 1, i.e. input EN = 1. set input acts on the 1/0 edge.
– Operating mode 3: 2 count-up/count-down counters – Operating mode 7: Counter with directional
In this operating mode two counters exist independent- discriminator
ly of one another. The message „End value reached“ In this operating mode the synchro transmitters can be
can only be inquired via the function blocks, not via the connected using two counting pulses with an offset of
terminals. 90 degrees compared to each other. Depending on the
The following two terminals are reserved for the counter position of the pulses the counter counts up or down.
and cannot be used for other purposes: A pulse multiplication (x2 or x4) does not occur.

Terminal 2 (E 62,00): Counting input counter 0 For this procedure synchro transmitters with a signal
Terminal 3 (E 62,01): Counting input counter 1 of 24 V can be used. Signals of 5 V synchro transmit-
ters must be increased. A zero track of the synchro
The function block COUNTW is required twice. transmitter is not processed. The message „End value
Note: reached“ can only be inquired via the function block,
Changing the counting direction (via U/D) is not plan- not via a terminal.
ned during running operation. If U/D is switched over, at The following two terminals are reserved for the counter
the same time the counter is set to the start value and and cannot be used for other purposes:
after this counting is continued in the new counting di-
rection. Terminal 2 (E62,00): Track A of the synchro transmitter
Terminal 3 (E62,01): Track B of the synchro transmitter
– Operating mode 4: 2 counters (1 counting input
inverted)
This operating mode corresponds completely to the
operating mode 3 with the only exception that the se-
cond counting input (counter 1) is inverted. It counts
the 1/0 edges at terminal 3 (E 62,01).
– Operating mode 5: 1 up-down counter with
dynamic set input via terminal
In this operating mode one up-down counter with dyna-
mic set input is available. Dynamic means that setting
has only an effect on the signal edge and not during
application of the signal.
The following two terminals are reserved for the counter
and cannot be used for other purposes:
Terminal 2 (E 62,00): Counting input
Terminal 3 (E 62,01): Dynamic set input
The dynamic set input at terminal 3 acts on the 0/1
edge.
The message „End value reached“ can only be inquired
via the function block, not via a terminal.

907 PC 331 / Issued: 08.99 7-15


7
COUNTW FAST COUNTER

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

COUNTW

WORT_IN Y N Y 0 00 NO ERR 00 0 Y N Y BIT_OUT


BIT_IN Y N Y 0 00 U/D STAT 00 0 Y N Y WORT_OUT
BIT_IN Y N Y 0 00 EN CF 00 0 Y N Y BIT_OUT
BIT_IN Y N Y 0 00 SET OUT 00 0 Y N Y WORT_OUT
WORT_IN Y N Y 0 00 STA
WORT_IN Y N Y 0 00 END

Source

SN ZN Command / Variable Symbol Long text

00000 00000 ;block Count_W start address


00001 !BA 000
00002 COUNTW
00003 PP 00 NO
00004 PP 00 U/D
00005 PP 00 EN
00006 PP 00 SET
00007 PP 00 STA
00008 PP 00 END
00009 PP 00 ERR
00010 PP 00 STAT
00011 PP 00 CF
00012 PP 00 OUT
00013 ;end address block COUNT_W
00014

7 7-16 907 PC 331 / Issued: 08.99


CONFIGURE CS31 MODULES CS31CO

FBD/LD IL

CS31CO CS31CO
!BA 0
FREI RDY M 00,00 FREI RDY A 00,00
CS31CO
GRN OK MW 10,00 GRN OK M 00,01
M 00,00
CODE ERR MW 10,01 CODE ERR MW 10,10
MW 10,00
D1 A1 MW 10,02 D1 A1 MW 10,11
MW 10,01
D2 A2 MW 10,03 D2 A2 MW 10,12
MW 10,02
D3 A3 MW 10,04 D3 A3 MW 10,13
MW 10,03
D4 A4 MW 10,05 D4 A4 MW 10,14
MW 10,04
D5 A5 MW 10,06 D5 A5 MW 10,15
MW 10,05
D6 A6 MW 10,07 D6 A6 MW 11,00
MW 10,06
D7 A7 MW 10,08 D7 A7 MW 11,01
MW 10,07
D8 MW 10,09 D8
MW 10,08
MW 10,09
A 00,00
M 00,01
MW 10,10
MW 10,11
MW 10,12
MW 10,13
MW 10,14
MW 10,15
MW 11,00
MW 11,01

Example of configuration of the analog input EW 00,03 for current


range 4 – 20 mA:

MW 10,00 = 0 Group number 0


MW 10,01 = 170 Job identification for ”Configure analog input
channel”
MW 10,02 = 3 Channel number 3
MW 10,03 = 49 Identification for current range 4 – 20 mA

These flags may be set to these values, e.g. with function “Overwrite”
in the PLC.

Parameters
FREI BINARY E, A, M, S Enable (0/1 edge) for processing the block
GRN WORD EW, AW, MW, KW Group number of the remote module to which
the job refers
CODE WORD EW, AW, MW, KW Identification of the job to be performed
D1 WORD EW, AW, MW, KW 1st parameter of the job
: : : :
D8 WORD EW, AW, MW, KW 8th parameter of the job
RDY BINARY A, M Processing of the job is completed
OK BINARY A, M It has been possible to process the job correctly
ERR WORD AW, MW Error message/status message
A1 WORD AW, MW 1st parameter of the response
: : : :
A7 WORD AW, MW 7th Parameter of the response

907 PC 331/Issued: 11.98 7–17


CS31CO CONFIGURE CS31 MODULES

Description D1...D8 WORD


The parameters required for the job are preset at inputs
The function block serves to configure the CS31 remote
D1...D8. The number of parameters is dependent upon
modules. The block can both send configuration parame-
the job to be executed. There are also jobs requiring no
ters to the remote modules and also scan their currently
parameters (see List of jobs on next page).
set configuration.

Apart from configuration of the CS31 remote modules, RDY BINARY


the function block can also process further jobs (see List
Output RDY signals that processing of the job currently
of jobs).
being processed is completed. Output RDY does not indi-
cate whether processing of the job has been successful
Note:
or not. Output RDY has therefore always to be considered
Function block CS31CO replaces the connection ele- together with output OK.
ment CS31CONF.
RDY = 1 and OK = 1:
Enable for processing a job once is triggered by a 0/1 Processing of the job is completed without errors.
edge at input FREI. The required job identification is spe- A new job can be started with a 0/1 edge at the
cified at input CODE. The parameters required for the job input FREI.
are planned at inputs D1...D8. Status messages are sig- RDY = 1 and OK = 0:
nalled at outputs RDY, OK and ERR. The response data During processing of the job an error has been
of the job are available at outputs A1...A7. detected. The corresponding error identification is
present at the ERR output.
It may take several PLC cycles to process the job. A new job can be started with a 0/1 edge at the
input FREI.
RDY = 0:
FREI BINARY Processing of an enabled job has not yet been
completed (job is still being processed)
Processing of the block is controlled via input FREI. or
FREI = 0: All block outputs are set to value the output RDY has been reset with FREI = 0.
“0”.
However, this is not valid, if a job
is currently being processed, i. e. OK BINARY
processing of a job which is
currently being processed, is not Output OK signals whether the job has been handled suc-
influenced by FREI = 0. cessfully or whether an error has been detected during
FREI = 0/1 edge: Processing of the job is enabled. processing. In the event of an error, an error number is in-
Input FREI is no longer evaluated dicated at output ERR. Output OK is not valid until the job
during processing of the job. has been completed, i. e. when RDY = 1.
FREI = 1: Block is not processed, i. e. it no The following applies:
longer changes its outputs. If RDY = 1 and
However, this is not valid, if a job OK = 1: Job has been processed successfully
is currently being processed.
OK = 0: An error has been detected during
processing of the job.
GRN WORD
ERR WORD
Group number with which the remote module is ad-
dressed by the PLC program. Status and error identifications are output at output ERR.
Range: 0...63 The status identifications are output during processing of
Example: a job in order to signal in what stage of processing the job
On binary input E 12,08, “12” is the group number and currently is. After enabling a job, status identifications are
“08” is the channel number. signalled only for as long as
RDY = 0.
The error identifications are output after completion of the
CODE WORD job processing if an error has occurred. Error identifica-
tions are thus not signalled until
The identification of the job to be executed is specified at RDY = 1 and
input CODE. (See List of jobs on next page). OK = 0.

7–18 907 PC 331/Issued: 11.98


CONFIGURE CS31 MODULES CS31CO

Error identifications ● Updating of the maximum number of remote mo-


dules detected
ERR = 1: An illegal job identification has been specified
at input CODE. Input word EW 07,15 contains, amongst other things,
the maximum number of remote modules detected in
ERR = 2: Incorrect parameters have been specified at the past. The actual number of remote modules
inputs D1...D8 (e.g. a group number for which which exist at the moment may be less. This com-
there is no remote module on the CS31 bus). mand is used to update this value. The modules
which exist are counted and the value is stored. The
user can scan this value in the PLC program. It is lo-
ERR = 3 The addressed CS31 remote module does not
cated in input word EW 07,15, bits 8...15.
accept the job.

– job
Status identifications
GRN: 255 (Master PLC with bus)
CODE: 132
ERR = 8: The function block is waiting since a job of an- D1 ... D8: not used
other user is currently being processed.
– OK response
ERR = 10: The job has been sent to the addressee and
RDY: 1
the block is waiting for its response.
OK: 1
A1 ... A7: 0

A1...A7 WORD ● Scanning the open–circuit monitoring of an in-


put to establish whether it is activated or deacti-
After completion of job processing, the response is avail-
vated
able at outputs A1...A7. The number of response param-
eters depends upon the job performed (see List of jobs).
– job
GRN: group number 0 ... 63
CODE: 32
List of jobs D1: channel number
D2 ... D8: not used
Processing a job consists of:
– transferring the job and – OK response
– supplying the OK response or RDY: 1
not–OK response OK: 1
A1: 47 ☞ open–circuit monitoring ON
The OK response is described in connection with 32 ☞ open–circuit monitoring OFF
the corresponding job. A2 ... A7: 0

The not–OK response of the individual jobs al- ● Scanning the open–circuit monitoring of an out-
ways looks as follows: put to establish whether it is activated or deacti-
vated
– Not–OK response
The following basically applies for the not–OK re- – job
sponse: GRN: group number 0 ... 63
CODE: 33
RDY: 1 D1: channel number
OK: 0 D2 ... D8: not used
ERR: 1 ☞ inadmissible job identification
2 ☞ wrong parameter; e. g. group – OK response
number to which there exists no RDY: 1
remote module OK: 1
3 ☞ remote module does not accept A1: 47 ☞ open–circuit monitoring ON
job 32 ☞ open–circuit monitoring OFF
A1 ... A7: 0 A2 ... A7: 0

907 PC 331/Issued: 11.98 7–19


CS31CO CONFIGURE CS31 MODULES

● Deactivating or activating open–circuit monito- ● Configuration of a channel as input or input/out-


ring of an input put

– job – job
GRN: group number 0 ... 63 GRN: group number 0 ... 63
CODE: 162 ☞ input
CODE: 224 ☞ open–circuit monitoring ON
163 ☞ input/output
160 ☞ open–circuit monitoring OFF
D1: channel number
D1: channel number D2 ... D8: not used
D2 ... D8: not used
– OK response
– OK response RDY: 1
RDY: 1 OK: 1
OK: 1 A1 ... A7: 0
A1 ... A7: 0
● Scanning the input delay of a channel

– job
● Deactivating or activating open–circuit monito- GRN: group number 0 ... 63
ring of an output CODE: 38
D1: channel number
– job D2 ... D8: not used
GRN: group number 0 ... 63
– OK response
CODE: 225 ☞ open–circuit monitoring ON
RDY: 1
161 ☞ open–circuit monitoring OFF OK: 1
D1: channel number A1: input delay:
D2 ... D8: not used 2 ☞ 2 ms
4 ☞ 4 ms
– OK response .
RDY: 1 .
.
OK: 1
30 ☞ 30 ms
A1 ... A7: 0
32 ☞ 32 ms
A2 ... A7: 0

● Scanning a channel to establish whether it is ● Setting the input delay of a channel


configured as input or input/output
– job
– job GRN: group number 0...63
GRN: group number 0 ... 63 CODE: 166
CODE: 34 D1: channel number
D1: channel number D2: input delay
D2 ... D8: not used 2 ☞ 2 ms
4 ☞ 4 ms
.
– OK response .
RDY: 1 .
OK: 1 30 ☞ 30 ms
A1: 34 ☞ input 32 ☞ 32 ms
35 ☞ input/output
A2 ... A7: 0 – OK response
RDY: 1
OK: 1
A1 ... A7: 0

7–20 907 PC 331/Issued: 11.98


CONFIGURE CS31 MODULES CS31CO

● Acknowledging errors on remote module D2: module type:


This command can be used to reset the error messa- 0 ☞ binary input
ges registered on the selected remote module. Reset 1 ☞ analog input
2 ☞ binary output
is possible only if the cause of the error is no longer
3 ☞ analog output
operative.
4 ☞ binary input/output
5 ☞ analog input/output
– job
GRN: group number 0 ... 63 Note:
CODE: 232 Bit: even number (0, 2, 4)
D1: lowest channel number on the module: Word: odd number (1, 3, 5)
0 ☞ lowest channel number on the D3 ... D8: not used
module is 0 (<7)
8 ☞ lowest channel number on the – OK response
module is 8 (>7) RDY: 1
D2: module type: OK: 1
0 ☞ binary input A1 ... A7: 0
1 ☞ analog input
2 ☞ binary output ● Scanning configuration of an analog input
3 ☞ analog output
4 ☞ binary input/output
5 ☞ analog input/output – job
GRN: group number 0 ... 63
Note: CODE: 42
D1: channel number
Bit: even number (0, 2, 4)
D2 ... D8: not used
Word: odd number (1, 3, 5)
D3 ... D8: not used
– OK response
RDY: 1
– OK response
OK: 1
RDY: 1
A1: 50 ☞ input 0 ... 20 mA
OK: 1 49 ☞ input 4 ... 20 mA
A1 ... A7: 0 A2 ... A7: 0

● Scanning configuration of an analog output


● Acknowledging errors on remote module and re-
setting configuration values to default setting – job
In addition to the job ’Acknowledging errors on re- GRN: group number 0 ... 63
mote module’, all configurable settings are reset to CODE: 43
the default setting. D1: channel number
D2 ... D8: not used
– job
GRN: group number 0 ... 63 – OK response
CODE: 233 RDY: 1
D1: first channel number on the module: OK: 1
0 ☞ first channel number on the A1: 50 ☞ output 0 ... 20 mA
module is 0 (<7) 49 ☞ output 4 ... 20 mA
8 ☞ first channel number on the 51 ☞ output + 10V
module is 8 (>7) A2 ... A7: 0

907 PC 331/Issued: 11.98 7–21


CS31CO CONFIGURE CS31 MODULES

● Configuration of an analog input – OK response


RDY: 1
OK: 1
– job
A1: status of the remote module:
GRN: group number 0 ... 63
Bit 0 ... 3: number of process data
CODE: 170
bytes (binary module) or words
D1: channel number
(word module), which the module
D2: 50 ☞ input 0 ... 20 mA
sends to the master
49 ☞ input 4 ... 20 mA
Bit 4 ... 7: number of process data
D3 ... D8: not used
bytes (binary module) or words
(word module), which the master
– OK response
sends to the module
RDY: 1
A2: group number (0 ... 63)
OK: 1
A3: Bit 0: 0 ☞ lowest channel number <7
A1 ... A7: 0
1 ☞ lowest channel number > 7
Bit 1: 0 ☞ binary module
● Configuration of an analog output 1 ☞ word module
A4 ... A7: 0
– job ● Read 1 ... 6 bytes
GRN: group number 0 ... 63
CODE: 171 – job
D1: channel number GRN: group number 0 ... 63
D2: 50 ☞ output 0 ... 20 mA CODE: 49 ☞ read 1 byte
49 ☞ output 4 ... 20 mA 50 ☞ read 2 bytes
51 ☞ output + 10V 51 ☞ read 3 bytes
D3 ... D8: not used 52 ☞ read 4 bytes
53 ☞ read 5 bytes
– OK response 54 ☞ read 6 bytes
RDY: 1 D1: first channel number on the module:
OK: 1 0 ☞ first channel number on the
A1 ... A7: 0 module is 0 (<7)
8 ☞ first channel number on the
module is 8 (>7)
● Scanning bus configuration D2: module type:
The bus interface of the Master PLC has a list which 0 ☞ binary input
stores specific data of the remote modules. The re- 1 ☞ analog input
mote modules are numbered in this list in the order in 2 ☞ binary output
which they can be found on the CS31 bus. The inter- 3 ☞ analog output
nal number of the modules must be specified with this 4 ☞ binary input/output
command. The response to this command is the 5 ☞ analog input/output
group number stored under this number and status
information on the corresponding module. Note:
bit: even number (0, 2, 4)
– job word: odd number (1, 3, 5)
GRN: not evaluated
CODE: 80 D3: Byte start address (Low Byte)
D1: number from module list (1 ... 31) D4: Byte start address (High Byte)
D2 ... D8: not used D5 ... D8: not used

7–22 907 PC 331/Issued: 11.98


CONFIGURE CS31 MODULES CS31CO

– OK response ● Write 1 ... 4 bytes


RDY: 1
OK: 1 – job
A1: value of 1st byte GRN: group number 0 ... 63
A2: value of 2nd byte or 0 CODE: 65 ☞ write 1 byte
A3: value of 3rd byte or 0 66 ☞ write 2 bytes
A4: value of 4th byte or 0 67 ☞ write 3 bytes
A5: value of 5th byte or 0 68 ☞ write 4 bytes
A6: value of 6th byte or 0 D1: first channel number on the module:
A7: 0 0 ☞ first channel number on the
module is 0 (<7)
● Read 1 bit of 1 byte 8 ☞ first channel number on the
module is 8 (>7)
– job D2: module type:
GRN: group number 0 ... 63 0 ☞ binary input
CODE: 63 1 ☞ analog input
D1: first channel number on the module: 2 ☞ binary output
0 ☞ first channel number on the 3 ☞ analog output
module is 0 (<7) 4 ☞ binary input/output
8 ☞ first channel number on the 5 ☞ analog input/output
module is 8 (>7)
D2: module type: Note:
0 ☞ binary input bit: even number (0, 2, 4)
1 ☞ analog input word: odd number (1, 3, 5)
2 ☞ binary output
3 ☞ analog output D3: byte start address (Low Byte)
4 ☞ binary input/output D4: byte start address (High Byte)
5 ☞ analog input/output D5: value of 1st byte
D6: value of 2nd byte or not used
Note: D7: value of 3rd byte or not used
bit: even number (0, 2, 4) D8: value of 4th byte or not used
word: odd number (1, 3, 5)
– OK response
D3: byte start address (Low Byte) RDY: 1
D4: byte start address (High Byte) OK: 1
D5: bit position within bytes 0 ... 7 A1 ... A7: 0
D6 ... D8: not used

– OK response
RDY: 1
OK: 1
A1: bit value (0 or 1)
A2 ... A7: 0

907 PC 331/Issued: 11.98 7–23


CS31CO CONFIGURE CS31 MODULES

● Write 1 bit of 1 byte D3: byte start address (Low Byte)


D4: byte start address (High Byte)
– job D5: bit position within bytes 0 ... 7
GRN: group number 0 ... 63 D6: bit value (0 or 1)
CODE: 79 D7 ... D8: not used
D1: first channel number on the module:
0 ☞ first channel number on the – OK response
module is 0 (<7) RDY: 1
8 ☞ first channel number on the OK: 1
module is 8 (>7) A1 ... A7: 0
D2: module type:
0 ☞ binary input
1 ☞ analog input
2 ☞ binary output
3 ☞ analog output
4 ☞ binary input/output
5 ☞ analog input/output

Note:
bit: even number (0, 2, 4)
word: odd number (1, 3, 5)
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 100 µs not available
Additional runtime: ––– –––
Output updating: no; recommendation: Allocate the output directly to a flag or use a
global intermediate flag; see volume 3, chapter 2.5.3
Number of historical values: 1 word 1 word
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 KR 91 R 101, Index c, SW version V 1.1 07 CR 41, 07 CT 41,
07 KR 91 R 151, Index c, SW version V 1.1 07 KR 51, 07 KT 51
07 KT 92 R 101, SW version V 1.0, 07 KT 93

7–24 907 PC 331/Issued: 11.98


ACKNOWLEDGE CS31 ERRORS CS31QU

FBD/LD IL

CS31QU CS31QU
!BA 0
FREI E 00,00 FREI CS31QU
E 00,00

Parameters
FREI BINARY E, A, M, S Enable block processing
____________________________________________________________________________________________

Description 1. A CS31 error of class 3 has occurred:


The block acknowledges the error on the CS31 re-
This function block permits error messages of CS31 re- mote module signalling the error
mote modules to be acknowledged automatically. and
also clears the error message on the PLC, i.e. the er-
ror flag M 255,13 is reset and LED FK3 is deactivated.
Error messages are stored on the CS31 remote modules
until they are acknowledged. Even if the error has been Example of an FK3 error:
remedied, the error message is still pending on the mod- – a remote module is disconnected from the CS31
ule until acknowledgment and is also signalled to the PLC bus.
until such time as it is acknowledged.
Note:
System constant KW 00,07 (FK3_REAK) must be 0 in or-
Note: der to permit errors of class 3 to be processed! If
Function block CS31QU replaces connection element KW 00,07 is not equal to 0, the PLC automatically aborts
CS31QUIT. execution of the PLC program when an FK3 error is de-
tected.

Processing of the block is enabled with a 1 signal at input 2. A CS31 error of class 4 has occurred:
FREI, and the block then acknowledges CS31 errors con- The block acknowledges the error on the CS31 re-
tinuously. It may take several PLC cycles to acknowledge mote module signalling the error
an error on a CS31 module. and
also clears the error message on the PLC, i.e. error
flag M 255,14 is reset.
If the function block is enabled, it constantly checks
whether a CS31 error of class 3 or 4 has occurred and ac- Examples of an FK4 error:
knowledges this error. – a remote module signals open circuit
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 60 µs not available
Additional runtime: ––– –––
Output updating: ––– –––
Number of historical values: 1 word 1 word
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 KR 91 R 101, Index c, SW version V 1.1 07 CR 41, 07 CT 41,
07 KR 91 R 151, Index c, SW version V 1.1 07 KR 51, 07 KT 51
07 KT 92 R 101, SW version V 1.0, 07 KT 93

907 PC 331/Issued: 11.98 7–25


CS31TE TESTING OF CS31 REMOTE MODULES (MASTER ONLY)

This block can only be used by the master at the CS31


bus (KW 00,00 = - 1). During initialization each remote
module logs in at the master with the following data: Ad- FBD/LD
dress, lowest channel number and number of process data CS31TE
bytes/words, which the module sends to the master or
0/1 RDY
receives from it. The block compares these data with the
TIME OK
description of the remote modules at the block inputs. ERNO
#n
#A
#>
#S MO
#R ME

Parameters
0/1 BINARY E, K, M, S, Enabling for non-recurring processing of the block with 0/1 edge
TIME DOUBLE WORD KD, MD Time for the modification identifier of the number of modules in
EW 07,15
RDY BINARY A, M Processing finished
OK BINARY A, M Module at CS31 bus ok.
ERNO WORD AW, MW Error number
255: no master
>0: remote module cannot be assigned
(list pointer inquiring of the bus configuration)
#n DIRECT #,#H Number of modules
CONSTANT
#A DIRECT #,#H Address (group number) of the remote module
CONSTANT
#> DIRECT #,#H 0: lowest channel number ≤ 7
CONSTANT 1: lowest channel number > 7
#S DIRECT #,#H For binary modules: number of process data bytes, which the
CONSTANT module sends to the master (0...15 corresponds to 0...15 bytes)
For word modules: number of process data words, which the
module receives from the master (100...108 corresponds to 0...8
words)
#R DIRECT #,#H For binary modules: number of process data bytes, which the
CONSTANT module receives from the master (0...15 corresponds to 0...15
bytes)
For word modules: number of process data words, which the
module receives from the master (100...108 corresponds to 0...8
words)
MO BINARY A, M Module ok.
(Module specifications match with the block specifications)
ME BINARY A, M Send/receive data from module and block are different
The inputs and outputs from #A to ME can be doubled for each module.

7 7-26 907 PC 331 / Issued: 08.99


TESTING OF CS31 REMOTE MODULES (MASTER ONLY) CS31TE

CE data
Output updating: no
Number of historical values: 3 words (6 bytes)

Available as of: 07 KR 91 R2 Index c, 07 KT 92 R2 Index c,


07 KT 93 R2 Index f, 07 KT 94

Description
This block can only be used by the master at the CS31 OK BINARY
bus (KW 00,00 = - 1). During initialization each remote Output OK indicates that the remote modules at the CS31
module logs in at the master with the following data : Ad- bus correspond to the block parameters. This output has
dress, lowest channel number and number of process data always to be considered together with output RDY. The
bytes/words, which the module sends to the master or following applies:
receives from it. After a 0/1 edge at input 0/1, the block
compares these data with the description of the remote RDY = 1 and OK = 1: The remote modules at the CS31
modules at the block inputs. If they agree, the outputs MO bus correspond to the block
= 1 and ME = 0 are set for this remote module. If the parameters.
number of remote modules (EW 07,15) does not change RDY = 1 and OK = 0: An error has occurred. The
within the time at input TIME, the block processing is fin- error can be evaluated using the
ished (RDY = 1). If OK = 1, all modules at the bus corre- outputs ERNO, MO and ME
spond to the block description. If OK = 0, the correspond- of the individual modules.
ing error of the individual modules can be read at output
ERNO and at the outputs MO and ME.

0/1 BINARY ERNO WORD


With a 0/1 edge at block 0/1 the non-recurring processing The output ERNO indicates an error number. The output
of the block is enabled. If RDY = 1 the processing is has always to be considered together with the outputs RDY
finished. At the outputs OK and ERNO (MO and ME of the and OK (RDY 1 and OK = 0). The following applies:
individual modules) can be read, if an error occurred during
ERNO = 255 -> Device is no master
the processing.
ERNO > 0 -> Remote module at the CS31 bus can
not be assigned (the value of ERNO
TIME DOUBLE WORD is the pointer to the list in case of the
At input TIME the time for the modification identifier of the mail "Inquiring the Bus configuration",
number of modules in EW 07,15 is specified. If the number refer to 907 PC 331 Operating and test
of remote modules (EW 07,15) does not change after a 0/ functions).
1 edge at input 0/1 within this time, the block processing
is finished (RDY = 1 means: outputs OK, ERNO, MO, ME
are valid). #n DIRECT CONSTANT
At input #n, the number of modules at the CS31 bus is
Recommended: 2000 to 4000 (corresponds to 2 to 4 se- specified. The inputs #A, #>, #S, #R, MO and ME can be
conds) doubled for each module.

RDY BINARY #A DIRECT CONSTANT


At input #A the address (group number) of the remote
After a 0/1 edge at input 0/1 the output RDY displays that
module is specified.
the block processing is finished (RDY = 1 means: outputs
OK, ERNO, MO, ME are valid).
#> DIRECT CONSTANT
At input #> the lowest channel number of the remote mod-
ule is specified.
The following applies: 0: lowest channel number < 7
1: lowest channel number > 7

907 PC 331 / Issued: 08.99 7-27


7
CS31TE TESTING OF CS31 REMOTE MODULES (MASTER ONLY)

#S DIRECT CONSTANT For binary modules: 0...15 (corresponds to 0...15


At input #S the number of process data bytes (for binary bytes), number of process data
modules) or process data words (for word modules) which bytes, which the module receives
the module sends to the master is specified. The following from the master.
applies:
For word modules: 100...108 (corresponds to 0...8
For binary modules: 0...15 (corresponds to 0...15 words), number of process data
bytes), number of process data words, which the module receives
bytes, which the module sends to from the master.
the master.
Valid values for #S and #R:
For word modules: 100..0,108 (corresponds to 0...8
Binary module: #S and #R: 0...15
words), number of process data
Word module: #S and #R: 100…108
words, which the module sends
to the master.
Valid values for #S and #R: MO BINARY
At the output MO (module ok) it is specified that the mo-
Binary module: #S and #R: 0...15 dule specifications of this remote module correspond to
Word module: #S and #R: 100...108 the block specifications (MO = 1 and ME = 0).

#R DIRECT CONSTANT ME BINARY


At input #R the number of process data bytes (for binary At the output ME (module error) it is specified, that the
modules) or process data words (for word modules) which module specifications data send/receive of this remote mo-
the module receives from the master is specified. The fol- dule do not correspond to the block specifications (MO =
lowing applies: 0 and ME = 1).
The inputs and outputs from #A to ME can be doubled for
each module.

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

CS31TE

BIT_IN Y N Y 0 00 0/1 RDY 00 0 Y N Y BIT_OUT


DWORT_IN Y N Y 0 00 TIME OK 00 0 Y N Y BIT_OUT
ERNO 00 0 Y N Y WORT_OUT
DIREKT-KONS Y N Y 0 00 #n
DIREKT-KONS Y N Y 1 01 #A
DIREKT-KONS Y N Y 1 01 #>
DIREKT-KONS Y N Y 1 01 #S MO 01 1 Y N Y BIT_OUT
DIREKT-KONS Y N Y 1 01 #R ME 01 1 Y N Y BIT_OUT

7 7-28 907 PC 331 / Issued: 08.99


TESTING OF CS31 REMOTE MODULES (MASTER ONLY) CS31TE

Source

SN ZN Command / Variable Symbol Long text

00000 00000 !BA 000


00001 CS31TE
00002 PP 00 0/1
00003 PP 00 TIME
00004 PP 00 RDY
00005 PP 00 OK
00006 PP 00 ERNO
00007 PP 00 #n
00008 [ 01
00009 PP 01 #A
00010 PP 01 #>
00011 PP 01 #S
00012 PP 01 #R
00013 PP 01 MO
00014 PP 01 ME
00015 ] 01
00016

907 PC 331 / Issued: 08.99 7-29


7
CTU UP COUNTER

The function block is used to count pulses. During count-


ing, every positive edge of the pulse at input CU is evaluat-
FBD/LD
ed. The edge increases the value at output CV by "1".
CTU
CU Q
R CV
PV

Parameters
CU BINARY E, M, A, K, S Pulse input, counting
R BINARY E, M, A, K, S Resetting the counter
PV WORD EW, MW, AW, KW Set point of the counter
Q BINARY M, A Output „End value reached“
CV WORD MW, AW Output for counter content

Available as of: Advant Controller 31, series 40 and 50

Description
The function block is used to count pulses. During count- CU BINARY
ing, every positive edge of the pulse at input CU is evaluat-
ed. The edge increases the value at output CV by "1". A positive edge increases the counter content by 1.

If the counter reaches the set point defined at input PV, R BINARY
output Q assumes the value 1. The signal 1 sets the counter at output CV to value 0.
With R, the counter can be reset to 0. PV WORD
Set point of the counter

Q BINARY
The signal 1 at this output signalizes that the counter
content has reached the set point:
CV < PV → Q = 0
CV = PV → Q = 1
CV > PV → Q = 1

CV WORD
Current counter content which is increased by 1 at input
CU with each positive edge.
Value range:
Integer word (16 bits)
- Low limit: 0000H or 0
- High limit: 7FFFH or +32767

7 7-30 907 PC 331 / Issued: 08.99


UP COUNTER CTU

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

CTU
BIT_IN Y N Y 0 00 CU Q 00 0 Y N Y BIT_OUT
BIT_IN Y N Y 0 00 R CV 00 0 Y N Y WORT_OUT
WORT_IN Y N Y 0 00 PV

Source

SN ZN Command / Variable Symbol Long text


00000 00000 !BA 000
00001 CTU
00002 PP 00 CU
00003 PP 00 R
00004 PP 00 PV
00005 PP 00 Q
00006 PP 00 CV

907 PC 331 / Issued: 08.99 7-31


7
CTUH FAST COUNTER

The function block is used to count pulses which are queued


at the counting input with higher frequency. The three
FBD/LD
counter operating modes in the basic units of the series
40 and 50 are supported. Therefore, the block allows the CTUH
evaluation of pulses which are generated by an encoder. #num Q
During counting, every single positive edge of the pulses R CV
S SPCV
at input E62,00 or E62,01 is evaluated and the value at
INIT
output CV is changed by "1".
RPI
For the operating modes 1 and 2, the value is increased, SP
for operating mode 3 it is increased or decreased depend- R-Q
ing on the direction of rotation (encoder – track A and B).

Parameters
#num DIRECT CONSTANT #,#H Counter operating mode
R BINARY E, M, A, K, S Resetting the counter
S BINARY E, M, A, K, S Setting the counter
INIT WORD EW, MW, AW, KW Counter start value
RPI BINARY E, M, A, K, S Enabling the CATCH inputs with counter reset
SP BINARY E, M, A, K, S Enabling the CATCH inputs without counter reset
R-Q BINARY E, M, A, K, S Resetting output Q
Q BINARY M, A Counter zero crossing
CV WORD AW, MW Current counter value
SPCV WORD AW, MW Stored counter value

Available as of: Advant Controller 31, series 40 and 50

Description #num DIRECT KONSTANT


The function block is used to count pulses which are queued Selection of the operating mode: The counter has three
at the counting input with higher frequency. The three operating modes:
counter operating modes in the basic units of the series
40 and 50 are supported. #1: Counter1 Counting input: E 62,00
CATCH input: E 62,03
The counter value can be stored in the counter with or
without counter reset. For this purpose, a 0/1 edge has to #2: Counter2 Counting input: E 62,01
be applied to the respective CATCH input. During counting CATCH input: E 62,03
and CATCH procedure, the positive edge of the pulse at #3: Incremental transmitter:
the input is evaluated. The CATCH inputs must be enabled
with RPI or SP. The counting inputs E 62,00 and E 62,01 are connect-
ed to an encoder with track A and track B. Depending
For the operating modes 1 and 2, the counter value is in- on the edge sequence (direction of rotation), the count-
creased, for operating mode 3 it is increased or decreased ing value is increased or decreased by the value 1.
depending on the edge sequence at both inputs (direction
of rotation: encoder – track A and B). CATCH input: E 62,02
If one of the two channels is defective or not connect-
ed, then the counter value constantly changes between
+1 and –1.

7 7-32 907 PC 331 / Issued: 08.99


FAST COUNTER CTUH

Using operating modes 1 and 2, two fast counters can R-Q BINARY
operate in a program at the same time. However, if a fast
The signal 1 resets output Q.
counter of operating mode 3 has already been programmed,
no further fast counter independent on the operating mode Q BINARY
can be processed in the program. The counter value has one zero crossing.
Q =1 if CV changes from –1 to 0 or from 0 to –1.
R BINARY CV WORD
The signal 1 sets the counter value in CV and the value Current value of the counter.
stored in SPCV to 0. This input has highest priority.
R = 1 → CV = 0
SPCV = 0 SPCV WORD

S BINARY Value stored by SP or RPI and the CATCH inputs.

The signal 1 sets the counter to the value specified at Value range:
INIT. Integer word (16 bits)
S = 1 → CV = INIT Lower limit: 8000H -32768
Upper limit: 7FFFH +32767
INIT WORD
Start value for the fast counter.

RPI BINARY
The signal 1 enables the CATCH inputs. RPI has the
higher priority than SP.
RPI = 0 → The CATCH inputs are
disabled
RPI = 1 → A positive edge at the CATCH
inputs E 62,02 or E 62,03
stores the value in SPCV.
The counter is reset.

SP BINARY
The signal 1 enables the CATCH inputs.
SP = 0 → The CATCH inputs are disabled.
SP = 1 → A positive edge at the CATCH inputs E 62,02
or E 62,03 stores the value in SPCV.
The counter is not reset.

907 PC 331 / Issued: 08.99 7-33


7
CTUH FAST COUNTER
Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

CTUH
DIREKT-KONS Y N Y 0 00 #num Q 00 0 Y N Y BIT_OUT
BIT_IN Y N Y 0 00 R CV 00 0 Y N Y WORT_OUT
BIT_IN Y N Y 0 00 S SPCV 00 0 Y N Y WORT_OUT
WORT_IN Y N Y 0 00 INIT
BIT_IN Y N Y 0 01 RPI
BIT_IN Y N Y 0 01 SP
BIT_IN Y N Y 0 01 R-Q

Source

SN ZN Command / Variable Symbol Long text

00000 00000 !BA 000


00001 CUTH
00002 PP 00 #num
00003 PP 00 R
00004 PP 00 S
00005 PP 00 INIT
00006 PP 00 RPI
00007 PP 00 SP
00008 PP 00 R-Q
00009 PP 00 Q
00010 PP 00 CV
00011 PP 00 SPCV

7 7-34 907 PC 331 / Issued: 08.99


READ DIRECT INPUTS DI

The function block DI directly reads in o n e binary value


from an input of the basic unit or its local expansion. This
input is specified at terminal IN. FBD/LD
DI
This function is useful
ENA
– if the cycle time is too long IN
– if the capacity utilization of the basic unit is too high.

Parameters
ENA BIT E, A, M, K, S Enable
IN BIT E Input which has to be updated

Available as of: Advant Controller 31, series 40 and 50

Description
At the beginning of each program cycle, the PLC process Using the function blocks DI and DO, a shorter terminal-
automatically generates a current process image of all in- terminal reaction at the selected direct inputs and outputs
puts. The block is used to update one input selected at IN can be reached.
within the process image during the program cycle. At in-
put IN, only the direct inputs and the inputs of the local Boundary conditions:
expansion must be programmed. – recommended only for standalone PLC processes
This can be necessary for special applications in order to – recommended only for large cycle time
acquire and process signal changes at the direct inputs
and the inputs of the local expansion more than one time – only reasonable for high capacity utilization of the
per cycle. PLC

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

DI
BIT_IN Y N Y 0 00 ENA
BIT_IN Y N Y 0 00 IN

Source

SN ZN Command / Variable Symbol Long text


00000 00000 !BA 000
00001 DI
00002 PP 00 ENA
00003 PP 00 IN

907 PC 331 / Issued: 08.99 7-35


7
DI READ DIRECT INPUTS

7 7-36 907 PC 331 / Issued: 08.99


READ DIRECT INPUTS DIN

FBD/LD IL

DIN DIN !BA 0


DIN

Description The function block is useful


With the help of the CS31 bus processor, the function ● with stand–alone PLC processors
block DIN reads all of the direct inputs of the PLC proces- ● if the cycle time is long
sor. The direct inputs are those inputs, which are directly ● if the capacity utilization of the PLC is high
available at the terminals of the PLC processor.

Use: Example:
The PLC processor automatically builds an updated pro-
cess image of the direct inputs at the start of each pro- – Cycle time: 80 ms
gram cycle. The DIN function block is able to create addi- – Capacity utilization: 95%
tional updates of the process image of the direct inputs – 3 DIN + 3 DOUT blocks distributed regularly over
within program cycles. This may be required in conjunc- the PLC program
tion with specific applications, in order to detect and pro- (i.e. after 20 ms, 40 ms and 60 ms)
cess signal changes of the direct inputs more than once
per program cycle.
In this example, the direct inputs of the PLC processor are
If the DIN and DOUT function blocks are used, the termi- read every 20 ms. The updated values of the direct out-
nal-to-terminal reaction time between direct inputs and di- puts are provided with the same frequency. See the figure
rect outputs can be reduced. below for illustration.

Cycle time: 80 ms, capacity utilization: 95%


Read inputs Write outputs

D D D D D D
O I O I O I
U N U N U N P
T T T E

0 ms 20 ms 40 ms 60 ms 80 ms

____________________________________________________________________________________________
CE Data
Runtime:
Stand-alone PLC:
07 KR 91, 07 KT 93: < 0.2 ms
07 KT 92: < 1 ms
additional with MASTER or SLAVE PLC: up to 4.8 ms
Output updating: –––
Number of historical values: 0 words
Available as of: ABB Procontic CS31, 07 KT 93, 07 KT 92 d, 07 KR 91 d

907 PC 331/Issued: 11.98 8–1


DMUX DEMULTIPLEXER

This function block connects one of the inputs E0...En–1


to the output A depending on the input INDX.
FBD/LD IL

!BA 0
DMUX
DMUX
INDX INDX
#n INOK #n
E0 A E0
INOK
A

____________________________________________________________________________________________

Parameters
INDX WORD EW, AW, MW, KW Index input
#n DIRECT #, #H Quantity n of word inputs E0 ... En–1
CONSTANT
E0 WORD EW, AW, MW, KWWord input capable of duplication
INOK BINARY A, M Range monitoring of the index input
A WORD AW, MW Word output to which one of the inputs E0...En–1 is
switched through.
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 36 µs
Additional runtime: none
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The following applies:


This function block connects one of the inputs E0...En–1 INDX = 1: E0 –> A
to the output A depending on the input INDX. INDX = 2: E1 –> A
INDX = 3: E2 –> A
The value at the input INDX is monitored for validity. The : : : :
output A is set to 0 if the word input INDX is not within the INDX = n: En–1 –> A
valid range. where: 1 < INDX < n < 32767 (theoretically)

Relationship between E0...En–1, INDX and A: The output A is set to 0 if the input INDX = 0.

The input INDX is used to define which of the inputs INDX WORD
E0...En–1 is connected to the output A. Index input for selection of one of the inputs E0...En–1.
The following applies:
1 < INDX < n (Number of inputs E0...En–1)
Note:
INDX = 0 –> Initialization of the output A with 0.

8–2 907 PC 331/Issued: 11.98


DEMULTIPLEXER DMUX

#n DIRECT CONSTANT A WORD


Quantity n of word inputs E0...En–1 Output to which one of the inputs E0...En–1 is switched
through.
E WORD
Input E0 ... En–1 capable of duplication By means of the input INDX, one of the inputs E0...En–1
is selected and its value is allocated to the output A. The
One of the inputs E0 ... En–1 is connected to the output A is set to 0 if the word input INDX is not within the
output A. valid range.

INOK BINARY
Range monitoring for the input INDX

The output INOK indicates whether or not the input INDX


is within the valid range. The outputs INOK and A are set
to 0 if the word input INDX is not within the valid range.

The following applies:


INOK = 1 –> INDX in the valid range
INOK = 0 –> INDX in the invalid range –> A = 0

Valid range for the index: 1 < INDX < n

907 PC 331/Issued: 11.98 8–3


DMUX DEMULTIPLEXER

Example

FBD/LD IL

!BA 0
DMUX
DMUX
MW 00,00 INDX MW 00,00
# 2 #n # 2
MW 00,01 E0 MW 00,01
MW 00,02 E1 INOK M 00,00 MW 00,02
A MW 00,03 M 00,00
MW 00,03

CE FBD Definition

DMUX
INDX
#n INOK
E A

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

INDX E W N P Y 0 0
#n K W N P Y 0 0
E E W N P Y 1 0
INOK A L N P Y 0 0
A A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 DMUX
00002 PP 0 INDX Index (WORD)
00003 PP 0 #n # Quantity (#)
[ 1
00004 PP 1 E Input (WORD)
] 1
00005 PP 0 INOK Output ’index valid’ (BINARY)
00006 PP 0 A Output (WORD)

8–4 907 PC 331/Issued: 11.98


DEMULTIPLEXER DOUBLE WORD DMUXD

This function block connects one of the inputs E0...En–1


to the output A depending on the input INDX.
FBD/LD IL

!BA 0
DMUXD
DMUXD
INDX INDX
#n #n
E0 INOK E0
A
INOK
A

____________________________________________________________________________________________

Parameters
INDX WORD EW, AW, MW, KW
Index input
#n DIRECT #, #H Quantity n of the double word inputs
E0 ... En–1
E0 DOUBLE WORD MD, KD Double word inputs E0 ... En–1;
the input E0 is capable of duplication.
NOK BINARY A, M Range monitoring of the index input
A DOUBLE WORD MD Double word output to which one of the inputs
E0 ... En–1 is switched through.
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 38 µs
Additional runtime: none
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Note: The output A is is set to 0 if the input INDX = 0.


This function block connects one of the inputs E0...En–1 INDX WORD
to the output A depending on the input INDX. Index input for selection of one of the inputs
E0 ... En–1.
The value at the input INDX is checked for validity. The
output A is set to 0 if the word input INDX is not within the The following applies:
valid range. 1 < INDX < n (number of inputs E0 ... En–1)
Relationship between E0 ... En–1, INDX and A:
Note:
The input INDX is used to define which of the inputs INDX = 0 –> Initialization of the output A with 0.
E0 ... En–1 is connected to the output A.
The following applies: #n DIRECT CONSTANT
Quantity n of double word inputs E0 ... En–1.
INDX = 1 : E0 –> A
INDX = 2 : E1 –> A
INDX = 3 : E2 –> A
: : : :
INDX = n : En–1 –> A

where: 1 < INDX < n < 32767 (theoretically)

907 PC 331/Issued: 11.98 8–5


DMUXD DEMULTIPLEXER DOUBLE WORD

E DOUBLE WORD
Input E0 ... En–1 capable of duplication.

One of the n inputs E0 ... En–1 is connected to the output


A.

INOK BINARY
Range monitoring for the input INDX

The output INOK indicates whether or not the input INDX


is within the valid range. The outputs INOK and A are set
to 0 if the word input INDX is not within the valid range.

The following applies:


INOK = 1 –> INDX within the valid range
INOK = 0 –> INDX in the invalid range –> A = 0

Valid range for the index: 1 < INDX < n

A DOUBLE WORD
Output to which one of the n inputs E0...En–1 is switched
through.

By means of the input INDX, one of the inputs E0...En–1


is selected and its value is allocated to the output A. The
output A is set to 0 if the input INDX is not within the valid
range.

8–6 907 PC 331/Issued: 11.98


DEMULTIPLEXER DOUBLE WORD DMUXD

Example

FBD/LD IL

!BA 0
DMUXD
DMUXD
MW 00,00 INDX MW 00,00
# 2 #n # 2
MD 00,01 E0 MD 00,01
MD 00,02 E1 INOK M 00,00 MD 00,02
A MD 00,03 M 00,00
MD 00,03

CE FBD Definition

DMUXD
INDX
#n
E INOK
A

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

INDX E W N P Y 0 0
#n K W N P Y 0 0
E E D N P Y 1 0
INOK A L N P Y 0 0
A A D N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 DMUXD
00002 PP 0 INDX Index (WORD)
00003 PP 0 #n Quantity (#)
[ 1
00004 PP 1 E Input (DOUBLE WORD)
] 1
00005 PP 0 INOK Output ’index valid’ (BINARY)
00006 PP 0 A Output (DOUBLE WORD)

907 PC 331/Issued: 11.98 8–7


DO WRITE DIRECT OUTPUTS

The function block DO directly reads out one binary value


at a direct output of the basic unit or its local expansion.
This output is specified at terminal OUT. FBD/LD
This function is useful DO
ENA OUT
– if the cycle time is too long
– if the capacity utilization of the basic unit is too high

Parameters
ENA BIT E, A, M, K, S Enable
OUT BIT A Output which has to be updated

Available as of: Advant Controller 31, series 40 and 50

Description
During the program processing, the PLC process genera- Using the function blocks DI and DO, a shorter terminal-
tes a current process image of all outputs. At the cycle terminal reaction at the selected direct inputs and outputs
end, the values of the output image are assigned to the can be reached.
individual output addresses.
Boundary conditions:
The block is used to update one output selected at OUT
– recommended only for standalone PLC processes
during the program cycle.
– recommended only for large cycle time
At output OUT, only the direct outputs and the outputs of
the local expansion must be programmed. – only reasonable for high capacity utilization of the PLC
This can be necessary for special applications in order to
read out the output signal changes more than one time per
PLC cycle or in a faster way via the direct/local outputs.

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

DO
BIT_IN Y N Y 0 00 ENA OUT 00 0 Y N Y BIT_OUT

Source

SN ZN Command / Variable Symbol Long text


00000 00000 !BA 000
00001 DO
00002 PP 00 ENA
00003 PP 00 OUT

7 8-8 907 PC 331 / Issued: 08.99


WRITE DIRECT OUTPUTS DOUT

FBD/LD IL

DOUT DOUT !BA 0


DOUT

Description The function block is useful


With the help of the CS31 bus processor, the function ● with stand–alone PLC processors
block DOUT writes all of the direct outputs of the PLC pro- ● if the cycle time is long
cessor. The direct outputs are those outputs, which are ● if the capacity utilization of the PLC is high
directly available at the terminals of the PLC processor.

Use: Example:
The PLC processor automatically outputs a process
image of the direct outputs, which was updated during the – Cycle time: 80 ms
program cycle, at the end of each program cycle. The – Capacity utilization: 95%
DOUT function block is able to output additional updates – 3 DIN + 3 DOUT blocks distributed regularly over
of the process image of the direct outputs within program the PLC program
cycles. This may be required in conjunction with specific (i.e. after 20 ms, 40 ms and 60 ms)
applications, in order to have available signal changes of
the direct outputs more than once per program cycle.
In this example, the direct inputs of the PLC processor are
If the DIN and DOUT function blocks are used, the termi- read every 20 ms. The updated values of the direct out-
nal-to-terminal reaction time between direct inputs and di- puts are provided with the same frequency. See the figure
rect outputs can be reduced. below for illustration.

Cycle time: 80 ms, capacity utilization: 95%


Read inputs Write outputs

D D D D D D
O I O I O I
U N U N U N P
T T T E

0 ms 20 ms 40 ms 60 ms 80 ms

____________________________________________________________________________________________

CE Data
Runtime:
Stand-alone PLC:
07 KR 91, 07 KT 93: < 0.2 ms
07 KT 92: < 1 ms
additional with MASTER or SLAVE PLC: up to 4.8 ms
Output updating: –––
Number of historical values: 0 words
Available as of: ABB Procontic CS31, 07 KT 93, 07 KT 92 d, 07 KR 91 d

907 PC 331/Issued: 11.98 8–9


OUPUT OF ASCII CHARACTERS AND HEX VALUES
DRUCK THROUGH A SERIAL INTERFACE

The DRUCK function block outputs texts and values of


operands stored in the PLC program through a serial in-
terface. FBD/LD IL

The numeric values to be output are conditioned for a di-


versity of representations by specifying a format identifi- !BA 0
er. DRUCK DRUCK
FREI FREI
SSK TXNR
TXNR SSK
TX0 RDY RDY
TX0

____________________________________________________________________________________________

Parameters
FREI BINARY A, E, S, M Enable signal for output of one text (0–>1–edge)
SSK WORD AW, EW, MW, KW Interface identifier; Number of the serial interface
TXNR WORD AW, EW, MW, KW Text number; number of the text to be output
TX0 ALL texts Texts; input for the texts; input can be duplicated
RDY BINARY A, E, M Ready; block is ready for output of a text
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: not available 374 µs
Additional runtime: not available 63 µs per character
Output updating: yes yes
Number of historical values: 1 word 1 word
Available as of: ABB Procontic CS31 /
Comm. module 07 KP 62 07 KR 31 V 2.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description ing so, the interface driver interprets the display formats
for the operand values and converts them to the required
The DRUCK function block outputs texts and values of display format before output.
operands stored in the PLC program through a serial in-
terface. Initialization of the serial interface

The numeric values to be output are conditioned for a di- Before the DRUCK block can communicate with one of
versity of representations by specifying a format identifi- the possible serial interfaces, it must be initialized with the
er. SINIT block.

The texts and operand identifiers to be output are stored Apart from the required interface parameters, a freely de-
in the user program in the PLC directly after the DRUCK finable end of text character is specified when using the
block. SINIT block in order to mark the end of the overall text/te-
legram to be sent. Whether or not the end of text charac-
The texts each have a text number for identification. ter is to be output through the interface is also specified in
the SINIT block.
The DRUCK block writes texts and operand values to be
output to a buffer from where they are fetched by an inter- The data flow is synchronized principally by way of the
face driver and output through the serial interface. In do- RTS and CTS signals.

8–10 907 PC 331/Issued: 11.98


OUPUT OF ASCII CHARACTERS AND HEX VALUES
THROUGH A SERIAL INTERFACE DRUCK

Serial Interfaces of the central units


Following serial interfaces can be used by the DRUCK
block:
Central unit 07 KR 91: COM1
Central unit 07 KT 92: COM1, COM2
Communication Processor 07 KP 62: COM1, COM2
Central unit 07 KR 31: COM1

S BUFFER 2

S BUFFER 1 COM2

COM1

Communication
software
Text V24
DRUCK

End of text
character
256 Bytes

The S buffers 1 and 2 are the


send buffers which are
assigned to the serial
interfaces COM1 and COM2.

907 PC 331/Issued: 11.98 8–11


OUPUT OF ASCII CHARACTERS AND HEX VALUES
DRUCK THROUGH A SERIAL INTERFACE

Brief overview of the block’s parameters After the first call of the block or after termination of a text
output, the following applies:
FREI RDY TXNR SSK MEANING
RDY = 1
0/1–EDGE 1 2 1 The text with the
number 2 is output
through interface 1
The block is now ready for output of a new text.

The RDY signal can be used to activate a new text trans-


fer with the FREI input, for example.
0/1–EDGE 0 2 1 0/1–edge is ignored
because the block
is not rea-dy
Storage of texts in the central unit

no 0/1–EDGE X X X No output of a new Storage: Directly after the DRUCK block


text

Quantity: 1...99

Length: Up to 256 characters (owing to the send


FREI BINARY buffer length = 256)
A 0 –> 1 edge at the FREI input results in output of one
text provided the block is ready to do this (RDY = 1).
In this case, the following applies to the length of the texts:
If a 0 –> 1 edge appears at the FREI input although the
RDY output is equal to 0, i.e. the block is not yet ready for ● 07 KR 91 / 07 KT 92 / 07 KT 93:
a new transfer, the 0 –> 1 edge will be ignored. Therefore,
no new text transfer can be started as long as the RDY – Each text character counts as 1 character
signal is 0.
– Each format identifier counts as 3 characters
SSK WORD
The number of the interface through which the text is to be – Each bit operand counts as 1 character
output is specified at the SSK input.
The following applies:
– Each word operand counts as 2 characters
COM1: number = 1
COM2: number = 2
– Each double word operand counts as 4 characters
TXNR WORD
The number of the text to be output is specified at the ● 07 KR 31:
TXNR input.
– Each text character counts as 1 character
1...99 texts are possible in a DRUCK block. The number
of the text to be output must be present at the TXNR input – Each bit operand counts as 1 character
until the block indicates the end of text transfer with a 1
signal at its RDY output.
– Each word operand counts as 1 to 6 characters *

RDY BINARY
– Each double word operand counts as
In the program cycle in which the block is called for the 10 to 11 characters *
first time, and during the time when a text is output, the
following applies:
RDY = 0. When the program is started, the PLC checks the texts to
determine whether or not the maximum length is exceed-
As long as RDY is equal to 0, no new text output can be ed.
activated and any 0 –> 1 edge present at the FREI input
will be ignored and will be lost. * depends on format

8–12 907 PC 331/Issued: 11.98


OUPUT OF ASCII CHARACTERS AND HEX VALUES
THROUGH A SERIAL INTERFACE DRUCK

Syntax (structure) of texts


A text for the DRUCK block consists of:

– The text number


– One or several subtexts (optional)
– Operands with format identifier (optional)

Syntax diagram of texts

#n #” Subtext ”#

# Format identifier Operand

#n : Number of the text to be entered as a Format identifier:The format identifier specifies the type
direct constant (1...99). of the operand and the display format
#” : Start identifier for text input. of its value. The format identifier is a
3–digit number. The 1st digit from the
”# : End identifier for text input (only in ter- left specifies the operand type. There
minal mode). are 3 operand types:
Caution: This end identifier is not spe-
cified when using the ABB Procontic Binary 1
programming system. Only when texts Word : 2
are entered directly in the PLC in termi- Double word: 3
nal mode do these have to be termi-
nated with this identifier. Numbers 2 and 3 define the display for-
Subtext: All ASCII characters 0...7F. The cha- mat.
racter ASCII <NUL> is an exception for
07 KR 91 / 07 KT 92 / 07 KT 93. This Operand: Binary, word or double word operands
character is used as a prefix for the for- whose values are output depending on
mat identifier in the send buffer. the display format.

907 PC 331/Issued: 11.98 8–13


OUPUT OF ASCII CHARACTERS AND HEX VALUES
DRUCK THROUGH A SERIAL INTERFACE

Input of texts Note:


Two text input cases can be distinguished:
The characters with the ASCII code >20H or >32D must
be entered with the keyboard. As an example, the charac-
– Input of texts in the ABB Procontic programming sys-
ter ”!” must be entered with the keyboard, and not as \033.
tem
– Input of texts directly in the PLC using a terminal Characters, which are no special characters and which
also could not be entered with the keyboard, can be gene-
Input of texts in the ABB Procontic programming sy- rated in the following way:
stem Press and hold down the <ALT> key, now type the nume-
rical code (decimal code) on the numeric keypad of the
On input into the programming system, the following parts
keyboard, then release the <ALT> key.
of the overall text are treated as independent operands:
– the text number e.g. #1 The character with the ASCII code 255 is reserved for in-
– a subtext e.g. #” Text1 ternal use of the programming software and must not be
– a format identifier e.g. # 203 used otherwise.
– an operand e.g. MW 2,3
– a further subtext e.g. #” Text2
In the function block diagram, each of these parts occu-
pies one of the inputs TX0...TXn at the symbol of the
DRUCK block.
Input of special characters for screen or printer control:
Control characters such as “line feed” <LF> or “carriage
return” <CR> are needed to arrange the text when output
to a screen or printer. These special characters can be
placed anywhere within a subtext. In the programming
system, these special characters are entered by means
of:
\Numerical value of the character
The numerical value of the character is specified as a
three–digit decimal number.

Example:
The following output is to be made on a printer:
First line
Blank line
Second line
To do this, the following text must be planned:
First line <CR> <LF> <LF> second line
The following applies:
<CR> = 013
<LF> = 010
The text input in the programming system is as follows:
#”First line\013\010\010second line

8–14 907 PC 331/Issued: 11.98


OUPUT OF ASCII CHARACTERS AND HEX VALUES
THROUGH A SERIAL INTERFACE DRUCK

Example
The text with the number 1 is to be planned in the
DRUCK block. The text consists of two subtexts (text
1 and text 2). The value of the word flag MW 2,3 is to
be output as a three–digit number (format 03) be-
tween these subtexts.

#1#”Text1#203MW02,03#”Text2
Subtext 2
Operand
Format identifier
Subtext 1
Text number 1 ... 99

FBD/LD IL

!BA 0
DRUCK
DRUCK
M 00,00 FREI M 00,00
MW 00,00 SSK MW 00,01
MW 00,01 TXNR MW 00,00
# 1 TX0 RDY A 00,00 A 00,00
#”TEXT1 TX1 # 1
# 203 TX2 #”TEXT1
MW 02,03 TX3 # 203
#”TEXT2 TX4 MW 02,03
#”TEXT2

Further texts can be planned with numbers 2...99. The


text with the serial number 2 is planned in the same way
as from the input TX5. In this case, the number of the next
text (#2) is specified at the input TX5.

907 PC 331/Issued: 11.98 8–15


OUPUT OF ASCII CHARACTERS AND HEX VALUES
DRUCK THROUGH A SERIAL INTERFACE

Input of texts with a terminal directly into the PLC Characteristics: Texts for the DRUCK block

If no ABB Procontic programming system is available to Storage: Directly after the DRUCK block
the user, he can enter his PLC program directly into the Quantity: 1...99
PLC as an instruction list (IL) using a terminal, or can read
it out. Length: Up to 256 characters (owing to their
send buffer length = 256)
In doing so, the texts are entered directly after the In this case, the following applies to the length of the texts:
DRUCK block, i.e. the text is entered as from the program
memory address following the operand at the RDY out- ● 07 KR 91 / 07 KT 92 / 07 KT 93:
put.
– Each text character counts as 1 character
Input of texts directly in the PLC – Each format identifier counts as 3 characters

When entering texts directly in the PLC, the user must – Each bit operand counts as 1 character
pay attention to the syntax rules for text formatting. – Each word operand counts as 2 characters
A text for the DRUCK block consists of: – Each double word operand counts as 4 characters
● 07 KR 31:
– the text number
– one or several subtexts (optional) – Each text character counts as 1 character
– operand with format identifier (optional)
– Each bit operand counts as 1 character
Texts are entered in the PLC within the “enter/edit user – Each word operand counts as 1 to 6 characters *
program” mode (see also System Description ABB Pro-
contic CS31, Vol. 7.3, ”Programming and Diagnosis Unit – Each double word operand counts as
TCZ”, chapter “Operating and test functions”). 10 to 11 characters *
The program editing (PA) function checks texts to ensure
Entered texts or subtexts (special characters are also that they will not exceed the maximum length.
possible) are embedded in the special characters #” (start
of text input) and “# (end of text input). * depends on format
____________________________________________________________________________________________

Syntax diagram of texts

#n #” Subtext ”#

# Format identifier Operand

#n : Number of the text to be entered as a direct terminal mode do these have to be terminated with
constant (1...99). this identifier.
#” : Start identifier for text input.
Subtext:
”# : End identifier for text input in terminal mode. All ASCII characters 0...7F. The character ASCII <NUL>
Caution: This end identifier is not specified when is an exception for 07 KR 91 / 07 KT 92 / 07 KT 93. This
using the ABB Procontic programming system. character is used as a prefix for the format identifier in the
Only when texts are entered directly in the PLC in send buffer.

8–16 907 PC 331/Issued: 11.98


OUPUT OF ASCII CHARACTERS AND HEX VALUES
THROUGH A SERIAL INTERFACE DRUCK

Format identifier:The format identifier specifies the type – If the user wishes a different processing sequence, this
of the operand and the display format must be planned by appropriate mutual interlocking of
of its value. The format identifier is a the DRUCK blocks.
3–digit number. The 1st digit from the
left specifies the operand type. There Communication by a DRUCK block and an EMAS
are 3 operand types: block with the same serial interface
A DRUCK block and an EMAS block may use the same
Binary: 1 serial interface without the need for special precautions.
Word: 2
Double word: 3 Display formats for numerical values to be output
The PLC is capable of presenting the numerical values to
Numbers 2 and 3 define the display for- be output on a screen or a printer in diverse ways.
mat.
Operand: Binary, word or double word operands The display format for a numerical value is defined by the
whose values are output depending on format identifier. This is planned directly before the flag to
the display format. be output and consists of three digits. It is defined as fol-
lows:
Correcting a character during text input with a termi-
nal Format identifier: The format identifier specifies the type
An incorrect character can not be corrected when enter- of the operand and the display format
ing a text on terminal. To correct the text input it must be of its value. The format identifier is a
terminated with the end of text input identifier ”# and the three–digit number. The first digit from
program must be terminated by pressing <CR>. By pro- the left specifies the operand type.
gram input, you must restart at the address of the charac- There are three operand types:
ter you wish to correct. Text input then begins with the
start of text input identifier #”. Binary: 1
Word: 2
Input of texts containing more than 80 characters on Double word: 3
a terminal
When making a text input, a maximum of 80 characters Digits 2 and 3 define the display for-
can be displayed in each line of the screen. If the text is mat.
more than 80 characters long, text input must be con-
Examples: ● Format identifier 103
cluded at the end of the screen line by means of the end of
– Digit 1: 1: Binary operand
text input identifier ”# and you must move to the next line
– Digits 2 and 3: 03: Display format 03
in the screen by entering the semicolon (;). Now continue
(see table)
text input with the start of text input identifier #”.
Communication between several DRUCK blocks and
the same serial interface ● Format identifier 204
Several DRUCK blocks may use the same serial interface – Digit 1: 2: Word operand
without the need for taking special precautions. If the seri- – Digits 2 and 3: 04: Display format 04
al interface is occupied by a DRUCK block, the other (see table)
DRUCK blocks automatically wait until it is free again.
– If several DRUCK blocks wish to access the same inter- ● Format identifier 341
face simultaneously, the DRUCK block located nearest – Digit 1: 3: Double word
to the front in the user program is given access. There- operand
fore, the order of priority corresponds to the sequence in – Digits 2 and 3: 41: Display format 41
which the DRUCK blocks are called in the user program. (see table)

907 PC 331/Issued: 11.98 8–17


OUPUT OF ASCII CHARACTERS AND HEX VALUES
DRUCK THROUGH A SERIAL INTERFACE

Display formats Displ. form. Display Numerical ASCII


identifier format example output
All possible display formats are listed in the following ta-
ble. With the exception of the special indentifiers 98 and Leading zeros substituted by blanks (in this
99, all identifiers are applicable to the binary, word and example, blanks are indicated by _ ).
double word data types.
17 x 00234 –––– 4
18 xx ––– 34
19 xxx –– 234
20 xxxx –– 234
Possible display formats 21 xxxxx –– 234
63 x 0087654321 ––––––––– 1
Displ. form. Display Numerical ASCII 64 xx –––––––– 21
identifier format example output 65 xxx ––––––– 321
66 xxxx –––––– 4321
Format with leading zeros 67 xxxxx ––––– 54321
68 xxxxxx –––– 654321
69 xxxxxxx ––– 7654321
70 xxxxxxxx –– 87654321
01 x 0012345678 8 71 xxxxxxxxx –– 87654321
02 xx 78 72 xxxxxxxxxx –– 87654321
03 xxx 678
04 xxxx 5678 22 xxxx,x 00347 –– 34,7
05 xxxxx 45678 23 xxx,xx –– 3,47
37 xxxxxx 345678 24 xx,xxx –– ,347
38 xxxxxxx 2345678 25 x,xxxx – ,0347
39 xxxxxxxx 12345678 26 ,xxxxx ,00347
40 xxxxxxxxx 012345678 27 +/– xxxxx + –– 347
41 xxxxxxxxxx 0012345678 28 +/– xxxx,x + –– 34,7

06 xxxx,x 02215 0221,5 73 xxxxxxxxx,x 0012345678 –– 1234567,8


07 xxx,xx 022,15 74 xxxxxxxx,xx –– 123456,78
08 xx,xxx 02,215 75 xxxxxxx,xxx –– 12345,678
09 x,xxxx 0,2215 76 xxxxxx,xxxx –– 1234,5678
10 ,xxxxx ,02215 77 xxxxx,xxxxx –– 123,45678
78 xxxx,xxxxxx –– 12,345678
42 xxxxxxxxx,x 0011223344 001122334,4 79 xxx,xxxxxxx –– 1,2345678
43 xxxxxxxx,xx 00112233,44 80 xx,xxxxxxxx –– ,12345678
44 xxxxxxx,xxx 0011223,344 81 x,xxxxxxxxx – ,012345678
45 xxxxxx,xxxx 001122,3344 82 ,xxxxxxxxxx ,0012345678
46 xxxxx,xxxxx 00112,23344 83 +/– xxxxxxxxxx + –– 12345678
47 xxxx,xxxxxx 0011,223344 84 +/– xxxxxxxxx,x + –– 1234567,8
48 xxx,xxxxxxx 001,1223344
49 xx,xxxxxxxx 00,11223344
50 x,xxxxxxxxx 0,011223344 Format Display Numerical ASCII
51 ,xxxxxxxxxx ,0011223344 identifier format example output

11 +/– xxxxx 00331 +00331 Addtional formats with suppression of


12 +/– xxxx,x +0033,1 leading zeros
13 +/– xxx,xx +003,31
14 +/– xx,xxx +00,331 29 xxxxx 00839 839
15 +/– x,xxxx +0,0331 30 xxxx,x 83,9
16 +/– ,xxxxx +,00331 31 xxx,xx 8,39
32 xx,xxx ,839
52 +/– xxxxxxxxxx 0055667788 +0055667788 33 +/– xxxxx +839
53 +/– xxxxxxxxx,x +005566778,8 34 +/– xxxx,x +83,9
54 +/– xxxxxxxx,xx +00556677,88 35 +/– xxx,xx +8,39
55 +/– xxxxxxx,xxx +0055667,788 36 +/– xx,xxx +,839
56 +/– xxxxxx,xxxx +005566,7788
57 +/– xxxxx,xxxxx +00556,67788 85 xxxxxxxxxx 0000000321 321
58 +/– xxxx,xxxxxx +0055,667788 86 xxxxxxxxx,x 32,1
59 +/– xxx,xxxxxxx +005,5667788 87 xxxxxxxx,xx 3,21
60 +/– xx,xxxxxxxx +00,55667788 88 xxxxxxx,xxx ,321
61 +/– x,xxxxxxxxx +0,055667788 89 +/– xxxxxxxxxx +321
62 +/– ,xxxxxxxxxx +,0055667788 90 +/– xxxxxxxxx,x +32,1
91 +/– xxxxxxxx,xx +3,21
92 +/– xxxxxxx,xxx +,321

8–18 907 PC 331/Issued: 11.98


OUPUT OF ASCII CHARACTERS AND HEX VALUES
THROUGH A SERIAL INTERFACE DRUCK

Special format: Output of a word Formats available in 07 KR 31:


operand’s HEX value
Bit: 101
The value of a word operand is output directly as a hexa-
decimal value. Therefore, the value is not converted to Words: 205...211
ASCII before output. 211...216
217...221
98 Only the LOW BYTE (8 bits) of the word 233...236
operand is output 222...226
99 The LOW BYTE of the word operand is out- 299
put first, followed by its HIGH BYTE
Double words:
Important:This special format is only permissible for 341...351
the “WORD” data type. 352...362
Permissible: 298 and 299
Inadmissible: 198, 199, 398 and 399
____________________________________________________________________________________________
Example: Input of a text in the user program and output through the interface
The folowing text is to be output:
Text–No.: 3
Subtext 1: DISTANCE
Value of the flag: MW0,0
Output format: 3–digit with leading zeros
Subtext 2: KM

User Meaning Output through the


Input serial interface
____________________________________________________________________________________________
#3 Text–No. 3, direct constant –––
#” Identifier for the start of text input –––
D Letter in ASCII 44H
I Letter in ASCII 49H
. . . . .
. . . . .
. . . . .
C . . . 43H
E . . . 45H
”# *) Identifier for the end of text input –––
#203 Type, format identifier as a direct constant –––
Type: Word, Format: 03
MW0,0 Contents of MW0,0 Formatted decimal value of the
flag MW0,0 in ASCII
#” Identifier for the start of text input –––
K Letter in ASCII 4BH
M ” ” 4DH
”# *) Identifier for the end of text input –––

End of text character (e.g. <CR>) if this is 0DH


planned in the SINIT block and is enabled for output

*) The end identifier ”# is dropped if input is made into the ABB Procontic programming system. The end identifier ”# is needed only when making inputs
directly into the PLC using a terminal.

907 PC 331/Issued: 11.98 8–19


OUPUT OF ASCII CHARACTERS AND HEX VALUES
DRUCK THROUGH A SERIAL INTERFACE

Example of end of text characters to be specified in


the SINIT block
<ETX> = 03H = 3
<EOT>= 04H = 4
<CR> = 0DH = 13
<LF> = 0AH = 10
<SP> = 20H = 32
. . .
. . .
. . .

Effective data transmission rate when using the


DRUCK block
Not available for 07 KR 31.
The effective data transmission rate (charcters actually
output through the serial interface) essentially depends
on the load on the PLC and the set baud rate.
The following relationship roughly applies:
Marginal condition: set baud rate: 9600 baud
Baud

1000
900
800
700
600
500
400
300
200
100

10 20 30 40 50 60 70 80 90 100

Load in %

Important: The load indication (command AL) is correct


only if no communication is taking place
through the serial interface at the time of indi-
cation. Communication adulterates the load
indication and it is therefore useless. If a user
program contains the DRUCK or EMAS
block, these must be disabled when deter-
mining the load.

8–20 907 PC 331/Issued: 11.98


OUPUT OF ASCII CHARACTERS AND HEX VALUES
THROUGH A SERIAL INTERFACE DRUCK

CE FBD Definition

DRUCK
FREI
SSK
TXNR
TX RDY

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P J 0 0
SSK E W N P J 0 0
TXNR E W N P J 0 0
TX E X N P J 1 0
RDY A L N P J 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 DRUCK
00002 PP 0 FREI Input BINARY (block enable)
00003 PP 0 TXNR Input WORD (text number)
00004 PP 0 SSK Input WORD (interface identifier)
00005 PP 0 RDY Output BINARY (Ready)
[ 1
00006 PP 1 TX Input ALLE (No., text, format, 0)
] 1

907 PC 331/Issued: 11.98 8–21


OUPUT OF ASCII CHARACTERS AND HEX VALUES
DRUCK THROUGH A SERIAL INTERFACE

8–22 907 PC 331/Issued: 11.98


DIFFERENTIATOR WITH DELAY OF THE 1ST ORDER DT1

The controlled variable x is multiplied by the proportional


coefficient KP. The proportional coefficient is specified as
a percentage. If the controlled variable no longer FBD/LD IL
changes, the manipulated variable y moves towards the
value 0 in an e function. The time constant T1 specifies
the time when the step response has dropped to approxi- !BA 0
mately 37% of its initial value. The value has dropped be- DT1 DT1
low 1% after 5*T1. x x
KP KP
T1/T y T1/T
y

____________________________________________________________________________________________

Parameters
x WORD EW, AW, MW, KW Controlled variable
KP WORD EW, AW, MW, KW Proportional coefficient, specified as a percentage
T1/T WORD EW, AW, MW, KW Time constant scaled to cycle time
y WORD AW, MW Manipulated variable
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 200 µs
Additional runtime: none
Output updating: yes
Number of historical values: 4 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
Transfer function:
The controlled variable x is multiplied by the proportional
coefficient KP. The proportional coefficient is specified as
x
a percentage. If the controlled variable no longer
changes, the manipulated variable y moves towards the
value 0 in an e function. The time constant T1 specifies
the time when the step response has dropped to approxi- 1
mately 37% of its initial value. The value has dropped be-
low 1% after 5*T1.

The inputs and the output can neither be duplicated nor t


negated.
y

Transfer function: KP

KP * s * T1
F(s)=
s * T1 + 1
37%

T1 t

907 PC 331/Issued: 11.98 9–1


DT1 DIFFERENTIATOR WITH DELAY OF THE 1ST ORDER

x WORD
The operand for the controlled variable (input value for the
DT1 function) is specified at the input x.

KP WORD
The proportional coefficient is specified at the input KP.
This value is specified as a percentage (since version V6;
GJP5122900 R301) and can be positive or negative.
Example:
1 = 1 Percent
55 = 55 Percent
100 = 100 Percent
1000 = 1000 Percent
–100 = –100 Percent

100 percent means that the input x is not influenced by the


proportional coefficient.

T1/T WORD
The time constant of the DT1 function is specified at the
input T1/T.To do this, the time constant T1 must be scaled
to the PLC cycle time T.

The following applies to T1/TZ:


10 < T1/TZ < 32767 –> T1 > 10 * TZ

If a negative value is specified for T1/T, then the PLC au-


tomatically sets T1/T to the maximum positive value
+32767.

y WORD
The manipulated variable (output value of the DT1 func-
tion) is output through the output y.

9–2 907 PC 331/Issued: 11.98


DIFFERENTIATOR WITH DELAY OF THE 1ST ORDER DT1

Example

FBD/LD IL

!BA 0
DT1 DT1
MW 00,00 x MW 00,00
KW 03,07 KP KW 03,07
KW 04,00 T1/T y AW 01,01 KW 04,00
AW 01,01

CE FBD Definition

DT1
x
KP
T1/T y

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

x E W N P Y 0 0
KP E W N P Y 0 0
T1/T E W N P Y 0 0
y A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 DT1
00002 PP 0 x Input WORD (controlled variable)
00003 PP 0 KP Input WORD (proportional coefficient)
00004 PP 0 T1/T Input WORD (time constant)
00005 PP 0 y Output WORD (manipulated variable)

907 PC 331/Issued: 11.98 9–3


DUALBCD BINARY TO BCD CONVERSION

The binary number at the DUAL input is converted to a


BCD coded number and is allocated to the operand at the
output BCD. FBD/LD IL

The binary number is represented in 16 bits and must lie


within the range !BA 0
DUALBCD BINBCD
0 < DUAL < 270FH (corresponding to BCD 9999). DUAL BCD DUAL
BCD
The BCD number is limited to 9999 if it lies outside of this
range. The BCD number is stored in a 16 bit word.

____________________________________________________________________________________________

Parameters
DUAL WORD EW, MW, AW, KW Binary number
BCD WORD AW,MW BCD coded number
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: Depending on the value: 28 µs 548 µs
(value = 0) ... 162 µs (value = 9999)
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51

9–4 907 PC 331/Issued: 11.98


BINARY TO BCD CONVERSION DUALBCD

Description Example:

The binary number at the DUAL input is converted to a HEXDEC NUMBER BCD NUIMBER
BCD coded number and is allocated to the operand at the
output BCD. 15 11 7 3 0 BIT 15 11 7 3 0

The binary number is represented in 16 bits and must lie 0 4 D 2 1 2 3 4


within the range

0 < DUAL < 270FH (corresponding to BCD 9999).

The BCD number is limited to 9999 if it lies outside this Z1 = 2 * 1 = 2 Z1 = 4 *1 = 4


Z2 = 13 * 16 = 208 Z2 = 3 * 10 = 30
range. The BCD number is stored in a 16–bit word. Z3 = 4 * 256 = 1024 Z3 = 2 * 100 = 200
The input and the output can neither be duplicated nor ne- Z4 = 0 * 4096 = 0 Z4 = 1 * 1000 = 1000
gated.
+ 1234 + 1234

Definition:
Conversion of a negative binary number to a BCD
number
The significance of the digits in a hexidecimal number and
a BCD coded number is defined as follows: A negative binary number with an amount less than
270FH can be converted to a BCD number, whereby the
value and the sign of the BCD number are each stored in
HEXDEC NUMBER BCD NUMBER one flag.

15 11 7 3 0 BIT 15 11 7 3 0

Z4 Z3 Z2 Z1 Z4 Z3 Z2 Z1

Numerical value: Numerical value:


Z1 * 1 Z1 * 1
Z2 * 16 Z2 * 10
Z3 * 256 Z3 * 100
Z4 * 4096 Z4 * 1000
0 < Zi < F 0 < Zi < 9

Example: Converting positive and negative binary numbers

DUALBCD BCD number value


M 03,01

BETR Binary number


Binary number amount <>
MW 03,00 M 01,00
BCD number sign
1: negative
0: positive

907 PC 331/Issued: 11.98 9–5


DUALBCD BINARY TO BCD CONVERSION

Converting a binary number with an amount higher


than 270FH
Binary numbers with an amount higher than 270FH are
first of all converted to a double word (function block
WDW). They are then converted from BINARY to BCD by
means of the DUALBCDD function block.

Example

WDW DUALBCDD
MW 03,00 MD 03,00

The same procedure as above applies if a sign has to be


taken into account.

Example

FBD/LD IL

!BA 0
DUALBCD BINBCD
MW 07,03 DUAL BCD MW 07,04 MW 07,03
MW 07,04

9–6 907 PC 331/Issued: 11.98


BINARY TO BCD CONVERSION DUALBCD

CE FBD Definition

DUALBCD
DUAL BCD

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

DUAL E W N P Y 0 0
BCD A W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 BINBCD
00002 PP 0 DUAL Input WORD (binary number)
00003 PP 0 BCD Output WORD (BCD coded number)

907 PC 331/Issued: 11.98 9–7


DUALBCDD BINARY TO BCD CONVERSION, DOUBLE WORD

The binary number at the input DUAL is converted to a


BCD coded number and is allocated to the operand at the
output BCD. FBD/LD IL

The binary number is represented in 32 bits and must lie


within the range !BA 0
DUALBCDD DWBCD
0 < DUAL < 5F5E0FFH DUAL BCD DUAL
(corresponding to BCD 99 999 999). BCD

The BCD number is limited to 99 999 999 if it lies outside


of this range. The BCD number is stored in a 32–bit word.

____________________________________________________________________________________________

Parameters
DUAL DOUBLE WORD MD, KD Binary number
BCD DOUBLE WORD MD BCD coded number
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 36 – 288 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331

9–8 907 PC 331/Issued: 11.98


BINARY TO BCD CONVERSION, DOUBLE WORD DUALBCDD

Description Example:

The binary number at the input DUAL is converted to a


BCD coded number and is allocated to the operand at the HEXDEC NUMBER BCD NUMBER
output BCD.
31 15 0 BIT 31 15 0
The binary number is represented in 32 bits and must lie
within the range
0 0 B C 6 1 4 E 1 2 3 4 5 6 7 8

0 < DUAL < 5F5E0FFH


(corresponding to BCD 99 999 999).

The BCD number is limited to 99 999 999 if it lies outside Z1 =14 * 1 = 14 Z1 = 8 *1 = 8


Z2 = 4 * 16 = 64 Z2 = 7 * 10 = 70
of this range. The BCD number is stored in a 32–bit word.
Z3 = 1 * 256 = 256 Z3 = 6 * 100 = 600
The input and output can neither be duplicated nor ne- Z4 = 6 * 4096 = 24576 Z4 = 5 * 1000 = 5000
gated. Z5 =12 * 65536 = 786432 Z5 = 4 * 10000 = 40000
Z6 = 11 * 1048576 = 11534336 Z6 = 3 * 100000 = 300000
Z7 = 0 * 16777216 = 0 Z7 = 2 * 1000000 = 2000000
Definition Z8 = 0 * 268435456 = 0 Z8 = 1 * 10000000 = 10000000

+ 12345678 + 12345678
The significance of the digits in a hexadecimal number
and a BCD coded number is defined as follows:

HEXDEC NUMBER BCD NUMBER


Converting a negative binary number to a BCD
number
See function block DUALBCD
31 15 0 BIT 31 15 0

Z8 Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z8 Z7 Z6 Z5 Z4 Z3 Z2 Z1

Numerical value: Numerical value:

Z1 * 1 Z1 * 1
Z2 * 16 Z2 * 10
Z3 * 256 Z3 * 100
Z4 * 4096 Z4 * 1000
Z5 * 65536 Z5 * 10000
Z6 * 1048576 Z6 * 100000
Z7 * 16777216 Z7 * 1000000
Z8 * 268435456 Z8 * 10000000

0 < Zi < F 0 < Zi < 9

907 PC 331/Issued: 11.98 9–9


DUALBCDD BINARY TO BCD CONVERSION, DOUBLE WORD

Example

FBD/LD IL

!BA 0
DUALBCDD DWBCD
KD 07,03 DUAL BCD MD 07,04 KD 07,03
MD 07,04

CE FBD Definition

DUALBCDD
DUAL BCD

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

DUAL E D N P Y 0 0
BCD A D N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 DWBCD
00002 PP 0 DUAL Input DOUBLE WORD (binary number)
00003 PP 0 BCD Output DOUBLE WORD (BCD coded number)

9–10 907 PC 331/Issued: 11.98


WRITE DOUBLE WORD IN THE EVENT OF VALUE CHANGE DWAES

If the value of the operand at the input E1 changes in com-


parison with the value during previous processing of the
block, the value of the operand at the input E1 is written to FBD/LD IL
the specified physical address.

!BA 0
DWAES DWAES
E1 E1
#OFF #OFF
#SEG #SEG

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Input for the operand to be read
#OFF DIRECT #, #H Offset address of the memory location to which the
CONSTANT value of E1 must be written in the event of a change.
#SEG DIRECT #, #H Segment address of the memory location to which the
CONSTANT value of E1 must be written in the event of a change.
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 27 µs
Additional runtime: –––
Output updating: yes
Number of historical values: 2 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description #OFF DIRECT CONSTANT (#,#H)


If the value of the operand at the input E1 changes in com- The offset component of the address to be written is spe-
parison with the value during previous processing of the cified at the #OFF input. This is specified as a direct con-
block, the value of the operand at the input E1 is written to stant.
the specified physical address.
#SEG DIRECT CONSTANT (#,#H)
The physical address consists of a segement and an off- The segment component of the address to be written is
set. specified at the input #SEG. This is specified as a direct
constant.
The inputs can neither be duplicated nor negated.

E1 DOUBLE WORD
If the operand at the input E1 changes, its value is written
to the address specified at the inputs #OFF and #SEG.

907 PC 331/Issued: 11.98 9–11


DWAES WRITE DOUBLE WORD IN THE EVENT OF VALUE CHANGE

Example

FBD/LD IL

!BA 0
DWAES DWAES
MD 08,03 MD 08,03
#H CBE0 #OFF #H CBE0
#H 8800 #SEG #H 8800

CE FBD Definition

DWAES
E1
#OFF
#SEG

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
#OFF K W N P Y 0 0
#SEG K W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 DWAES
00002 PP 0 E1 Input DOUBLE WORD (Value)
00003 PP 0 #OFF # CONSTANT (offset address)
00004 PP 0 #SEG # CONSTANT (segment address)

9–12 907 PC 331/Issued: 11.98


AND COMBINATION, DOUBLE WORD DWAND

This function block generates, bit by bit, the AND combi-


nation of the operands present at the inputs E1 and E2.
The result is allocated to the operand at the output A1. FBD/LD IL

!BA 0
DWAND DWAND
E1 E1
E2 A1 E2
A1

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Operand 1
E2 DOUBLE WORD MD, KD Operand 2
A1 DOUBLE WORD MD Result of the AND combination
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 49 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This function block generates, bit by bit, the AND combi- The inputs and the output can neither be duplicated nor
nation of the operands present at the inputs E1 and E2. inverted/negated.
The result is allocated to the operand at the output A1.

Example

E1 1.0.0.0 0.0.1.1 0.0.1.0 0.1.1.0 1.0.1.0 1.1.0.0 0.0.1.1 0.1.0.1

E2 1.0.0.1 0.1.1.0 0.0.1.0 1.1.1.1 1.1.1.1 0.0.0.0 0.1.1.0 1.1.0.0

A1 1.0.0.0 0.0.1.0 0.0.1.0 0.1.1.0 1.0.1.0 0.0.0.0 0.0.1.0 0.1.0.0

907 PC 331/Issued: 11.98 9–13


DWAND AND COMBINATION, DOUBLE WORD

Example

FBD/LD IL

!BA 0
DWAND DWAND
MD 00,00 MD 00,00
KD 03,01 MD 08,00 KD 03,01
MD 08,00

CE FBD Definition

DWAND
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
E2 E D N P N 0 0
A1 A D N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 DWAND
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 E2 Input DOUBLE WORD
00004 PP 0 A1 Output DOUBLE WORD

9–14 907 PC 331/Issued: 11.98


READ DOUBLE WORD WITH ENABLE DWOL

When a 1 signal is present at the FREI input, the value of


the specified physical address is read and is allocated to
the operand at the output A1. FBD/LD IL

!BA 0
DWOL DWOL
FREI FREI
#OFF #OFF
#SEG A1 #SEG
A1

____________________________________________________________________________________________

Parameters
FREI BINARY E, A, M, S, K Block enable
#OFF DIRECT #, #H Offset address of the memory location whose double word
CONSTANT value is to be read.
#SEG DIRECT #, #H Segment address of the memory location whose double word
CONSTANT value is to be read.
A1 DOUBLE WORD MD Output to which the value read is allocated.
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 26.5 µs; 19.0 µs in case of no enable.
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description #OFF DIRECT CONSTANT (#, #H)


When a 1 signal is present at the FREI input, the value of The offset component of the address to be read is speci-
the specified physical address is read and is allocated to fied at the input #OFF. This is specified as a direct con-
the operand at the output A1. stant.
#SEG DIRECT CONSTANT (#, #H)
No double word is read if there is a 0 signal at the FREI The segment component of the address to be read is spe-
input. cified at the input #SEG. This is specified as a direct con-
stant.
The physical address consists of a segment and an off-
set. A1 WORD
The value read is allocated to the operand at the output
A1.
FREI BINARY
Processing of the block is enabled or disabled with the op-
erand at the input FREI. The following applies:
FREI = 0 –> Processing disabled
FREI = 1 –> Processing enabled

907 PC 331/Issued: 11.98 9–15


DWOL READ DOUBLE WORD WITH ENABLE

Example

FBD/LD IL

!BA 0
DWOL DWOL
E 01,00 FREI E 01,00
#H CBE0 #OFF #H CBE0
#H 8800 #SEG MD 08,03 #H 8800
MD 08,03

CE FBD Definition

DWOL
FREI
#OFF
#SEG A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
#OFF K W N P Y 0 0
#SEG K W N P Y 0 0
A1 A D N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 DWOL
00002 PP 0 FREI Input BINARY (block enable)
00003 PP 0 #OFF # CONSTANT (offset address)
00004 PP 0 #SEG # CONSTANT (segment address)
00005 PP 0 A1 Output DOUBLE WORD (value)

9–16 907 PC 331/Issued: 11.98


OR COMBINATION, DOUBLE WORD DWOR

This function block generates the bit–by–bit OR combina-


tion of the operands present at the inputs E1 and E2. The
result is allocated to the operand at the output A1. FBD/LD IL

!BA 0
DWOR DWOR
E1 E1
E2 A1 E2
A1

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Operand 1
E2 DOUBLE WORD MD, KD Operand 2
A1 DOUBLE WORD MD Result of the OR combination
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 35 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________
Description The inputs and the output can neither be duplicated nor
negated nor inverted.
This function block generates a bit–by–bit OR combina-
tion of the operands present at the inputs E1 and E2. The
result is allocated to the operand at the output A1.

Example

E1 1.0.0.0 0.0.1.1 0.0.1.0 0.1.1.0 1.0.1.0 1.1.0.0 0.0.1.1 0.1.0.1

E2 1.0.0.1 0.1.1.0 0.0.1.0 1.1.1.1 1.1.1.1 0.0.0.0 0.1.1.0 1.1.0.0

A1 1.0.0.1 0.1.1.1 0.0.1.0 1.1.1.1 1.1.1.1 1.1.0.0 0.1.1.1 1.1.0.1

907 PC 331/Issued: 11.98 9–17


DWOR OR COMBINATION, DOUBLE WORD

Example

FBD/LD IL

!BA 0
DWOR DWOR
MD 00,00 MD 00,00
KD 03,01 MD 08,01 KD 03,01
MD 08,01

CE FBD Definition

DWOR
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
E2 E D N P N 0 0
A1 A D N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 DWOR
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 E2 Input DOUBLE WORD
00004 PP 0 A1 Output DOUBLE WORD

9–18 907 PC 331/Issued: 11.98


WRITE DOUBLE WORD WITH ENABLING DWOS

If there is a 1 signal at the input FREI, the value of the op-


erand at the input E1 is read and then written to the speci-
fied physical address. FBD/LD IL

!BA 0
DWOS DWOS
FREI FREI
E1 E1
#OFF #OFF
#SEG #SEG

____________________________________________________________________________________________

Parameters
FREI BINARY E, M, A, S, K Block enable
E1 DOUBLE WORD MD, KD Input for the operand to be written
#OFF DIRECT #, #H Offset address of the memory location to which the
CONSTANT value of E1 must be written.
#SEG DIRECT #, #H Segment address of the memory location to which the
CONSTANT value of E1 must be written.
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 38 µs in case of enable; 19 µs in case of no enable.
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description E1 DOUBLE WORD


If there is a 1 signal at the input FREI, the value of the op- The operand at the input E1 is read and its value is written
erand at the input E1 is read and then written to the speci- to the address defined by the inputs #OFF and #SEG.
fied physical address.
#OFF DIRECT CONSTANT (#,#H)
No double word is written if there is a 0 signal at the FREI The offset component of the address to be written is spe-
input. cified at the input #OFF. This is specified as a direct con-
stant.
The physical address consists of a segment and an off-
set.
#SEG DIRECT CONSTANT (#,#H)
The inputs can neither be duplicated nor negated. The segment component of the address to be written is
specified at the input #SEG. This is specified as a direct
constant.
FREI BINARY
Processing of the block is enabled or disabled with the op-
erand at the input FREI. The following applies:
FREI = 0 –> Processing disabled
FREI = 1 –> Processing enabled

907 PC 331/Issued: 11.98 9–19


DWOS WRITE DOUBLE WORD WITH ENABLING

Example

FBD/LD IL

!BA 0
DWOS DWOS
E 01,00 FREI E 01,00
MD 08,03 MD 08,03
#H FFF0 #OFF #H FFF0
#H 2000 #SEG #H 2000

CE FBD Definition

DWOS
FREI
E1
#OFF
#SEG

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
E1 E D N P N 0 0
#OFF K W N P Y 0 0
#SEG K W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (vorbelegt 0)


00001 DWOS
00002 PP 0 FREI Input BINARY (block enable)
00003 PP 0 E1 Input DOUBLE WORD (value)
00004 PP 0 #OFF # CONSTANT (offset address)
00005 PP 0 #SEG # CONSTANT (segment address)

9–20 907 PC 331/Issued: 11.98


DOUBLE WORD RECODER DWUMC

This function block compares the value of the operand at


the input E to the reference values of the operands at the
inputs EC0...ECn–1. If the input E agrees with at least FBD/LD IL
one of the reference values EC, the output E=EC is set to
1. The output A receives the value of the output code AC,
which is allocated to the reference value EC found. !BA 0
DWUMC DWUMC
E E
#2*n #2*n
EC0 E=EC EC
AC0 A AC
E=EC
A

____________________________________________________________________________________________

Parametes
E DOUBLE WORD MD, KD Input
#2*n DIRECT #, #H, KW Quantity n of reference values (multiplied by 2)
CONSTANT
EC DOUBLE WORD MD, KD Reference value; the input can be duplicated
AC DOUBLE WORD MD, KD Output code; the input can be duplicated
E=EC BINARY A, M Coincidence indication
A DOUBLE WORD MD Output of the output code’s value
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 53 µs
Additional runtime: 10 µs per entered reference value
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331

907 PC 331/Issued: 11.98 10–1


DWUMC DOUBLE WORD RECODER

Description EC0...ECn–1 DOUBLE WORD


The input EC0 must be duplicated according to the num-
ber of reference values needed. The operands for the ref-
This function block compares the value of the operand at
erence values are specified at the inputs EC0...ECn–1.
the input E to the reference values of the operands at the
The value of the operand at the input E1 is compared to
inputs EC0...ECn–1. If the input E agrees with at least
the reference values.
one of the reference values EC, the output E=EC is set to
1. The output A receives the value of the output code AC, AC0...ACn–1 DOUBLE WORD
which is allocated to the reference value EC found. By duplication of the input EC0, the input AC0 is automati-
cally also duplicated.
The output codes are specified at the inputs
An operand for the output code ACi is allocated to each AC0...ACn–1. The output code ACi is output through the
reference value at the inputs ECi. Affiliation of EC to AC is output A if the input E agrees with one of the re- ference
recognizable by the index i. The index begins with 0 and is values ECi.
generated automatically in the event of dupli-cation.
Affiliation between reference values and output codes:
The number of inputs EC and AC must be specified as a EC0 <–> AC0
direct constant at the input #2*n. EC1 <–> AC1
. .
The inputs and outputs cannot be negated/inverted. . .
ECn–1 <–> ACn–1
E=EC BINARY
E DOUBLE WORD Agreement between the operand value of the input E and
The operand whose value is to be compared to the values one of the reference values is signalled at the output
of the n reference values (EC0...ECn–1) is specified at E=EC.
the input E. The following applies: E=EC = 0 –> No agreement
E=EC = 1 –> Agreement
A DOUBLE WORD
#2*nDIRECT CONSTANT (#,#H) The output code ACi is output through the output A if the
The total number (2*n) of the reference values input E agrees with one of the reference values ECi.
(EC0...ECn–1) and output codes (AC0...ACn–1) is speci-
fied at the input #2*n. This is specified as an indirect con- The following applies: A = 0 –> No agreement
stant. A = ACi –> Agreement

10–2 907 PC 331/Issued: 11.98


DOUBLE WORD RECODER DWUMC

Example

FBD/LD IL

!BA 0
DWUMC DWUMC
MD 08,03 E MD 08,03
#4 #2*n #4
MD 05,00 EC0 E=EC M 08,14 MD 05,00
MD 05,01 EC1 A MD 08,14 MD 05,01
MD 05,02 AC0 MD 05,02
KD 05,03 AC1 KD 05,03
M 08,14
MD 08,14

CE FBD Definition

DWUMC
E
#2*n
EC E=EC
AC A

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E D N P Y 0 0
#2*n K W N P Y 0 0
EC E D N P Y 1 0
AC E D N P Y 1 0
E=EC A L N P Y 0 0
A A D N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 DWUMC
00002 PP 0 E Input DOUBLE WORD (input value)
00003 PP 0 #2*n # CONSTANT (number of EC and AC)
[ 1
00004 PP 1 EC Input DOUBLE WORD (reference value)
] 1
[ 1
00005 PP 1 AC Input DOUBLE WORD (output code)
] 1
00006 PP 0 E=EC Output BINARY (input value=Ecode)
00007 PP 0 A Output DOUBLE WORD (output value)

907 PC 331/Issued: 11.98 10–3


DWW DOUBLE WORD TO WORD CONVERSION

The value of the double word operand at the input E1 is


converted to a word variable and the result is allocated to
the word operand at the output A1. FBD/LD IL

!BA 0
DWW DWW
E1 A1 E1
Q A1
Q

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Double word variable to be converted
A1 WORD AW, MW Result of conversion, word variable
Q BINARY A, M Result limited
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 36...38 µs 154 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 2.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
The value of the double word operand at the input E1 is
converted to a word variable and the result is allocated to
the word operand at the output A1.
The result is limited to the maximum or minimum number
range.
Max. number range: +32 767 (7FFFH)
Min. number range: –32 767 (8001H)
If limiting has taken place, a 1 signal is allocated to the
binary operand at the output Q. If no limiting has taken
place, a 0 signal is allocated to the binary operand at the
output Q.
If the value of the operand at the input E1 lies outside of
the permissible number range (value 8000 0000H), the
converted value is set to –32 767 (8001H).

The input and the outputs can neither be duplicated nor


negated.

10–4 907 PC 331/Issued: 11.98


DOUBLE WORD TO WORD CONVERSION DWW

Example

FBD/LD IL

!BA 0
DWW DWW
MD 00,00 AW 05,00 MD 00,00
Q M 03,01 AW 05,00
M 03,01

CE FBD Definition

DWW
E1 A1
Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
A1 A W N P N 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 DWW
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 A1 Output WORD
00004 PP 0 Q Output BINARY

907 PC 331/Issued: 11.98 10–5


DWWW CONVERTER DOUBLE WORD TO 2 WORD

The block packs one 32 bit double word into 2 16 bit words.
The low word of the double word input E (bit 0 to bit 15) is FBD/LD
assigned to output A1 and the high word of input E (bit 16
to bit 31) is assigned to output A2. DWWW
E A1
A2

Parameters
E DOUBLE WORD MD Double word input
A1 WORD AW, MW Output, low word of input E
A2 WORD AW, MW Output, high word of input E

CE data
Output updating: yes
Number of historical values: none

Available as of: 07 KR 91 R2 Index c, 07 KT 92 R2 Index c,


07 KT 93 R2 Index f, 07 KT 94

Description
The block packs one 32 bit double word into 2 16 bit words. A1 WORD
The low word of the double word input E (bit 0 to bit 15) is
assigned to output A1 and the high word of input E (bit 16 At output A1, the low word (bit 0 to bit 15) of input E is
to bit 31) is assigned to output A2. output.

E DOUBLE WORD A2 WORD

The double word at input E is split up into 2 16 bit words At output A2, the high word (bit 16 to bit 31) of input E is
E1 and E2. output.

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

DWWW

DWORT_IN Y N Y 0 00 E A1 00 0 Y N Y WORT_OUT
A2 00 0 Y N Y WORT_OUT

Source
SN ZN Command / Variable Symbol Long text

00000 00000 DWWW


00001 PP 00 E
00002 PP 00 A1
00003 PP 00 A2
00004

7 10-6 907 PC 331 / Issued: 08.99


EXCLUSIVE OR COMBINATION, DOUBLE WORD DWXOR

This function block generates the bit–by–bit XOR combi-


nation of the operands present at the inputs E1 and E2.
The result is allocated to the operand at the output A1. FBD/LD IL

!BA 0
DWXOR DWXOR
E1 E1
E2 A1 E2
A1

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Operand 1
E2 DOUBLE WORD MD, KD Operand 2
A1 DOUBLE WORD MD Result of the XOR combination
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 35 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The inputs and the output can neither be duplicated nor
negated nor inverted.
This function block generates the bit–by–bit XOR combi-
nation of the operands present at the inputs E1 and E2.
The result is allocated to the operand at the output A1.

Example

E1 1.0.0.0 0.0.1.1 0.0.1.0 0.1.1.0 1.0.1.0 1.1.0.0 0.0.1.1 0.1.0.1

E2 1.0.0.1 0.1.1.0 0.0.1.0 1.1.1.1 1.1.1.1 0.0.0.0 0.1.1.0 1.1.0.0

A1 0.0.0.1 0.1.0.1 0.0.0.0 1.0.0.1 0.1.0.1 1.1.0.0 0.1.0.1 1.0.0.1

907 PC 331/Issued: 11.98 10–7


DWXOR EXCLUSIVE OR COMBINATION, DOUBLE WORD

Example

FBD/LD IL

!BA 0
DWXOR DWXOR
MD 00,00 MD 00,00
KD 00,01 MD 08,02 KD 00,01
MD 08,02

CE FBD Definition

DWXOR
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
E2 E D N P N 0 0
A1 A D N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 DWXOR
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 E2 Input DOUBLE WORD
00004 PP 0 A1 Output DOUBLE WORD

10–8 907 PC 331/Issued: 11.98


RECEPTION OF CHARACTERS EMASm

The function block EMAS


– receives telegrams through a serial interface of the FBD/LD IL
PLC
– compares these telegrams to comparison telegrams !BA 0
stored in the user program EMASm
EMAS
QUIT QUIT
– and, if these agree, provides the user data of the tele-
SSK MEUN SSK
gram received at the block’s outputs.
#ANU RDY #ANU
VT0 TELN MEUN
MW0 RDY
TELN
MW0
VT0

____________________________________________________________________________________________

Parameters
QUIT BINARY A, E, M, S, K Reception of telegrams not enabled.
SSK WORD AW, EW, MW, KW Interface identifier; number of the serial interface
#ANU DIRECT Number of outputs for user information
CONSTANT #, #H
VT0 ALL texts Comparison telegram; input capable of duplication
MEUN BINARY A, M Data invalid
RDY BINARY A, M Telegram has been received
TELN WORD AW, MW Number of the comparison telegram with which the
received one agrees
MW0 WORD AW, MW User data; output capable of duplication
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: not available 332 µs
Additional runtime: not available 135 µs per character
Output updating: yes yes
Number of historical values: 1 word 1 word
Available as of: ABB Procontic CS31 /
Comm. module 07 KP 62
907 PC 331 / 07 KR 31 V 2.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
The function block EMAS Initialization of the serial interface
– receives telegrams through a serial interface of the PLC
One of the possible serial interfaces must be initialized
– compares these telegrams to comparison telegrams with the SINIT block before the EMAS can communicate
stored in the user program with one of these. Besides the required interface parame-
ters, the following are specified in the SINIT block:
– and, if these agree, provides the user data of the tele-
gram received at the block’s outputs.
– An end of telegram character, which can be planned
The received telegrams are fetched from the serial inter- freely, in order to recognize the end of the telegram to
face by an interface driver and are provided in a BUFFER be received
for further processing by EMAS. The driver recognizes
the end of the telegram by the end of telegram character. – Whether or not a character received through the inter-
This end of telegram character is planned in the SINIT face is to be echoed. Synchronization of the data flow is
block. basically achieved by way of the RTS and CTS signals.

907 PC 331/Issued: 11.98 10–9


EMASm RECEPTION OF CHARACTERS

Following serial interfaces can be used by block EMAS:

Central unit 07 KR 91: COM1


Central unit 07 KT 92: COM1, COM2
Communication Processor 07 KP 62: COM1, COM2
Central unit 07 KR 31: COM1

E BUFFER 2

E BUFFER 1 COM2

COM1

Communication
Software
Telegram V24
EMAS

End of
telegram
character
256 Bytes

The E buffers 1 and 2 are the


receive buffers, which are
assigned to serial interfaces
COM1 and COM2.

10–10 907 PC 331/Issued: 11.98


RECEPTION OF CHARACTERS EMASm

Brief overview of the block’s parameters:


● QUIT
● RDY
● MEUN

QUIT MEUN RDY Meaning


The EMAS is disabled by QUIT = 1. In doing so, the outputs MEUN and RDY are
1 0 0
permanently set to 0.
EMAS is enabled for reception, but still no telegram has been received and eva-
0 1 0
luated.

0 0 1 EMAS has received a valid telegram and is ready to receive a new telegram.

EMAS has received an invalid telegram. An acknowledgement at the QUIT input


0 1 1
is necessary in order to be able to receive a new telegram.
QUIT: 0–>1

0–>1 0 0 Acknowledgement after reception of an invalid telegram. After acknowledge-


ment, the EMAS is enabled again by QUIT = 0

QUIT BINARY #ANU DIRECT CONSTANT


The input QUIT controls reception of telegrams and also The number of outputs MW0...MWn at which the block
provides the received user information is specified at the
serves the purpose of acknowledgement in the event of
input #ANU (number of user information items). This is
an error occurring.
specified as a direct constant.

● QUIT = 0: Reception of telegrams enabled. VT0 ... VTn ALL


The input VT0...VTn is capable of duplication. The com-
● QUIT = 1: Reception of telegrams not enabled. Ack- parison telegrams to be stored in the PLC program are
nowledgment after reception of an invalid specified at the inputs VT0...VTn. The block is capable of
telegram. processing 1 ... 99 telegrams. One telegram occupies 2
inputs, each telegram number being specified at one in-
put and the actual telegram text being specified at the
If agreement with none of the stored comparison tele- next one. The exact syntax and handling of the compari-
grams is ascertained on comparison of a received tele- son telegrams are described separately in this descrip-
gram, the EMAS automatically assumes the “error” state. tion.
In this case, EMAS no longer processes any new tele-
grams until the error is acknowledged with a 1 signal at MEUN BINARY
the input QUIT and reception of telegrams is enabled The output MEUN (flag invalid) indicates whether or not
again (next cycle) with a 0 signal at the input QUIT. the data at the outputs MW0...MWn is valid or invalid.

If a telegram is received and processed properly, the data


at the outputs MW0...MWn is declared valid. The data at
SSK WORD
the outputs MW0...MWn is declared invalid if the received
The number of the interface through which the block re- telegram does not agree with any of the stored compari-
ceives its telegrams is specified at the SSK input (inter- son telegrams or if the received telegram cannot be pro-
face identifier). cessed properly.
The following applies:
MEUN = 0 –> Data at the outputs MW0...MWn is valid
COM1: number = 1
COM2: number = 2 MEUN = 1 –> Data at the outputs MW0...MWn is invalid

907 PC 331/Issued: 11.98 10–11


EMASm RECEPTION OF CHARACTERS

RDY BINARY Initialization of the serial interface


The output RDY (ready) indicates that a telegram has One of the possible serial interfaces must be initialized
been received and processed. with the SINIT block before the EMAS can communicate
The output RDY does not provide any information as to with one of these. Besides the required interface parame-
whether or not a valid or invalid telegram has been re- ters, the following are specified in the SINIT block:
ceived.
– An end of telegram character that can be planned freely
in order to recognize the end of the telegram to be re-
RDY = 0 –> Still no telegram has been received ceived

RDY = 1 –> A telegram has been received and proces- – Whether or not a character received at the input is to be
sed echoed. Synchronization of the data flow is basically
achieved by way of the RTS and CTS signals.
TELN WORD
If a valid telegram is received, the number of the affiliated Comparison telegrams
comparison telegram is output through the output TELN 1...99 comparison telegrams are stored directly after the
(telegram number). EMAS block.

The comparison telegrams serve to identify


MW0 ... MWn WORD
The output MW0 can be duplicated (MW0...MWn). The – the current telegrams received
user data communicated in the telegram currently re-
– and the user data contained in the telegrams received
ceived is output through the outputs MW0...MWn. This
user data may consist of numerical values or any charac- The stored comparison telegrams each have a telegram
ters. This depends on which kind of dummy parameters number to identify them. Each comparison telegram may
have been planned in the comparison telegram. The user comprise up to 255 characters.
data of a telegram is stored beginning with the output
MW0 and in the sequence in which they are planned in the The comparison telegrams consist of:
comparison telegram. As many outputs MW0...MWn
must be provided as are sufficient for the telegram with – ASCII characters serving only to identify the telegram
the most user data. received,

– Dummy parameters for the user information to be re-


ceived and to be output through the block’s outputs.

Detailed description of the functional scope As regards the dummy parameters for the user informa-
of function block EMAS tion, EMAS distinguishes between dummy parameters
for digits and dummy parameters for characters.

The function block EMAS Dummy parameter for digits: # (1 # for each digit)

Dummy param. for characters: * (1 * for each char-


– receives telegrams through a serial interface of the
acter/byte)
PLC

– compares these telegrams to the comparison tele- Dummy parameter for digits
grams stored in the user program For each dummy digit parameter (#) of the comparison
telegram, EMAS expects precisely one ASCII coded dec-
– and, if they agree, provides the user data of the tele- imal digit in the telegram to be received.
gram received at the block’s outputs.
Up to 5 dummy digits constitute one dummy parameter
group. Such a group of dummy digits represents the nu-
The telegrams received are fetched from the serial inter- merical value of a decimal number comprising up to 5 dig-
face by an interface driver and are provided for further its.
processing in a BUFFER for the EMAS. The driver recog-
nizes the end of the telegram by the end of telegram char- No dummy parameter is specified for the decimal num-
acter. This end of telegram character is planned in the SI- ber’s sign because EMAS takes it into account automati-
NIT block. cally.

10–12 907 PC 331/Issued: 11.98


RECEPTION OF CHARACTERS EMASm

The EMAS allocates one user information output to each gram to be received. These may comprise ASCII charac-
numerical value belonging to a dummy parameter group. ters of letters, but also all other hex values from 0...FF.
In doing so, EMAS automatically limits the value range to
+32767. The length of a dummy character group is up to 255. If this
were the case, the complete comparison telegram would
consist of dummy characters only.
Dummy parameter for characters
EMAS allocates the characters/bytes received without
For each dummy character (*) of the comparison tele- change and successively to its user information outputs
gram, EMAS expects any one character/byte in the tele- MW0...MWn.
____________________________________________________________________________________________

Syntax diagram: Structure of comparison telegrams

#n #” * ”#

TEXT

#n : Successive telegram number (direct constant 1...99)


#” : Start identifier for text input
”# : End identifier for text input in terminal mode
Important: This end identifier is not specified when using the ABB Procontic programming system. Only
when texts are entered directly in the PLC in terminal mode do these have to be concluded by
this end identifier.
*: Dummy parameter for character/byte
#: Dummy parameter for digits
TEXT: All ASCII characters 1 ... FF except * and #

907 PC 331/Issued: 11.98 10–13


EMASm RECEPTION OF CHARACTERS

Input of comparison telegrams Note:


As regards input of comparison telegrams, two cases
The characters with the ASCII code >20H or >32D must
must be distinguished:
be entered with the keyboard. As an example, the charac-
– Input in the ABB Procontic programming system
ter ”!” must be entered with the keyboard, and not as \033.
– Input directly in the PLC with a terminal
Characters, which are no special characters and which
Input of comparison telegrams in the ABB Procontic also could not be entered with the keyboard, can be gene-
programming system rated in the following way:
Each comparison telegram consists of: Press and hold down the <ALT> key, now type the nume-
– the telegram number rical code (decimal code) on the numeric keypad of the
– the telegram text keyboard, then release the <ALT> key.
The character with the ASCII code 255 is reserved for in-
The telegram number and the telegram text are each sep- ternal use of the programming software and must not be
arate operands. This is why the telegram number and the used otherwise.
telegram text each occupy one separate input in the FBD
symbol of the EMAS block. Therefore, two inputs are
needed for one comparison telegram. Input of comparison telegrams directly in the PLC
with a terminal
Example: The telegrams are entered directly after the EMAS block,
Input VT0: #1 i.e. the first comparison telegram begins at the program
(No. of the first comparison telegram) memory address following the operand at the output
Input VT1: #”PRINT### IDENTIFIER**** MWn.
(Text of the first comparison telegram)
The telegram number is specified as a direct constant.
Apart from the ASCII characters for * and #, all ASCII When entered, the telegram text is embedded in the spe-
characters are possible in the telegram text. cial characters #” (start of text input) and “# (end of text
input). Apart from the ASCII characters for * and #, all
When entering special ASCII characters such as “start of ASCII characters from 1 ... FF are possible. The ASCII
line” <CR>, the following must be observed when using character <NUL> is used as a prefix for the format identifi-
the ABB Procontic programming system: er in the send buffer.
Special characters are entered by:
\Numerical value of the character
The character’s numerical value is specified as a three–
digit decimal number.

Example:
The following telegram text is to be entered in the ABB
Procontic programming system:
Temperature <CR> boiler 1
The following applies: <CR> = 013
The text input in the programming system is as follows:
#”temperature\013boiler 1

10–14 907 PC 331/Issued: 11.98


RECEPTION OF CHARACTERS EMASm

Syntax diagramm: Text input directly in the PLC with a terminal

#n #” * ”#

TEXT

#n : Successive telegram number (direct constant 1 ... 99)


#” : Start identifier for text input
”# : End identifier for text input in terminal mode
*: Dummy parameter for character/byte
#: Dummy parameter for digits
TEXT: All ASCII characters 1 ... FF except * and #

Correcting a character within a text input in terminal Receiving and processing telegrams
mode
An incorrectly entered character can not be corrected Receiving telegrams
when entering a text. To correct the text input it must be The QUIT input controls reception of telegrams and also
terminated with a text input end identifier “# and program serves the purpose of acknowledgement in the event of
input must be terminated by <CR>. Continue with pro- an error.
gram input at the address of the character to be cor-
rected. Text input then begins with the text input start ● QUIT = 0: Telegram reception enabled.
identifier #”.
● QUIT = 1: Telegram reception not enabled. Acknow-
ledgement after reception of an invalid tele-
Input of texts containing more than 80 characters on gram.
a terminal
When making a text input, no more than 80 characters The EMAS automatically assumes the “error” state if
can be displayed on each line of the screen. If the text is agreement with none of the stored comparison telegrams
longer than 80 characters, text input must be terminated is ascertained when comparing a telegram received. In
at the end of the screen line by means of the text input end this case, EMAS will not process any new telegram until
identifier “# and you must jump to the next line on the the error is acknowledged with a 1 signal at the QUIT in-
screen by means of the ; character. Now continue text in- put and reception of telegrams is enabled again (next
put with the text input start identifier #”. cycle) with a 0 signal at the QUIT input.

907 PC 331/Issued: 11.98 10–15


EMASm RECEPTION OF CHARACTERS

Processing telegrams Special case:


If more user information is planned in a comparison tele-
The EMAS compares a received telegram character by gram than user information outputs are available on the
character to the comparison telegrams stored. In doing block, i.e. specified at the input #ANU, the received user
so, agreement between the dummy parameters in the data is output through the user information outputs until
comparison telegram and the affiliated current characters the end of the outputs has been reached. The remaining
in the received telegram is checked. user data received will not be output.

Important: For EMAS, the telegram end identifier indica- The following applies in this error case:
tes the end of the telegram to be received. MEUN = 1, because it has not been possible to
This is why the telegram end identifier must process the telegram properly
not occur within a telegram. This also applies
to user characters received on the basis of a RDY = 1, because a telegram has been
dummy parameter (# or *). received and processed
TELN = Text No. of the relevant comparison
Agreement
telegram
If the EMAS ascertains agreement between the received
telegram and one of its comparison telegrams, the follow- MW0... MWn = The part of the current user data
ing applies to the outputs: from the received telegram for
which the number of planned user
MEUN = 0, because it has been possible to information outputs suffices.
receive and process the telegram
properly
No agreement
RDY = 1, because a telegram has been The received telegram agrees with none of the stored
received and processed comparison telegrams.
The following then applies to the outputs:
TELN = Number of the relevant comparison
telegram MEUN = 1, because the received telegram is invalid
RDY = 1, because a telegram has been received and
MW0 ... MWn = Current user data from the te–
processing of it has been terminated
legram received
The EMAS is now in the “ERROR” state. In this case,
The coherent digits defined by a dummy digit group in the EMAS does not process any new telegram until the error
comparison telegram are read out of the received tele- is acknowledged with a 1 signal at the QUIT input and the
gram, are combined in one numerical value and this is reception of telegrams is enabled again (next cycle) with a
output to one word operand (user information output). 0 signal at the QUIT input.
Text characters marked by dummy text characters (*) in
the comparison text are read out of the received telegram
and each single character/byte is output without change Acknowledgement of the error
to a word operand (user information output). Set QUIT = 1 and then, in the next cycle QUIT = 0.
After reception of telegrams has been enabled, it may
The user information is allocated to the outputs
happen that still no telegram is available for reception or
MW0...MWn in the same sequence as the user informa-
that a telegram has not yet been received and evaluated
tion occurs in the currently received telegram (see also
completely.
examples).
In this case, the outputs are set as follows
The maximum number of user information word operands
to be output is specified at the input #ANU. The maximum ● MEUN = 1 and
number results from the telegram with the most user in- ● RDY = 0
formation word operands to be reserved (up to 256 word
operands, in which case the telegram would consist of until a telegram has been received and processed com-
user information only). pletely.

10–16 907 PC 331/Issued: 11.98


RECEPTION OF CHARACTERS EMASm

Communication between several EMAS Notes:


blocks and the same serial interface – The texts designated TEXT1, TEXT2 and TEXT3 in the
– EMAS blocks of a user program which access the sa- example are permanently planned texts which EMAS
me serial interface must be interlocked so that only does not output to user information outputs. They serve
ever one EMAS block is active. If this is not done, tele- exclusively to identify an arriving telegram.
grams may be processed by the wrong EMAS and de-
Any sequence of texts and dummy parameters for cha-
clared invalid.
racters and digits is possible.
– If both user program 1 and also user program 2 contain
EMAS blocks which access the same serial interface, – Up to five # may be specified as dummy parameters for
they must be interlocked so that only ever one EMASm digits. Precisely one dummy parameter (#) must be
block is active. If this is not done, telegrams may be specified in the comparison telegram for each digit of
processed by the wrong EMAS and declared invalid. the decimal number. No dummy parameter must be
specified for the decimal number’s sign. EMAS takes
A telegram loss can be avoided by interlocking of the
its sign into account automatically.
EMAS blocks. Interlocking must be planned so that only
the EMAS block is enabled for which the telegram arriving
E.g.: Decimal number Dummy parameters
through the interface is intended.
1234 ####
+1234 ####
Communikation by an EMAS block and a –1234 ####
DRUCK block with the same serial interface
The EMAS block checks the received decimal number in
An EMAS and a DRUCK block can use the same serial relation to its significant range. Only numbers within the
interface without special precautions having to be taken. +32767 range can be processed in the PLC. If the re-
Example of a comparison telegram ceived decimal number exceeds the significant range, the
#n#”TEXT1***TEXT2#####TEXT3”#
EMAS will automatically insert the maximum respective
limit. The limit for a positive number is +32767 and the lim-
it is –32767 for a negative number.

Identifier ”# for the end


of a text input;
not neccessary for the
ABB Procontic pro-
gramming system

Dummy digits for a de-


cimal number (a num-
ber comprising up to 5
digits)

Dummy characters
(e.g. 3 characters/by-
tes)
Identifier #” for the
start of a text input

Input of telegram num-


bers 1 to 99 as a direct
constant

907 PC 331/Issued: 11.98 10–17


EMASm RECEPTION OF CHARACTERS

Further examples of comparison telegrams


Input with ABB Procontic programming system
Example 1: Text 1: #1#”RO104

Example 2: Text 2: #2#”DO##”#”###

Terminate text
input and restart,
see also special case

Example 3: Text 3: #3#”CO##****

Example 4: Text 4: #4#”*****###**

Special case, example 2:


If the text character (”) is used and a dummy parameter
for digits (#) follows the text character, the input must be
terminated after the text character (”). A subsequent text
or dummy parameter begins with the input identifier of a
new text input (#”).

Input directly in the PLC in terminal mode


Example 1: Text 1: #1#”RO104”#

Example 2: Text 2: #2#”DO##””##”###”#

Terminate text input


and restart, see
also special case

Example 3: Text 3: #3#”CO##****”#

Example 4: Text 4: #4#”*****###**”#

Special case, example 2:


If the text character (”) is used and a dummy parameter
for digits (#) follows the text character, the input must be
terminated after the text character (”). A subsequent text
or dummy parameter begins with the input identifier of a
new text input (#”).

10–18 907 PC 331/Issued: 11.98


RECEPTION OF CHARACTERS EMASm

Input of comparison telegrams and the corresponding received telegram

User input Meaning Telegram received


through serial interface
____________________________________________________________________________________________

#1 Telegram No. 1, direct constant


#” Identifier for the start of text input
R Letter in ASCII 52H
O ” ” 4FH
1 Number in ASCII 31H
0 ” ” 30H
4 ” ” 34H
End of text character e. g. <CR> 0DH
”# Identifier for the end of text input (dropped when using the ABB progr. system)
#2 Telegram No. 2, direct constant
#” Identifier for the start of text input
D Letter in ASCII 44H
O ” ” 4FH
Sign (+) 2BH
# 1st of two digits xxH
# 2nd of two digits xxH
” Character in ASCII 22H
”# Identifier for the end of text input (dropped when using the ABB progr. system)
#” Identifier for the start of text input
# 1st of 3 digits yyH
# 2nd of 3 digits yyH
# 3rd of 3 digits yyH
” Character in ASCII 22H
”# Identifier for the end of text input (dropped when using the ABB progr. system)
End of text character, e. g. <CR> 0DH
#3 Telegram No. 3, direct constant
#” Identifier for the start of text input
C Letter in ASCII 43H
O ” ” 4FH
Sign (–) 2DH
# 1st of 2 digits zzH
# 2nd of 2 digits zzH
* 1st of 4 characters nnH
* 2nd of 4 characters nnH
* 3rd of 4 characters nnH
* 4th of 4 characters nnH
End of text character, e.g. <CR> 0DH
”# Identifier for the end of text input (dropped when using the ABB progr. system)
#4 Telegram No. 4, direct constant
#” Identifier for the start of text input
* 1st of 5 characters mmH
* 2nd of 5 characters ”
* 3rd of 5 characters ”
* 4th of 5 characters ”
* 5th of 5 characters ”
# 1st of 3 digits xxH
# 2nd of 3 digits ”
# 3rd of 3 digits xxH
* 1st of 2 characters nnH
* 2nd of 2 characters nnH
End of text character <CR> 0DH
”# Identifier for the end of text input (dropped when using the ABB progr. system)

907 PC 331/Issued: 11.98 10–19


EMASm RECEPTION OF CHARACTERS

The following telegrams have been received and eva- MEUN =0


luated: RDY =1
TELN =3
Example 1 MW0 = –11
MW1 =A
RO104<CR>
MW2 =U
The number 1 is output through the TELN output. MW3 =T
MW4 =O
The outputs MW0...MWn are not written because no user Example 4
information is planned.
TEMPO120KM<CR>
As the received telegram has been evaluated and agrees
The number 4 is output through the TELN output.
with a comparison telegram, the following applies:
54H (T in ASCII) is present at the output MW0 as the con-
MEUN =0 tents of a word flag.
RDY =1
TELN =1 45H (E in ASCII) is present at the output MW1 as the con-
tents of a word flag.
Example 2
4DH (M in ASCII) is present at the output MW2 as the con-
DO+12”457”<CR> tents of a word flag.
50H (P in ASCII) is present at the output MW3 as the con-
The number 2 is output through the TELN output. tents of a word flag.
The value 12 is present at the output MW0 as the con- 4FH (O in ASCII) is present at the output MW4 as the con-
tents of a word flag. tents of a word flag.
The value 457 is present at the output MW1 as the con- The value 120 is present at the output MW5 as the con-
tents of a word flag. tents of a word flag.
As the received telegram has been evaluated and agrees
with a comparison telegram, the following applies: 4BH (K in ASCII) is present at output MW6 as the contents
of a word flag.
MEUN =0
RDY =1 4DH (M in ASCII) is present at output MW7 as the con-
TELN =2 tents of a word flag.
MW0 = 12 As the received telegram has been evaluated and agrees
MW1 = 457 with a comparison telegram, the following applies:

Example 3 MEUN =0
RDY =1
CO–11AUTO<CR> TELN =4
MW0 =T
The number 3 is output through the TELN output. MW1 =E
MW2 =M
–11 is present at the output MW0 as the contents of a
MW3 =P
word flag.
MW4 =O
41H (A in ASCII) is present at the output MW1 as the con- MW5 = 120
tents of a word flag. MW6 =K
MW7 =M
55H (U in ASCII) is present at the output MW2 as the con- Example 5
tents of a word flag.
XY25OTTO<CR>
54H (T in ASCII) is present at the output MW3 as the con-
The received telegram has been evaluated, but agrees
tents of a word flag.
with none of the comparison telegrams.
4FH (O in ASCII) is present at the output MW4 as the con- Therefore the following applies:
tents of a word flag.
MEUN =1
As the received telegram has been evaluated and agrees RDY =1
with a comparison telegram, the following applies: TELN = is not allocated

10–20 907 PC 331/Issued: 11.98


RECEPTION OF CHARACTERS EMASm

Reception of further telegrams is blocked until reception Examples of end of telegram characters to be specified in
of the invalid telegram is acknowledged at the QUIT input. the SINIT block:
End of telegram character <ETX> = 03H = 3
<EOT> = 04H = 4
The receive driver of the EMAS block recognizes the end
of the received telegram by virtue of the end of telegram <CR> = 0DH = 13
character. <LF> = 0AH = 10
<SP> = 20H = 32
. . .
. . .
____________________________________________________________________________________________
Effective data transmission rate in the EMAS block
Not available for 07 KR 31.
The effective data transmission rate (characters actually
read through the serial interface) depends on the load on
the PLC and the set baud rate.
The following relationship roughly applies:

Marginal condition: set baud rate: 9600 Baud

Baud

1000
900
800
700
600
500
400
300
200
100

10 20 30 40 50 60 70 80 90 100

Load in %

Important: The load indication (command AL) is correct


only if no communication is taking place
through the serial interface at the time of indi-
cation. Communication adulterates the load
indication and renders it useless. If a user pro-
gram contains the blocks DRUCK or EMAS,
these must be disabled while determining the
load.

907 PC 331/Issued: 11.98 10–21


EMASm RECEPTION OF CHARACTERS

Example

FBD/LD IL

!BA 0
EMASm EMAS
M 00,00 QUIT M 00,00
MW 00,00 SSK MEUN M 01,00
MW 00,00
# 1 #ANU RDY M 02,00
# 1
MW 01,00
# 1 VT0 TELN M 01,00
#”KM### VT1 MW0 MW 05,00 M 02,00
MW 01,00
MW 05,00
# 1
#”KM###

10–22 907 PC 331/Issued: 11.98


ADDITIONAL COMPARISON TELEGRAMS FOR EMASm EMASmVT

The connection element EMASmVT serves to additional-


ly plan comparison telegrams when using the EMASm
block. FBD/LD IL

EMASmVT
VT
VT

____________________________________________________________________________________________

Parameters
VT ALL Comparison telegram, input capable of duplication
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: not available
Additional runtime: not available
Output updating: not applicable
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The maximum occurring number of outputs (#ANU) for


the received user data is specified at the EMASm block.
The connection element EMASmVT serves to additional- When specifying this value, the comparison telegrams
ly plan comparison telegrams when using the EMASm planned on the connection element EMASmVT must also
block. be taken into account.
In the programming system, the number of duplications of
an input/output is limited to 63. Therefore, the number of VT Comparison telegrams
comparison telegrams that can be planned is also limited
to a maximum of 32. The comparison telegrams are planned on the input VT
capable of duplication. Planning is completely the same
Using the connection element EMASmVT, further com- as on the VT input of the EMASm block.
parison telegrams can be added for each EMASm block.
The maximum number of comparison telegrams per
EMASm is 99. At the same time, the comparison tele- Note:
grams added with the connection element EMASmVT
are also counted. If comparison telegrams are not stored in the program-
ming system in the IL, but are entered directly in the
All comparison telegrams planned on the EMASm block PLC by means of a terminal, the following applies:
are stored directly after EMASm in the instruction list. The – the comparison text begins with a start identi-
comparison telegrams planned on the connection ele- fier: #”
ment EMASmVT are stored in the IL directly after the – the comparison text ends with the end
comparison telegrams of the EMASm block. identifier: ”#
Important:
The connection element(s) EMASmVT must be planned Refer also to the PLC description, ABB Procontic T300,
in the FBD directly after the EMASm block. chapter entitled text processing.

907 PC 331/Issued: 11.98 11–1


EMASmVT ADDITIONAL COMPARISON TELEGRAMS FOR EMASm

Example

FBD/LD IL

!BA
EMASm
EMAS
M 00,00 QUIT
MW 00,00 SSK MEUN M 01,00 M 00,00 QUIT
# 2 #ANU RDY M 01,01 MW 00,00 SSK
MW 01,00 # 2 #ANU
# 1 VT0 TELN
MW 02,00 M 01,00 MEUN
# ”ABB#### VT1 MW0
MW 02,01 M 01,01 RDY
MW1
MW 01,00 TELN
MW 02,00 MW0
MW 02,01 MW1
# 1 Telegram No. 1
EMASmVT
#”ABB#### Text 1
# 2 VT0 # 2 Telegram No. 2
# ”CCC** VT1 # ”CCC** Text 2
# 3 VT2 # 3 Telegram No. 3
# ”DDD*## VT3 # ”DDD*## Text 3

CE FBD Definition

EMASmVT

VT

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

VT E X N P Y 1 0

CE IL Definition
[ 1
00000 PP 1 VT Input comparison telegrams
] 1

11–2 907 PC 331/Issued: 11.98


ON DELAY ESV

The 0–1 edge of the input TI I0 is delayed by the time ZD


and is output as a 0–1 edge at the output Q.
FBD/LD IL
The output Q retains 0 level if the input TI I0 returns to 0
level before the time ZD has elapsed.
!BA 0
ESV ESV
T I I0 TI I 0
ZD Q ZD
Q

____________________________________________________________________________________________

Parameters
T I I0 BINARY E, M, A, S, K Input signal
ZD DOUBLE WORD MD, KD Delay time
Q BINARY M, A Delayed signal
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 38 µs; max. runtime 400 µs, in case 97 µs – 554 µs
of edges at input TI I0
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: 1 word 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description The inputs and the output can neither be duplicated nor
inverted.
The 0–1 edge of the input TI I0 is delayed by the time ZD
and is output as a 0–1 edge at the output Q.

The output Q retains 0 level if the input TI I0 returns to 0


level before the time ZD has elapsed.
T 0
The time is specified in milliseconds. Only integral multi-
ple of 5 ms are admissible (Examples: 5 ms, 500 ms,
100 000 ms, ...). Time range which can be specified: Q
5 ms ... 24.8 days. t t
In case of the indirect constant KD the value of the delay
time is specified in the long text. t0 ZD t0 t<ZD
Maximum time offset at the output: < 1 cycle time

Meaningful range for ZD: > 1 cycle time

907 PC 331/Issued: 11.98 11–3


ESV ON DELAY

General response Important note


The behaviour of the timers has been changed. All run-
● Started timers are processed by the PLC’s operating ning timers are stopped when one of the following actions
system and are therefore completely independent of occurs:
processing of the PLC program. An appropriate mes-
sage of the operating system is not issued to the affilia- – Abort PLC program
ted timer block in the PLC program until the timer has – RUN/STOP switch from RUN –> STOP
elapsed.
This modification is valid as of:
● Processing of a timer in the PLC’s operating system is 07 KR 91 Index g
not influenced by the following commands: 07 KT 92 Index g
– Abort program 07 KT 93
– Start program
– Stop program
– Continue program
That is to say, processing of a started timer is continued
in the PLC’s operating system even if the affiliated PLC
program is aborted, restarted or stopped and continued
again.

Initialization

The timers are always initialized each time a cold or warm


start of the PLC is executed. A running timer will always
be aborted by a cold or warm start of the PLC.
Cold start:
– KALT <CR> command
– Activating the voltage for the first time
Warm start:
– WARM <CR> command
– Activating the voltage
– RESET switch

11–4 907 PC 331/Issued: 11.98


ON DELAY ESV

Example

FBD/LD IL

!BA 0
ESV ESV
E 01,00 TI I 0 E 01,00
KD 03,00 ZD Q M 07,01 KD 03,00
M 07,01

CE FBD Definition

ESV
TI I 0
ZD Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

TI I 0 E L N P Y 0 0
ZD E D N P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 ESV
00002 PP 0 T I I0 Input BINARY (start time)
00003 PP 0 ZD Input DOUBLE WORD (time value)
00004 PP 0 Q Output BINARY (time)

907 PC 331/Issued: 11.98 11–5


FCDEL DELETE DATA SEGMENT IN SMARTMEDIA CARD

This function block deletes a data segment in the Smart-


Media Card. All data in this data segment are lost after FBD/LD
deletion.
FCDEL
The SmartMedia Card can also be accessed via the pro-
0/1 RDY
gramming interface using the operating and test functions
SEG ERR
(for initialization of the SmartMedia Card and operating ERNO
function refer to AC31 System description volume 7.3, chap-
ter 2.4.1, commands FCINIT, FCWR, FCRD, FCDEL).

Parameters
0/1 BINARY E, K , M, S Deletion of a data segment by a 0/1 edge
SEG WORD EW, MW Number of the data segment, valid values: 1...250
RDY BINARY A, M Deletion procedure completed
ERR BINARY A, M Error occurred, data segment cannot be deleted
ERNO WORD AW, MW Error number

CE data
Output updating: no
Number of historical values: 2 words

Available as of: 07 KT 94 Index e

Description 0/1 BINARY


This function block deletes a data segment in the Smart- Processing of the block is controlled via input 0/1. The
Media Card. All data in this data segment are lost after following applies:
deletion.
0/1 = 0: All outputs are set to the value 0. This
The SmartMedia Card can also be accessed via the pro- is not valid during a deletion procedure.
gramming interface using the operating and test functions
(for initialization of the SmartMedia Card and operating
function refer to AC31 System description volume 7.3, chap- 0/1 = 0/1 edge: Deletion of the data segment is started
ter 2.4.1, commands FCINIT, FCWR, FCRD, FCDEL). once. Until the deletion procedure has
not been finished (RDY = 1), input 0/1
The input SEG defines the data segment in the SmartMe-
will not be evaluated again.
dia Card. The deletion of a data segment can take several
PLC cycles.
With a 0/1 edge at input 0/1 the data segment deletion is 0/1 = 1: The block is not processed, i.e. it no
performed once. Until the deletion procedure has not been longer changes its outputs. This is not
finished (RDY = 1), the input will not be evaluated again. valid during a deletion procedure.

After completion of the deletion procedure all function block


outputs are updated. The deletion operation was successful, SEG WORD
if RDY = 1 and ERR = 0. If the outputs show RDY = 1 and
The number of the data segment in the SmartMedia Card
ERR = 1, the data segment could not be deleted.
is specified at input SEG. In the SmartMedia Card, 250
data segments are available.
Valid values: 1...250.

7 11-6 907 PC 331 / Issued: 08.99


DELETE DATA SEGMENT IN SMARTMEDIA CARD FCDEL

RDY BINARY ERNO WORD


Output RDY indicates that the data segment deletion has The output ERNO indicates an error number. This output
been completed. This output has always to be considered has always to be considered together with the outputs RDY
together with output ERR. The following applies: and ERR. The following applies:

ERNO = 0: No error has occurred.


RDY = 1 and ERR = 0: The deletion procedure has been
completed. The data segment has ERNO = 1: Block number and number of blocks is
been deleted successfully. greater than 63 (Bit 0 of ERNO = 1).
ERNO = 2: The defined data segment is greater than
RDY = 1 and ERR = 1: An error occurred during the dele-
250 (Bit 1 of ERNO = 1).
tion procedure. The data segment
could not be deleted. ERNO = 4: Block not programmable or checksum error
(Bit 2 of ERNO = 1).
ERNO = 8: Block already contains data
ERR BINARY (Bit 3 of ERNO = 1).
Output ERR indicates whether an error occurred during ERNO = 16: Sector not deletable
the deletion operation. This output has always to be con- (Bit 4 of ERNO = 1).
sidered together with output RDY.
ERNO = 32: SmartMedia Card not initalized
If the data segment could not be deleted, the following (Bit 5 of ERNO = 1).
applies: ERNO = 64: SmartMedia Card not inserted
RDY = 1 and ERR = 1. (Bit 6 of ERNO = 1).
Output ERNO signalizes the error number.
The inputs and outputs can neither be duplicated nor inver-
ted.

Graphic
Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

FCDEL
BIT_IN Y N Y 0 00 0/1 RDY 00 0 Y N Y BIT_OUT_FB
WORT_IN Y N Y 0 00 SEG ERR 00 0 Y N Y BIT_OUT_FB
ERNO 00 0 Y N Y WORT_OUT

Source
SN ZN Command / Variable Symbol Long text

00000 00000 FCDEL


00001 PP 00 0/1
00002 PP 00 SEG
00003 PP 00 RDY
00004 PP 00 ERR
00005 PP 00 ERNO
00006

907 PC 331 / Issued: 08.99 11-7


7
FCRD READ DATA SET FROM SMARTMEDIA CARD

The function block reads a data set from a data segment


of the SmartMedia Card and stores the read data set be- FBD/LD
ginning at the start flag defined by SM.
FCRD
0/1 RDY
SM ERR
nB ERNO
SEG
BNR

Parameters
0/1 BINARY E, K , M, S Storage of a data set by a 0/1 edge
SM BINARY A, E, K, M, S
WORD AW, EW, KW, MW
DOUBLE WORD KD, MD Start flag of the data set
nB WORD EW, KW, MW Number of data set blocks;
valid values: 1...128
SEG WORD EW, KW, MW Number of the data segment, valid values: 1...250
BNR WORD EW, KW, MW Number of the block in the data segment;
valid values: 0...127
RDY BINARY A, M Reading procedure completed
ERR BINARY A, M Error has occurred
ERNO WORD AW, MW Error number

CE data
Output updating: no
Number of historical values: 2 words

Available as of: 07 KT 94 Index e

Description
The function block reads a data set from a data segment The following applies: Either 64 binary data or 32 word
of the SmartMedia Card and stores the read data set be- data are read per block. The data of each block are se-
ginning at the start flag defined by SM. The data of the cured by a checksum.
data set have been stored in the SmartMedia Card by the
function block FCWR or by the operation command FCWR. The reading procedure of a data record is carried out once
by a 0/1 edge at input 0/1. If no error occurred when read-
Important note: ing the data, the outputs RDY and ERNO are set to 0. The
The SmartMedia Card can only be accessed using the data set is stored beginning at the defined start flag SM.
function blocks FCWR and FCRD or via the programming Storing the data set can take several PLC cycles.
interface using the operating and test functions (for initial-
ization of the SmartMedia Card and operating function re- If an error occurs during the reading procedure, RDY and
fer to AC31 System description volume 7.3, chapter 2.4.1, ERR are both set to 1. The error type is indicated at output
commands FCINIT, FCWR, FCRD, FCDEL). ERNO.

The inputs SM and nB define which data are read from the The outputs RDY, ERR and ERNO are set to 0 by a 0
SmartMedia Card. The input SEG defines the SmartMedia signal at input 0/1.
Card data segment. The number of data which are read
from a block depends on input SM.

7 11-8 907 PC 331 / Issued: 08.99


READ DATA SET FROM SMARTMEDIA CARD FCRD

0/1 BINARY BNR WORD


Processing of the block is controlled via input 0/1. The The block number in the data segment is specified at input
following applies: BNR.
Valid values: 0...127
0/1 = 0: The outputs RDY, ERR and ERNO are
set to 0. RDY BINARY

0/1 = 0/1 edge: The reading procedure of the data set is Output RDY indicates that the reading of the data record
carried out once. has been completed. This output has always to be consid-
ered together with output ERR. The following applies:
0/1 = 1: The block is not processed, i.e. it no
longer changes its outputs.
RDY = 1 and ERR = 0: The reading operation has been
completed. The data set is stored
SM BINARY/WORD/DOUBLE WORD beginning at the defined input SM.

The first binary/word/double word flag for storing the data


set is specified at input SM. RDY = 1 and ERR = 1: An error occurred during the rea-
ding procedure. Output ERNO si-
nB WORD gnalizes the error number.
The number of the data set blocks is specified at input nB.
ERR BINARY
The number of data which are read from a block depends
on input SM. Either 64 binary data or 32 word data or 16 Output ERR indicates whether an error occurred during
double word data are read per block. the reading operation. This output has always to be con-
Valid values: 1...128 sidered together with output RDY.
Examples: If an error has occurred, the following applies:
RDY = 1 and ERR = 1.
- SM = M 01,00 and nB = 1: Storing the data from
Output ERNO signalizes the error number.
M 01,00 to M 04,15
(1 block = 64 binary data)
- SM = M 01,00 and nB = 2: Storing the data from ERNO WORD
M 01,00 to M 08,15
(2 blocks = 128 binary data) The output ERNO indicates an error number. This output
has always to be considered together with the outputs RDY
- SM = MW 02,00 and nB = 1: Storing the data from and ERR. The error number is binary encoded. The follow-
MW 02,00 to MW 03,15 ing applies:
(1 block = 32 word data)
ERNO = 0: No error has occurred.
- SM = MW 02,00 and nB = 2: Storing the data from
ERNO = 1: Block number and number of blocks is
MW 02,00 to MW 05,15
greater than 63 (Bit 0 of ERNO = 1).
(2 blocks = 64 word data)
ERNO = 2: The defined data segment is greater than
- SM = MD 03,00 and nB = 1: Storing the data from 250 (Bit 1 of ERNO = 1).
MD 03,00 to MD 03,15
ERNO = 4: Block not programmable or checksum error
(1 block = 16 double word data)
(Bit 2 of ERNO = 1).
- SM = MD 03,00 and nB = 2: Storing the data from ERNO = 8: Block already contains data
MD 03,00 to MD 04,15 (Bit 3 of ERNO = 1).
(2 blocks = 32 double word data)
ERNO = 16: Sector not deletable
SEG WORD (Bit 4 of ERNO = 1).
The number of the data segment in the SmartMedia Card ERNO = 32: SmartMedia Card not initalized
is specified at input SEG. In the SmartMedia Card, 250 (Bit 5 of ERNO = 1).
data segments are available. ERNO = 64: SmartMedia Card not inserted
Valid values: 1...250. (Bit 6 of ERNO = 1).
The inputs and outputs can neither be duplicated nor inver-
ted.

907 PC 331 / Issued: 08.99 11-9


7
FCRD READ DATA SET FROM SMARTMEDIA CARD

Graphic
Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

FCRD
BIT_IN Y N Y 0 00 0/1 RDY 00 0 Y N Y BIT_OUT_FB
ALLE Y N Y 0 00 SM ERR 00 0 Y N Y BIT_OUT_FB
WORT_IN Y N Y 0 00 nB ERNO 00 0 Y N Y WORT_OUT
WORT_IN Y N Y 0 00 SEG
WORT_IN Y N Y 0 00 BNR

Source
SN ZN Command / Variable Symbol Long text

00000 00000 FCRD


00001 PP 00 0/1
00002 PP 00 SM
00003 PP 00 nB
00004 PP 00 SEG
00005 PP 00 BNR
00006 PP 00 RDY
00007 PP 00 ERR
00008 PP 00 ERNO
00009

7 11-10 907 PC 331 / Issued: 08.99


WRITE DATA SET TO SMARTMEDIA CARD FCWR

The function block writes a data set to a data segment in


the SmartMedia Card. FBD/LD

FCWR
0/1 RDY
SM ERR
nB ERNO
SEG
BNR

Parameters
0/1 BINARY E, K , M, S Storage of a data set by a 0/1 edge
SM BINARY A, E, K, M, S
WORD AW, EW, KW, MW
DOUBLE WORD KD, MD Start flag of the data set
nB WORD EW, KW, MW Number of data set blocks;
valid values: 1...128
SEG WORD EW, KW, MW Number of the data segment, valid values: 1...250
BNR WORD EW, KW, MW Number of the block in the data segment;
valid values: 0...127
RDY BINARY A, M Writing procedure completed
ERR BINARY A, M Error has occurred
ERNO WORD AW, MW Error number

CE data
Output updating: no
Number of historical values: 2 words

Available as of: 07 KT 94 Index e

Description
The function block writes a data set to a data segment in The inputs SM and nB define which data are written to the
the SmartMedia Card. For this purpose, there are 250 data SmartMedia Card. The input SEG defines the data seg-
segments (1...250) available in the SmartMedia Card. A ment in the SmartMedia Card. The number of data which
deletion procedure (function block FCDEL) always deletes can be stored in a block depends on input SM.
a complete data segment. Each data segment consists of
128 blocks (0...127). Each block consists of 32 words. The following applies: Either 64 binary data or 32 word
data or 16 double word data are written per block. The data
After a deletion procedure, each of these 128 data seg- of each block are secured by a checksum.
ment blocks can store data only once. If a block contain-
ing data is to be overwritten by new data, the entire data When a writing procedure of a data set is started
segment has to be deleted first. In doing so, all data in this (0/1 edge at input 0/1), the data of the data set must not
segment are lost. be changed until the end of the writing procedure (RDY =
TRUE). Storing a data set in the SmartMedia Card can
Important note: take several PLC cycles.
The SmartMedia Card can only be accessed using the
function blocks FCWR and FCRD or via the programming
interface using the operating and test functions (for initial-
ization of the SmartMedia Card and operating function re-
fer to AC31 System description volume 7.3, chapter 2.4.1,
commands FCINIT, FCWR, FCRD, FCDEL).

907 PC 331 / Issued: 08.99 11-11


7
FCWR WRITE DATA SET TO SMARTMEDIA CARD

With a 0/1 edge at input 0/1 the data segment writing is Examples:
performed once. Until the writing procedure has not been
finished (RDY = 1), input 0/1 will not be evaluated again. - SM = M 01,00 and nB = 1: Writing the data from
M 01,00 to M 04,15
After the writing operation has been completed, the block (1 block = 64 binary data)
outputs RDY, ERR and ERNO are updated. The writing
operation was successful, if RDY = 1 and ERR = 0. For - SM = M 01,00 and nB = 2: Writing the data from
the outputs RDY = 1 and ERR = 1, an error occurred. The M 01,00 to M 08,15
error type is signalized at output ERNO. (2 blocks = 128 binary data)

After storing the data set in the SmartMedia Card, the block - SM = MW 02,00 and nB = 1: Writing the data from
outputs RDY, ERR and ERNO are set to 0 by a signal 0 at MW 02,00 to MW 03,15
input 0/1. A new 0/1 edge at input 0/1 starts a new writing (1 block = 32 word data)
procedure. Since without a previous deletion of the data - SM = MW 02,00 and nB = 2: Writing the data from
segment no new data can be written to blocks which al- MW 02,00 to MW 05,15
ready contain data, the input BNR must point to the next (2 blocks = 64 word data)
free block for the next writing procedure.
- SM = MD 03,00 and nB = 1: Writing the data from
MD 03,00 to MD 03,15
(1 block = 16 double word data)
- SM = MD 03,00 and nB = 2: Writing the data from
MD 03,00 to MD 04,15
0/1 BINARY (2 blocks = 32 double word data)
Processing of the block is controlled via input 0/1. The SEG WORD
following applies:
The number of the data segment in the SmartMedia Card
0/1 = 0: The outputs RDY, ERR and ERNO are is specified at input SEG. In the SmartMedia Card, 250
set to 0. This is not valid during a writing data segments are available.
procedure.
Valid values: 1...250.
BNR WORD
0/1 = 0/1 edge: Writing of the data set is started once.
Until the writing procedure has not been The block number in the data segment is specified at input
finished (RDY = 1), the input will not be BNR.
evaluated again. Valid values: 0...127
RDY BINARY
0/1 = 1: The block is not processed, i.e. it no
Output RDY indicates that writing of the data record has
longer changes its outputs. This is not
been completed. This output has always to be considered
valid during the writing procedure.
together with output ERR. The following applies:

SM BINARY/WORD/DOUBLE WORD RDY = 1 and ERR = 0: The writing operation has been
completed. The data set has been
The first binary/word/double word flag of the data set is
stored in the SmartMedia Card.
specified at input SM. When a writing procedure of a data
set is started (0/1 edge at input 0/1), the data of the data RDY = 1 and ERR = 1: An error occurred during the writ-
set must not be changed until the end of the writing proce- ing procedure. Output ERNO sig-
dure (RDY = 1). nalizes the error number.
nB WORD
The number of the data set blocks is specified at input nB. ERR BINARY
The number of data which can be stored in a block de- Output ERR indicates whether an error occurred during
pends on input SM. Either 64 binary data or 32 word data the writing procedure. This output has always to be consi-
or 16 double word data are stored per block. dered together with output RDY. If an error has occurred,
Valid values: 1...128 the following applies:
RDY = 1 and ERR = 1.
Output ERNO signalizes the error number.

7 11-12 907 PC 331 / Issued: 08.99


WRITE DATA SET TO SMARTMEDIA CARD FCWR

ERNO WORD ERNO = 8: Block already contains data


(Bit 3 of ERNO = 1).
The output ERNO indicates an error number. This output
has always to be considered together with the outputs RDY ERNO = 16: Sector not deletable
and ERR. The error number is binary encoded. The follo- (Bit 4 of ERNO = 1).
wing applies: ERNO = 32: SmartMedia Card not initalized
(Bit 5 of ERNO = 1).
ERNO = 0: No error has occurred.
ERNO = 64: SmartMedia Card not inserted
ERNO = 1: Block number and number of blocks is
(Bit 6 of ERNO = 1).
greater than 63 (Bit 0 of ERNO = 1).
The inputs and outputs can neither be duplicated nor inver-
ERNO = 2: The defined data segment is greater than
ted.
250 (Bit 1 of ERNO = 1).
ERNO = 4: Block not programmable or checksum error
(Bit 2 of ERNO = 1).

Graphic
Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

FCWR
BIT_IN Y N Y 0 00 0/1 RDY 00 0 Y N Y BIT_OUT_FB
ALLE Y N Y 0 00 SM ERR 00 0 Y N Y BIT_OUT_FB
WORT_IN Y N Y 0 00 nB ERNO 00 0 Y N Y WORT_OUT
WORT_IN Y N Y 0 00 SEG
WORT_IN Y N Y 0 00 BNR

Source
SN ZN Command / Variable Symbol Long text

00000 00000 FCWR


00001 PP 00 0/1
00002 PP 00 SM
00003 PP 00 nB
00004 PP 00 SEG
00005 PP 00 BNR
00006 PP 00 RDY
00007 PP 00 ERR
00008 PP 00 ERNO
00009

907 PC 331 / Issued: 08.99 11-13


7
FDEL DELETE DATA SEGMENT IN FLASH EPROM

FBD/LD IL

FDEL FDEL !BA 0


0/1 RDY M 00,00 0/1 RDY A 00,00 FDEL
#SEG ERR #1 SEG ERR A 00,01 M 00,00
#1
A 00,00
A 00,01

Parameters
0/1 BINARY E, M, A, K, S Deletion of one data segment by a 0/1 edge
#SEG DIRECT #, #H Number of the data segment in the FLASH EPROM
CONSTANT 0...3
RDY BINARY A, M Write procedure completed
ERR BINARY A, M Error occurred, data segment cannot be deleted

____________________________________________________________________________________________

Description 0/1 BINARY


The input 0/1 controls the processing of the function
This function block deletes a data segment in the Flash block.
EPROM. All data in this data segment are lost after dele-
tion. 0/1 = 0: All outputs are set to the value of ”0”.
This is not valid during a deletion pro-
cedure.
Important notes:
0/1= 0/1 edge: Deletion of the data segment is started
An access to the Flash EPROM is only permitted by using once.
the function blocks FWR and FRD. It is not allowed to Until the procedure has not been
access the Flash EPROM by other function blocks (WOL, finished (RDY = 1), the input 0/1 will
WOS, COPY,...). not be evaluated again.
0/1 = 1: The function block is not processed,
The input #SEG defines the data segment in the Flash i.e. the function block does no longer
EPROM. change its outputs. This is not valid
The deletion procedure in the Flash EPROM can take during a deletion procedure.
several PLC cycles.
#SEG DIRECT CONSTANT
The number of the data segment in the Flash EPROM is
A 0/1 edge at the input 0/1 starts the deletion procedure given at the input SEG. In the Flash EPROM, 4 data seg-
once. Until the procedure has not been finished ments are available.
(RDY = 1), the input 0/1 will not be evaluated again.
The following is valid:
After completion of the deletion procedure all function – #0 corresponds to data segment 0
block outputs are updated. If then RDY = 1 and ERR = 0, – #1 corresponds to data segment 1
the deletion was successful. If the outputs show RDY = 1 – #2 corresponds to data segment 2
and ERR = 1, the data segment could not be deleted. – #3 corresponds to data segment 3

11–14 907 PC 331/Issued: 11.98


DELETE DATA SEGMENT IN FLASH EPROM FDEL

RDY BINARY ERR BINARY


The output RDY indicates, that the deletion procedure The output ERR indicates whether or not an error has oc-
has been completed. This output has always to be con- curred during the deleting procedure. This output has al-
sidered together with the output ERR. ways to be considered together with the output RDY.
If the data segment could not be deleted, the outputs have
The following is valid: the following statuses:
RDY = 1 and ERR = 0: The deletion procedure has RDY = 1 and ERR = 1
been completed. The data
segment has been deleted The inputs as well as the outputs can neither be doubled
successfully. nor be inverted.
RDY = 1 and ERR = 1: An error has occurred during
the deletion procedure. The
data segment could not be
deleted.
____________________________________________________________________________________________

CE data
Runtime: 07 KR 91 / 07 KT 92 / 07 KT 93 / 07 KP 62
Basic runtime: 23 – 53 µs
Additional runtime: –––
Updating of the outputs: no
Number of historical values: 2 words
Available as of: ABB Procontic CS31 07KT92 R202/R262, 07KT93 R171
ABB Procontic T200 07KP62 R202

907 PC 331/Issued: 11.98 11–15


FEHSU ERROR SEARCHER WITH AUTOMATIC DELETION

This function block searches through a list of binary vari-


ables (E, A, M, S) for set binary variables. If a set binary
variable is found, its serial number referred to the list is FBD/LD IL
indicated. The set binary variable at the input is deleted.
!BA 0
FEHSU
FEHSU R
FREI FREI
R #n
#n END B0
B0 NR END
NR

____________________________________________________________________________________________

Parameters
FREI BINARY E, A, M, S, K Enable search
R BINARY E, A, M, S, K Reset
#n DIRECT #, #H Number of binary variables
CONSTANT
B0 BINARY E, A, M List of binary variables; the input can be duplicated
END BINARY A, M List end reached
NR WORD AW, MW List number of the variables found
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 90 µs
Additional runtime: 10 µs per binary variable at the inputs B0...Bn–1
Output updating: yes if FREI = 1
recommendation: Allocate the output directly to a flag or use a global
intermediate flag; see volume 3, chapter 2.5.3
Number of historical values: 4 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description If a binary variable with the value 1 is found in the list, the
search is ended, the variable is deleted and its list number
This function block searches through a list of binary vari- is output through the output NR. The search is continued
ables (E, A, M, S) for set binary variables. If a set binary again when the block is called again (in the next program
variable is found, its serial number referred to the list is cycle). The binary variable directly following the one
indicated. The set binary variable at the input is deleted. found is now examined first.
The inputs and outputs cannot be negated/inverted. The
input B0 is capable of duplication. The search ends at the end of the list if no further set vari-
able is found.
FREI BINARY
The search for a set binary variable is enabled with the
The value 1 is then allocated to the END output and the
FREI input.
number of the variable found last during the search is indi-
FREI = 0 Search is not enabled
cated at the output NR.
FREI = 1 Search is enabled.

Search: If no set variable is found during a search from the start of


The search is continued until the list, the search is automatically repeated from the start
– a set binary variable is found or of the list when the block is called again. This takes place
– the end of the variable list is reached. until a set variable is found.

11–16 907 PC 331/Issued: 11.98


ERROR SEARCHER WITH AUTOMATIC DELETION FEHSU

R BINARY NR WORD
By means of the input R, the function block is set to a de- The list number of the binary variable found last is output
fined state (reset) in order to be able to start a search from through the NR output.
the start of the variable list. The following affiliations apply:
R = 0 –> No reset of the block
R = 1 –> Reset of the block for preparation of a
search from the start of the list Variable at the input List number
Note: Even when the block is called for the very first B0 1
time after starting the PLC program, a reset must
B1 2
first of all be executed in order to create the cor-
rect marginal conditions for the first search. . .
. .
A reset of the block results in the following:
– Output END = 0 . .
– Output NR = 0 Bn–1 n
– The next search takes place from the start of the list

Priority: If the end of the list is reached during the search without a
The input R has higher priority than the input FREI, i. e. no set variable having been found, the number of the vari-
search is executed as long as there is a 1 signal at the in- able last found continues to be output through the output
put R. NR.
Searching from the start of the list without a variable being
#n DIRECT CONSTANT found:
The number of binary variables planned at the inputs If no set binary variable is found during a search from the
B0...Bn–1 is specified at the input #n. This is specified as start of the list, the state 1 is assigned to the output END
a direct constant. when the end of the list is reached and the value 0 is as-
signed to the output NR. When the block is called again in
B0..Bn–1 BINARY the next program cycle, the search automatically takes
The input B0 can be duplicated (B0...Bn–1). place again from the start of the list. Automatic searching
The list of binary variables to be examined is specified at from the start of the list continues until a set binary vari-
the inputs B0...Bn–1. Owing to the reset mechanism, step able is found once.
operands (S) and indirect constants (K) are not allowed.

END BINARY
Whether or not the end of the specified variable list has
been reached without a set binary variable having been
found in the search just carried out is signalled at the END
output. That is to say, if the last binary variable of the list is
recognized and reported as being “set” during a search,
the output END is not yet set to the value 1. Instead, this
does not take place until the next processing cycle.
END = 0 –> List end not reached
END = 1 –> List end reached without a set binary vari-
able having been found in the current
search

907 PC 331/Issued: 11.98 11–17


FEHSU ERROR SEARCHER WITH AUTOMATIC DELETION

Example

FBD/LD IL

!BA 0
FEHSU
FEHSU M 00,04
M 00,00 FREI M 00,00
M 00,04 R # 3
# 3 #n END M 01,01 M 01,10
M 01,10 B0 NR AW 05,00 M 01,11
M 01,11 B1 M 01,12
M 01,12 B2 M 01,01
AW 05,00

CE FBD Definition

FEHSU
FREI
R
#n END
B NR

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
R E L N P Y 0 0
#n K W N P Y 0 0
B E L N P Y 1 0
END A L N P Y 0 0
NR A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 FEHSU
00002 PP 0 R Input BINARY (Reset)
00003 PP 0 FREI Input BINARY (enable)
00004 PP 0 #n # CONSTANT (number of bits)
[ 1
00005 PP 0 B Input BINARY (element of the list of binary variables)
] 1
00006 PP 0 END Ausgang BINÄR (list end reached)
00007 PP 0 NR Ausgang WORT (No.)

11–18 907 PC 331/Issued: 11.98


STACK, FIRST IN/FIRST OUT FIFO

This function block realizes a stack for binary or word data


from which the data written in first is again read out first
(first in/first out). FBD/LD IL

!BA 0
FIFO FIFO
B/W R
LADE LADE
LESE LESE
R A E
E FST B/W
#L L #L
ANF V ANF
A
FST
L
V

____________________________________________________________________________________________

Parameters
B/W BINARY E, A, M, S, K Binary/word data
LADE BINARY E, A, M, S, K Load FIFO
LESE BINARY E, A, M, S, K Read FIFO
R BINARY E, A, M, S, K Reset FIFO, 0–>1 edge
E BINARY, E, A, M, S, K Input of data in the FIFO
WORD EW, AW, MW, KW
#L DIRECT #, #H Number of memory locations (bytes)
CONSTANT
ANF BINARY E, A, M, K Start of the FIFO in the flag area
WORD EW, AW, MW, KW
A BINARY, E, M Output of data from the FIFO
WORD AW, MW
FST WORD AW, MW Filling level of the FIFO
L BINARY A, M FIFO empty
V BINARY A, M FIFO full
____________________________________________________________________________________________

VE–Data
Runtime:
Basic runtime: 64 µs
Additional runtime: 0 ... 114 µs according to the function to be carried out
Output updating: no; recommendation: Allocate the output directly to a flag or use a global
intermediate flag; see volume 3, chapter 2.5.3
Number of historical values: 4 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This function block realizes a stack for binary or word data
from which the data written in first is again read out first
(first in/first out).
The inputs and outputs can neither be duplicated nor ne-
gated/inverted.

907 PC 331/Issued: 11.98 11–19


FIFO STACK, FIRST IN/FIRST OUT

B/W BINARY R and LADE and LESE


The input BW serves to preselect binary or word process- The value at the input E is forwarded directly to the output
ing (FIFO for binary or word data) A. The output L is set permanently to 1 and the output
FST is set permanently to 0.

B/W = 0 –> word processing E BINARY/WORD


B/W = 1 –> binary processing The value to be transferred into the FIFO is specified at
the input E.
Binary or word processing is defined once and must not #L DIRECT CONSTANT
be changed during operation of the FIFO.
The number of required memory locations (bytes) of the
FIFO is specified at the input A. This quantity is specified
LADE BINARY as a direct constant and results from the following formu-
The value present at the input E is transferred to the next la:
free position of the FIFO by means of a 1 signal at the BINARY data:
LADE input. #L = Number of binary values to be stored
If the FIFO is “full” and a “load” signal is present, the new
value will not be read in. A new value can only be read if a WORD data:
value has been read out first. It is then transferred to the #L = 2 * Quantity of word values to be stored
first position of the FIFO.
E.g.: BINARY data: 3 values –> #L = 3
WORD data: 3 values –> #L = 6
LESE BINARY
A 1 signal at the input LESE results in output of the current The FIFO length parameter is subjected to a plausibility
FIFO value through the output A. If the FIFO is “empty”, a check for the value 0 and, in word processing mode, also
pending read order is ignored and the value 0 is output in relation to an odd byte parameter. If the para-meter
through the output A. The output A is always set to 0 if specified at the input #L is incorrect, the FIFO will assume
there is no read order. the initial state (as after R).

ANF BINARY/WORD
LADE and LESE The FIFO memory start address is specified as a binary
If load and read orders are present simultaneously, the or word flag at the input ANF. The FIFO begins with the
value to be loaded is forwarded directly from the input E to specified flag.
the output A provided the FIFO is empty.
A BINARY/WORD
If the FIFO is not empty, the current FIFO value is output
and the new load information is transferred to it. When the FIFO is read, the current value is available at
The FIFO does not change its filling level in this mode. the output A. If no read order is available, the value 0 is
The value output through the output FST remains con- output.
stant. If the FIFO is empty, the output L remains 1 and the FST WORD
output FST is set to 0.
The output FST indicates the current filling level of the
FIFO at any time. The filling level is the number of binary
R BINARY or word values stored in the FIFO.
A 0–>1 edge at the input R results in the reset of the block. L BINARY
Therefore, values read in before are no longer available.
The output L indicates whether or not the FIFO is empty.
L = 0 –> FIFO is not empty
The output L assumes the value 1 and the outputs FST L = 1 –> FIFO is empty
and A assume the value 0.
V BINARY
The output V indicates whether or not the FIFO is full.
R and LADE
V = 0 –> FIFO is not full
If R and LADE signals are present simultaneously the re- V = 1 –> FIFO is full
set is performed first and then directly afterwards the load
operation. Therefore, the FIFO is reset and the new value No more values can be read in if the FIFO is full. A value
to be read in is then immediately stored in the FIFO as the can only be read in once a value has been read out. This
first value. then takes place as from the start of the FIFO.

11–20 907 PC 331/Issued: 11.98


STACK, FIRST IN/FIRST OUT FIFO

Example

FIFO for 9 binary data, stored as of M 01,10

FBD/LD IL

!BA 0
FIFO FIFO
K 00,01 B/W M 01,09
M 01,01 LADE M 01,01
M 01,05 LESE M 01,05
M 01,09 R A M 12,05 M 06,04
M 6,04 E FST MW 11,07 K 00,01
# 9 #L L A 00,01 # 9
M 01,10 ANF V A 01,15 M 01,10
M 12,05
MW 11,07
A 00,01
A 01,15

FIFO for 3 word data, stored as of MW 10,00

FBD/LD IL

!BA 0
FIFO FIFO
K 00,00 B/W M 02,00
M 01,00 LADE M 01,00
M 01,01 LESE M 01,01
M 02,00 R A MW 11,01 MW 03,01
MW 03,01 E FST MW 11,02 K 00,00
# 6 #L L M 03,00 # 6
MW 10,00 ANF V M 03,01 MW 10,00
MW 11,01
MW 11,02
M 03,00
M 03,01

907 PC 331/Issued: 11.98 11–21


FIFO STACK, FIRST IN/FIRST OUT

CE FBD Definition

FIFO
B/W
LADE
LESE
R A
E FST
#L L
ANF V

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

B/W E L N P Y 0 0
LADE E L N P Y 0 0
LESE E L N P Y 0 0
R E L N P Y 0 0
E E X N P Y 0 0
#L K W N P Y 0 0
ANF E X N P Y 0 0
A A X N P Y 0 0
FST A W N P Y 0 0
L A L N P Y 0 0
V A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 FIFO
00002 PP 0 R Input BINARY (Reset)
00003 PP 0 LADE Input BINARY (load FIFO)
00004 PP 0 LESE Input BINARY (read FIFO)
00005 PP 0 E Input BINARY/WORD (input)
00006 PP 0 B/W Input BINARY (BINARY/WORD data)
00007 PP 0 #L # CONSTANT (number of memory locations)
00008 PP 0 ANF Input BINARY/WORD (start of memory locations)
00009 PP 0 A Output BINARY/WORD (ouput)
00010 PP 0 FST Output WORD (filling level)
00011 PP 0 L Output BINARY (FIFO empty)
00012 PP 0 V Output BINARY (FIFO full)

11–22 907 PC 331/Issued: 11.98


FUNCTION GENERATOR FKG

In an x/y coordinate system, a polygon is defined by n


coordinate points X0/Y0...Xn–1/Yn–1. For each value at
the input x, the function block outputs the affiliated y value FBD/LD IL
of the polygon through the output y.

!BA 0
FKG FKG
x x
#2*n #2*n
XC0 XC0
YC0 y YC0
y

____________________________________________________________________________________________

Parameters
x WORD EW, AW, MW, KW Input for the x value of the polygon
#2*n DIRECT #, #H n: number of interpolation points
CONSTANT
XC0 WORD EW, AW, MW, KW
Input for x values of the interpolation points;
Input can be duplicated
YC0 WORD EW, AW, MW, KW Input for y values of the interpolation points;
Input can be duplicated
y WORD AW, MW Output for the y value of the polygon
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 136 µs
Additional runtime: 9 µs per interpolation point
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The following applies to interpolation between 2 interpola-


tion points:
In an x/y coordinate system, a polygon is defined by n
coordinate points X0/Y0...Xn–1/Yn–1. For each value at
the input x, the function block outputs the affiliated y value (x – X i–1 ) * (Y i – Y i–1)
of the polygon through the output y. y= +Y i–1
X i –X i–1
The following applies to the x coordinates:

X0 < X1 < X2 ... < Xn–1 Note: The result of division is always rounded down, i. e.
2 < n < 32767 any division remainder is ignored.

The following applies to the range outside of the interpola-


This function block interpolates linearly between the inter- tion points:
polation points. The resulting polygon represents the re-
lationship between the input quantity x and the output y = Y0 for x < X0
quantity y. y = Yn–1 for x > Xn–1

907 PC 331/Issued: 11.98 11–23


FKG FUNCTION GENERATOR

(X2/Y2)

(X1/Y1) (X3/Y3)

(Xn–1/Yn–1)
(X0/Y0)

x WORD
The current x coordinate is specified at the input x. The
block then defines the y coordinate affiliated by the poly-
gon.

#2*n DIRECT CONSTANT


The number of x/y coordinates needed to define the poly-
gon is specified at the input #2*n. This is specified as a
direct constant.
n = number of interpolation points
2*n = number of x/y coordinates for n interpo–
lation points

XC0...XCn–1 WORD
The x coordinates of the n interpolation points are speci-
fied are the inputs XC0...XCn–1. The input XC0 is capa-
ble of duplication. If this input is duplicated, the input YCO
is automatically also duplicated.

YC0...YCn–1 WORD
The y coordinates of the n interpolation points are speci-
fied at the inputs YC0...YCn–1. The input YC0 is capable
of duplication. If this input is duplicated, the input XC0 is
automatically also duplicated.

y WORD
The y coordinate affiliated by the polygon of the specified
x coordinate is output through the output y.

11–24 907 PC 331/Issued: 11.98


FUNCTION GENERATOR FKG

Example

FBD/LD IL

!BA 0
FKG FKG
MW 00,00 x MW 00,00
# 6 #2*n # 6
KW 00,00 XC0 KW 00,00
KW 00,01 XC1 KW 00,01
MW 01,00 XC2 MW 01,00
KW 02,00 YC0 KW 02,00
KW 02,01 YC1 KW 02,01
MW 01,01 YC2 y AW 01,01 MW 01,01
AW 01,01

CE FBD Definition

FKG
x
#2*n
XC0
YC0 y

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

x E W N P Y 0 0
#2*n K W N P Y 0 0
XC0 E W N P Y 1 0
YC0 E W N P Y 1 0
y A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 FKG
00002 PP 0 x Input WORD
00003 PP 0 #2*n Input # CONSTANT (n = number of interpolation points)
00004 [ 1
00005 PP 1 XC0 Input WORD (x coordinate)
00006 PP 1 YC0 Input WORD (y coordinate)
00007 ] 1
00008 PP 0 y Output WORD

907 PC 331/Issued: 11.98 11–25


FRD READ DATA SET FROM FLASH EPROM

FBD/LD IL

FRD FRD !BA 0


0/1 RDY M 00,00 0/1 RDY A 00,00 FWR
SM ERR MW 01,00 SM ERR A 00,01 M 00,00
#nB ERNO #1 #nB ERNO MW 09,01 MW 01,00
#SEG #3 #SEG #1
BNR MW 09,00 BNR #3
MW 09,00
A 00,00
A 00,01
MW 09,01

Parameters
0/1 BINARY E, M, A, K, S Reading of one data set by a 0/1 edge
SM BINARY E, M, A, K, S
WORD EW, MW, AW, KW
DOUBLE WORD MD, KD Start flag of the location of the data set
#nB DIRECT #, #H Number of blocks of the data set
CONSTANT 1...481
#SEG DIRECT #, #H Number of the data segment in the Flash EPROM
CONSTANT 0...3
BNR WORD EW, MW, AW, KW Number of the block in the data segment
valid values: 0 ... 480
RDY BINARY A, M Reading procedure completed
ERR BINARY A, M Occurred error
ERNO WORD AW, MW Error number

____________________________________________________________________________________________

Description The following is valid:

This function block reads a data set from a data segment Either 32 binary data or 16 word data or 8 double word
in the Flash EPROM and stores the read data set begin- data are read per block. The data of each block are se-
ning at the start flag defined by SM. The data of the data cured by a checksum.
set had been stored in the Flash EPROM by the function
The reading procedure is carried out once by a 0/1 edge
block FWR or by the operating command FWR.
at the input 0/1. If there was no error when reading the
data, the output RDY is set to ”1” and the outputs ERR
Important note:
and ERNO are set to ”0”. The data set is stored beginning
An access to the Flash EPROM is only permitted by using at the defined start flag SM.
the function blocks FWR and FRD. It is not allowed to
access the Flash EPROM by other function blocks (WOL, Storing the data set can take several PLC cycles.
WOS, COPY,...). If an error occurs during the reading procedure, RDY and
ERR are both set to ”1”. The error type is indicated at the
The inputs SM and #nB define, which data are read from output ERNO.
the Flash EPROM. The input #SEG defines the data seg-
ment in the Flash EPROM. The number of data, which are The outputs RDY, ERR and ERNO are set to ”0” by a sig-
read from a block, depends on input SM. nal 0 at the input 0/1.

11–26 907 PC 331/Issued: 11.98


READ DATA SET FROM FLASH EPROM FRD

0/1 BINARY BNR WORD


The processing of the block is controlled by The number of the block in the data segment is given at
the input 0/1 . the input BNR.
0/1 = 0: The outputs RDY, ERR and ERNO Valid values: 0...480
are set to ”0”.
0/1= 0/1 edge: The reading procedure of the data set RDY BINARY
is carried out once. The output RDY indicates, that the reading procedure has
0/1 = 1: The block is not processed, i.e. it been completed. The output has always to be considered
does not change its outputs any together with the output ERR.
more. The following is valid:
RDY = 1 and ERR = 0: The reading procedure has
SM BINARY / WORD / DOUBLE WORD been completed. The data set
The first binary/word/double-word flag for storing the data is stored beginning at the defi-
set is given at input SM. nition at the input SM.
#nB DIRECT CONSTANT RDY = 1 and ERR = 1: An error has occurred during
The number of blocks of the data set is given at input #nB. the reading procedure. The
The number of data, which are read by a block, depends output ERNO indicates the
on the input SM. Either 32 binary data or 16 word data or 8 error number.
double word data are read per block.
ERR BINARY
Examples: The output ERR indicates whether or not an error has oc-
– SM = M 01,00 and #nB = 1: curred during the reading procedure. The output has al-
Storing the data from M 01,00 to M 02,15 ways to be considered together with the output RDY.
(1 block = 32 binary data) If there was an error, the outputs have the following sta-
– SM = M 01,00 and #nB = 2: tuses:
Storing the data from M 01,00 to M 04,15
RDY = 1 and ERR = 1
(2 blocks = 64 binary data)
The output ERNO indicates the error number.
– SM = MW 02,00 and #nB = 1:
Storing the data from MW 02,00 to MW 02,15 ERNO WORD
(1 block = 16 word data)
The output ERNO indicates an error number. This output
– SM = MW 02,00 and #nB = 2:
has always to be considered together with the outputs
Storing the data from MW 02,00 to MW 03,15
RDY and ERR.
(2 blocks = 32 word data)
The error number is coded binary.
– SM = MD 03,00 and #nB = 1:
Storing the data from MD 03,00 to MD 03,07 The following applies:
(1 block = 8 double word data)
– SM = MD 03,00 and #nB = 2: ERNO = 0: There was no error.
Storing the data from MD 03,00 to MD 03,15 ERNO = 1: Block number and number of blocks
(2 blocks = 16 double word data) is greater than 480
(bit 0 of ERNO = 1).
#SEG DIRECT CONSTANT
ERNO = 2: Data segment is greater than 3
The number of the data segment in the Flash EPROM is
(bit 1 of ERNO = 1).
given at the input SEG. In the Flash EPROM, 4 data seg-
ERNO = 4: Checksum error of read data.
ments are available.
The data are not entered into the
The following is valid: flag area
– #0 corresponds to data segment 0 (bit 2 of ERNO = 1).
– #1 corresponds to data segment 1
– #2 corresponds to data segment 2 The inputs as well as the outputs can neither be doubled
– #3 corresponds to data segment 3 nor be inverted.
____________________________________________________________________________________________
CE data
Runtime: 07 KR 91 / 07 KT 92 / 07 KT 93 / 07 KP 62
Grundlaufzeit: 25 – 67 µs
Additional runtime: –––
Updating of the outputs: no
Number of historical values: 2 words
Available as of: ABB Procontic CS31 07KT92 R202/R262,07KT93 R171
ABB Procontic T200 07KP62 R202

907 PC 331/Issued: 11.98 11–27


FRD READ DATA SET FROM FLASH EPROM

11–28 907 PC 331/Issued: 11.98


WRITE DATA SET TO FLASH EPROM FWR

FBD/LD IL

FWR FWR !BA 0


0/1 RDY M 00,00 0/1 RDY A 00,00 FWR
SM ERR MW 01,00 SM ERR A 00,01 M 00,00
#nB ERNO #1 #nB ERNO MW 09,01 MW 01,00
#SEG #3 #SEG #1
BNR MW 09,00 BNR #3
MW 09,00
A 00,00
A 00,01
MW 09,01

Parameters
0/1 BINARY E, M, A, K, S Saving of one data set by a 0/1 edge
SM BINARY E, M, A, K, S
WORD EW, MW, AW, KW
DOUBLE WORD MD, KD Start flag of the data set
#nB DIRECT #, #H Number of blocks of the data set
CONSTANT 1...481
#SEG DIRECT #, #H Number of the data segment in the Flash EPROM
CONSTANT 0...3
BNR WORD EW, MW, AW, KW Number of the block in the data segment
valid values: 0...480
RDY BINARY A, M Writing procedure completed
ERR BINARY A, M Occurred error
ERNO WORD AW, MW Error number

____________________________________________________________________________________________

Description For each user data set, a separate function block FWR as
well as a separate function block FRD have to be planned
The function block writes a data set to a data segment in in the PLC program.
the Flash EPROM. For this purpose, there are 4 data seg- The inputs SM and #nB define, which data are written to
ments (0...3) available in the Flash EPROM. A deletion the Flash EPROM. The input #SEG defines the data seg-
procedure (function block FDEL) always deletes a com- ment in the Flash EPROM. The number of data, which
plete data segment. Each data segment consists of 481 can be stored in the block, depends on input SM.
blocks (0...480). After deletion, each of these 481 blocks
can store data only once. If a block containing data is to The following applies:
be overwritten by new data, the entire data segment has Either 32 binary data or 16 word data or 8 double word
to be deleted beforehand. In doing so, all data in this seg- data are written per block. The data of each block are se-
ment are lost. cured by a checksum.
When a writing procedure of a data set is started
Important note: (0/1 edge at input 0/1), the data of the data set must not
An access to the Flash EPROM is only permitted by using be changed until the end of the writing procedure (RDY =
the function blocks FWR and FRD. It is not allowed to 1).
access the Flash EPROM by other function blocks (WOL, Storing the data set in the Flash EPROM can take several
WOS, COPY,...). PLC cycles.

907 PC 331/Issued: 11.98 12–1


FWR WRITE DATA SET TO FLASH EPROM

A 0/1 edge at input 0/1 starts the writing procedure of the Examples:
data set once. The input 0/1 is no longer evaluated until – SM = M 01,00 and #nB = 1:
the storing of the data set has been completed (RDY = 1). Writing of the data from M 01,00 to M 02,15
(1 block = 32 binary data)
– SM = M 01,00 and #nB = 2:
After completion of the writing procedure the block out- Writing of the data from M 01,00 to M 04,15
puts RDY, ERR and ERNO are updated. If RDY = 1 and (2 blocks = 64 binary data)
ERR = 0, the procedure was successful. If RDY = 1 and – SM = MW 02,00 and #nB = 1:
ERR = 1, an error had occurred. The output ERNO indica- Writing of the data from MW 02,00 to MW 02,15
tes the error type then. (1 block = 16 word data)
– SM = MW 02,00 and #nB = 2:
Writing of the data from MW 02,00 to MW 03,15
After storing the data set in the Flash EPROM, the block (2 blocks = 32 word data)
outputs RDY, ERR and ERNO are set to ”0” by a signal 0 – SM = MD 03,00 and #nB = 1:
at input 0/1. A new 0/1 edge at input 0/1 starts a new wri- Writing of the data from MD 03,00 to MD 03,07
ting procedure. Since without a previous deletion of the (1 block = 8 double word data)
data segment no new data can be written to blocks which – SM = MD 03,00 and #nB = 2:
already contain data, the input BNR must point to the next Writing of the data from MD 03,00 to MD 03,15
(2 blocks = 16 double word data)
free block for the next writing procedure.
#SEG DIRECT CONSTANT
The number of the data segment in the Flash EPROM is
0/1 BINARY given at the input SEG. In the Flash EPROM, 4 data seg-
The processing of the function block is controlled by the ments are available.
input 0/1. The following is valid:
0/1 = 0: The outputs RDY, ERR and ERNO – #0 corresponds to data segment 0
are set to ”0”. – #1 corresponds to data segment 1
This is not valid during a writing – #2 corresponds to data segment 2
procedure. – #3 corresponds to data segment 3
0/1= 0/1 edge: The writing procedure of the data set BNR WORD
is started once. The number of the block in the data segment is given at
The input 0/1 is no longer evaluated the input BNR.
until the writing procedure has been Valid values: 0...480
completed (RDY = 1). RDY BINARY
0/1 = 1: The function block is not processed, The output RDY indicates that the writing procedure of
i.e. it does not change its outputs any the data set has been completed. The output has always
more. This is not valid during a writing to be considered together with the output ERR.
procedure. The following applies:
RDY = 1 and ERR = 0: The writing procedure is
completed. The data set has
SM BINARY / WORD / DOUBLE WORD has been stored in the Flash
The first binary/word/double-word flag of the data set is EPROM.
given at input SM. When the writing procedure of a data RDY = 1 and ERR = 1: An error has occurred during
set has been started (0/1 edge at input 0/1), the data of the writing procedure. The
the data set must not be changed until the procedure has output ERNO indicates the
been completed (RDY = 1). error number.
ERR BINARY
The output ERR indicates whether or not an error has oc-
#nB DIRECT CONSTANT curred during the writing procedure. The output has al-
The number of blocks of the data set is given at input #nB. ways to be considered together with the output RDY.
The number of data, which can be stored in a block, de- If an error has occurred, the following is valid:
pends on input SM. Either 32 binary data or 16 word data RDY = 1 and ERR = 1.
or 8 double word data are stored per block. The output ERNO indicates the error number then.

12–2 907 PC 331/Issued: 11.98


WRITE DATA SET TO FLASH EPROM FWR

ERNO WORD The following applies:


The output ERNO indicates an error number. This output ERNO = 0: There was no error.
has always to be considered together with the outputs ERNO = 1: Block number and number of blocks
RDY and ERR. is greater than 480
(bit 0 of ERNO = 1).
ERNO = 2: Data segment is greater than 3
(bit 1 of ERNO = 1).
ERNO = 4: Flash EPROM is not writeable
(bit 2 of ERNO = 1).
ERNO = 8: Block already contains data
(bit 3 of ERNO = 1).
The inputs as well as the outputs can neither be doubled
nor be inverted.
____________________________________________________________________________________________

CE data
Runtime: 07 KR 91 / 07 KT 92 / 07 KT 93 / 07 KP 62
Basic runtime: 22 – 67 µs
Additional runtime: –––
Updating of the outputs: no
Number of historical values: 2 words
Available as of: ABB Procontic CS31 07KT92 R202/R262, 07KT93 R171
ABB Procontic T200 07KP62 R202

907 PC 331/Issued: 11.98 12–3


HLG RAMP–FUNCTION GENERATOR

The ramp–function generator serves to provide ramp–


shaped adaption of the current actual value at the output
to a specified setpoint. FBD/LD IL

The value at the output of the HLG is adapted linearly


from the current actual value to the specified setpoint with !BA 0
the slope y’. HLG HLG
0/1 0/1
In doing so, the value at the output precisely runs through 0S 0S
the amount of the setpoint during the time TH or TR. If the 1S 1S
value at the output of the HLG has reached the setpoint, it TH/T TH/T
no longer changes unless a new setpoint is specified. TR/T TR/T
STOP STOP
S S
INIT INIT
R A1 R

____________________________________________________________________________________________

Parameters
0/1 BINARY E, A, M, S, K Selection of the setpoint 0 or the setpoint 1
0S WORD EW, AW, MW, KW Setpoint 0
1S WORD EW, AW, MW, KW Setpoint1
TH/T WORD EW, AW, MW, KW Start up time scaled to the cycle time
TR/T WORD EW, AW, MW, KW Return time scaled to the cycle time
STOP BINARY E, A, M, S, K Latching of the output at the current value
S BINARY E, A, M, S, K Setting of the output to the INIT value
INIT WORD EW, AW, MW, KW INIT value to which the output can be set
R BINARY E, A, M, S, K Reset of the output to the value 0
A1 WORD MW, AW Output
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 126 µs
Additional runtime: –––
Output updating: yes
Number of historical values: 2 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The inputs and the output can neither be duplicated nor
negated/inverted.
The ramp–function generator serves to provide ramp– The slope y’ of the ramp results from the specified time
shaped adaption of the current actual value at the output TH (start up time) or TR (return time) and the amount of
to a specified setpoint. the setpoint:

The value at the output of the HLG is adapted linearly


from the current actual value to the specified setpoint with Setpoint amount
Slope y’ =
the slope y’. TH or TR

In doing so, the value at the output precisely runs through


the amount of the setpoint during the time TH or TR. If the
value at the output of the HLG has reached the setpoint, it
no longer changes unless a new setpoint is specified.

12–4 907 PC 331/Issued: 11.98


RAMP–FUNCTION GENERATOR HLG

The slope is 0/1 BINARY


One of the two setpoints is selected with the input 0/1. 0/1
– positive, if setpoint > actual value = 0 –> setpoint 0 S
– negative, if setpoint < actual value 0/1 = 1 –> setpoint 1 S
– 0 if setpoint = 0
Therefore, the specified setpoint has two functions:
0S WORD
– its amount defines the slope of the ramp together with
The setpoint 0 is specified at the input 0 S.
the specified time TH or TR;
– it represents the value to which the current actual value
must be adapted in a ramp shape. 1S WORD
The user may specify the start up time TH and the return The setpoint 1 is specified at the input 1 S.
time TR separately. The direction of the slope is defined
on the basis of the setpoint. The direction of the slope
then defines whether or not the running time TH or TR is TH/T WORD
used. The startup time is specified at the input TH/T. At the
same time, the start up time TH must be scaled to the
Slope y’ positive –> TH, i.e. the ramp runs upwards Slope
y’ negative –> TR, i.e. the ramp runs downwards. cycle time T.

The start up time TH and the return time TR must be


scaled to the program cycle time TZ, i.e. the following TR/T WORD
must be specified at the corresponding inputs of the The start up time is specified at the input TH/T. At the
block: same time, the start up time TH must be scaled to the
– Start up time: TH/TZ cycle time T.
– Return time: TR/TZ
The times are specified in milliseconds. The following ap-
plies to the time constants TH or TR: STOP BINARY
0 < TH < 32767 The output can be latched to the current value by means
0 < TR < 32767 of the STOP input.
STOP = 0 –> Output not latched
Two setpoints can be planned (0 S and 1 S), whereby one
of these setpoints is selected by the binary input 0/1 (set- STOP = 1 –> Output is latched
point selection). The STOP input has higher priority than the inputs S
and R.
The setpoints may assume the following values: –32767
< setpoint < +32767
At any time, the output of the ramp–function generator S BINARY
can be With the input S, the output can be set to the initial value
– stopped at the current value specified at the input INIT.
– set to an initial value S = 0 –> Output is not set to initial value.
– reset (output = 0)
S = 1 –> Output is set to initial value.
The STOP input has the highest priority and the R input
has the lowest.
The values at the inputs of the HLG can be altered at any INIT WORD
time in the user program. In this way, any (non–linear) The initial value to which the output is to be set if required
adaptation to the setpoint can be realized on the basis of is specified at the input INIT.
the linear adaptation of the actual value.
Important
Setpoint = 0 means that the slope of the ramp is also 0, R BINARY
i. e. the current actual value does not change. If it is in- The output can be set to the value 0 with the input R.
tended to switch from an actual value unequal to 0 to an R = 0 –> Output is not reset
actual value of 0, a setpoint unequal to 0 must be speci- R = 1 –> Output is reset to the value 0.
fied and the output of the ramp–function generator must
be limited to 0 by a subsequent limiter. (On interpolation,
the rounding transitions are based on calculation of inte- A1 WORD
gral numbers only). Output of the block.

907 PC 331/Issued: 11.98 12–5


HLG RAMP–FUNCTION GENERATOR

Example 1
The actual value is to be changed from 0 to the setpoint +
500 (setpoint amount 500) and then from +500 to the set-
point –1000 (setpoint amount 1000).
The start up time is TH and the return time TR.
0 S: 500
1 S: –1000

Output (actual value)

Setpoint switchover from 0 S –> 1 S

+ 500

t
TH

– 500
TR

– 1000
TR(*)

TR(*) is the actual time until the actual value has reached –1000.
During the time TH or TR, the actual value changes by the amount of the applied setpoint.

12–6 907 PC 331/Issued: 11.98


RAMP–FUNCTION GENERATOR HLG

Example 2
The actual value is to be changed from 0 to the setpoint
+500 (setpoint amount 500) and then from +500 to the
setpoint 1500 (setpoint amount 1500).

The startup time is TH and the return time TR.


0 S: 500
1 S: 1500

Output (actual value)

+ 2000

+ 1500

+ 1000
Setpoint changeover
from 0 S –> 1 S

+ 500

t
TH1 TH2(*)

TH2

TR(*) is the actual time until the actual value has reached 1500.
During the time TH or TR, the actual value changes by the amount of the applied setpoint.

907 PC 331/Issued: 11.98 12–7


HLG RAMP–FUNCTION GENERATOR

Example

FBD/LD IL

E 00,00 0/1 !BA E 00,00


MW 01,00 0S HLG MW 01,00
EW 02,00 1S EW 02,00
MW 02,06 TH/T MW 02,06
KW 03,08 TR/T KW 03,08
M 04,00 STOP M 04,00
E 04,03 S E 04,03
MW 06,01 INIT MW 06,01
S 03,07 R S 03,07
AW 08,02 AW 08,02

CE FBD Definition

HLG
0/1
0S
1S
TH/T
TR/T
STOP
S
INIT
R A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0/1 E L N P Y 0 0
0S E W N P Y 0 0
1S E W N P Y 0 0
TH/T E W N P Y 0 0
TR/T E W N P Y 0 0
STOP E L N P Y 0 0
S E L N P Y 0 0
INIT E W N P Y 0 0
R E L N P Y 0 0
A1 A W N P N 0 0

12–8 907 PC 331/Issued: 11.98


RAMP–FUNCTION GENERATOR HLG

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 HLG
00002 PP 0 0/1 Input BIT (setpoint selection)
00003 PP 0 0S Input WORD (setpoint No. 0)
00004 PP 0 1S Input WORD (setpoint No. 1)
00005 PP 0 TH/T Input WORD (start up time)
00006 PP 0 TR/T Input WORD (return time)
00007 PP 0 STOP Input BIT (stop ramp–function generator)
00008 PP 0 S Input BIT (set to INIT)
00009 PP 0 INIT Input WORD (initial value)
00010 PP 0 R Input BIT (reset to 0)
00011 PP 0 A1 Output WORD

907 PC 331/Issued: 11.98 12–9


I– PULSE (NEGATIVE EDGE)

A negative edge (1–0) at the input 1–0 generates a pulse


at the output PULS which has the duration of 1 PLC pro-
gram cycle. FBD/LD IL

IMPORTANT:
To some extent, functioning of this connection element ! 1–0
did not correspond to the description. The functional I– =S Q
scope has been modified as from 907 PC 31 Vers. 2.2 and 1–0 Q !N 1–0
now conforms to the description. PULS & Q
=R Q
= PULS

____________________________________________________________________________________________

Parameters
1–0 BINARY E, M, A, S, K Input for 1 – 0 edge
Q BINARY A, M Output for interrogation of the direct flag
PULS BINARY A, M Pulse output
____________________________________________________________________________________________

CE Data Series 90, 07 KP 62 Series 30, 40, 50


Runtime:
Basic runtime: 13.2 µs 45 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values:none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
ABB Procontic T200 / 07 KP 62 07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description 1–0 BINARY


A negative edge (1–0) at the input 1–0 generates a pulse The value of the operand at this input is monitored for a
at the output PULS which has the duration of 1 PLC pro- 1–0 edge.
gram cycle.
IMPORTANT: Q BINARY
To some extent, functioning of this connection element
did not correspond to the description. The functional This additional auxiliary flag, which is specified as a direct
scope has been modified as from 907 PC 31 Vers. 2.2 and flag above the connection element, is needed for edge
now conforms to the description. detection. This flag must not be used again in the PLC
Description of the error in 907 PC 31 Vers. 1.1 and older: program. It can be interrogated via the output Q. That is to
When the PLC program is activated (when the connection say, the output Q can be connected to another connection
element is run through for the first time), a pulse is erro- element or a binary operand (A, M) can also be planned at
neously output through the PULS output. the output Q.

12–10 907 PC 331/Issued: 11.98


PULSE (NEGATIVE EDGE) I–

PULS BINARY
A pulse is present at this output for 1 program cycle time if
a 1–0 edge occurs at the input 1–0.
Duration of the pulse
From recognition of the 1–0 edge by the connection ele-
ment up to renewed processing of this connection ele-
ment in the next program cycle.

1–0

PULS
T T

T: Program cycle time of the PLC


The input and the ouputs can neither be duplicated nor in-
verted.

907 PC 331/Issued: 11.98 12–11


I– PULSE (NEGATIVE EDGE)

Example

FBD/LD IL
M 10,00

! M 03,00
I– =S M 10,00
M 03,00 1–0 Q !N M 03,00
PULS M 05,05 & M 10,00
=R M 10,00
= M 05,05

CE FBD Definition

I–
1–0 Q
PULS

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

1–0 E L N P Y 0 0
Q A L N P Y 0 0
PULS A L N P Y 0 0

CE IL Definition

00000 ! PP 0 1–0 Input BINARY (1–0 edge)


00002 =S PP 0 Q Auxiliary flag BINARY
00004 !N PP 0 1–0 Input BINARY (1–0 edge)
00006 & PP 0 Q Auxiliary flag BINARY
00008 =R PP 0 Q Auxiliary flag BINARY
00010 = PP 0 PULS Output BINARY (pulse)

12–12 907 PC 331/Issued: 11.98


PULSE (POSITIVE EDGE) I+

A positive edge at the input 0–1 generates a pulse with the


duration of one PLC program cycle at the PULS output.
FBD/LD IL

!N 0–1
I+ =R Q
0–1 Q ! 0–1
PULS &N Q
=S Q
= PULS

____________________________________________________________________________________________

Parameters
0–1 BINARY E, M, A, S, K Input for 0 – 1 edge
Q BINARY A, M Output for interrogation of the direct flag
PULS BINARY A, M Pulse output
____________________________________________________________________________________________

CE Data Series 90, 07 KP 62 Series 30, 40, 50


Runtime:
Basic runtime: 13.2 µs 45 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values:none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
ABB Procontic T200 / 07 KP 62 07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description PULS BINARY


A pulse is present at this output for 1 program cycle time if
A positive edge at the input 0–1 generates a pulse with the a 0–1 edge occurs at the input 0–1.
duration of one PLC program cycle at the PULS output.
Duration of the pulse
From recognition of the 0–1 edge by the connection ele-
ment until renewed processing of this connection element
0–1 BINARY
in the next program cycle.
The value of the operand at this input is monitored for a
0–1 edge.
0–1

Q
Q BINARY
This additional auxiliary flag, which is specified as a direct PULS
flag above the connection element, is needed for edge T T
detection. This flag must not be used again in the PLC
program. It can be interrogated via the output Q. That is to
T: Program cycle time.
say, the output Q can be connected to another connection
element or a binary operand (A, M) can also be planned at The input and the outputs can neither be duplicated nor
the output Q. inverted.

907 PC 331/Issued: 11.98 12–13


I+ PULSE (POSITIVE EDGE)

Example

FBD/LD IL

M 08,06
!N E 01,00
I+ =R M 08,06
E 01,00 0–1 Q ! E 01,00
PULS M 08,07 &N M 08,06
=S M 08,06
= M 08,07

CE FBD Definition

I+
0–1 Q
PULS

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0–1 E L N P Y 0 0
Q A L N P Y 0 0
PULS A L N P Y 0 0

CE IL Definition

00000 !N PP 0 0–1 Input BINARY (0–1 edge)


00002 =R PP 0 Q Auxiliary flag BINARY
00004 ! PP 0 0–1 Input BINARY (0–1 edge)
00006 &N PP 0 Q Auxiliary flag BINARY
00008 =S PP 0 Q Auxiliary flag BINARY
00010 = PP 0 PULS Output BINARY (pulse)

12–14 907 PC 331/Issued: 11.98


IDENTIFICATION IDENT

The block is used for identification of the device. If enable


is set (FREI = 1), the device type, the category and the
software version is output.
FBD/LD

IDENT
FREI TYP
RUB
VER

Parameters
FREI BINARY E,K , M, S Enabling of the block processing
TYP WORD AW, MW, Device type
RUB WORD AW, MW Category
VER WORD AW, MW Software version

CE data
Output updating: no
Number of historical values: none

Available as of: 07 KR 91 R2 Index c, 07 KT 92 R2 Index c,


07 KT 93 R2 Index f, 07 KT 94

Description RUB WORD


The block is used for identification of the device. If enable
If FREI = 1, the category is output at output RUB.
is set (FREI = 1), the device type, the category and the
software version is output. Example: RUB = 101 → the device has the category R0101.

VER WORD
FREI BINARY If FREI = 1, the software version is output at output VER.
Enabling the block with FREI = 1. For FREI = 0, the out- Example: VER = 105 → the device has the software version 1.5.
puts are not changed.
If FREI = 0, the block is not processed, i. e. the outputs
are not changed.
TYP WORD
If FREI = 1, the device type is output at output TYP.
Example: TYP = 94 →the device is a basic unit
07 KT 94.

907 PC 331 / Issued: 08.99 12-15


7
IDENT IDENTIFICATION

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

IDENT

BIT_IN Y N Y 0 00 FREI TYP 00 0 Y N Y WORT_OUT


RUB 00 0 Y N Y WORT_OUT
VER 00 0 Y N Y WORT_OUT

Source

SN ZN Command / Variable Symbol Long text

00000 00000 IDENT


00001 PP 00 FREI
00002 PP 00 TYP
00003 PP 00 RUB
00004 PP 00 VER
00005

7 12-16 907 PC 331 / Issued: 08.99


READ BINARY VARIABLE, INDEXED IDLB

This function block serves the purpose of indexed reading


of binary variables.
FBD/LD IL

!BA 0
IDLB IDLB
FREI FREI
INDX INDX
BASI BASI
ZIEL ZIEL

____________________________________________________________________________________________
Parameters
FREI BINARY E, A, M, K, S Enable for the block
Frei = 0: Block is not processed
Frei = 1: The value of the source variable is read
and allocated to the target variable.
INDX WORD EW, AW, MW, KW The index and the basic variable result
in the source variable
BASI BINARY E, A, M, K Basic variable
ZIEL BINARY A, M Target variable
____________________________________________________________________________________________
CE Data
Runtime:
Basic runtime: 35 µs
Additional runtime: none
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / Communication Processor 07 KP 62
____________________________________________________________________________________________
Description Formula:
This function block serves the purpose of indexed reading
of binary variables. INDX
–––– = A Remainder B
The source variable to be read is obtained from indexing 16
the basic variable. The value of the source variable read is Group No. of the source flag:
allocated to the target variable. Group No. of the basic flag + A
Channel No. of the source flag:
The inputs and outputs can neither be duplicated nor in-
Channel No. of the basic flag + B
verted nor negated.
Example:
The group and channel numbers of the source flag
(source variable) are determined from the basic flag and Basic variable: M 00,00
the index INDX. INDX = 10 –> 10 : 16 = A = 0, Remainder B = 10
The source flag is: –>Source variable:
M (G_Basis + A) , (K_Basis + B) M(00+A),(00+B) = M(00+0),(00+10) = M 00,10

where:

G_Basis: Group number of the basic flag


K_Basis: Channel number of the basic flag

907 PC 331/Issued: 11.98 12–17


IDLB READ BINARY VARIABLE, INDEXED

Further examples ZIEL BINARY


The target variable is specified at the output ZIEL. The
Basic variable INDX Source variable
value of the selected source variable is allocated to the
target variable ZIEL.
M 00,00 0 M 00,00
M 00,00 2 M 00,02
M 00,00 16 M 01,00
M 00,02 18 M 01,04
E 00,00 3 E 00,03
E 01,01 5 E 01,06
A 05,05 6 A 05,11
K 00,04 8 K 00,12

FREI BINARY
Enable block

FREI= 0 –> Block is not processed


FREI= 1 –> The value of the source variable is read
and allocated to the target variable ZIEL.

INDX WORD
The index value is specified at the input INDX. The source
variable (see above for a calculation) results from the in-
dex INDX and the basic variable.
Value range: –16383 < INDX < +16383

BASI BINRAY
The basic variable is specified at the input BASI. The
source variable (see above for a calculation) results from
the index INDX and the basic variable.

12–18 907 PC 331/Issued: 11.98


READ BINARY VARIABLE, INDEXED IDLB

Example

FBD/LD IL

!BA 0
IDLB IDLB
M 00,00 FREI M 00,00
MW 00,00 INDX MW 00,00
M 00,01 BASI M 00,01
ZIEL M 00,02
M 00,02

907 PC 331/Issued: 11.98 12–19


IDLm READ WORD VARIABLE, INDEXED

This function block serves the purpose of indexed reading


of word variables.
FBD/LD IL

!BA 0
IDLm IDL
FREI FREI
INDX INDX
BASI BASI
ZIEL ZIEL

____________________________________________________________________________________________
Parameters
FREI BINARY E, A, M, K, S Enable for the block
Frei = 0: Block is not processed
Frei = 1: The value of the source variable is read
and allocated to the target variable.
INDX WORD EW, AW, MW, KW The index and the basic variable result
in the source variable
BASI WORD EW, AW, MW, KW Basic variable
ZIEL WORD AW, MW Target variable
____________________________________________________________________________________________
CE Data Series 90 Series 30, 40, 50
Runtime:
Basic runtime: 35 µs 63 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________
Description Formula:
This function block serves the purpose of indexed reading
of word variables. INDX
–––– = A Remainder B
The source variable to be read is obtained from indexing 16
the basic variable. The value of the source variable read is Group No. of the source flag:
allocated to the target variable. Group No. of the basic flag + A
Channel No. of the source flag:
The inputs and outputs can neither be duplicated nor in- Channel No. of the basic flag + B
verted nor negated.
Example:
The group and channel numbers of the source flag
(source variable) are determined from the basic flag and Basic variable: MW 00,00
the index INDX. INDX = 10 –> 10 : 16 = A = 0, Remainder B = 10
The source flag is: –>Source variable:
MW (G_Basis + A) , (K_Basis + B) MW(00+A),(00+B) = MW(00+0),(00+10) = MW 00,10

where:

G_Basis: Group number of the basic flag


K_Basis: Channel number of the basic flag

12–20 907 PC 331/Issued: 11.98


READ WORD VARIABLE, INDEXED IDLm

Further examples ZIEL WORD


The target variable is specified at the output ZIEL. The
Basic variable INDX Source variable
value of the selected source variable is allocated to the
target variable ZIEL.
MW 00,00 0 MW 00,00
MW 00,00 2 MW 00,02
MW 00,00 16 MW 01,00
MW 00,02 18 MW 01,04
EW 00,00 3 EW 00,03
EW 01,01 5 EW 01,06
AW 05,05 6 AW 05,11
KW 00,04 8 KW 00,12

FREI BINARY
Enable block

FREI= 0 –> Block is not processed


FREI= 1 –> The value of the source variable is read
and allocated to the target variable ZIEL.

INDX WORD
The index value is specified at the input INDX. The source
variable (see above for a calculation) results from the in-
dex INDX and the basic variable.
Value range: –16383 < INDX < +16383
If INDX is out of range, the function block is not pro-
cessed.

BASI WORD
The basic variable is specified at the input BASI. The
source variable (see above for a calculation) results from
the index INDX and the basic variable.

907 PC 331/Issued: 11.98 12–21


IDLm READ WORD VARIABLE, INDEXED

Example

FBD/LD IL

!BA 0
IDLm IDL
M 00,00 FREI M 00,00
MW 00,00 INDX MW 00,00
MW 00,01 BASI MW 00,01
ZIEL MW 00,02
MW 00,02

CE FBD Definition

IDLm
FREI
INDX
BASI
ZIEL

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
INDX E W N P Y 0 0
BASI E W N P Y 0 0
ZIEL E W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 IDL
00002 PP 0 FREI Enable (BINARY)
00003 PP 0 INDX Index relatet to basis (WORD)
00004 PP 0 BASI Basic variable (WORD)
00005 PP 0 ZIEL Target variable (WORD)

12–22 907 PC 331/Issued: 11.98


WRITE BINARY VARIABLE, INDEXED IDSB

This function block serves the purpose of indexed writing


of binary variables.
FBD/LD IL

!BA 0
IDSB IDSB
FREI FREI
QUEL QUEL
INDX INDX
BASI
BASI

____________________________________________________________________________________________

Parameters
FREI BINARY E, A, M, K, S Enable block
FREI = 0: Block is not processed
FREI = 1: The value of the source variable is read
and allocated to the target variable
QUEL BINARY E, A, M, K Source variable
INDX WORD EW, AW, MW, KW The current target variable results from the index
and the basic variable
BASI BINARY A, M Basic variable
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 35 µs
Additional runtime: none
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / Communication Processor 07 KP 62
____________________________________________________________________________________________

Description Formula:

This function block serves the purpose of indexed wri-ting INDX


of binary variables. –––– = A Remainder B
16
When the block is enabled, the value of the source vari-
able is read and allocated to the target variable. The tar- Group No. of the target flag:
get variable is defined by indexing the basic variable. Group No. of the basic flag + A

The inputs and outputs can neither be duplicated nor ne- Channel No. of the target flag:
gated nor inverted. Channel No. of the basic flag + B

The group and channel number of the target flag (target Example:
variable) are determined on the basis of the basic flag and
the index INDX. Basic variable: M 00,00
–> INDX = 10 –> 10 : 16 = A = 0, Remainder B = 10
The target flag is called: M (G_Basis+A),(K_Basis+B) –> Target variable:
where: M(00+A), (00+B) = M (00+0),(00+10) =
G_Basis: Group number of the basic flag M 00,10
K_Basis: Channel number of the basic flag –> Target variable: M 00,10

907 PC 331/Issued: 11.98 13–1


IDSB WRITE BINARY VARIABLE, INDEXED

Further examples: BASI BINARY


The basic variable is specified at the input BASI. The tar-
Basic variable INDX Target variable get variable (see above for a calculation) results from the
index INDX and the basic variable.
M 00,00 0 M 00,00
M 00,00 2 M 00,02
M 00,00 16 M 01,00
M 00,02 18 M 01,04
A 00,00 3 A 00,03
A 00,15 1 A 01,00
A 05,05 6 A 05,11
A 05,05 12 A 06,01

FREI BINARY
Enable block
FREI=0: –> Block is not processed
FREI=1: –> The value of the source variable is read
and allocated to the target variable
ZIEL.

QUEL BINARY
The source variable is specified at the input QUEL. The
value of this variable is read and allocated to the target
variable.

INDX WORD
The index value is specified at the input INDX. The target
variable (see above for a calculation) results from the in-
dex INDX and the basic variable.

Value range: –16383 < INDX < +16383

13–2 907 PC 331/Issued: 11.98


WRITE BINARY VARIABLE, INDEXED IDSB

Example

FBD/LD IL

!BA 0
IDSB IDSB
M 00,00 FREI M 00,00
M 09,00 QUEL M 09,00
MW 00,00 INDX MW 00,00
BASI M 00,01
M 00,01

CE FBD Definition

IDSB
FREI
QUEL
INDX
BASI

Param. Param. Param. Inv. Occupa- Displ. Param. Dupli.


Group Type tion Screen Block Type

FREI E L N P J 0 0
QUEL E L N P J 0 0
INDX E W N P J 0 0
BASI A L N P J 0 0

CE IL Definition
00000 !BA 0 No. Block No. (preset to 0)
00001 IDSB
00002 PP 0 FREI Enable (BINARY)
00003 PP 0 QUEL Source variable (BINARY)
00004 PP 0 INDX Index related to basis (WORD)
00005 PP 0 BASI Basis variable for target (BINARY)

907 PC 331/Issued: 11.98 13–3


IDSm WRITE WORD VARIABLE, INDEXED

This function block serves the purpose of indexed writing


of word variables.
FBD/LD IL

!BA 0
IDSm IDS
FREI FREI
QUEL QUEL
INDX INDX
BASI
BASI

____________________________________________________________________________________________

Parameters
FREI BINARY E, A, M, K, S Enable block
FREI = 0: Block is not processed
FREI = 1: The value of the source variable is read
and allocated to the target variable
QUEL WORD EW, AW, MW, KW Source variable
INDX WORD EW, AW, MW, KW The current target variable results from the index
and the basic variable
BASI WORD AW, MW Basic variable
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 35 µs 99 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description Formula:

This function block serves the purpose of indexed wri-ting INDX


of word variables. –––– = A Remainder B
16
When the block is enabled, the value of the source vari-
able is read and allocated to the target variable. The tar- Group No. of the target flag:
get variable is defined by indexing the basic variable. Group No. of the basic flag + A

The inputs and outputs can neither be duplicated nor ne- Channel No. of the target flag:
gated nor inverted. Channel No. of the basic flag + B

The group and channel number of the target flag (target Example:
variable) are determined on the basis of the basic flag and
the index INDX. Basic variable: MW 00,00
–> INDX = 10 –> 10 : 16 = A = 0, Remainder B = 10
The target flag is called: MW (G_Basis+A),(K_Basis+B) –> Target variable:
where: MW(00+A), (00+B) = MW (00+0),(00+10) =
G_Basis: Group number of the basic flag MW 00,10
K_Basis: Channel number of the basic flag –> Target variable: MW 00,10

13–4 907 PC 331/Issued: 11.98


WRITE WORD VARIABLE, INDEXED IDSm

Further examples: BASI WORD


The basic variable is specified at the input BASI. The tar-
Basic variable INDX Target variable get variable (see above for a calculation) results from the
index INDX and the basic variables.
MW 00,00 0 MW 00,00
MW 00,00 2 MW 00,02
MW 00,00 16 MW 01,00
MW 00,02 18 MW 01,04
AW 00,00 3 AW 00,03
AW 00,15 1 AW 01,00
AW 05,05 6 AW 05,11
AW 05,05 12 AW 06,01

FREI BINARY
Enable block
FREI=0: –> Block is not processed
FREI=1: –> The value of the source variable is read
and allocated to the target variable
ZIEL.

QUEL WORD
The source variable is specified at the input QUEL. The
value of this variable is read and allocated to the target
variable.

INDX WORD
The index value is specified at the input INDX. The target
variable (see above for a calculation) results from the in-
dex INDX and the basic variable.

Value range: –16383 < INDX < +16383


If INDX is out of range, the function block is not pro-
cessed.

907 PC 331/Issued: 11.98 13–5


IDSm WRITE WORD VARIABLE, INDEXED

Example

FBD/LD IL

!BA 0
IDSm IDS
M 00,00 FREI M 00,00
MW 09,00 QUEL MW 09,00
MW 00,00 INDX MW 00,00
BASI MW 00,01
MW 00,01

CE FBD Definition

IDSm
FREI
QUEL
INDX
BASI

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
QUEL E W N P Y 0 0
INDX E W N P Y 0 0
BASI A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 IDS
00002 PP 0 FREI Enable (BINARY)
00003 PP 0 QUEL Source variable (WORD)
00004 PP 0 INDX Index relatet to basis (WORD)
00005 PP 0 BASI Basic variable for target (WORD)

13–6 907 PC 331/Issued: 11.98


Call not possible IF THEN

IF THEN is a basic function in the manufacturer library.


The element’s name in the library is :=
The element cannot be called in the CE and CE IL editors. FBD/LD IL

Call not possible

____________________________________________________________________________________________

Parameters
–––
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 4 µs
Additional runtime: –––
Output updating: –––
Number of historical values: –––
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
IF THEN is a basic function in the manufacturer library.
The element’s name in the library is :=
The element cannot be called in the CE and CE IL editors.
The programming unit uses this element to realize con-
nection lines.
____________________________________________________________________________________________

Example

FBD/LD IL

Call is not possible

____________________________________________________________________________________________

CE FBD Definition
not defined

CE IL Definition
00000 ! PP 0 inp
00002 = PP 0 outp

907 PC 331/Issued: 11.98 13–7


IF THEN, WORD Call not possible

IF THEN, WORD is a basic function in the manufacturer


library. The element’s name in the library is :=WO
This element can not be called in the CE and CE IL edi- FBD/LD IL
tors.

Call not possible

____________________________________________________________________________________________

Parameters
–––
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 4 µs
Additional runtime: –––
Output updating: –––
Number of historical values: –––
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
IF THEN, WORD is a basic function in the manufacturer
library. The element’s name in the library is :=WO
This element cannot be called in the CE and CE IL edi-
tors.
The programming unit uses this element to realize con-
necting lines.
____________________________________________________________________________________________

Example

FBD/LD IL

Call not possible

CE FBD Definition
not defined

CE IL Definition
00000 ! PP 0 inp
00002 = PP 0 outp

13–8 907 PC 331/Issued: 11.98


INITIALIZE MEMORY AREA IN THE
OPERAND MEMORY WITH ZERO INITS

This function block serves the purpose of word–by–word


initialization of memory areas in the operand memory with
the value 0. FBD/LD IL

!BA 0
INITS
INITS
0–1 0–1
#n #n
VAR VAR

____________________________________________________________________________________________

Parameters
0–1 BINARY E, A, M, S Enabling for non–recurring processing of the block
(0/1 edge)
#n DIRECT #, #H Quantity (n) of memory words to be initialized
CONSTANT
VAR BINARY, E, A, M, K, S, The n memory words specified at the input #n are
WORD, EW, AM, MW, KW, initialized as from this variable.
DOUBLE WORD MD, KD
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 40 µs
Additional runtime: 2.6 µs per memory word to be initialized
Output updating: not applicable
Number of historical values: 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The following must be observed:


This function block serves the purpose of word–by–word
BINARY operand:
initialization of memory areas in the operand memory with
Occupies 1 BYTE in the operand memory.
the value 0.
WORD operand:
The block is run through precisely once in the event of a Occupies 1 WORD in the operand memory.
0/1 edge at the input 0–1. In doing so, n memory words DOUBLE WORD operand:
are initialized with the value 0 as from the variable speci- Occupies 2 WORDS in the operand memory.
fied at the input VAR. The variable specified at this input 0–1 BINARY
can be a BINARY, WORD or DOUBLE WORD operand.
Block enable.
The block is run through precisely once when a 0/1 edge
appears at this input.

907 PC 331/Issued: 11.98 13–9


INITIALIZE MEMORY AREA IN THE
INITS OPERAND MEMORY WITH ZERO

#n DIRECT CONSTANT
Quantity (n) of words to be initialized.

The number of memory words to be initialized is specified


as a DIRECT CONSTANT at this input.
Value range: 0 < n < 65535

No initialization is realized if the value 0 is specified.

VAR BINARY, WORD, DOUBLE WORD


n memory words are initialized with the value 0 as from
this variable (inclusive).

13–10 907 PC 331/Issued: 11.98


INITIALIZE MEMORY AREA IN THE
OPERAND MEMORY WITH ZERO INITS

Example

The 4 binary flags

M 03,01
M 03,02
M 03,03
M 03,04

are to be initialized with the value 0. A binary flag in


memory takes up 1 byte. Therefore there is a total
of 4 bytes = 2 words to be initialized. For this rea-
son, the value 2 must be specified at the input #n
as a DIRECT CONSTANT and at input VAR the
flag M 03,01.

FBD/LD IL

!BA 0
INITS
INITS
M 00,00 0–1 M 00,00
# 2 #n # 2
M 03,01 VAR M 03,01

CE FBD Definition

INITS
0–1
#n
VAR

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0–1 E L N P Y 0 0
#n K W N P Y 0 0
VAR E X N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 INITS
00001 PP 0 0–1 Enable edge (BINARY)
00002 PP 0 #n Number (DIRECT CONSTANT)
00003 PP 0 VAR Start variable (BINARY, WORD, DOUBLE WORD)

907 PC 331/Issued: 11.98 13–11


INITV INITIALIZE VARIABLES

This function block serves to initialize BINARY and


WORD variables with numeric values.
FBD/LD IL

!BA 0
INITV
INITV
0–1
0–1
#W/B
#W/B
#n
#n
#W0
#W0
VR0
VR0

____________________________________________________________________________________________

Parameters
0–1 BINARY E, A, M, S Enabling for non–recurring processing of the block
(0/1 edge)
#W/B DIRECT #, #H Format specification
CONSTANT #W/B = 1: Initialization of WORD variables
#W/B = 0: Initialization of BINARY variables
#n DIRECT #, #H Number of variables to be initialized
CONSTANT
#W0 DIRECT #, #H Initialization value for the subsequent variable;
CONSTANT The inputs #W0 and VR0 can be duplicated in pairs
VR0 BINARY, WORD E, A, M, Variable to be initialized;
EW, AW, MW The inputs VR0 and #W0 can be duplicated in pairs
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 34 µs
Additional runtime: 11 µs per additional variable VR1 ... VRn–1 to be initialized
Output updating: not applicable
Number of historical values: 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description #W/B DIRECT CONSTANT


This function block serves to initialize BINARY and The format of the variable to be initialized is specified as a
WORD variables with numeric values. direct constant at the input #W/B. The following applies:

The initialization values are specified as direct constants. #W/B = 1: Word variable (EW, AW, MW)
The block is run through precisely once when a 0/1 edge #W/B = 0: Binary variable (E, A, M)
appears at the input 0–1.
0–1 BINARY #n DIRECT CONSTANT
The block is run through precisely once when a 0/1 edge The quantity n of variables to be initialized is specified as
appears at the input 0–1. a direct constant at the input #n.

13–12 907 PC 331/Issued: 11.98


INITIALIZE VARIABLES INITV

#W0 DIRECT CONSTANT


The initialization value for the subsequent variable is spe-
cified as a direct constant at the input #W0.

The inputs #W0 and VR0 can be duplicated in pairs.


The following affiliations apply :
Value 0 –> Variable 0
: :
Value n–1 –> Variable n–1

VR0 BINARY/WORD
The first variable to be initialized is specified at the input
VR0.

The inputs VR0 and #W0 can be duplicated in pairs.

907 PC 331/Issued: 11.98 13–13


INITV INITIALIZE VARIABLES

Example

The following variables are to be initialized:

MW 00,09 = 4853
MW 03,07 = 12
MW 02,15 = 8

FBD/LD IL

!BA 0
INITV
INITV
M 00,00 0–1 M 00,00
# 1 #W/B # 1
# 3 #n # 3
# 4853 #W0 # 4853
MW 00,09 VR0 MW 00,09
# 12 #W1 # 12
MW 03,07 VR1 MW 03,07
# 8 #W2 # 8
MW 02,15 VR2 MW 02,15

CE FBD Definition

INITV
0–1
#W/B
#n
#W0
VR0

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Goup Type Screen Block Type

0–1 E L N P Y 0 0
#W/B K W N P Y 0 0
#n K W N P Y 0 0
#W K W N P Y 1 1
VR E X N P Y 1 1

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 INITV
00002 PP 0 0–1 Enable edge (BINARY)
00003 PP 0 #W/B Format für Variable (#)
00004 PP 0 #n Number (#)
[ 1
00005 PP 1 #W Initial value for variable (#)
00006 PP 1 VR Variable to be initialized (BINARY/WORD)
] 1

13–14 907 PC 331/Issued: 11.98


INTEGRATOR (EXTENDED) INTK

This block generates the integral of the controlled variable


x multiplied by the proportinal coefficient K. FBD/LD IL

!BA 0
INTK INTK
x x
K TI/T
TI/T R
OG STOP
UG S
STOP INIT
S y=OG K
INIT y=UG OG
R y UG
y
y=OG
y=UG
____________________________________________________________________________________________

Parameters
x WORD EW, AW, MW, KW Controlled variable
K WORD EW, AW, MW, KW Proportional coefficient, output as a percentage
TI/T WORD EW, AW, MW, KW Integration time scaled to the cycle time
OG WORD EW, AW, MW, KW High limit for the manipulated variable y
UG WORD EW, AW, MW, KW Low limit for the manipulated variable y
STOP BINARY E, A, M, S, K Integrator stop
S BINARY E, A, M, S, K Set output to INIT value
INIT WORD EW, AW, MW, KW Initial value
R BINARY E, A, M, S, K Reset output y to the value 0
y=OG BINARY A, M Output y has reached top limit
y=UG BINARY A, M Output y has reached low limit
y WORD AW, MW Manipulated variable
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 189 – 197 µs
Additional runtime: –––
Output updating: yes
Number of historical values: 3 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description ● It can be set to the initial value at the INIT input by


a 1 signal at the input S (set)
This block generates the integral of the controlled variable ● It can be limited to a maximum value specified at
x multiplied by the proportinal coefficient K. the input OG (high limit)
The integrator’s output y can be manipulated as follows: ● It can be limited to a minimum value specified at
● It can be set to the value 0 by a 1 signal at the the input UG (low limit)
input R (reset)
● It can be latched to the current value by a The inputs and outputs can neither be duplicated nor ne-
1 signal at the input STOP gated/inverted.

907 PC 331/Issued: 11.98 13–15


INTK INTEGRATOR (EXTENDED)

Transfer function ● 100 percent means that the block multiplies the value
at input x by the factor 1
K
F(s) = s*T ● 1000 percent means that the block multiplies the value
at input x by the factor 10
Transfer function
TI/T WORD
x The integration time is specified at the input TI/T. It must
be scaled to the cycle time. During the time TI the output y
of the integrator changes by the value K * x.
1

Value range: 0 < TI/T < 328

t ● If values are specified which are beyond the admissi-


ble value range the PLC uses the value 328.
y
● A large integration time (TI) can be achieved by choos-
ing a great cycle time, too. If the block is used within a
OG run number block, the cycle time of the run number
block is valid for block INTK and not the cycle time (KD
0,0) of the PLC program.

OG WORD
The manipulated variable y can be limited to a value
K
range. The high limit for the manipulated variable y is spe-
cified at the input OG.
INIT
TI

UG UG WORD
The manipulated variable y can be limited to a value
range. The low limit for the manipulated variable y is spe-
t cified at the input UG.

x WORD
The operand for the controlled variable is specified at the STOP BINARY *)
input x. Integration can be stopped with the STOP input.

STOP = 0 –> integration is not stopped


K WORD STOP = 1 –> integration is stopped, i.e. the output y
The proportional coefficient is specified at the input K. It no longer changes.
serves to weight the controlled variable at the input x.
Weighting is achieved by multiplying the controlled vari-
able by the proportional coefficient.
S BINARY *)
As from version V6 (GJP 122900 R301), the proportional
By means of the input S, the manipulated variable y can
coefficient is specified as a percentage.
be set to the initial value specified at the input INIT. In-
Example: tegration then again begins as from the initial value.
1 = 1 Percent
55 = 55 Percent S = 0 –> No setting
100 = 100 Percent S = 1 –> Output y is set to the specified initial value
1000 = 1000 Percent
–100 = –100 Percent
INIT WORD
● 1 percent means that the block multiplies the value at The initial value to which the output y must be set when
input x by the factor 0.01 required is specified at the input INIT.

13–16 907 PC 331/Issued: 11.98


INTEGRATOR (EXTENDED) INTK

R BINARY *) y=OG = 0 –> y has not reached the limit


With the input R, the output y can be reset to the value 0. y=OG = 1 –> y has reached the limit
Integration then again begins as from the value 0.
y=UG BINARY
*) Priority sequence for the inputs STOP, S and R:
Whether the value at the output y has reached the speci-
fied lower limit is signalled at the output y=UG. Integration
R Highest priority is stopped automatically when the limit is reached.
STOP
S Lowest priority y=UG = 0 –> y has not reached the limit
y=UG = 1 –> y has reached the limit
y=OG BINARY
Whether the value at the output y has reached the speci- y WORD
fied top limit is signalled at the output y=OG. Integration is The manipulated variable (output value of the integrator)
stopped automatically when the limit is reached. is output through the output y.

Example

FBD/LD IL

!BA 0
INTK INTK
EW 00,01 x EW 00,01
AW 00,08 K KW 01,00
KW 01,00 TI/T S 05,12
AW 02,04 OG A 04,00
EW 06,10 UG M 07,09
A 04,00 STOP MW 12,03
M 07,09 S y=OG A 08,09
MW 12,03 INIT y=UG AW 00,08
M 11,13
S 05,12 R y AW 08,03 AW 02,04
EW 06,10
AW 08,03
A 08,09
M 11,13

907 PC 331/Issued: 11.98 13–17


INTK INTEGRATOR (EXTENDED)

CE FBD Definition

INTK
x
K
TI/T
OG
UG
STOP
S y=OG
INIT y=UG
R y

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

x E W N P Y 0 0
K E W N P Y 0 0
TI/T E W N P Y 0 0
OG E W N P Y 0 0
UG E W N P Y 0 0
STOP E L N P Y 0 0
S E L N P Y 0 0
INIT E W N P Y 0 0
R E L N P Y 0 0
y=OG A L N P Y 0 0
y=UG A L N P Y 0 0
y A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 INTK
00002 PP 0 x Input WORD (controlled variable)
00003 PP 0 TI/T Input WORD (integration time)
00004 PP 0 R Input BINARY (reset to 0)
00005 PP 0 STOP Input BINARY (integrator stop)
00006 PP 0 S Input BINARY (set to INIT)
00007 PP 0 INIT Input WORD (initial value)
00008 PP 0 K Input WORD (proportinal coefficient)
00009 PP 0 OG Input WORD (high limit)
00010 PP 0 UG Input WORD (low limit)
00011 PP 0 y Output WORD (manipulated variable)
00012 PP 0 y=OG Output BINARY (OG reached)
00013 PP 0 y=UG Output BINARY (UG reached)

13–18 907 PC 331/Issued: 11.98


INPUT / OUTPUT CONFIGURATION IOCON

FBD/LD IL

IOCON IOCON !BA 0


BASE A 01,04 BASE IOCON
#OFF #3 #OFF A 01,04
#ANZ #32 #ANZ #3
#32

The outputs A 04,04 ... A 06,03 are output, even if their names
are not configured in the PLC program.

Parameters
BASE BINARY E, A Base of input or output identifier
#OFF DIRECT #, #H Offset of the desired group number
CONSTANT (related to BASE)
#ANZ DIRECT #, #H Number of channels to be configured
CONSTANT

____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: ca. 0 µs
Additional runtime: –––
Output updating: –––
Number of historical values: 0 words
Available as of: ABB Procontic CS31, 07 KR 91 g, 07 KT 92 g, 07 KT 93
____________________________________________________________________________________________

Description function is, for instance, required, when binary inputs are
to be read with the IDLB function block or binary outputs
The PLC processor only operates those binary inputs and are to be written with the IDSB function block, respec-
outputs whose identifier are explicitly configured in the tively.
PLC program.
The IOCON function block can enable a defined range of The input or output range is specified at the function
binary inputs or outputs for operation, whose identifier do block. The range is configured at the program start in con-
not exist in the PLC program. Normally, those inputs and junction with the program preparation. The IOCON block
outputs are not processed automatically. This enable has no function within the program cycle itself.

907 PC 331/Issued: 11.98 13–19


IOCON INPUT / OUTPUT CONFIGURATION

BASE BINARY #ANZ DIRECTE CONSTANT


The identifier of a binary input or output is given at the in-
Range of values: #ANZ > 1
put BASE. This identifier is the base which #OFF and
#ANZ relate to. At the input #ANZ the number of input or output channels
is specified which are to be configured in the additional
#OFF DIRECT CONSTANT range.
Range of values: #OFF > 0
The end of the range is calculated as follows:
At the input #OFF, it is specified where the input or output
range, which is to be operated additionally, starts. Equation:
The beginning of the additionally configured range is as (#ANZ–1 + channel_number_BASE):16 = ∆G,
follows: Remainder = channel_number_of_end_of_range
The value specified at the input #OFF is added to the GroupNo._end_of _range =
group number of the configured input or output identifier, GroupNo._beginning_of_range + ∆G
which is given at the input BASE. The new input or output
identifier, calculated in this way, marks the beginning of where is:
the input or output range which is to be configured addi-
tionally. GroupNo._end_of_range:
last group number of the range
The beginning of the range is calculated as follows:
Channel_number_of_end_of_range:
GroupNo._beginning_of_range =
last channel number of the range
GroupNo._BASE + #OFF
Channel_number_beginning_of_range = GroupNo._beginning_of_range:
Channel_number_BASE first group number of the range
where is:
Channel_number_BASE:
GroupNo._beginning_of_range: channel number of the identifier at BASE
first group number of the range
Channel_number_beginning_of_range: Example:
first channel number of the range
configured:
#OFF: value at the input #OFF
BASE: A 01,04
GroupNo._BASE: #OFF: 3
group number of the identifier at BASE #ANZ: 32
Channel_number_BASE:
channel number of the identifier at BASE it follows:
Example: Beginning of range: A (01+3),04 = A 04,04
– Input BASE: A 01,04
i.e. group number = 01 and channel number = 04 End of range: Equation:
(32 –1 + 4):16 = 2, Remainder 3
– Input #OFF: 3 ––> A (04+2),03 = A 06,03
i.e. the range to be configured starts with:
A (01+3),04 = A 04,04 Range: A 04,04 ... A 06,03

13–20 907 PC 331/Issued: 11.98


INPUT / OUTPUT CONFIGURATION IOCON

Example
configured: The result is:
BASE : A 01,04 Beginning of range: A (01+#OFF),04 = A 04,04
#OFF : 3 End of range: A 06,03
#ANZ : 32

A00,00 A00,00

A01,00 A01,00
A01,01 A01,01
A01,02 A01,02
A01,03 BASE = A 01,04 A01,03
A01,04 A01,04
A01,05 A01,05

A02,00 A02,00

#OFF = 3
A03,00 A03,00

A04,00 A04,00
A04,01
A04,02
Beginning of range = A04,04 A04,03
A04,04

A05,00 A05,00
#ANZ = 32

A06,00 A06,00
A06,01 A06,01
A06,02 A06,02
A06,03 A06,03
A06,04 End of range = A 06,03 A06,04

907 PC 331/Issued: 11.98 13–21


IOCON INPUT / OUTPUT CONFIGURATION

13–22 907 PC 331/Issued: 11.98


READ BYTE VALUE FROM I/O ADDRESS IOR

This function block reads a byte out of the I/O area and
allocates it to the operand at the output.
FBD/LD IL

!BA 0
IOR IOR
ADR A1 ADR
A1

____________________________________________________________________________________________

Parameters
ADR WORD EW, AW, MW, KW Address from the I/O area whose BYTE value is to be
read.
A1 WORD AW, MW The BYTE value read is allocated to the output A1.
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 24 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This function block reads a byte out of the I/O area and
allocates it to the operand at the output.

The input and output can neither be duplicated nor ne-


gated.

ADR WORD
The value of the operand at the input ADR represents the
I/O address to be read.

A1 WORD
The byte read out of the I/O area is allocated to the LOW
BYTE of the operand at the output A1.

907 PC 331/Issued: 11.98 14–1


IOR READ BYTE VALUE FROM I/O ADDRESS

Example

FBD/LD IL

!BA 0
IOR IOR
KW 00,00 ADR AW 02,00 KW 00,00
AW 02,00

CE FBD Definition

IOR
ADR A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

ADR E W N P Y 0 0
A1 A W N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 IOR
00002 PP 0 ADR Input WORD (I/O address)
00003 PP 0 A1 Output WORD (value)

14–2 907 PC 331/Issued: 11.98


WRITE BYTE VALUE TO I/O ADDRESS IOW

This function block writes the byte specified at the input


E1 into the I/O area.
FBD/LD IL

!BA 0
IOW IOW
E1 E1
ADR ADR

____________________________________________________________________________________________

Parameters
E1 WORD EW, AW, MW, KW Operand whose LOW byte is read and written into the
I/O area
ADR WORD EW, AW, MW, KW I/O address to which the value of the operand is
written.
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 24 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This function block writes the byte specified at the input
E1 into the I/O area.

E1 WORD
The LOW BYTE of the operand at the input E1 is written
into the I/O area.

ADR WORD
The value of the operand at the input ADR represents the
I/O address to which the value is written.

907 PC 331/Issued: 11.98 14–3


IOW WRITE BYTE VALUE TO I/O ADDRESS

Example

FBD/LD IL

!BA 0
IOW IOR
EW 00,00 EW 00,00
KW 01,00 ADR KW 01,00

CE FBD Definition

IOW
E1
ADR

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
ADR E W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 IOW
00002 PP 0 E1 Input WORD (value)
00003 PP 0 ADR Input WORD (I/O address)

14–4 907 PC 331/Issued: 11.98


ILLUMINATION PUSHBUTTON CONTROL LDT

This function block changes the state at the output A with


every 0/1 edge at the input E (like a toggle flip–flop).
FBD/LD IL

!BA 0
LDT
LDT
EIN EIN
AUS AUS
E A E
R EINI R
AUSI A
EINI
AUSI

____________________________________________________________________________________________

Parameters
EIN BINARY E, A, M, K, SDynamic input for activating output A
AUS BINARY E, A, M, K, SDynamic input for deactivating output A
E BINARY E, A, M, K, SDynamic input for activating and deactivating output A
R BINARY E, A, M, K, SStatic input for deactivating output A
A BINARY A, M Output
EINI BINARY A, M Pulse for the duration of one PLC program cycle when
activating output A
AUSI BINARY A, M Pulse for the duration of one PLC program cycle when
deactivating output A
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 79...83 µs
Additional runtime: none
Output updating: yes
Number of historical values: 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This function block changes the state at the output A with EIN AUS E R A NA: Inverting of the
every 0/1 edge at the input E (like a toggle flip–flop). How- previous state of A
X X X H L
X: State is ignored
ever, this only applies if the input R is inactive. The output X X > L NA >: 0/1 edge
A can be influenced additionally with the inputs EIN, AUS X > < L L <: no 0/1 edge
and R. > < < L H L: State 0
H: State 1
All inputs except R are edge–controlled, i. e. they react
only to a 0/1 edge. The input R is active for as long as a
static 1 signal is present at it. Brief pulses are available at
the output EINI and AUSI when a status change of the
output A occurs.

907 PC 331/Issued: 11.98 14–5


LDT ILLUMINATION PUSHBUTTON CONTROL

EIN BINARY R BINARY


The output A is set with every 0/1 edge at the input EIN. The output A is reset when a static 1 signal is present at
However, this only applies when the inputs AUS, E and R the input R.
are inactive. Therefore, of all inputs the input EIN has the The input R has a higher priority than the inputs E and
lowest priority. EIN. A priority conflict with the input AUS is not possible
because both inputs have the same effect on the outputs.

AUS BINARY A BINARY


The output A is changed corresponding to the definition of
The output A is reset with every 0/1 edge at the input AUS.
the inputs.
Therefore, the input AUS has a higher priority than the in-
put EIN, but a lower priority than the inputs E and R. EINI BINARY
A pulse is generated at the output EINI with every 0/1
edge of the output A. The length of this pulse is 1 program
E BINARY
cycle.
With every 0/1 edge at the input E, the block changes the
status at the output A. However, this only applies if the in- AUSI BINARY:
put R is inactive. Therefore, the input E has a higher prior- A pulse is generated at the output AUSI with every 1/0
ity than the inputs EIN and AUS, but a lower priority than edge of the output A. The length of this pulse is 1 program
the input R. cycle.

14–6 907 PC 331/Issued: 11.98


ILLUMINATION PUSHBUTTON CONTROL LDT

Example

FBD/LD IL

!BA 0
LDT
LDT
M 00,00 EIN M 00,00
M 09,07 AUS M 09,07
M 09,08 E A M 00,01 M 09,08
M 04,02 R EINI M 00,02 M 04,02
AUSI M 00,03 M 00,01
M 00,02
M 00,03

CE FBD Definition

LDT
EIN
AUS
E A
R EINI
AUSI

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

EIN E L N P Y 0 0
AUS E L N P Y 0 0
E E L N P Y 0 0
R E L N P Y 0 0
A A L N P Y 0 0
EINI A L N P Y 0 0
AUSI A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 LDT
00002 PP 0 EIN 0/1: Activating A (BINARY)
00003 PP 0 AUS 0/1: Deactivating A (BINARY)
00004 PP 0 E 0/1: Activating/deactivating A (BINARY)
00005 PP 0 R Statically: deactivating A (BINARY)
00006 PP 0 A Output (BINARY)
00007 PP 0 EINI Activating pulse (BINARY)
00008 PP 0 AUSI Deactivating pulse (BINARY)

907 PC 331/Issued: 11.98 14–7


LIFO STACK, LAST IN/FIRST OUT

This function block realizes a stack for binary or word data


from which the data written in last is read out first (last in/
first out). FBD/LD IL

!BA 0
LIFO LIFO
B/W R
LADE LADE
LESE LESE
R A E
E FST B/W
#L L #L
ANF V ANF
A
FST
L
V

____________________________________________________________________________________________

Parameters
B/W BINARY E, A, M, S, K Binary data/word data
LADE BINARY E, A, M, S, K Load LIFO
LESE BINARY E, A, M, S, K Read LIFO
R BINARY E, A, M, S, K Reset LIFO, 0/1 edge
E BINARY E, A, M, S, K Enter data in the LIFO
WORD EW, AW, MW, KW
#L DIRECT #, #H Number of memory locations (bytes)
CONSTANT
ANF BINARY E, A, M, K Start of the LIFO in the flag area
WORD EW, AW, MW, KW
A BINARY E, M Output of data from the LIFO
WORD AW, MW
FST WORD AW, MW Filling level of the LIFO
L BINARY A, M LIFO empty
V BINARY A, M LIFO full
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 64 µs
Additional runtime: 0–114 µs according to the function to be carried out
Output updating: no; recommendation: Allocate the output directly to a flag or use a global
intermediate flag; see volume 3, chapter 2.5.3
Number of historical values: 3 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This function block realizes a stack for binary or word data
from which the data written in last is read out first (last in/
first out).

The inputs and outputs can neither be duplicated nor ne-


gated/inverted.

14–8 907 PC 331/Issued: 11.98


STACK, LAST IN/FIRST OUT LIFO

B/W BINARY R and LADE and LESE


The input B/W serves to preselect binary or word pro- The value at the input E is forwarded directly to the output
cessing (LIFO for binary or word data) A. The output L is set permanently to 1 and the output
FST is set permanently to 0.
B/W = 0 –> word processing E BINARY/WORD
B/W = 1 –> binary processing The value to be transferred into the LIFO is specified at
the input E.
Binary or word processing is defined once and must not
be changed during operation of the LIFO. #L DIRECT CONSTANT
The number of required memory locations (bytes) of the
LIFO is specified at the input #L. This quantity is specified
as a direct constant and results from the following formu-
LADE BINARY
la:
The value present at the input E is transferred to the next
free position of the LIFO by means of a 1 signal at the BINARY data:
LADE input. If the LIFO is “full” and a “load” signal is pres- #L = Number of binary values to be stored
ent, the new value will not be read in. A new value can only
be read in if a value has been read out first. It is then trans- WORD data:
ferred to the first position of the LIFO. #L = 2 * Quantity of word values to be stored

E.g.: BINARY data: 3 values –> #L = 3


WORD data: 3 values –> #L = 6
LESE BINARY
The LIFO length parameter is subjected to a plausibility
A 1 signal at the input LESE results in output of the current
check for the value 0 and, in word processing mode, also
LIFO value through the output A. If the LIFO is “empty”, a
in relation to an odd byte parameter. If the parameter spe-
pending read order is ignored and the value 0 is output
cified at the input #L is incorrect, the LIFO will assume the
through the output A. The output A is always set to 0 if
initial state (as after R).
there is no read order.
ANF BINARY/WORD
The LIFO memory start address is specified as a binary or
LADE and LESE word flag at the input ANF. The LIFO begins with the spe-
If load and read orders are present simultaneously, the cified flag.
value to be loaded is forwarded directly from the input E to A BINARY/WORD
the output A. At the same time, the LIFO does not store
the value. The LIFO does not change its filling level in this When the LIFO is read, the current value is available at
mode. The value output through the output FST remains the output A. If no read order is available, the value 0 is
constant. If the LIFO is empty, the output L remains 1 and output.
the output FST is set to 0.
FST WORD
The output FST indicates the current filling level of the
LIFO at any time. The filling level is the number of binary
R BINARY or word values stored in the LIFO.
A 0–>1 edge at the input R results in the reset of the block.
Therefore, values read in before are no longer available. L BINARY
The output L assumes the value 1 and the outputs FST The output L indicates whether or not the LIFO is empty.
and A assume the value 0. L = 0 –> LIFO is not empty
L = 1 –> LIFO is empty

V BINARY
R and LADE
The output V indicates whether or not the LIFO is full.
If R and LADE signals are present simultaneously the re- V = 0 –> LIFO is not full
set is performed first and then directly afterwards the load V = 1 –> LIFO is full
operation. Therefore, the LIFO is reset and the new value No more values can be read in if the LIFO is full. A value
to be read in is then immediately stored in the LIFO as the can only be read in again once a value has been read out.
first value. This then takes place as from the start of the LIFO.

907 PC 331/Issued: 11.98 14–9


LIFO STACK, LAST IN/FIRST OUT

Example

LIFO for 9 binary data, stored as of M 01,10

FBD/LD IL

!BA 0
LIFO LIFO
K 00,01 B/W M 01,09
M 01,01 LADE M 01,01
M 01,05 LESE M 01,05
M 01,09 R A M 12,05 M 06,04
M 06,04 E FST MW 11,07 K 00,01
# 9 #L L A 00,01 # 9
M 01,10 ANF V A 01,15 M 01,10
M 12,05
MW 11,07
A 00,01
A 01,15

LIFO for 3 word data, stored as of MW 10,00

FBD/LD IL

!BA 0
LIFO LIFO
K 00,00 B/W M 02,00
M 01,00 LADE M 01,00
M 01,01 LESE M 01,01
M 02,00 R A MW 11,01 MW 03,01
MW 03,01 E FST MW 11,02 K 00,00
# 6 #L L M 03,00 # 6
M 10,00 ANF V M 03,01 MW 10,00
MW 11,01
MW 11,02
M 03,00
M 03,01

14–10 907 PC 331/Issued: 11.98


STACK, LAST IN/FIRST OUT LIFO

CE FBD Definition

LIFO
B/W
LADE
LESE
R A
E FST
#L L
ANF V

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

B/W E L N P Y 0 0
LADE E L N P Y 0 0
LESE E L N P Y 0 0
R E L N P Y 0 0
E E X N P Y 0 0
#L K W N P Y 0 0
ANF E X N P Y 0 0
A A X N P Y 0 0
FST A W N P Y 0 0
L A L N P Y 0 0
V A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (presest to 0)
00001 LIFO
00002 PP 0 R Input BINARY (R)
00003 PP 0 LADE Input BINARY (load LIFO)
00004 PP 0 LESE Input BINARY (read LIFO)
00005 PP 0 E Input BINARY/WORD (input)
00006 PP 0 B/W Input BINARY (BINARY/WORD data)
00007 PP 0 #L # CONSTANT (number of memory locations)
00008 PP 0 ANF Input BINARY/WORD (start of memory locations)
00009 PP 0 A Output BINARY/WORD (output)
00010 PP 0 FST Output WORD (filling level)
00011 PP 0 L Output BINARY (LIFO empty)
00012 PP 0 V Output BINARY (LIFO full)

907 PC 331/Issued: 11.98 14–11


LIZU LIST ALLOCATOR

This function block has a list of direct constants at its in-


puts. With a list pointer, it selects a constant out of this list
and outputs it through its output. FBD/LD IL

!BA 0
LIZU LIZU
ZEIG ZEIG
#n A=#E #n
#E0 A #E0
A=#E
A

____________________________________________________________________________________________

Parameters
ZEIG WORD AW, EW, MW, KW Pointer to the list of direct constants
#n DIRECT #, #H Number of direct constants in the list
CONSTANT
#E0 DIRECT #, #H List of direct constants; the input is capable of
CONSTANT duplication
A WORD AW, MW Selected direct constant
A=#E BINARY A, M 0 < ZEIG < #n, i. e. pointer in the valid range
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 19 µs 127 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description The value at the input ZEIG is subjected to a validity


This function block has a list of direct constants at its in- check. The result of this range check is signalled at the
puts. With a list pointer, it selects a constant out of this list output A=#E.
and outputs it through its output.

The inputs and outputs cannot be negated/inverted. The Allowed range:


input #E0 can be duplicated. 0 < ZEIG < n–1
Where n: Number of the inputs #E0...#En–1.
ZEIG WORD No allocation to the output A takes place if the value at the
The pointer to the direct constant to be selected from the input ZEIG is outside the allowed range.
list is specified at the input ZEIG.

The following affiliations apply:


ZEIG = 0 –> Direct constant at E0 #n DIRECT CONSTANT
ZEIG = 1 –> Direct constant at E1 The number n of the direct constants planned at the in-
. . . puts #E0...#En–1 is specified at the input #n. This is spe-
ZEIG = n–1 –> Direct constant at En–1 cified as a direct constant.

14–12 907 PC 331/Issued: 11.98


LIST ALLOCATOR LIZU

#E0...#En–1 DIRECT CONSTANT


The input #E0 is capable of duplication (#E0...#En–1).
The direct constants out of which one is selected with the
value at the input ZEIG and allocated to the output A are
specified at the inputs #E0...#En–1.

A=#E BINARY
Whether the value of the list pointer (input ZEIG) is within
the allowed range is specified at the output A=#E.
Allowed range:
0 < ZEIG < n–1
where n: Number of the direct constants at #E0...#En–1.
The following applies:
ZEIG in the allowed range –> A=#E = 1
ZEIG in the forbidden range –> A=#E = 0
If the list pointer has a forbidden value, no allocation of a
constant to the output A takes place because no constant
can be selected. In this case, the output A is not updated.

A WORD
The value of the selected direct constant is allocated to
the operand at the output A.

907 PC 331/Issued: 11.98 14–13


LIZU LIST ALLOCATOR

Example

FBD/LD IL

!BA 0
LIZU LIZU
MW 09,00 ZEIG MW 09,00
# 3 #n A=#E A 00,01
# 3
# 131 #E0 A AW 01,05
# 131
# 150 #E1
# 150
# 380 #E2
# 380
A 00,01
AW 01,05

CE FBD Definition

LIZU
ZEIG
#n A=#E
#E A

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

ZEIG E W N P Y 0 0
#n K W N P Y 0 0
#E K W N P Y 1 0
A=#E A L N P Y 0 0
A A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 LIZU
00002 PP 0 ZEIG Input WORD (pointer)
00003 PP 0 #n # CONSTANT (number of #Es)
[ 1
00004 PP 1 #E # CONSTANT (input values)
] 1
00005 PP 0 A=#E0 Output BINARY (0 < ZEIG < #n)
00006 PP 0 A Output WORD (output value)

14–14 907 PC 331/Issued: 11.98


RUN NUMBER BLOCK LZB

This function block controls processing of a program part.


This program part is called run number block and begins
with the function block LZB and ends with the affiliated FBD/LD IL
target label specified at the input MRK. This program part
is processed as follows depending on the value of the op-
erand at the input E1: !BA 0
LZB LZB
E1 = 0: Program part is not processed E1 E1
E1 = 1: Program part is processed during every cycle MRK MA NR
E1 = 2: Program part is processed during every #0
second cycle #0
E1 = n: Program part is processed during every nth #0
cycle

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Run number
MRK SPECIAL MRK Target label
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 29 µs
Additional runtime: –––
Output updating: not applicable
Number of historical values: 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description IL

This function block controls processing of a program part. Designation of the target label: MA No.
This program part is called run number block and begins Where: MA Key word
with the function block LZB and ends with the affiliated 0 < Nr < 999 Number of the label
target label specified at the input MRK. This program part
is processed as follows depending on the value of the op-
The PLC automatically calculates:
erand at the input E1:
– The number of historical values to be skipped
E1 = 0: Program part is not processed – The address of the target label
E1 = 1: Program part is processed during every cycle – The pointer to the own historical value
E1 = 2: Program part is processed during every
The PLC enters the 3 computed values in the intended
second cycle
positions of the LZB block. When planned in IL, the user
E1 = n: Program part is processed during every nth
can basically fill these 3 program words with any con-
cycle
tents. However, it is suggested that the numeric value 0
be entered here.
FBD/LD
Caution:
Designation of the target label: MRK No.
The 3 program words should not be written with NOPs be-
Where: MRK Key word cause these are removed when optimizing the user pro-
0 < Nr < 999 Number of the label gram.

907 PC 331/Issued: 11.98 14–15


LZB RUN NUMBER BLOCK

Example

FBD/LD IL

!BA 0
LZB LZB
MW 01,00 MW 01,00
MRK 10 MRK MA 10
#0
. #0
.
. #0
. .
.
MRK .
.
MRK 10 MA 10

CE FBD Definition

LZB
E1
MRK

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
MRK S S N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 LZB
00002 PP 0 E1 Input WORD (run number)
00003 MA PP 0 MRK Targel Label
00004 # 0
00005 # 0
00006 # 0

14–16 907 PC 331/Issued: 11.98


MAJORITY MAJ

This connection element realizes a MAJORITY element.

FBD/LD IL

! BA 0
MAJ MAJ
E1 E1
E2 E2
E3 MAJ E3
MAJ

____________________________________________________________________________________________

Parameters
E1 BINARY E, M, A, S, K Operand 1

E2 BINARY E, M, A, S, K Operand 2

E3 BINARY E, M, A, S, K Operand 3

MAJ BINARY M, A Result


____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 36 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description

This connection element realizes a MAJORITY element.

If at least 2 of the 3 binary operands at the inputs E1, E2


and E3 have the state 1, then the state 1 is allocated to the
binary operand at the output MAJ. The state 0 is allocated
if this is not the case.

The inputs and the output can neither be duplicated nor


negated.

907 PC 331/Issued: 11.98 14–17


MAJ MAJORITY

Example

FBD/LD IL

! BA 0
MAJ MAJ
E 00,00 E 00,00
E 03,11 E 03,11
M 00,00 MAJ A 02,00 M 00,00
A 02,00

CE FBD Definition

MAJ
E1
E2
E3 MAJ

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E L N P N 0 0
E2 E L N P N 0 0
E3 E L N P N 0 0
MAJ A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MAJ
00002 PP 0 E1 Input BINARY
00003 PP 0 E2 Input BINARY
00004 PP 0 E3 Input BINARY
00005 PP 0 MAJ Output BINARY (majority)

14–18 907 PC 331/Issued: 11.98


MASK MASKE

The individual bits of the operand at the input E1 are com-


pared to the bits of the operand at the input MASK.
FBD/LD IL
The result of the comparison is signalled at the outputs
ALLE and KEIN.
!BA 0
MASKE MASKE
E1 E1
MASK MASK
ALLE ALLE
KEIN KEIN

____________________________________________________________________________________________

Parameters
E1 WORD EW, AW, MW, KW Input value
MASK WORD EW, AW, MW, KW Mask
ALLE BINARY A, M All bits agree
KEIN BINARY A, M No bit agrees
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 35 – 38 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________
Description If only some of the bits are set on the operand at the input
E1 which are set on the operand at the input MASK, the
The individual bits of the operand at the input E1 are com-
following applies to the outputs:
pared to the bits of the operand at the input MASK.
ALLE =0
KEIN =0
The result of the comparison is signalled at the outputs
ALLE and KEIN. The inputs and outputs can neither be duplicated nor ne-
gated nor inverted.
If at least all bits are set on the operand at the input E1
which are set on the operand at the input MASK, the fol- Example
lowing applies to the outputs:
ALLE = 1 E1 : X1111XX11XXXX11X ALLE = 1
KEIN = 0 MASK : 0111100110000110 KEIN = 0

If none of the bits are set on the operand at the input E1 E1 : 00XXXXX0XXX0XXXX ALLE = 0
which are set on the operand at the input MASK, the fol- MASK : 1100000100010000 KEIN = 1
lowing applies to the outputs:
ALLE = 0 E1 : 1X1X1XXX10XXXX10 ALLE = 0
MASK : 0010100011000011 KEIN = 0
KEIN =1
X: These bits may have any value (don’t care)

907 PC 331/Issued: 11.98 14–19


MASKE MASK

Example

FBD/LD IL

!BA 0
MASKE MASKE
MW 08,02 MW 08,02
KW 03,00 MASK KW 03,00
ALLE M 08,11 M 08,11
KEIN M 08,12 M 08,12

CE FBD Definition

MASKE
E1
MASK
ALLE
KEIN

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
MASK E W N P Y 0 0
ALLE A L N P Y 0 0
KEIN A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MASKE
00002 PP 0 E1 Input WORD (input value)
00003 PP 0 MASK Input WORD (mask)
00004 PP 0 ALLE Output BINARY (all bits agree)
00005 PP 0 KEIN Output BINARY (no bit agrees)

14–20 907 PC 331/Issued: 11.98


MASK, DOUBLE WORD MASKED

The individual bits of the operand at the input E1 are com-


pared to the bits of the operand at the input MASK.
FBD/LD IL
The result of the comparison is signalled at the outputs
ALLE and KEIN.
!BA 0
MASKED MASKED
E1 E1
MASK MASK
ALLE ALLE
KEIN KEIN

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Input value
MASK DOUBLE WORD MD, KD Mask
ALLE BINARY A, M All bits agree
KEIN BINARY A, M No bit agrees
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 42 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description If only some of the bits are set on the operand at the input
The individual bits of the operand at the input E1 are com- E1 which are set on the operand at the input MASK, the
pared to the bits of the operand at the input MASK. following applies to the outputs:
ALLE = 0
The result of the comparison is signalled at the outputs KEIN = 0
ALLE and KEIN.
The inputs and outputs can neither be duplicated nor ne-
If at least all bits are set on the operand at the input E1 gated nor inverted.
which are set on the operand at the input MASK, the fol-
lowing applies to the outputs:
ALLE = 1
KEIN = 0

If none of the bits are set on the operand at the input E1


which are set on the operand at the input MASK, the fol-
lowing applies to the outputs:
ALLE = 0
KEIN = 1

907 PC 331/Issued: 11.98 15–1


MASKED MASK, DOUBLE WORD

Example

E1 : X1111XX11XXXX11X X1XXXXX1XXX1XXXX ALLE = 1


MASK : 0111100110000110 0100000100010000 KEIN = 0

E1 : X0000XX00XXXX00X X0XXXXX0XXX0XXXX ALLE = 0


MASK : 0111100110000110 0100000100010000 KEIN = 1

E1 : X1011XX10XXXX11X X1XXXXX0XXX1XXXX ALLE = 0


MASK : 0111100110000110 0100000100010000 KEIN = 0

X: These bits may have any values (don’t care).

15–2 907 PC 331/Issued: 11.98


MASK, DOUBLE WORD MASKED

Example

FBD/LD IL

!BA 0
MASKED MASKED
MD 08,02 MD 08,02
KD 03,00 MASK KD 03,00
ALLE M 08,11 M 08,11
KEIN M 08,12 M 08,12

CE FBD Definition

MASKED
E1
MASK
ALLE
KEIN

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
MASK E D N P Y 0 0
ALLE A L N P Y 0 0
KEIN A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MASKED
00002 PP 0 E1 Input DOUBLE WORD (input value)
00003 PP 0 MASK Input DOUBLE WORD (mask)
00004 PP 0 ALLE Output BINARY (all bits agree)
00005 PP 0 KEIN Output BINARY (no bit agrees)

907 PC 331/Issued: 11.98 15–3


MAX MAXIMUM VALUE GENERATOR

From n operands, this function block generates the maxi-


mum value and allocates it to the output.
FBD/LD IL

!BA 0
MAX MAX
#n #n
E1 MAX E1
MAX

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of inputs
CONSTANT
E1 WORD EW, MW, AW, KW 1st input value; the input is capable of duplication
MAX WORD AW, MW Output (maximum value)
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 22 µs 74 µs
Additional runtime: 9 µs per planned input E1
64 µs per planned input E1
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description MAX WORD


The maximum value from the n input operands is avail-
From n operands, this function block generates the maxi- able at the output MAX.
mum value and allocates it to the output.

The input E1 can be duplicated.


#n DIRECT CONSTANT (#, #H)
The output can neither be duplicated nor negated.
The number of operands from which the maximum value
is to be determined is specified at the input #n. This is spe-
cified as a direct constant.
n > 0 applies.

E1 WORD
The input must be duplicated as many times as neces-
sary until the number of inputs specified at the input #n
exists. On the basis of the values of the operands at these
inputs, the maximum value is determined and is allocated
to the output MAX.

15–4 907 PC 331/Issued: 11.98


MAXIMUM VALUE GENERATOR MAX

Example

FBD/LD IL

!BA 0
MAX MAX
#2 #n #2
MW 05,00 MAX MW 09,03 MW 05,00
MW 05,01 MW 05,01
MW 09,03

CE FBD Definition

MAX
#n
E1 MAX

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
E1 E W N P N 1 0
MAX A W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MAX
00002 PP 0 #n # CONSTANT (number of inputs)
[ 1
00003 PP 1 E1 Input WORD
] 1
00004 PP 0 MAX Output WORD (max. value)

907 PC 331/Issued: 11.98 15–5


MAXD MAXIMUM VALUE GENERATOR, DOUBLE WORD

From n operands, this function block generates the maxi-


mum value and allocates it to the output.
FBD/LD IL

!BA 0
MAXD MAXD
#n #n
E1 MAX E1
MAX

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of inputs
CONSTANT
E1 DOUBLE WORD MD, KD 1st input value; the input is capable of duplication
MAX DOUBLE WORD MD Output (maximum value)
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 29 µs
Additional runtime: 13 µs per planned input E1
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description MAX DOUBLE WORD


From n operands, this function block generates the maxi- The maximum value from the n input operands is avail-
mum value and allocates it to the output. able at the output MAX.
The input E1 can be duplicated.
#n DIRECT CONSTANT (#, #H) The output can neither be duplicated nor negated.
The number of operands from which the maximum value
is to be determined is specified at the input #n. This is spe-
cified as a direct constant.
n > 0 applies.

E1 DOUBLE WORD
The input must be duplicated as many times as neces-
sary until the number of inputs specified at the input #n
exists. On the basis of the values of the operands at these
inputs, the maximum value is determined and is allocated
to the output MAX.

15–6 907 PC 331/Issued: 11.98


MAXIMUM VALUE GENERATOR, DOUBLE WORD MAXD

Example

FBD/LD IL

!BA 0
MAXD MAXD
#2 #n #2
MD 05,00 MAX MD 09,03 MD 05,00
MD 05,01 MD 05,01
MD 09,03

CE FBD Definition

MAXD
#n
E1 MAX

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
E1 E D N P N 1 0
MAX A D N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MAXD
00002 PP 0 #n # CONSTANT (number of inputs)
[ 1
00003 PP 1 E1 Input DOUBLE WORD
] 1
00004 PP 0 MAX Output DOUBLE WORD (max. value)

907 PC 331/Issued: 11.98 15–7


MAXIMUM VALUE GENERATOR AS
MAZ A FUNCTION OF TIME

This function block determines, on the basis of the time


progression of a signal, its maximum value occurring up
to the current point in time. FBD/LD IL

!BA 0
MAZ MAZ
E1 E1
S S
INIT MAZ INIT
MAZ

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Input value whose time maximum is to be determined
S BINARY E, M, A, S, K Set input
INIT WORD EW, MW, AW, KW Initial value
MAZ WORD AW, MW Maximum value
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 36 ... 40 µs
Additional runtime: –––
Output updating: yes
Number of historical values: 2 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The output MAZ is set to the value of the operand at the
input INIT (initial value) with the 0–>1 edge at the binary
This function block determines, on the basis of the time
input S.
progression of a signal, its maximum value occurring up
to the current point in time.
The following applies:
The value of the operand at the input E1 is compared to
E1 < MAZ –> MAZ = MAZ
the previously occurring maximum value. If the input val-
E1 > MAZ –> MAZ = E1
ue E1 is higher than the previously occurring maximum,
the input value is the new maximum value and is allocated S = 0–>1 edge –> MAZ = INIT
to the operand at the output MAZ.
If the input value E1 is less than the previously occurring
maximum value, the previous maximum value is allo- The inputs and the output can neither be duplicated nor
cated to the output. negated/inverted.

15–8 907 PC 331/Issued: 11.98


MAXIMUM VALUE GENERATOR AS
A FUNCTION OF TIME MAZ

Example

FBD/LD IL

!BA 0
MAZ MAZ
MW 05,00 MW 05,00
E 01,00 S E 01,00
KW 00,00 INIT MAZ MW 09,05 KW 00,00
MW 09,05

CE FBD Definition

MAZ
E1
S
INIT MAZ

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
S E L N P Y 0 0
INIT E W N P Y 0 0
MAZ A W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MAZ
00002 PP 0 E1 Input WORD (input value)
00003 PP 0 S Input BINARY (set input)
00004 PP 0 INIT Input WORD (initial value)
00005 PP 0 MAZ Output WORD (max. value)

907 PC 331/Issued: 11.98 15–9


MAXIMUM VALUE GENERATOR AS A FUNCTION OF TIME,
MAZD DOUBLE WORD

This function block determines, on the basis of the time


progression of a signal, its maximum value occurring up
to the current point in time. FBD/LD IL

!BA 0
MAZD MAZD
E1 E1
S S
INIT MAZ INIT
MAZ

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Input value whose time maximum is to be determined
S BINARY E, M, A, S, K Set input
INIT DOUBLE WORD MD Initial value
MAZ DOUBLE WORD MD Maximum value
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 49 ... 58 µs
Additional runtime: –––
Output updating: yes
Number of historical values: 3 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description The following applies:


This function block determines, on the basis of the time E1 < MAZ –> MAZ = MAZ
progression of a signal, its maximum value occurring up E1 > MAZ –> MAZ = E1
to the current point in time. S = 0–>1 edge –> MAZ = INIT

The value of the operand at the input E1 is compared to


the previously occurring maximum value. If the input val- The inputs and the output can neither be duplicated nor
ue E1 is higher than the previously occurring maximum, negated/inverted.
the input value is the new maximum value and is allocated
to the operand at the output MAZ.

If the input value E1 is less than the previously occurring


maximum value, the previous maximum value is allo-
cated to the output.
The output MAZ is set to the value of the operand at the
input INIT (initial value) with the 0–>1 edge at the binary
input S.

15–10 907 PC 331/Issued: 11.98


MAXIMUM VALUE GENERATOR AS A FUNCTION OF TIME,
DOUBLE WORD MAZD

Example

FBD/LD IL

!BA 0
MAZD MAZD
MD 05,00 MD 05,00
E 01,00 S E 01,00
KD 03,00 INIT MAZ MD 09,05 KD 03,00
MD 09,05

CE FBD Definition

MAZD
E1
S
INIT MAZ

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
S E L N P Y 0 0
INIT E D N P Y 0 0
MAZ A D N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MAZD
00002 PP 0 E1 Input DOUBLE WORD (input value)
00003 PP 0 S Input BINARY (set input)
00004 PP 0 INIT Input DOUBLE WORD (initial value)
00005 PP 0 MAZ Output DOUBLE WORD (max. value)

907 PC 331/Issued: 11.98 15–11


MIN MINIMUM VALUE GENERATOR

This function block determines the minimum value from n


operands and allocates it to the output.
FBD/LD IL

!BA 0
MIN MIN
#n #n
E1 MIN E1
MIN

____________________________________________________________________________________________

Parameter
#n DIRECT #, #H Number of inputs
CONSTANT
E1 WORD EW, MW, AW, KW 1st input value; the input is capable of duplication
MIN WORD AW, MW Output (minimum value)
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 35 µs 74 µs
Additional runtime: 7 µs per planned input E1
64 µs per planned input E1
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description MIN WORD


This function block determines the minimum value from n The minimum value of the n input operands is available at
operands and allocates it to the output. the output MIN.
The input E1 can be duplicated.
#n DIRECT CONSTANT (#, #H) The output can neither be duplicated nor negated.
The number of operands from which the minimum value
is to be determined is specified at the input #n. This is spe-
cified as a direct constant.
n > 0 applies.

E1 WORD
The input E1 must be duplicated as often as the number
of inputs specified at the input #n exists. On the basis of
the values of the operands at these inputs, the minimum
value is determined and is allocated to the output MIN.

15–12 907 PC 331/Issued: 11.98


MINIMUM VALUE GENERATOR MIN

Example

FBD/LD IL

!BA 0
MIN MIN
#2 #n #2
MW 05,00 MIN MW 09,03 MW 05,00
MW 05,01 MW 05,01
MW 09,03

CE FBD Definition

MIN
#n
E1 MIN

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
E1 E W N P N 1 0
MIN A W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MIN
00002 PP 0 #n # CONSTANT (number of inputs)
[ 1
00003 PP 1 E1 Input WORD
] 1
00004 PP 0 MIN Output WORD (min. value)

907 PC 331/Issued: 11.98 15–13


MIND MINIMUM VALUE GENERATOR, DOUBLE WORD

This function block determines the minimum value from n


operands and allocates this value to the output.
FBD/LD IL

!BA 0
MIND MIND
#n #n
E1 MIN E1
MIN

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of inputs
CONSTANT
E1 DOUBLE WORD MD, KD 1st input value; the input is capable of duplication
MIN DOUBLE WORD MD Output (minimum value)
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 24 µs
Additional runtime: 14 µs per planned input E1
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description MIN DOUBLE WORD


This function block determines the minimum value from n The minimum value of the n input operands is available at
operands and allocates this value to the output. the output MIN.
The input E1 can be duplicated.
#n DIRECT CONSTANT (#, #H) The output can neither be duplicated nor negated.
The number of operands from which the minimum value
is to be determined is specified at the input #n. This is spe-
cified as a direct constant.
n > 0 applies.

E1 DOUBLE WORD
The input E1 must be duplicated until the number of in-
puts specified at the input #n exists. On the basis of the
values of the operands at these inputs, the minimum val-
ue is determined and is allocated to the output MIN.

15–14 907 PC 331/Issued: 11.98


MINIMUM VALUE GENERATOR, DOUBLE WORD MIND

Example

FBD/LD IL

!BA 0
MIND MIND
#2 #n #2
MD 05,00 MIN MD 09,04 MD 05,00
MD 05,01 MD 05,01
MD 09,04

CE FBD Definition

MIND
#n
E1 MIN

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
E1 E D N P N 1 0
MIN A D N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MIND
00002 PP 0 #n # CONSTANT (number of inputs)
[ 1
00003 PP 1 E1 Input DOUBLE WORD
] 1
00004 PP 0 MIN Output DOUBLE WORD (min. value)

907 PC 331/Issued: 11.98 15–15


MOA MONOSTABLE ELEMENT ”ABORT”

A 0–1 edge at the input 1 produces a 0–1 edge at the


output Q. If the input 1 remains at 1 level, a 1–0 edge is
output on output Q after duration ZD has elapsed. FBD/LD IL

The output Q is also set back to 0 level if the input 1


should return to 0 level before expiry of time TD. !BA 0
MOA MOA
Maximum time offset at the output: < 1 cycle time 1 1
ZD Q ZD
Q

____________________________________________________________________________________________

Parameters
1 BINARY E, M, A, S, K Input signal
ZD DOUBLE WORD MD, KD Pulse length
Q BINARY M, A Output signal
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 36 µs;
max. runtime in case of 97 µs / 552 µs
edges at input 1 : 600 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: 1 word 1 word
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________
_________

Description
A 0–1 edge at the input 1 produces a 0–1 edge at the
output Q. If the input 1 remains at 1 level, a 1–0 edge is 1
output on output Q after duration ZD has elapsed.

The output Q is also set back to 0 level if the input 1 Q


should return to 0 level before expiry of time TD. t t
The time is specified in milliseconds. Only integral multi-
ple of 5 ms are admissible (Examples: 5 ms, 500 ms, t0 ZD t0 t<ZD
100 000 ms, ...). Time range which can be specified:
5 ms ... 24.8 days.
In case of the indirect constant KD the value of the pulse
length is specified in the long text.
Maximum time offset at the output: < 1 cycle time
Meaningful range for ZD: > 1 cycle time
The inputs and the output can neither be duplicated nor
inverted.

15–16 907 PC 331/Issued: 11.98


MONOSTABLE ELEMENT ”ABORT” MOA

General behavior Important note


The behaviour of the timers has been changed. All run-
● Started timers are processed by the PLC’s operating ning timers are stopped when one of the following actions
system and are therefore completely independent of occurs:
processing of the PLC program. A corresponding mes-
sage is not issued by the operating system to the affilia- – Abort PLC program
ted timer in the PLC program until the timer has elap- – RUN/STOP switch from RUN –> STOP
sed.
This modification is valid as of:
● Processing of a timer in the operating system of the 07 KR 91 Index g
PLC is not influenced by the following commands: 07 KT 92 Index g
– Abort program 07 KT 93
– Start program
– Stop program
– Continue program
That is to say, if a timer has been started it will continue
to be processed in the PLC’s operating system even if
the affiliated PLC program is aborted, restarted or stop-
ped and continued again.

Initialization

The timers are always initialized in the event of a cold or


warm start of the PLC. Therefore, a running timer is al-
ways aborted by a cold or warm start of the PLC.
Cold start:
– KALT <CR> command
– Activation of the power for the first time
Warm start:
– WARM <CR> command
– Activation of the power
– RESET switch

907 PC 331/Issued: 11.98 15–17


MOA MONOSTABLE ELEMENT ”ABORT”

Example

FBD/LD IL

!BA 0
MOA MOA
E 01,00 1 E 01,00
KD 03,00 ZD Q M 07,03 KD 03,00
M 07,03

CE FBD Definition

MOA
1
ZD Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

1 E L N P Y 0 0
ZD E D N P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MOA
00002 PP 0 1 Input BINARY (start timer)
00003 PP 0 ZD Input DOUBLE WORD (pulse length)
00004 PP 0 Q Output BINARY (time)

15–18 907 PC 331/Issued: 11.98


MONOSTABLE ELEMENT "ABORT" MOAT

A 0/1 edge at input IN produces a 0/1 edge at output Q. If


input IN remains at 1 level, a 1/0 edge is applied at output FBD/LD
Q after the duration PT has elapsed.
MOAT
Output ET displays the current time.
PT Q
Output Q is also immediately set back to 0 level if input IN IN ET
returns to 0 level before the time period PT has expired.

Parameters
IN BINARY E, M, A, S, K Input signal
PT WORD/DOUBLE WORD MW&MW+1, MD, KW&KW+1, KD, Pulse length
EW&EW+1, AW&AW+1
Q BINARY M, A Output signal
ET WORD/DOUBLE WORD MW&MW+1, MD Time display

Available as of: Advant Controller 31, series 40 and 50

Description
A 0/1 edge at input IN produces a 0/1 edge at output Q. If IN
input IN remains at 1 level, a 1/0 edge is applied at output
Q after the duration PT has elapsed. Q
t t
Output Q is also immediately set back to 0 level if input IN
returns to 0 level before the time period PT has expired. t0 PT t0 t<PT
The output ET indicates the current time.
For times less than 65 s, variables of the type WORD can
General behaviour
be used at input PT and output ET: flags, constants, other
WORD functions (+, -, AWT) and the potentiometer inputs • Started timers are processed by the PLC’s operating
of the basic unit. In this case MW, KW, EW and AW as- system and are therefore completely independent of
sign two successive addresses. MW+1, KW+1, EW+1 the PLC program processing. The operating system
and AW+1 must no longer be used in the program. does not issue a corresponding message to the corre-
sponding timer block in the PLC program until the timer
Time is entered in milliseconds.
has elapsed.
Valid time range: 5 ms ... 24,8 days.
• The timer processing in the PLC operating system is
For the indirect constant KD, the value for the pulse length not affected by the following commands:
is entered in long text.
- Abort program
Maximum time offset at the output: < 1 cycle time. - Start program
- Stop program
Sensible range for PT: > 1 cycle time - Continue program
The inputs and the output can neither be duplicated nor This means: If a timer is started, its processing in the PLC
inverted. operating system is also continued if the corresponding
PLC program is aborted, started or stopped again or con-
tinued.

907 PC 331 / Issued: 08.99 15-19


7
MOAT MONOSTABLE ELEMENT "ABORT"

Initialization Cold start


The timers are generally initialized with each PLC cold or - Command KALT <CR>
warm start. Therefore a running timer is always aborted by - First switching-on of the voltage
a PLC cold or warm start.
Warm start
- Command WARM <CR>
- Switching on voltage
- RESET switch

Graphic
Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

MOAT
BIT_IN Y N Y 0 00 IN Q 00 0 Y N Y BIT_OUT
ALLE Y N Y 0 00 PT ET 00 0 Y N Y ALLE

Source
SN ZN Command / Variable Symbol Long text

00000 00000 !BA 000


00001 MOAT
00002 PP 00 IN
00003 PP 00 PT
00004 PP 00 ET
00005 PP 00 Q

7 15-20 907 PC 331 / Issued: 08.99


MODBUS MASTER MODBUS

Communication function block


The central unit is a master on a MODBUS network and – system constant KW 00,06 = 100
can communicate with other products with MODBUS pro- – connection between pins 7 and 6 on the connector
tocol. of the serial interface

The function MODBUS MASTER in the central unit is val- Several function blocks MODBUS can be used in one
ided by: user program.
____________________________________________________________________________________________

Parameters
FREI BINARY E,A,M,K,S Enable signal for one communication (rising edge)
SLAV WORD EW,AW,MW,KW Slave number
FCT WORD EW,AW,MW,KW Function code
TIME WORD EW,AW,MW,KW Time-out for MODBUS communication
ADDR WORD EW,AW,MW,KW Address in the slave
NB WORD EW,AW,MW,KW Number of data to send or to read
DATA WORD EW,AW,MW,KW
BINARY E,A,M Data to send to the slave or to write
with the data received from a slave MODBUS
RDY BINARY A,M Ready, communication in progress
ERR BINARY A,M Communication error
ERN WORD AW,MW Communication error, detail of error
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: not available
Additional runtime: not available
Output updating: yes
Number of historical values: 1 word
Available as of: ABB Procontic CS31 / 07 KR 31 V 2.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description SLAV WORD

The MODBUS protocol is a master/slave protocol. The Address of the slave which receives the request.
master sends a frame to a slave and waits for the answer Value: 0 < ADDR < 255
(a time-out is defined). Binary or numeric data can be re- In case of address 0 (ADDR = 0), all slaves on the MOD-
ad or written in a slave. BUS network will read the frame.
FCT WORD
The area of data in the master is chosen by the address of
the first variable. The size of area is necessary for send- The function depends on the type of parameters and if it is
ing or receiving. Reading or writing data are done auto- reading or writing.
matically from these areas.
Value: 1: reading n bits
2: reading n bits
FREI BINARY 3: reading n words
4: reading n words
A rising edge at the FREI input leads to an output of a re- 5: writing one bit
quest to a slave MODBUS, provided that the block is 6: writing one word
ready to do this (RDY = 1). 7: fast reading
15: writing n bits
If a rising edge appears at the FREI input although the
16: writing n words
RDY output is equal to 0, i.e. the block is not ready for a
new MODBUS communication, the rising edge will be ig- The other function codes are not supported by the 07 KR
nored. Therefore, no new MODBUS communication can 31. In case of a wrong function code, an error 1 is gener-
be started as long as the RDY output is 0. ated in the word ERN.

907 PC 331/Issued: 11.98 15–21


MODBUS MODBUS MASTER

TIME WORD Writing:


Time-out for the communication (maximum time for an ADDR DATA result
answer of the slave MODBUS).
word word idem
The value is given in milliseconds. bit bit idem
bit word same as the function
Cycle time (KD 00,00) < TIME < 32767 block PACK
In case of a time-out, the output ERN provides the value word bit same as the function
of 9. block UNPACK

ADDR WORD RDY BINARY

Address of data in the slave memory to read or write. The output RDY (ready) indicates whether a MODBUS
communication is in progress or not. As long as a commu-
NB WORD nication is in progress, the output RDY is equal to 0. The
function block can only be used if RDY = 1.
Number of data to read or write in the slave.
ERR BINARY
This number defines also the size of the data area in the
master to send to the slave or to receive from the slave. The output ERR indicates an error occurred during com-
munication. The word output ERN indicates the details of
DATA WORD, BINARY the error.
DATA defines the first variable of the data area in the mas- If ERR = 1 –> error,
ter. The size of this area depends on the NB parameter. ERR = 0 –> no error or
communication in progress.
Different cases are possible according to the function
code and the operand: The error is clear after one cycle time.
Reading:
ERN WORD
ADDR DATA result
Details of error:
word word idem
bit bit idem 0: no error
bit word same as the function 1: unknown function code
block PACK 2: address error
word bit The first bit of the word is 3: data error
ranged in the first bit of the 9: time-out
group number. 10: checksum error
Example: data = M 00,07 The error is clear after one cycle time.
The first bit of the read word
will be written in M 00,00. Graphic:

Plaus. group Dty Inv Dpl Mod No No Mod Dpl Inv Dty Plaus. group

MODBUS
BIT_IN N Y Y 0 00 FREI
WORT_IN N N Y 0 00 SLAV RDY 00 0 Y N Y BIT_OUT
WORT_IN Y N Y 0 00 FCT ERR 00 0 Y N Y BIT_OUT
ALLE Y N Y 0 00 TIME ERN 00 0 Y N Y WORT_OUT
ALLE Y N Y 0 00 ADDR
WORT_IN Y N Y 0 00 NB
ALLE Y N Y 0 00 DATA

15–22 907 PC 331/Issued: 11.98


MODBUS MASTER MODBUS

Source:
SN LN Command / Variable Symbol Long text
00000 00000 ;MODBUS MASTER
00001 !BA 000
00002 CALLUP
00003 PP 00 FREI
00004 #H 0300 OFFSET
00005 #H 0000 SEGMENT
00006 #H 0000 NB HIST
00007 # +00009 NB DATA
00008 PP 00 SLAV
00009 PP 00 FCT
00010 PP 00 TIME
00011 PP 00 ADDR
00012 PP 00 NB
00013 PP 00 DATA
00014 PP 00 RDY
00015 PP 00 ERR
00016 PP 00 ERN
00017 ;MODBUS MASTER END

907 PC 331/Issued: 11.98 15–23


MODBUS MODBUS MASTER

15–24 907 PC 331/Issued: 11.98


MONOSTABLE ELEMENT ”CONSTANT” MOK

A 0–1 edge at the input 1 produces a 0–1 edge at the


output Q. The output Q is reset to 0 level after expiry of the
period ZD. FBD/LD IL

A second 0–1 edge of the input 1 V before the time ZD


has elapsed is ignored. !BA 0
Maximum time offset at the output: < 1 cycle time MOK MOK
1 V 1 V
ZD Q ZD
Q

____________________________________________________________________________________________

Parameters
1 V BINARY E, M, A, S, K Input signal
ZD DOUBLE WORD MD, KD Pulse length
Q BINARY M, A Output signal
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 20 µs; max. runtime 380 µs in case 97 µs / 554 µs
of edges at input 1 V
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: 1 word 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
A 0–1 edge at the input 1 produces a 0–1 edge at the
output Q. The output Q is reset to 0 level after expiry of the 1 V
period ZD.

A second 0–1 edge of the input 1 V before the time ZD Q


has elapsed is ignored. ZD ZD

The time is specified in milliseconds. Only integral multi-


ple of 5 ms are admissible (Examples: 5 ms, 500 ms,
100 000 ms, ...). Time range which can be specified:
5 ms ... 24.8 days.
In case of the indirect constant KD the value of the pulse
length is specified in the long text.

Maximum time offset at the output: < 1 cycle time


Meaningful range for ZD: > 1 cycle time
The inputs and the output can neither be duplicated nor
inverted.

907 PC 331/Issued: 11.98 16–1


MOK MONOSTABLE ELEMENT ”CONSTANT”

General behavior Important note


● Started timers are processed by the PLC’s operating The behaviour of the timers has been changed. All run-
system and are therefore completely independent of ning timers are stopped when one of the following actions
processing of the PLC program. A corresponding mes- occurs:
sage is not issued by the operating system to the affilia-
ted timer in the PLC program until the timer has elap- – Abort PLC program
sed. – RUN/STOP switch from RUN –> STOP
● Processing of a timer in the operating system of the This modification is valid as of:
PLC is not influenced by the following commands: 07 KR 91 Index g
– Abort program 07 KT 92 Index g
– Start program 07 KT 93
– Stop program
– Continue program
That is to say, if a timer has been started it will continue
to be processed in the PLC’s operating system even if
the affiliated PLC program is aborted, restarted or stop-
ped and continued again.

Initialization
The timers are always initialized in the event of a cold or
warm start of the PLC. Therefore, a running timer is al-
ways aborted by a cold or warm start of the PLC.
Cold start:
– KALT <CR> command
– Activation of the power for the first time
Warm start:
– WARM <CR> command
– Activation of the power
– RESET switch

16–2 907 PC 331/Issued: 11.98


MONOSTABLE ELEMENT ”CONSTANT” MOK

Example

FBD/LD IL

!BA 0
MOK MOK
E 01,00 1 V E 01,00
KD 03,00 ZD Q M 07,05 KD 03,00
M 07,05

CE FBD Definition

MOK
1 V
ZD Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

1 V E L N P Y 0 0
ZD E D N P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 MOK
00002 PP 0 1 V Input BINARY (start time)
00003 PP 0 ZD Input DOUBLE WORD (time value)
00004 PP 0 Q Output BINARY (time)

907 PC 331/Issued: 11.98 16–3


MRK TARGET LABEL

In the PLC program, the branch target of a branch block or


run number block is defined by a label.
FBD/LD IL
The name and number of the label is specified at the input
MRK in the following form:
MRK No. MA MRK
MRK
where: MRK Key word MRK
0 < No. < 999 Number of the label

____________________________________________________________________________________________

Parameters
MRK SPECIAL MRK Target label
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 0 µs 0 µs
Additional runtime: ––– –––
Output updating: not applicable not applicable
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
In the PLC program, the branch target of a branch block or
run number block is defined by a label.

The name and number of the label is specified at the input


MRK in the following form:
MRK No.

Where: MRK Key word


0 < No. < 999 Number of the label

16–4 907 PC 331/Issued: 11.98


TARGET LABEL MRK

Example

FBD/LD IL

MA MRK 0
MRK
MRK 0

CE FBD Definition

MRK
MRK

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

MRK S S N P N 0 0

CE IL Definition
00000 MA PP 0 MRK Target label

907 PC 331/Issued: 11.98 16–5


MUL2N MULTIPLICATION BY 2 TO THE POWER OF N

The value of the operand at the input E1 is shifted bit–by–


bit N times.
FBD/LD IL
If the value at the input N is positive, the value is shifted to
the left. For each shift by 1 bit position, this corresponds to
multiplication of the current value by 2. !BA 0
MUL2N MUL2N
If the value at the input N is negative, the value is shifted to E1 E1
the right. For each shift by 1 bit position, this corresponds N A1 N
to division of the current value by 2. A1

The result is allocated to the operand at the output A1.

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Input operand
N WORD EW, MW, AW, KW Quantity
A1 WORD MW, AW Result
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 30–35 µs 72 µs
Additional runtime: 4 µs per shift 15 µs per shift
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description Sign of the value at the input E1:


The value of the operand at the input E1 is shifted bit–by– The sign of the value E1 is not influenced by the shift oper-
bit N times. ation. That is to say, the sign of the output value is always
identical with the input value’s sign.
If the value at the input N is positive, the value is shifted to
the left. For each shift by 1 bit position, this corresponds to
multiplication of the current value by 2.

If the value at the input N is negative, it is shifted to the


right. For each shift by 1 bit position, this corresponds to
division of the current value by 2.

The result is allocated to the operand at the output A1.

The inputs and the output can neither be duplicated nor


negated.
Meaningful range for N: –14 < N < +14

If N = 0, the value at the input E1 is passed directly to the


output A1.

16–6 907 PC 331/Issued: 11.98


MULTIPLICATION BY 2 TO THE POWER OF N MUL2N

Shift to the left (Multiplication): Shift to the right (Division):


When the value at the input is shifted to the left, the re-
When shifting to the right, every bit moves to the right by
leased bit 0 is filled with 0. The sign bit (bit 15) is not
one position. At the same time, the sign bit (bit 15) always
changed because limiting to the limit of the number range
retains its value. The released bit (bit 14) is filled in each
takes place beforehand.
case with the value of the sign bit.
Limiting of the value at the output A1 when shifting to the
Limiting of the value at the output when shifting to the
left:
right:
● The following applies to positive values at the
input E1: ● The following applies to positive values at the
input E1:
If bit 14 has a “1” and if shift operations still have to be car-
ried out on the basis of the value at the input N, these are If now only bit 0 has a “1” and shift operations still have to
no longer executed. Instead, the output is set to the limit be carried out because of the value at the input N, the out-
of the positive number range. That is to say, the limit has put will be set to the value 0. That is to say, the value 0 has
been reached in any case at the latest after 14 shifts. been reached in any case at the latest after 14 shifts.
Output A1 = 0.
Limit value: Output A1 = +32767 (7FFFH).
● The following applies to negative values at the
● The following applies to negative values at the input E1:
input E1:
If bit 0 ... bit 15 has a “1” as the result of the shift, the limit
If bit 14 has a “0” and shift operations still have to be car- value (–1) has been reached. Further shifts have no ef-
ried out because of the value at the input N, these will no fect. That is to say, the value –1 has been reached at the
longer be executed. Instead, the output is set to the limit latest after 15 shifts.
of the negative number range. That is to say, the limit has Output A1 = –1 (FFFFH).
been reached in any case at the latest after 14 shifts.
The inputs and the output can neither be duplicated nor
Limit: Output A1 = –32767 (8001H) negated.

907 PC 331/Issued: 11.98 16–7


MUL2N MULTIPLICATION BY 2 TO THE POWER OF N

Examples:
1. Input value E1 = 5498 (157AH)
Exponent N = 2 –> 2 * Left shift

Bit 15 0
Input value
0.0.0.1 0.1.0.1 0.1.1.1 1.0.1.0 157AH before the left shift

Bit 15 0

55E8H Result after


0.1.0.1 0.1.0.1 1.1.1.0 1.0.0.0
(21992) 2 left shifts

2. Input value E1 = 32612 (7F64H)


Exponent N = – 3 –> 3 * Right shift

Bit 15 0
7F64H Input value
(32612) 0.1.1.1 1.1.1.1 0.1.1.0 0.1.0.0
before the right shift

Bit 15 0
0FECH Result after
0.0.0.0 1.1.1.1 1.1.1.0 1.1.0.0
(4076) 3 right shifts

3. Input value E1 = –32612 (8008H)


Exponent N = – 3 –> 3 * Right shift

Bit 15 0
8008 H Input value
(–32760) 1.0.0.0 0.0.0.0 0.0.0.0 1.0.0.0
before the right shift

Bit 15 0
F001 H Result after
1.1.1.1 0.0.0.0 0.0.0.0 0.0.0.1
(–4095) 3 right shifts

16–8 907 PC 331/Issued: 11.98


MULTIPLICATION BY 2 TO THE POWER OF N MUL2N

Example

FBD/LD IL

!BA 0
MUL2N MUL2N
EW 00,00 EW 00,00
MW 03,11 N AW 02,00 MW 03,11
AW 02,00

CE FBD Definition

MUL2N
E1
N A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
N E W N P Y 0 0
A1 A W N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 MUL2N
00002 PP 0 E1 Input WORD
00003 PP 0 N Input WORD (number of shifts)
00004 PP 0 A1 Output WORD

907 PC 331/Issued: 11.98 16–9


MUL2ND DOUBLE WORD MULTIPLICATION BY 2 TO THE POWER OF N

The value of the operand at the input E1 is shifted N times


and bit–by–bit.
FBD/LD IL
If the value at the input N is positive, shifting takes place to
the left. For each shift by 1 bit position, this corresponds to
multiplying the current value by 2. !BA 0
MUL2ND MUL2ND
If the value at the input N is negative, shifting takes place E1 E1
to the right. For each shift, this corresponds to division of N A1 N
the current value by 2. A1

The result is allocated to the operand at the output A1.

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Input operand
N WORD EW, AW, MW, KW Quantity
A1 DOUBLE WORD MD Result
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 34 µs
Additional runtime: 6 µs per shift
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Left shifting (Multiplication):


The value of the operand at the input E1 is shifted N times When the value at the input is shifted to the left, the bit 0
and bit–by–bit. released in each case is filled up with 0. The sign bit (bit
31) is not changed because setting to the limit of the num-
If the value at the input N is positive, shifting takes place to ber range takes place beforehand.
the left. For each shift by 1 bit position, this corresponds to
multiplying the current value by 2. Limiting of the value at the output A1 during left shifting:
● The following applies to positive values at the
If the value at the input N is negative, shifting takes place input E1:
to the right. For each shift, this corresponds to division of
the current value by 2. If bit 30 is assigned a “1” and if shift operations still have to
be carried out as the result of the value at the input N,
The result is allocated to the operand at the output A1. these will no longer be executed. Instead, the output will
be set to the limit of the postivie number range. That is to
Meaningful range for N: –30 < N < +30 say, the limit has been reached in any case at the latest
after shifting 30 times.
If N = 0, the value at the input E1 is passed directly to the Output A1 = +2 147 483 647 (7FFF FFFFH).
output A1.
Sign of the value at the input E1:
The sign of the value E1 is not influenced by the shift oper-
ation. That is to say, the sign of the output value is always
identical to that of the input value.

16–10 907 PC 331/Issued: 11.98


DOUBLE WORD MULTIPLICATION BY 2 TO THE POWER OF N MUL2ND

● The following applies to negative values at the input


E1:
If bit 30 is assigned a “0” and if shift operations still have to
be carried out as the result of the value at the input N,
these will no longer be executed. Instead, the output will
be set to the limit of the postivie number range. That is to
say, the limit has been reached in any case at the latest
after shifting 30 times.
Output A1 = –2 147 483 647 (8000 0001H).
Shifting to the right (division):
When shifting to the right, each bit is moved to the right by
one position. At the same time, the sign bit (bit 31) always
retains its value. The bit released (bit 30) is filled up with
the value of the sign bit in each case.
Limiting of the value at the output when shifting to the
right:
● The following applies to positive values at the input:
If now only bit 0 has a “1” and if shift operations still have to
be executed as the result of the value at the input N, the
output will be set to the value 0. That is to say, the value 0
is reached in any case at the latest after shifting 30 times.
Output A1 = 0.
● The following applies to negative values at the
input E1:
If bits 0...31 have a “1” as the result of shifting, the limit
(–1) has been reached. Further shifts have no effect. That
is to say, the value –1 has been reached in any case at the
latest after shifting 31 times.
Output A1 = –1 (FFFF FFFFH).
The inputs and the output can neither be duplicated nor
negated

907 PC 331/Issued: 11.98 16–11


MUL2ND DOUBLE WORD MULTIPLICATION BY 2 TO THE POWER OF N

Examples
1. Input value E1 = 58350926 (37A5D4EH)
Exponent N = 4 ––> 4 * Left shift

31 0 Bit

0000 0011 0111 1010 0101 1101 0100 1110 37A5D4EH

37A5D4E0H
0011 0111 1010 0101 1101 0100 1110 0000
(933614816)

2. Input value E1 = 326786382 (137A5D4EH)


Exponent N = – 4 ––> 4 * Right shift

31 0 Bit

0001 0011 0111 1010 0101 1101 0100 1110 137A5D4EH

0137A5D4H
0000 0001 0011 0111 1010 0101 1101 0100
(20424148)

3. Input value E1 = –326786382 (EC85A2B2H)


Exponent N = – 4 ––> 4 * Right shift

31 0 Bit

1110 1100 1000 0101 1010 0010 1011 0010 EC85A2B2H

FEC85A2BH
1111 1110 1100 1000 0101 1010 0010 1011
(–20424149)

16–12 907 PC 331/Issued: 11.98


DOUBLE WORD MULTIPLICATION BY 2 TO THE POWER OF N MUL2ND

Example

FBD/LD IL

!BA 0
MUL2ND MUL2ND
MD 00,00 MD 00,00
KW 03,11 N MD 01,00 KW 03,11
MD 01,00

CE FBD Definition

MUL2ND
E1
N A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
N E W N P Y 0 0
A1 A D N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 MUL2ND
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 N Input WORD (number of shifts)
00004 PP 0 A1 Output DOUBLE WORD

907 PC 331/Issued: 11.98 16–13


MUXR MULTIPLEXER WITH RESET

This function block connects the input E to one of the out-


puts A0...An–1 depending on the input INDX.
FBD/LD IL

!BA 0
MUXR
MUXR
E E
INDX INDX
#n INOK #n
A0 INOK
A0

____________________________________________________________________________________________

Parameters
E WORD EW, AW, MW, KW Input
INDX WORD EW, AW, MW, KW Index input
#n DIRECT #,#H Quantity n of word outputs A0 ... An–1
CONSTANT
INOK BINARY A, M Range monitoring for input INDX
A0 WORD AW, MW Word outputs A0 ... An–1; the output A0 is capable of
duplication
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 44.5 µs
Additional runtime: 7.5 µs per additional word output A1 ... An–1
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description E WORD
This function block connects the input E to one of the out- Input which is switched through to one of the outputs
puts A0...An–1 depending on the input INDX. A0...An–1.

The word outputs that are not connected are set to 0. The INDX WORD
validity of the value at the input INDX is checked.
Index input for selection of one of the outputs A0...An–1.
Relationship between E, INDX and A0...An–1: Value range: 1 < INDX < n
The input INDX is used to define with which of the outputs
A0...An–1 the input E is connected.
Note:
The following apply: INDX = 1 : E –> A0
INDX = 0 can be used to initialize the outputs
INDX = 2 : E –> A1
A0 ... An–1 (A0 ... An–1 = 0).
INDX = 3 : E –> A2
: :: :
INDX = n : E –> An–1 #n DIRECT CONSTANT

where 1 < INDX < n < 32767 (theoretically) Quantity n of word outputs A0 ... An–1.

16–14 907 PC 331/Issued: 11.98


MULTIPLEXER WITH RESET MUXR

INOK BINARY A0 WORD


Range monitoring of the INDX input The output A0 is capable of duplication (A0...An–1). The
input E is allocated to one of the n outputs A0...An–1.
The output indicates whether or not the input INDX is
within the valid range.
Valid range: 1 < INDX < n
INOK = 1 –> Index input INDX within the valid range
INOK = 0 –> Index input INDX in the invalid range
–> A0...An–1 = 0
If the word input INDX is not within the valid range, all
word outputs A0 to An–1 are set to 0. Thus, for example,
INDX = 0 can be used to initialize the outputs (A0...An–1 =
0).

907 PC 331/Issued: 11.98 16–15


MUXRMULTIPLEXER WITH RESET MULTIPLEXER WITH RESET

Example

FBD/LD IL

!BA 0
MUXR
MUXR
MW 00,00 E MW 00,00
MW 00,01 INDX MW 00,01
# 2 #n INOK M 00,00 # 2
A0 MW 00,02 M 00,00
A1 MW 00,03 MW 00,02
MW 00,03

CE FBD Definition

MUXR
E
INDX
#n INOK
A

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E W N P Y 0 0
INDX E W N P Y 0 0
#n K W N P Y 0 0
INOK A L N P Y 0 0
A A W N P Y 1 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 MUXR
00002 PP 0 E Input (WORD)
00003 PP 0 INDX Index (WORD)
00004 PP 0 #n Number of outputs (#)
00005 PP 0 INOK Output index valid (BINARY)
[ 1
00006 PP 1 A Output (WORD)
] 1

16–16 907 PC 331/Issued: 11.98


MULTIPLEXER, DOUBLE WORD WITH RESET MUXRD

This function block connects the input E to one of the out-


puts A0...An–1 depending on the input INDX.
FBD/LD IL

!BA 0
MUXRD
MUXR
E E
INDX INDX
#n INOK #n
A0 INOK
A0

____________________________________________________________________________________________

Parameters
E DOUBLE WORD MD, KD Input
INDX WORD EW, AW, MW, KW Index input
#n DIRECT #,#H Quantity n of double word outputs A0 ... An–1
CONSTANT
INOK BINARY A, M Range monitoring for input INDX
A0 WORD MD Double word outputs A0 ... An–1; the output A0 is
capable of duplication
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 43 µs
Additional runtime: 10 µs per additional double word output A1 ... An–1
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description E DOUBLE WORD


This function block connects the input E to one of the out- Input which is switched through to one of the outputs
puts A0...An–1 depending on the input INDX. A0...An–1.

The double word outputs that are not connected are set to
0. The validity of the value at the input INDX is checked. INDX WORD
Index input for selection of one of the outputs A0...An–1.
Relationship between E, INDX and A0...An–1:
Value range: 1 < INDX < n
The input INDX is used to define with which of the outputs
A0...An–1 the input E is connected.
The following applies: INDX = 1 : E –> A0 Note:
INDX = 2 : E –> A1 INDX = 0 can be used to initialize the outputs A0...An–1
INDX = 3 : E –> A2 (A0...An–1 = 0).
: : : :
INDX = n : E –> An–1
#n DIRECT CONSTANT
where: 1 < INDX < n < 32767 (theoretically) Quantity n of double word outputs A0...An–1.

907 PC 331/Issued: 11.98 16–17


MUXRD MULTIPLEXER, DOUBLE WORD WITH RESET

INOK BINARY A0 DOUBLE WORD


Range monitoring of the input INDX The output A0 is capable of duplication (A0...An–1). The
input E is allocated to one of the n outputs A0...An–1.
The output indicates whether or not the input INDX is
within the valid range.
Valid range: 1 < INDX < n
INOK = 1 –> Index input INDX within the valid range
INOK = 0 –> Index input INDX in the invalid range
–> A0...An–1 = 0
If the word input INDX is not within the valid range, all
double word outputs A0 to An–1 are set to 0. Therefore, for
example, INDX = 0 can be used to initialize the outputs
(A0...An–1 = 0).

16–18 907 PC 331/Issued: 11.98


MULTIPLEXER, DOUBLE WORD WITH RESET MUXRD

Example

FBD/LD IL

!BA 0
MUXRD
MUXR
MD 00,00 E MD 00,00
MW 00,01 INDX MW 00,01
# 2 #n INOK M 00,00 # 2
A0 MD 00,02 M 00,00
A1 MD 00,03 MD 00,02
MD 00,03

CE FBD Definition

MUXRD
E
INDX
#n INOK
A

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E D N P Y 0 0
INDX E W N P Y 0 0
#n K W N P Y 0 0
INOK A L N P Y 0 0
A A D N P Y 1 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 MUXRD
00002 PP 0 E Input (DOUBLE WORD)
00003 PP 0 INDX Index (WORD)
00004 PP 0 #n Number of outputs (#)
00005 PP 0 INOK Output index valid (BINARY)
[ 1
00006 PP 1 A Output (DOUBLE WORD)
] 1

907 PC 331/Issued: 11.98 16–19


MUXRD MULTIPLEXER, DOUBLE WORD WITH RESET

16–20 907 PC 331/Issued: 11.98


NEGATION, DOUBLE WORD NEGD

The value of the operand at the input E1 is negated and


the result is allocated to the operand at the output A1.
FBD/LD IL

!BA 0
NEGD NEGD
E1 A1 E1
A1

____________________________________________________________________________________________

Parameters
E1 DOUBLE WORD MD, KD Input value
A1 DOUBLE WORD MD Negated value
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 34 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Number range


The value of the operand at the input E1 is negated and Integer double word (32 Bit).
the result is allocated to the operand at the output A1.
● Low limit: 8000 0001H – 2 147 483 647
If the inadmissible value 8000 0000H (–2 147 483 648) is ● High limit: 7FFF FFFFH + 2 147 483 647
present at the input E1, the value 7FFF FFFFH ● Inadmissible value: 8000 0000H –––
(+2 147 483 647) is allocated to the output A1. There-
fore, before negation the inadmissible value is replaced
by the admissible value 8000 0001H (–2 147 483 647).

The input and the output can neither be duplicated nor ne-
gated.

907 PC 331/Issued: 11.98 17–1


NEGD NEGATION, DOUBLE WORD

Example

FBD/LD IL

!BA 0
NEGD
NEGD MD 00,00
MD 00,00 MD 02,00 MD 02,00

CE FBD Definition

NEGD
E1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E D N P N 0 0
A1 A D N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 NEGD
00002 PP 0 E1 Input DOUBLE WORD
00003 PP 0 A1 Output DOUBLE WORD

17–2 907 PC 331/Issued: 11.98


Call not possible NOTBIT

NOTBIT is a basic function in the manufacturer library.


The name of the element in the library is NOTBIT. This
element cannot be called in the CE and CE–IL editors. FBD/LD IL

Calll not possible

____________________________________________________________________________________________

Parameters
–––
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 4 µs
Additional runtime: –––
Output updating: –––
Number of historical values: –––
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
NOTBIT is a basic function in the manufacturer library.
The name of the element in the library is NOTBIT. This
element cannot be called in the CE and CE–IL editors.
The programming unit uses this element to realize con-
necting lines.
____________________________________________________________________________________________

Example

FBD/LD IL

Call not possible

CE FBD Definition
not defined

CE IL Definition
00000 ! PP 0 inp
00002 =N PP 0 outp

907 PC 331/Issued: 11.98 17–3


NPULSE PULSE GENERATOR FOR STEPPER MOTORS

The function block generates pulse sequences with speci-


fic frequencies and specific number of pulses. Thus, it can FBD/LD
be used for the activation of stepper motors.
NPULSE
The pulse sequences are available at output A 62,00.
VAL RDY
RES VALP
FREQ
NB

Parameters
VAL BINARY E, A, M, S Enabling
RES BINARY E, A, M, S Reset
FREQ WORD EW, AW, MW, KW Frequency
NB WORD EW, AW, MW, KW Number of pulses
RDY BINARY A, M Ready
VALP WORD AW, MW Number of processed pulses

Available as of: Advant Controller 31, series 40 and 50

Description FREQ WORD

The function block generates pulse sequences with speci- Frequency of the pulse sequence:
fic frequencies and specific number of pulses. Thus, it can Frequency range: 10 Hz to 2,6 kHz
be used for the activation of stepper motors. The pulse Formula for frequency calculation:
sequences are available at output A 62,00. Frequency [Hz = 1000000/((256 - FREQ) • 384)

At output VALP, the currently generated number of pulses Example:


is displayed. The pulse output is started by a positive edge
at input VAL. The first period starts with the binary value 1. FREQ Frequency

Max. offset is one cycle time. 0 10,1 Hz


1 10,212 Hz
2 10,253 Hz
10 10,586 Hz
100 16,693 Hz
VAL
254 1,302 kHz
NB 255 2,604 kHz
A 62,00 <0 10,1 Hz
t >255 2,604 kHz
with t < TCYCLE
NB WORD
VAL BINARY Number of pulses to be generated.
Value range: 0 to 32767
Enabling the output of the impulse sequence at the fixed
For NB < 0, pulses are generated as
output A 62,00.
long as input RES is set.
RES BINARY
RDY BINARY
A signal 1 stops the pulse generation. Output A 62,00 is
Ready bit
set to 0.
RDY = 0 Pulses are generated
RDY = 1 Pulse sequence is finished

7 17-4 907 PC 331 / Issued: 08.99


PULSE GENERATOR FOR STEPPER MOTORS NPULSE

VALP WORD
Number of currently generated pulses.
In case of an error: +/-1.

Graphic
Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

NPULSE
BIT_IN Y N Y 0 00 VAL RDY 00 0 Y N Y BIT_OUT
BIT_IN Y N Y 0 00 RES VALP 00 0 Y N Y WORT_OUT
WORT_IN Y N Y 0 00 FREQ
WORT_IN Y N Y 0 00 NB

Source
SN ZN Command / Variable Symbol Long text

00000 00000 !BA 000


00001 NPULSE
00002 PP 00 VAL
00003 PP 00 RES
00004 PP 00 FREQ
00005 PP 00 NB
00006 PP 00 RDY
00007 PP 00 VALP

907 PC 331 / Issued: 08.99 17-5


7
PACK PACK BINARY VARIABLES IN WORD

This function block packs n binary variables in one word


variable.
FBD/LD IL

!BA 0
PACK PACK
#n #n
BI0 WORT BI0
WORT

____________________________________________________________________________________________

Parameters
#n DIRECT #,#H Number of binary variables to be packed
CONSTANT
BI0 BINARY E, M, A, K, S 1st binary variable to be packed; the input is capable of
duplication
WORT WORD AW, MW Word variable
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 25 µs 44 µs
Additional runtime: 8 µs per planned binary variable
31 µs per planned
binary variable
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description WORT WORD


The value of each binary variable at the inputs BI0...BIn–1
is loaded into the corresponding bit (bit 0 ... bit 15) of the
This function block packs n binary variables in one word variable at the output WORT.
variable.
Affiliations
#n DIRECT CONSTANT (#, #H) BI0 –> bit 0 of the output variable
The number of binary variables to be packed is specified
at the input #n. This is specified as a direct constant. BI1 –> bit 1 of the output variable
The following applies: 1 < n < 16 . .
n = 0 is forbidden! . .
BI15 –> bit 15 of the output variable
BI0 BINARY
The input BI0 is capable of duplication (BI0...BI15). The Note: If the user plans less than 16 binary input vari-
binary variables to be packed are specified at the inputs ables, the bits of the output variable not needed
BI0...BIn–1. are occupied with the value 0.

17–6 907 PC 331/Issued: 11.98


PACK BINARY VARIABLES IN WORD PACK

Example

FBD/LD IL

!BA 0
PACK PACK
#2 #n #2
E 01,00 BI0 WORT MW 07,05 E 01,00
E 01,01 BI1 E 01,01
MW 07,05

CE FBD Definition

PACK
#n
BI WORT

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
BI E L N P Y 1 0
WORT A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 PACK
00002 PP 0 #n # CONSTANT (number of bits)
[ 1
00003 PP 1 BI Input BINARY
] 1
00004 PP 0 WORT Output WORD

907 PC 331/Issued: 11.98 17–7


PACKD PACK BINARY VARIABLES IN DOUBLE WORD

This function block packs n binary variables in one double


word variable.
FBD/LD IL

!BA 0
PACKD PACKD
#n #n
BI0 DW BI0
DW

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of binary variables to be packed
CONSTANT
BI0 BINARY E, M, A, K, S 1st binary variable to be packed; the input is capable of
duplication
DW DOUBLE WORD MD Double word variable
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 31 µs
Additional runtime: 9 µs, per planned binary variable
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description DW DOUBLE WORD


The value of each binary variable at the inputs BI0...BIn is
loaded into the corresponding bit (bit 0...bit 31) of the vari-
This function block packs n binary variables in one double able at the output DW.
word variable.

Affiliations
#n DIRECT CONSTANT (#, #H)
BI0 –> bit 0 of the output variable
The number of binary variables to be packed is specified
at the input #n. This is specified as a direct constant. BI1 –> bit 1 of the output variable
The following applies: 1 < n < 32 . .
n = 0 is forbidden! . .
BI31 –> bit 31 of the output variable

BI0 BINARY
The input BI0 is capable of duplication (BI0...BI31). The Note: If the user plans less than 32 binary input vari-
binary variables to be packed are specified at the inputs ables, the bits of the output variables not needed
BI0...BIn–1. are occupied with the value 0.

17–8 907 PC 331/Issued: 11.98


PACK BINARY VARIABLES IN DOUBLE WORD PACKD

Example

FBD/LD IL

!BA 0
PACKD PACKD
#2 #n #2
E 01,00 BI0 DW MD 07,05 E 01,00
E 01,01 BI1 E 01,01
MD 07,05

CE FBD Definition

PACKD
#n
BI DW

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
BI E L N P Y 1 0
DW A D N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 PACKD
00002 PP 0 #n # CONSTANT (number of bits)
[ 1
00003 PP 1 BI Input BINARY
] 1
00004 PP 0 DW Output DOUBLE WORD

907 PC 331/Issued: 11.98 17–9


PDM PULSE DURATION MODULATOR

This function block generates a pulse duration–modu-


lated binary signal at its PULS output.
FBD/LD IL
The duty ratio is specified at the t/ta input and the period
for the output signal is specified at the ta/T input.
!BA 0
PDM PDM
t/ta t/ta
ta/T ta/T
PULS PULS

____________________________________________________________________________________________

Parameters
t/ta WORD EW, MW, AW, KW Duty ratio
ta/T WORD EW, MW, AW, KW Period referred to the cycle time
PULS BINARY A, M Pulse duration modulated signal
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 35 µs 1300 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: 3 words 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 2.2
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description Marginal condition for t: t > T

This function block generates a pulse duration–modu- That is to say, the required duty cycle of the output signal
lated binary signal at its PULS output. must be higher than the cycle time of the PLC program.

The duty ratio is specified at the t/ta input and the period
for the output signal is specified at the ta/T input.

The inputs and the output can neither be duplicated nor


negated nor inverted. PULS
t
t/ta WORD Duty ratio

The required duty ratio for the output signal PULS is spe-
cified at the input t/ta. At the same time, ta is the period of
ta t
the signal at the output PULS and t is the time within the
period ta during which the output signal assumes a 1
level. The specified value for the required duty ratio at the T T T T T T T T
input t/ta must be specified in scaled form. To do this, the
required duty ratio must be multiplied by the value 32767
and rounded to a whole number. The resulting numerical
value is then specified at the input t/ta.

17–10 907 PC 331/Issued: 11.98


PULSE DURATION MODULATOR PDM

The following relationship applies to specification of the Combination of the PDM block with a controller
keying ratio at the input t/ta: If the PDM function block is connected to the output of a
controller in order to realize a “switching” controller, the
following marginal conditions apply:
Scaled value at Results in duty ratio
the t/ta input at the output PULS
– Period ta of the PDM = sampling time of the controller –
Period of the pulse signal must be synchronous with the
Negative value 0 ( 0 %)
period of the controller’s sampling time.
0 (0 * 32 767) 0 ( 0 %)
. . .
These marginal conditions are fulfilled by planning the
. . .
controller in the same PLC program as the PDM, but
16384 (0,5 * 32 767) 0,5 ( 50 %) within one run number block. By means of the run number
. . . block, the sampling time of the controller is prolonged by
. . . an integral multiple of the cycle time. Therefore, the con-
32767 (1 * 32 767) 1 (100 %) troller is processed less frequently within the run number
block than the PDM outside of the run number block.
Example:
ta/T WORD
Required:
The required period ta for the signal at the output PULS is – Duty ratio: t/ta = 0,25 (25 %)
specified at the input ta/T. At the same time, the period ta
– Period: ta = 800 ms (only an integral
must be scaled to the cycle time T.
multiple of the PLC cycle time is possible)
– Cycle time: T = 100 ms
Marginal condition for ta:
– ta must be an integral multiple of T Block parameters to be specified:
(ta = n * T)
– ta >> T > 0; the higher ta is in relation to T, – Value at the input t/ta: 8192 (0,25 * 32767)
the more exactly the required duty ratio is kept – Value at the input ta/T: 8 (800 ms/100 ms)
to
E.g. ta > 10 * T –> inaccuracy of the duty ratio at
the output PULS < 10%. PULS
t
If a value ta/T < 0 is specified for ta/T, the function block
automatically replaces this meaningless value by 32767.

PULS BINARY ta t
The pulse duration modulated signal is available at the
T T T T T T T T
PULS output.

907 PC 331/Issued: 11.98 17–11


PDM PULSE DURATION MODULATOR

Example

FBD/LD IL

!BA 0
PDM PDM
MW 00,00 t/ta MW 00,00
KW 00,01 ta/T KW 00,01
PULS M 07,07 M 07,07

CE FBD Definition

PDM
t/ta
ta/T
PULS

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

t/ta E W N P Y 0 0
ta/T E W N P Y 0 0
PULS A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 PDM
00002 PP 0 t/ta Input WORD (Duty ratio)
00003 PP 0 ta/T Input WORD (period)
00004 PP 0 PULS Output BINARY

17–12 907 PC 331/Issued: 11.98


PROGRAM END PE

The program end identifies the end of the PLC program.


Commands located after this end identifier are not pro-
cessed by the PLC. FBD/LD IL

! PE
PE

____________________________________________________________________________________________

Parameters
–––
____________________________________________________________________________________________

CE Data Series 90, 07 KP 62 Series 30, 40, 50


Runtime:
Basic runtime: 2 µs 2 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values:none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
ABB Procontic T200 / 07 KP 62 07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
The program end identifies the end of the PLC program.
Commands located after this end identifier are not pro-
cessed by the PLC.

907 PC 331/Issued: 11.98 17–13


PE PROGRAM END

Example

FBD/LD IL

! PE
PE

CE FBD Definition

PE

CE IL Definition
00000 !PE

17–14 907 PC 331/Issued: 11.98


PROPORTIONAL–INTEGRAL–CONTROLLER PI

The PI controller changes the value at its output y (manip- FBD/LD IL


ulated variable) until the value at the input x (controlled
variable) is equal to the value at the input w (command
variable). !BA 0
PI PI
w
w x
x KP
KP TN/T
TN/T INIT
OG S
UG R
S y=OG OG
INIT y=UG UG
R y y
y=OG
y=UG

____________________________________________________________________________________________
Parameters
w WORD EW, AW, MW, KW
Command variable (setpoint)
x WORD EW, AW, MW, KW
Controlled variable (actual value)
KP WORD EW, AW, MW, KW
Proportional coefficient; specified as a %
TN/T WORD EW, AW, MW, KW
Integral action time scaled to the PLC cycle time
OG WORD EW, AW, MW, KW
High limit for the manipulated variable y
UG WORD EW, AW, MW, KW
Low limit for the manipulated variable y
S BINARY E, A, M, S, K
Enabling for setting the manipulated variable y to the
initial value INIT
INIT WORD EW, AW, MW, KW Initial value for the manipulated variable y
R BINARY E, A, M, S, K Reset of the manipulated variable y to the value 0
y=OG BINARY A, M High limit has been reached
y=UG BINARY A, M Low limit has been reached
y WORD AW, MW Output for the manipulated variable y
____________________________________________________________________________________________
CE Data Series 90 Series 30, 40, 50
Runtime:
Basic runtime: 280 µs 3600 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: 4 words 6 words
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 2.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________
Description Transfer function:
The PI controller changes the value at its output y (manip- 1
ulated variable) until the value at the input x (controlled F(s) = KP * (1+ –––––––)
variable) is equal to the value at the input w (command s * TN
variable). The inputs and outputs can neither be duplicated nor ne-
Control algorithm: Simple rectangle rule gated/inverted.
KP w–x KP
Y = –––– * –––––– + YI(z–1) + –––– * (w–x)
100 TN/T 100

Where: YI(z–1) is the integral component from the


previous program cycle

907 PC 331/Issued: 11.98 17–15


PI PROPORTIONAL–INTEGRAL–CONTROLLER

XD=w–x XD=w–x

1 1

t1 t1 t
t

S S

1 1

t1 t
t1 t

KP KP

KP(t1)

t1 t1 t
t

INIT INIT

t1 t1 t
t

KP*XD
Y Y

OG OG

Y1 = INIT + KP * XD
Y1
Integr.comp. limited
because Y = OG
INIT TN
Integral
component
Integr.component

INIT Integr.comp.(t1)=INIT
TN
Integr.comp.(t1)= INIT–KP * XD
t1 t
t1 t

PI controller: Surge–free transition from the specified PI controller: Surging transition from the specified ini-
initial value to control operation tial value to control operation

17–16 907 PC 331/Issued: 11.98


PROPORTIONAL–INTEGRAL–CONTROLLER PI

w WORD Limiting the manipulated variable y


The command variable (setpoint) is specified at OG WORD
the input w. UG WORD
The output y (manipulated variable) of the controller can
x WORD be limited
The controlled variable (actual value) is specified at the
input x. – To a maximum value by specifying a limit at the input
OG (high limit);
KP WORD – To a minimum value by specifying a limit at the input UG
The proportional coefficient is specified at the input KP. (low limit)
This value is specified as a percentage and may be posi-
The high and low limits also apply to the controller’s inter-
tive or negative.
nal I component. That is to say, the I component can only
assume values between the high and low limits. If the ma-
Example: nipulated variable y reaches one of the two limits, the con-
1 = 1 Percent troller’s I component is no longer altered. This prevents
55 = 55 Percent the I component from running amock in the event of limit-
100 = 100 Percent ing of the controller output y, assuming meaningless val-
1000 = 1000 Percent ues from the point of view of control and, in certain circum-
–500 = –500 Percent stances, not returning to the operating range until after a
very long time. This response of a controller is also re-
● 1 percent means that the block multiplies the system ferred to as a “special anti–reset windup measure”.
deviation by the factor 0.01 (see also control algoritm)
Setting and resetting the controller
● 100 percent means that the block multiplies the system S BINARY
deviation by the factor 1 (see also control algoritm) INIT WORD
R BINARY
● 1000 percent means that the block multiplies the sys- Setting the controller to an initial value
tem deviation by the factor 10 (see also control algo- – The output y of the controller is set to the initial value
ritm) specified at the INIT input by means of a 1 signal at the
input S (set).
Generally, proportional coefficients of more than 1000%
– A 1 signal at the input R (reset) is equivalent to speci-
are not meaningful in control systems.
fying the initial value 0 (see above).
Surge–free setting/resetting

TN/T WORD – The output y of the controller is set to the initial value
The integral action time TN is scaled to the PLC cycle time specified at the input INIT by means of a 1 signal at the
T and is specified at the input TN/T. binary input S (set).
– A 1 signal at the input R (reset) is equivalent to speci-
Value range: 0 < TN/T < 328 fying the initial value 0.
In doing so, adjustment to the initial value takes place
● If values are specified which are beyond the admissible internally in the controller. This adjustment is a shift of
value range the PLC uses the value 328. the controller output from the momentary value to the
required initial value. Now, the controller continues
● A large integral action time TN can be achieved by operating from this initial value precisely as it would
choosing a great cycle time T, too. If the block is used have done at the old operating point before the shift, i.e.
within a run number block, the cycle time of the run without surges. The controller’s I component is defined
number block is valid for block PI and not the cycle time so that the sum of the P component and the I compo-
(KD 0,0) of the PLC program. nent just results in the initial value.

907 PC 331/Issued: 11.98 17–17


PI PROPORTIONAL–INTEGRAL–CONTROLLER

Advantage of surge–free operation: y WORD


– Control as from the new initial value is devoid of surges. The controller’s manipulated variable y is output through
the output y.
Disadvantage of surge–free operation:
– The following equation applies:
I_component = INIT – P_component y=OG BINARY
The output y=OG signals whether or not the value at the
In certain circumstances, the I component is set to high output y has exceeded the specified high limit.
values and may take very long before this “wrong” I
component from the point of view of control is dissipa- y=OG = 0 limit has not been reached.
ted again. y=OG = 1 limit has been reached.

Surging setting/resetting
y=UG BINARY
– The output y of the controller is set to the initial value The output y=UG signals whether or not the value at the
specified at the INIT input by means of a 1 signal at the output y has reached the specified low limit.
input S (set).
– A 1 signal at the input R (reset) is equivalent to speci- y=UG = 0 limit has not been reached.
fying the initial value 0. y=UG = 1 limit has been reached.
In the event of surging setting or resetting of the controller
the I component is set equal to the initial value. To do this,
the P component must be suppressed during setting.
Where: I component = INIT
Surging setting to an initial value is achieved by the follow-
ing measure during setting:

– Specifying the value 0 at the input KP.

This measure renders the P component inactive. The


controller output y assumes the initial value during the set
cycle.

The P component is enabled again after the set cycle.


From the initial value, the controller output y jumps ac-
cording to the P component of the controller.
Advantage of surging setting:
– The I component is not set to “wrong” values from the
point of view of control.
Disadvantage of surging setting:
– No freedom from surging

17–18 907 PC 331/Issued: 11.98


PROPORTIONAL–INTEGRAL–CONTROLLER PI

Example

FBD/LD IL

!BA 0
PI PI
EW 00,01 w EW 00,01
AW 00,08 x AW 00,08
KW 01,00 KP KW 01,00
AW 02,04 TN/T AW 02,04
MW 03,00 OG EW 05,03
MW 04,00 UG S 05,12
S 05,12 S y=OG A 08,00 M 02,00
EW 05,03 INIT y=UG M 01,00 MW 03,00
M 02,00 R y AW 08,03 MW 04,00
AW 08,03
A 08,03
M 01,00

CE FBD Definition

PI
w
x
KP
TN/T
OG
UG
S y=OG
INIT y=UG
R y

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

w E W N P Y 0 0
x E W N P Y 0 0
KP E W N P Y 0 0
TN/T E W N P Y 0 0
OG E W N P Y 0 0
UG E W N P Y 0 0
S E L N P Y 0 0
INIT E W N P Y 0 0
R E L N P Y 0 0
y=OG A L N P Y 0 0
y=UG A L N P Y 0 0
y A W N P Y 0 0

907 PC 331/Issued: 11.98 17–19


PI PROPORTIONAL–INTEGRAL–CONTROLLER

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 PI
00002 PP 0 w Input WORD (command variable)
00003 PP 0 x Input WORD (controlled variable)
00004 PP 0 KP Input WORD (proportional coefficient)
00005 PP 0 TN/T Input WORD (integral action time)
00006 PP 0 INIT Input WORD (initial value)
00007 PP 0 S Input BIT (set to INIT)
00008 PP 0 R Input BIT (reset to 0)
00009 PP 0 OG Input WORD (high limit)
00010 PP 0 UG Input WORD (low limit)
00011 PP 0 y Output BINARY (manipulated variable)
00012 PP 0 y=OG Output BINARY (OG reached)
00013 PP 0 y=UG Output BINARY (UG reached)

17–20 907 PC 331/Issued: 11.98


PIDT1 CONTROLLER PIDT1

The PI controller changes its output y (manipulated vari-


able) until the input x (controlled variable) is equal to the FBD/LD IL
input w (command variable).
!BA 0
PIDT1
w PIDT1
w
x x
KP KP
TN/T TN/T
TV/T TV/T
T1/T T1/T
D–FR D–FR
OG INIT
UG
S
S y=OG
R
INIT y=UG
OG
R y
UG
y
y=OG
y=UG

____________________________________________________________________________________________

Parameters
w WORD EW, AW, MW, KW Command variable (setpoint)
x WORD EW, AW, MW, KW Controlled variable (actual value)
KP WORD EW, AW, MW, KW Proportional coefficient, specified as a percentage
TN/T WORD EW, AW, MW, KW Integral action time scaled to the PLC cycle time
TV/T WORD EW, AW, MW, KW Derivative action time scaled to the PLC cycle time
T1/T WORD EW, AW, MW, KW Returning time scaled to the PLC cycle time
D–FR BINARY E, A, M, K Enable DT1 component
OG WORD EW, AW, MW, KW High limit for the manipulated variable y
UG WORD EW, AW, MW, KW Low limit for the manipulated variable y
S BINARY E, A, M, S, K Enable for setting to initial value INIT
INIT WORD EW, AW, MW, KW Initial value for the manipulated variable y
R BINARY E, A, M, S, K Reset the manipulated variable y to the value 0
y=OG BINARY A, M High value has been reached
y=UG BINARY A, M Low value has been reached
y WORD AW, MW Output for manipulated variable y
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 318 µs without DT1 component, 564 µs with DT1 component
Additional runtime: no
Output updating: yes
Number of historical values: 9 words
Available as of: ABB Procontic CS31 / 907 PC 331

907 PC 331/Issued: 11.98 18–1


PIDT1 PIDT1 CONTROLLER

Description
The PI controller changes its output y (manipulated vari-
able) until the input x (controlled variable) is equal to the
input w (command variable).

Transfer function:

1 s * TV
F(s) = KP * (1 + +
s * TN 1 + (s * T1)

Control algorithm: simple rectangle rule

KP XD T1/TZ 1 TV KP
y = KP * XD + * + YI(z–1) + * (YDT1(z – 1) + * * * (XD–XD(z–1)))
100 100 TN/TZ 1 + (T1/TZ) T1/TZ TZ 100

where:

YI(z–1): The integral portion from the previous program cycle


YDT1(z–1): The differential portion from the previous program cycle
XD(z–1): Control system difference from the previous program cycle

The inputs and outputs can neither be duplicated nor ne-


gated/inverted.

18–2 907 PC 331/Issued: 11.98


PIDT1 CONTROLLER PIDT1

XD=w–x XD=w–x

1 1

t1 t t1 t

S S

1 1

t1 t1
t t

D–FR D–FR

1 1

t1 t t1 t

KP KP

KP(T1) KP(T1)

t1 t t1 t

INIT INIT

t1 t1 t
t

Y Y
OG OG
TV
__
Y2 = Y1 + KP * * XD
T1
INIT Y2
Integr.compon. limi– Integr. comp. limi–
ted because Y=OG ted because Y=OG

DT1 Comp. Integral compon. DT1 Comp.


Integral comp.

TN Integr.comp.(t1)+KP*XD Y1 TN Y1 = INIT + KP * XD

P Comp P Comp.

TV
__ INIT Integr.component(t1) = INIT
Integr.comp.(t1)=INIT–KP*XD*(1+ )
T1

t1 t t1 t

PIDT1 controller: Surge–free transition from the speci- PIDT1 controller: Surging transition from the specified
fied intitial value to control mode initial value to control mode

907 PC 331/Issued: 11.98 18–3


PIDT1 PIDT1 CONTROLLER

w WORD T1/T WORD


The command variable (setpoint) is specified at the input The returning time T1 is scaled to the PLC cycle time T
w. and is specified at the input T1/T
(0 < T1/T < 32767).

x WORD The returning time is the time in which the DT1 compo-
nent has decreased to approximately 37% of its initial va-
The controlled variable (actual value) is specified at the lue.
input x.
Inadmissible time parameters
KP WORD Every time value is set to the maximum positive value
32767 if the time value at the input is erroneously speci-
The proportional coefficient is specified at the input KP.
fied as less than or equal to “0”.
This value is specified as a percentage and may be positi-
ve or negative. D–FR WORD
The DT1 component of the controller can be connected or
Example: deactivated by means of the D–FR input.
1 = 1 Percent D–FR Meaning
55 = 55 Percent
100 = 100 Percent 0 DT1–Comp. is deactivated –> pure PI
1000 = 1000 Percent controller
–500 = –500 Percent 1 DT1–Comp. is connected –> PIDT1
controller
● 1 percent means that the block multiplies the system
In the following cases, from the control point of view it is
deviation by the factor 0.01 (see also control algoritm)
often disturbing and not meaningful for the DT1 compo-
nent to be active:
● 100 percent means that the block multiplies the system – During activations
deviation by the factor 1 (see also control algoritm) – In the event of large system deviations
– When setting the controller to a specified initial value
● 1000 percent means that the block multiplies the sys- – When resetting the controller to the value 0
tem deviation by the factor 10 (see also control algo- The command and controlled variables can be compared
ritm) outside of the controller. Depending on this comparison,
the DT1 component can be activated or deactivated spe-
Generally, proportional coefficients of more than 1000% cifically by way of the D–FR input.
are not meaningful in control systems.
For example, activation can be restricted to ensuring that
the system deviation is within a required bandwidth. That
TN/T WORD is to say, the DT1 component is only active if the con-
The integral action time TN is scaled to the PLC cycle time trolled variable fluctuates around the setpoint within a
T and is specified at the input TN/T. specific bandwidth. The DT1 component is deactivated if
the controlled variable leaves this tolerance band.
Value range: 0 < TN/T < 328 Limiting the maniulated variable y
OG WORD
● If values are specified which are beyond the admissible UG WORD
value range the PLC uses the value 328. The output y (manipulated variable) of the controller can
be limited
● A large integral action time TN can be achieved by – To a maximum value by specifying a limit at the input
choosing a great cycle time T, too. If the block is used OG (high limit);
within a run number block, the cycle time of the run
number block is valid for block PIDT1 and not the cycle – To a minimum value by specifying a limit at the input UG
time (KD 0,0) of the PLC program. (low limit)
The high and low limits also apply to the controller’s inter-
TV/T WORD nal I component. That is to say, the I component can only
The derivative action time TV is scaled to the PLC cycle assume values between the high and low limits. If the ma-
time T and is specified at the input TV/T nipulated variable y reaches one of the two limits, the con-
(0 < TV/T < 32767). troller’s I component is no longer altered.

18–4 907 PC 331/Issued: 11.98


PIDT1 CONTROLLER PIDT1

This prevents the I component from running amock in the Surging setting/resetting
event of limiting of the controller output y, assuming
meaningless values from the point of view of control and, – The output y of the controller is set to the initial value
in certain circumstances, not returning to the operating specified at the INIT input by means of a 1 signal at the
range until after a very long time. This response of a con- input S (set).
troller is also referred to as a “special anti–reset windup – A 1 signal at the input R (reset) is equivalent to specify-
measure (ARW)”. ing the initial value 0.
– In the event of surging setting or resetting of the con-
Setting and resetting the controller troller, the I component is set equal to the initial value.
To do this, the P and DT1 components must be sup-
pressed during setting.
S BINARY
INIT WORD Where: I component = INIT
R BINARY
Surging setting to an initial value is achieved by the follow-
ing measures during setting:
Setting the controller to an initial value
– Deactivation of the DT1 component via the D–FR con-
– The output y of the controller is set to the initial value trol input and
specified at the INIT input by means of a 1 signal at the
– Specifying the value 0 at the input KP.
input S (set).
These measures render the P component and the DT1
– A 1 signal at the input R (reset) is equivalent to specify- component inactive during setting of the controller.
ing the initial value 0 (see above).
The controller output assumes the initial value during the
set cycle.
Surge–free setting/resetting
The P and DT1 components are enabled again after the
– The output y of the controller is set to the initial value set cycle. From the initial value, the controller output y
specified at the input INIT by means of a 1 signal at the jumps according to the P and DT1 components of the
binary input S (set). controller.
Advantage of surging setting:
– A 1 signal at the input R (reset) is equivalent to specify-
ing the initial value 0. – The I component is not set to “wrong” values from the
In doing so, adjustment to the initial value takes place point of view of control.
internally in the controller. This adjustment is a shift of Disadvantage of surging setting:
the controller output from the momentary value to the
required initial value. Now, the controller continues op- – No freedom from surging
erating from this initial value precisely as it would have
done at the old operating point before the shift, i.e. with-
y WORD
out surges. The controller’s I component is defined so
The controller’s manipulated variable y is output through
that the sum of the P component, I component and DT1
the output y.
component just results in the initial value.

Advantage of surge–free operation: y=OG BINARY


The output y=OG signals whether or not the value at the
– Control as from the new initial value is devoid of surges. output y has reached the specified high limit.

Disadvantage of surge–free operation: y=OG = 0 limit has not been reached.


y=OG = 1 limit has been reached.
– The following equation applies:
y=UG BINARY
I component = INIT – P component – DT1 component The output y=UG signals whether or not the value at the
In certain circumstances, the I component is set to high output y has reached the specified low limit.
values and may take very long before this “wrong” I
component from the point of view of control is dissi- y=UG = 0 limit has not been reached.
pated again. y=UG = 1 limit has been reached.

907 PC 331/Issued: 11.98 18–5


PIDT1 PIDT1 CONTROLLER

Example

FBD/LD IL

!BA 0
PIDT1 PIDT1
EW 00,00 w EW 00,00
MW 01,01 x MW 01,01
MW 02,00 KP MW 02,00
KW 02,13 TN/T KW 02,13
KW 04,01 TV/T KW 04,01
KW 07,03 T1/T KW 07,03
E 03,09 D–FR E 03,09
MW 13,00 OG MW 11,11
MW 09,01 UG A 03,03
A 03,03 S y=OG A 01,00 M 02,06
MW 11,11 INIT y=UG M 02,01 MW 13,00
M 02,06 R y MW 04,02 MW 09,01
MW 04,02
A 01,00
M 02,01

CE FBD Definition
PIDT1
w
x
KP
TN/T
TV/T
T1/T
D–FR
OG
UG
S y=OG
INIT y=UG
R y

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

w E W N P Y 0 0
x E W N P Y 0 0
KP E W N P Y 0 0
TN/T E W N P Y 0 0
TV/T E W N P Y 0 0
T1/T E W N P Y 0 0
D–FR E L N P Y 0 0
OG E W N P Y 0 0
UG E W N P Y 0 0
S E L N P Y 0 0
INIT E W N P Y 0 0
R E L N P Y 0 0
y=OG A L N P Y 0 0
y=UG A L N P Y 0 0
y A W N P Y 0 0

18–6 907 PC 331/Issued: 11.98


PIDT1 CONTROLLER PIDT1

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 PIDT1
00002 PP 0 w Input WORD (command variable)
00003 PP 0 x Input WORD (controlled variable)
00004 PP 0 KP Input WORD (proportional coefficient)
00005 PP 0 TN/T Input WORD (integral action time)
00006 PP 0 TV/T Input WORD (derivative time)
00007 PP 0 T1/T Input WORD (returning time)
00008 PP 0 D–FR Input BINARY (enable DT1 component)
00009 PP 0 INIT Input WORD (initial value)
00010 PP 0 S Input BINARY (set to INIT)
00011 PP 0 R Input BINARY (reset to 0)
00012 PP 0 OG Input WORD (high limit)
00013 PP 0 UG Input WORD (low limit)
00014 PP 0 y Output BINARY (manipulated variable)
00015 PP 0 y=OG Output BINARY (OG reached)
00016 PP 0 y=UG Output BINARY (UG reached)

907 PC 331/Issued: 11.98 18–7


PT1 PT1 ELEMENT

This function block realizes a delay element of the first or-


der.
FBD/LD IL

!BA 0
PT1 PT1
x x
T1/T y T1/T
y

____________________________________________________________________________________________

Parameters
x WORD EW, AW, MW, KW Controlled variable
T1/T WORD EW, AW, MW, KW Time constant
y WORD AW, MW Manipulated variable
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 106 µs
Additional runtime: –––
Output updating: yes
Number of historical values: 2 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Transfer funktion:


This function block realizes a delay element of the first or- x
der.
Transfer function:
1
1
F = ––––––––––
1 + T1 * s
t

The inputs and the output can neither be duplicated nor y


negated.

T1 t

18–8 907 PC 331/Issued: 11.98


PT1 ELEMENT PT1

x WORD
The controlled variable is specified at the input x.

T1/T WORD
The delay time T1 is specified at the input T1/T. At the
same time, the delay time T1 must be scaled to the cycle
time T.

T1/T > 0 must apply


If a negative time value is specified erroneously, the PLC
automatically sets the value 32767 for T1/T.

y WORD
The result of the delay element (manipulated variable) is
output through the output y.

907 PC 331/Issued: 11.98 18–9


PT1 PT1 ELEMENT

Example

FBD/LD IL

!BA 0
PT1
PT1
MW 00,01 x MW 00,01
MW 02,00 T1/T y AW 03,06 MW 02,00
AW 03,06

CE FBD Definition

PT1
x
T1/T y

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

x E W N P Y 0 0
T1/T E W N P Y 0 0
y A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 PT1
00002 PP 0 x Input WORD (controlled variable)
00003 PP 0 T1/T Input WORD (time constant)
00004 PP 0 y Output WORD (manipulated variable)

18–10 907 PC 331/Issued: 11.98


READ BINARY VALUES FROM
HISTORICAL VALUES MEMORY RDB

This function block reads binary values out of its historical


values memory and allocates these to the outputs
BI0...BIn–1. The binary values are written beforehand FBD/LD IL
into the historical values memory by means of the WRB
block.
!BA 0
RDB
RDB
#n
#n BI0 BI0

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of outputs BI0 ... BIn–1
CONSTANT
BI0 BINARY A, M Output for the binary values, capable of
duplication (BI0 ... BIn–1)
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 48 µs. The runtime of the WRB block is already contained.
Additional runtime: 14 µs per variable
Output updating: yes
Number of historical values: #n even –> #n/2 words; #n odd –> (#n + 1)/2 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description BI0...BIn–1 BINARY


This function block reads binary values out of its historical The output BI0 is capable of duplication (BI0...BIn–1).
values memory and allocates these to the outputs The block allocates the values read out of the historical
BI0...BIn–1. The binary values are written beforehand values memory to the outputs BI0...BIn–1.
into the historical values memory by means of the WRB
block.

The RDB and WRB function blocks always occur in pairs.


The WRB block writes the required values into the histori-
cal values memory. The RDB block reads them again.

#n DIRECT CONSTANT

The number of outputs BI0...BIn–1 is specified at the in-


put #n. This is specified as a direct constant.

Note:

The value specified at the input #n must also agree with


the number of inputs of the affiliated WRB block.

907 PC 331/Issued: 11.98 18–11


READ BINARY VALUES FROM
RDB HISTORICAL VALUES MEMORY

Example

FBD/LD IL

!BA 0
RDB RDB
#3 #n BI0 M 03,00 #3
BI1 M 03,01 M 03,00
BI2 M 03,02 M 03,01
M 03,02

The program part, which is used multiply and in


which the variables M 03.00 ... M 03,02 are
needed in the next cycle, is located here. For this
purpose, the values are written into the historical
values memory by means of the WRB block and
are read out again in the next cycle by means of
the RDB block.

!BA 0
WRB WRB
#3 #n #0
M 03,00 BI0 #3
M 03,01 BI1 M 03,00
M 03,02 BI2 M 03,01
M 03,02

18–12 907 PC 331/Issued: 11.98


READ BINARY VALUES FROM
HISTORICAL VALUES MEMORY RDB

CE FBD Definition

RDB
#n BI

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
BI A L N P Y 1 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 RDB
00002 PP 0 #n # DIRECT CONSTANT (number of bits)
[ 1
00003 PP 1 BI Output BINARY
] 1

907 PC 331/Issued: 11.98 18–13


READ DOUBLE WORD VALUES FROM
RDDW HISTORICAL VALUES MEMORY

This function block reads double word values out of its


historical values memory and allocates them to the out-
puts DW0...DWn–1. Beforehand, the WRDW block FBD/LD IL
writes the double word values into the historical values
memory.
!BA 0
RDDW
RDDW #n
#n DW0 DW0

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of outputs DW0 ... DWn–1
CONSTANT
DW0 DOUBLE WORD MD Output for the double word values, capable of duplica–
tion (DW0 ... DWn–1)
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 34 µs. The runtime of the WRDW block is already contained here.
Additional runtime: 28 µs per additional output DW1 ... DWn–1
Output updating: yes
Number of historical values: 2 * #n words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description DW0...DWn–1 DOUBLE WORD


This function block reads double word values out of its The DW0 output can be duplicated (DW0...DWn–1). The
historical values memory and allocates them to the out- block allocates the values read out of the historical values
puts DW0...DWn–1. Beforehand, the WRDW block memory to the outputs DW0...DWn–1.
writes the double word values into the historical values
memory.
The RDDW and WRDW function blocks always occur in
pairs. The WRDW block writes the required values into
the historical values memory. The RDDW block reads
them out again.

#n DIRECT CONSTANT
The number of the outputs DW0...DWn–1 is specified at
the input #n. This is specified as a direct constant.
Note:
The value specified at the input #n must also agree with
the number of inputs of the affiliated WRDW block.

18–14 907 PC 331/Issued: 11.98


READ DOUBLE WORD VALUES FROM
HISTORICAL VALUES MEMORY RDDW

Example

FBD/LD IL

!BA 0
RDDW RDDW
#3 #n DW0 MD 03,00 # 3
DW1 MD 03,01 MD 03,00
DW2 MD 03,02 MD 03,01
MD 03,02

The program part, which is used multiply and in


which the variables MD 03,00 ... MD 03,02 are
needed in the next cycle, is located here. For this
purpose, the WRDW block writes the values into
the historical values memory and the RDDW
block reads them out again in the next cycle.

!BA 0
WRDW WRDW
#3 #n # 0
MD 00,00 DW0 # 3
MD 00,01 DW1 MD 00,00
MD 00,02 DW2 MD 00,01
MD 00,02

907 PC 331/Issued: 11.98 18–15


READ DOUBLE WORD VALUES FROM
RDDW HISTORICAL VALUES MEMORY

CE FBD Definition

RDDW
#n DW

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
DW A D N P Y 1 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 RDDW
00002 PP 0 #n # CONSTANT (number of double words)
[ 1
00003 PP 1 DW Output DOUBLE WORD
] 1

18–16 907 PC 331/Issued: 11.98


READ WORD VALUES FROM HISTORICAL
VALUES MEMORY RDW

This function block reads word values out of its historical


values memory and allocates these to the outputs
WO0...WOn–1. The word values are written beforehand FBD/LD IL
into the historical values memory by means of the WRW
block.
!BA 0
RDW
RDW #n
#n WO0 WO0

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of outputs WO0 ... WOn–1
CONSTANT
WO0 WORD AW, MW Output for the word values,
capable of duplication (WO0 ... WOn–1)
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 38 µs. The runtime of the WRW block is already contained here.
Additional runtime: 19 µs per additional output WO1 ... WOn–1
Output updating: yes
Number of historical values: #n words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description WO0 ... WOn–1 WORD


This function block reads word values out of its historical The output WO0 can be duplicated (WO0...WOn–1). The
values memory and allocates these to the outputs block allocates the values read out of the historical values
WO0...WOn–1. The word values are written beforehand memory to the outputs WO0...WOn–1.
into the historical values memory by means of the WRW
block.

The function blocks RDW and WRW always occur in


pairs. The WRW block writes the required values into the
historical values memory. The RDW block reads them out
again.

#n DIRECT CONSTANT
The number of outputs WO0...WOn–1 is specified at the
input #n. This is specified as a direct constant.

Note:
The value specified at the input #n must agree with the
number of inputs of the affiliated WRW block.

907 PC 331/Issued: 11.98 18–17


READ WORD VALUES FROM HISTORICAL
RDW VALUES MEMORY

Example

FBD/LD IL

!BA 0
RDW RDW
#3 #n WO0 MW 03,00 #3
WO1 MW 03,01 MW 03,00
WO2 MW 03,02 MW 03,01
MW 03,02

The program part which is used multiply and in which


the variables MW 03,00 ... MW 03,02 are used in the
next cycle is located here. For that the values are
written into the historical values memory by the WRW
block and are being read out by the RDW block in the
next cycle.

!BA 0
WRW WRW
#3 #n # 0
MW 03,00 WO0 # 3
MW 03,01 WO1 MW 03,00
MW 03,02 WO2 MW 03,01
MW 03,02

18–18 907 PC 331/Issued: 11.98


READ WORD VALUES FROM HISTORICAL
VALUES MEMORY RDW

CE FBD Definition

RDW
#n WO

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
WO A W N P Y 1 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 RDW
00002 PP 0 #n DIRECT CONSTANT
[ 1
00003 PP 1 WO Output
] 1

907 PC 331/Issued: 11.98 18–19


READ WORD VALUES FROM HISTORICAL
RDW VALUES MEMORY

18–20 907 PC 331/Issued: 11.98


SET MEMORY, DOMINATING RS

This connection element realizes a binary memory with


the characteristic “dominating set”.
FBD/LD IL
The operand Q, which performs the storage function, is
Q
entered above the graphical symbol. The status of the op-
erand Q is allocated to the operand at the output Q. ! R
RS =R Q
A status 1 at the input R resets the operand Q to a status R ! S
0. S Q =S Q

A status 1 at the input S sets the operand Q to a status 1.

A simultaneous 1 status at the inputs S and R sets the op-


erand Q to a status 1 (dominating set).

A status 0 at the input S or R has no influence on the oper-


and Q.
____________________________________________________________________________________________

Parameters
R BINARY E, M, A, S, K Reset input
S BINARY E, M, A, S, K Set input
Q BINARY M, A Flip–flop output
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 8.6 µs 30 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
The operand Q, which performs the storage function, is
entered above the graphical symbol. The status of the op-
erand Q is allocated to the operand at the output Q.

A status 1 at the input R resets the operand Q to a status


0.

A status 1 at the input S sets the operand Q to a status 1.

A simultaneous 1 status at the inputs S and R sets the op-


erand Q to a status 1 (dominating set).

A status 0 at the input S or R has no influence on the oper-


and Q.

The inputs and the output cannot be duplicated.


The inputs R and S can be inverted.

907 PC 331/Issued: 11.98 19–1


RS SET MEMORY, DOMINATING

Example

FBD/LD IL
M 00,00

! E 00,00
RS =R M 00,00
E 00,00 R ! E 03,11
E 03,11 S Q A 02,00 =S M 00,00
! M 00,00
= A 02,00

CE FBD Definition

RS
R
S Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

R E L Y P Y 0 0
S E L Y P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 ! PP 0 R Input BINARY


00002 =R PP 0 Q Output BINARY
00004 ! PP 0 S Input BINARY
00006 =S PP 0 Q Output BINARY

19–2 907 PC 331/Issued: 11.98


SET BINARY VARIABLE IN WORD/DOUBLE WORD SETB

The bit at input #BIT is set (E = 1) or reset (E = 0) in the


word/double word A depending on input E.
FBD/LD
Valid values at input #BIT: 0...31
If a word variable is entered at output A and #BIT is greater SETB
than 15, the corresponding bit of the following word varia- E
ble is set or reset. #BIT A
Example: A = MW 00,00 and #BIT = 16 → bit 0 of MW 00,01
is set or reset depending on input E.

Parameters
E BINARY E, K , M, S Input
#BIT DIRECT #,#H Bit position; admissible values: 0...31
CONSTANT
A WORD AW, EW, MW Output
DOUBLE WORD MD

CE data
Output updating: yes
Number of historical values: none

Available as of: 07 KR 91 R2 Index c, 07 KT 92 R2 Index c,


07 KT 93 R2 Index f, 07 KT 94

Description
The bit at input #BIT is set (E = 1) or reset (E = 0) in the A WORD/DOUBLE WORD
word/double word A depending on input E.
The corresponding bit is set or reset at output A. If a word
variable is entered at output A and #BIT is greater than 15,
E BINARY the corresponding bit of the following word variable is set
or reset.
For E = 0, the corresponding bit in output A is reset, for
E = 1 it is set. Example: A = MW 00,02 and #BIT = 18 → bit 2 of MW 00,03
is set or reset depending on input E.
#BIT DIRECT CONSTANT (#, #H)
At input #BIT, the position of the corresponding bit is spe-
cified.
Admissible values: 0...31

907 PC 331 / Issued: 08.99 19-3


7
SETB SET BINARY VARIABLE IN WORD/DOUBLE WORD

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

SETB

BIT_IN Y N Y 0 00 E
DIREKT-KONS Y N Y 0 00 #BIT A 00 0 Y N Y WORT_DW_OUT

Source

SN ZN Command / Variable Symbol Long text

00000 00000 SETB


00001 PP 00 E
00002 PP 00 #BIT
00003 PP 00 A
00004

7 19-4 907 PC 331 / Issued: 08.99


ERROR SEARCHER WITH STORAGE SFEHSU

This function block successively searches through a list


of binary variables (E, A, M, S) for set binary variables. If a
set binary variable is found, its number is output through FBD/LD IL
the output NR. In doing so, the block does not directly
search through the input list for the set binary variables, !BA 0
but through its image, which it stores in an internal list. Af- SFEHSU
ter a set binary variable has been found in the internal list SFEHSU S
and its number has been output through the output NR, S R
this binary variable is deleted from the internal list. R FSU
FSU FKOP
FKOP #n
#n END B0
B0 NR END
NR

____________________________________________________________________________________________

Parameters
S BINARY E, A, M, S, K Set
R BINARY E, A, M, S, K Reset
FSU BINARY E, A, M, S, K Enable search
FKOP BINARY E, A, M, S, K Enable copy
#n DIRECT #, #H Number of binary variables
CONSTANT
B0 BINARY E, A, M, S, K List of binary variables; the input can be duplicated
END BINARY A, M List end reached
NR WORD AW, MW List number of the variable found
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 83 µs
Additional runtime: 22 µs per input B0...Bn–1
Output updating: yes
Number of historical values: 3 words + #n/16 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description S BINARY

This function block successively searches through a list A 1 signal at the input S results in the following:
of binary variables (E, A, M, S) for set binary variables. If a - All set binary variables of the input list are additionally
set binary variable is found, its number is output through entered in the internal list (ORed with the internal list).
the output NR. In doing so, the block does not directly
search through the input list for the set binary variables, - The block is prepared for a search from the start of the
but through its image, which it stores in an internal list. Af- internal list, i. e. the internal list’s pointer is set to its start.
ter a set binary variable has been found in the internal list - The output END (list end reached) is set to 1 and the
and its number has been output through the output NR, output NR (number of the binary variable) is set to 0.
this binary variable is deleted from the internal list.
- If a set variable has been found during the previous
The inputs and outputs cannot be negated. The input B0 search in the internal list, this is deleted from the internal
can be duplicated (B0...Bn–1). list in order to avoid a double message.

907 PC 331/Issued: 11.98 19–5


SFEHSU ERROR SEARCHER WITH STORAGE

R BINARY - If no set binary variable has been found during the


course of a search from the start of the list, the output
- All set binary variables in the internal list are deleted END (list end reached) is set to 1 and the output NR
when the input R has a 1 signal. The set binary variables (number) retains the value 0. Each time the block is
at the block’s inputs are not affected by this. called again, the whole list is always searched through
- The pointer to the internal list is not changed, i. e. a sub- until a binary variable assumes the value 1 and is found.
sequent search begins as from the point to which the
pointer of the internal list pointed before deletion.
FKOP BINARY
- The output END is set to 1 and the output NR is set to 0. When the input FKOP has a 1 signal, all set binary vari-
ables of the input list are additionally entered in the inter-
nal list. At the same time, the binary variables already set
FSU BINARY in the internal list are retained. Updating is realized by
- A 1 signal enables the search for set binary variables in “ORing” of the input list with the internal list.
the internal list.
- A 0 signal disables the search; in doing so, the old val- Restart when searching after updating
ues at the outputs are reallocated during each cycle.
Updating of the internal list has no influence on the next
- If a binary variabe with the value 1 has been found in the search. The search begins precisely at the point in the in-
internal list, the number of this set binary variable is out- ternal list where it would also have been begun if no up-
put through the output NR. The binary variable is then dating had taken place.
cleared from the internal list. The output END (list end
reached) is set to 0 if the binary variable is not the last
one in the list. #n DIRECT CONSTANT
The number of binary variables planned at the inputs
- Numbering of the binary variables begins with 1. B0...Bn–1 is specified at the input #n. This is specified as
- The output END retains the value 0 as long as the block a direct constant.
has not reached the end of the internal list du-ring the
search. Important: The quantity at the input #n must be an inte-
- Each time it is called again, the block continues the gral multiple of 16. Dummy operands may
search in the internal list, beginning with the next binary also be planned (e.g. K0,0 is specified at all
variable after the one found last. Beforehand, the binary inputs not needed) in order to keep to this stip-
variable found last is deleted from the internal list in or- ulation.
der to avoid a double message.
- The following applies if the end of the internal list is B0...Bn–1 BINARY
reached during the search: The input B0 is capable of duplication (B0...Bn–1). The
binary variables to be examined are specified at the in-
– the output END (list end reached) is set to 1. puts B0...Bn–1. The number of variables must always be
an integral multiple of 16. To achieve this, assign K0,0 = 0
– the number of the binary variable in the internal list
to inputs Bi that are not needed.
found last is output through the output NR.
– each further time the block is called, the internal list is
searched through as from the point of the binary vari- END BINARY
able found last. The search ends when a set binary Whether or not the end of the list has been reached during
variable is found or when the end of the list is the search is signalled at the output END.
reached. END = 0 –> List end not reached
END = 1 –> List end reached
– If the last binary variable of the list is set and has been If the last variable of the list is set and has been found dur-
found during the search, the search stops there until a ing the search just carried out, its number is output
new search from the start of the internal list is prepared through the output NR and the value 1 is additionally allo-
by means of the input S. cated to the output END.

19–6 907 PC 331/Issued: 11.98


ERROR SEARCHER WITH STORAGE SFEHSU

NR WORD
The list number of the variable found last is output through
the output NR. The following affiliations apply:

Variable at the input List number


B0 1
B1 2
. .
. .
. .
Bn–1 n

If the end of the list is reached during the search without a


new variable having been found, the number of the vari-
able found at last continues to be output through the out-
put NR.
The value 0 is output through the output NR if no variable
is set in the list.
Priorities of the inputs S, R, FSU, FKOP
– The set input S has the highest priority. No other input is
processed as long as the input S has a 1 signal.
– The reset input R has the second highest priority. The
subsequent inputs are not processed as long as the in-
put R has a 1 signal.
– The update input FKOP has priority over the enable
search input FSU.
Updating of the internal list (input FKOP):
Case 1: Updating enabled (FKOP = 1)
If updating is enabled, all set binary input variables are ad-
ditionally entered in the internal list. If the search is en-
abled at the input FSU, it is carried out immediately after
updating of the internal list.
Case 2: Updating not enabled (FKOP = 0)
If updating is not enabled, the search is carried out imme-
diately if enabled at the input FSU.
If the search is not enabled in both cases, the old values
are output through the outputs END and NR.

907 PC 331/Issued: 11.98 19–7


SFEHSU ERROR SEARCHER WITH STORAGE

Example

FBD/LD IL

!BA 0
SFEHSU SFEHSU
M 00,01 S M 00,01
E 00,03 R E 00,03
E 00,07 FSU E 00,07
M 01,00 FKOP M 01,00
# 3 #n END A 00,08 # 3
M 10,00 B0 NR AW 05,00 M 10,00
M 10,01 B1 M 10,01
M 10,02 B2 M 10,02
A 00,08
AW 05,00

CE FBD Definition

SFEHSU
S
R
FSU
FKOP
#n END
B NR

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

S E L N P Y 0 0
R E L N P Y 0 0
FSU E L N P Y 0 0
FKOP E L N P Y 0 0
#n K W N P Y 0 0
B0 E L N P Y 1 0
END A L N P Y 0 0
NR A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 SFEHSU
00002 PP 0 S Input BINARY (Set)
00003 PP 0 R Input BINARY (Reset)
00004 PP 0 FSU Input BINARY (enable search)
00005 PP 0 FKOP Input BINARY (enable copy)
00006 PP 0 #n # CONSTANT (number of bits)
[ 1
00007 PP 0 B Input BINARY (element of the list of binary variables)
] 1
00008 PP 0 END Output BINARY (list end reached)
00009 PP 0 NR Output WORD (No.)

19–8 907 PC 331/Issued: 11.98


SHIFT BLOCK SHIFT

This function block shifts the operand present at the input


by a specified number of bit positions to the left or right.
FBD/LD IL

!BA 0
SHIFT
SHIFT
E E
D/W D/W
ANZ ANZ
LKS LKS
ROT ROT
ROTC ROTC
SLOG SLOG
SARI SARI
CY_E CY_A CY_E
A CY_A
A
____________________________________________________________________________________________

Parameters
E WORD EW, AW, MW, KW Operand to be shifted
DOUBLE WORD KD, MD Word or double word
D/W BINARY E, A, M, K, S Format selection, double word or word
D/W = 0 –> Word
D/W = 1 –> Double word
ANZ WORD EW, AW, MW, KW Number of bit positions to be shifted
LKS BINARY E, A, M, K, S Shift direction, left or right
LKS = 0 –> shift to right
LKS = 1 –> shift to left
ROT BINARY E, A, M, K, S Shift–Art: ROTATE
ROTC BINARY E, A, M, K, S Shift–Art: ROTATE by the CARRY FLAG
SLOG BINARY E, A, M, K, S SHIFT type: LOGICAL SHIFT
SARI BINARY E, A, M, K, S SHIFT type: ARITHMETIC SHIFT
CY_E BINARY E, A, M, K, S Initial value for the CARRY FLAG in the case of
shift type ROTC
CY_A BINARY A, M Status of the CARRY FLAG after the shift
A WORD AW, MW Result of the shift
DOUBLE WORD MD
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 37 ... 78 µs according to the shift type
Additional runtime: 1 µs per bit position to be shifted
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331

907 PC 331/Issued: 11.98 19–9


SHIFT SHIFT BLOCK

Description ROT BINARY


Shift type: ROTATE
This function block shifts the operand present at the input The bit position released by the shift is replaced by the bit
by a specified number of bit positions to the left or right. shifted out. The contents of the CARRY FLAG are addi-
tionally replaced by the bit shifted out. After the shift, the
The result of the shift and the CARRY flag are available at result and the contents of the CARRY FLAG are available
the block’s outputs. The operand at the input remains un- at the block’s outputs.
changed. ROT to right:

The required shift type is planned at the inputs:


– ROT
– ROTC
– SLOG MSB ..... ................ LSB C
– SARITH

If several shift types are specified simultaneously, the ROT to left:


shift type located furthest to the front in the sequence of
the block’s inputs applies.

The block can shift both word and also double word oper-
ands. C MSB ..... ................ LSB
Important: In certain circumstances, the value 8000H or
8000 0000H forbidden for arithmetic operations may be LSB: Least significant bit
present at this block’s output. MSB: Most significant bit
ROTC BINARY
The inputs and outputs can neither be duplicated nor in- Shift type: ROTATE by the CARRY FLAG
verted nor negated. The bit position released by the shift is replaced by the
contents of the CARRY FLAG. The CARRY FLAG is then
replaced by the bit shifted out. After the shift, the result
E WORD/DOUBLE WORD and the contents of the CARRY FLAG are available at the
Operand to be shifted block’s outputs.
The planned SHIFT operation is applied to the input oper-
and, which is not changed. ROTC to the right:

D/W BINARY
Format selection for the input operand
D/W = 0 –> WORD MSB ..... ................ LSB C
D/W = 1 –> DOUBLE WORD

ANZ WORD ROTC to the left:


Number of bit positions to be shifte
Meaningful range for the quantity n:
Word operands: 0 < n < 16
Double word operands: 0 < n < 32
C MSB ..... ................ LSB
LKS BINARY
Direction in which shifting takes place
LKS = 0 –> shift to right LSB: Least significant bit
LKS = 1 –> shift to left MSB: Most significant bit

19–10 907 PC 331/Issued: 11.98


SHIFT BLOCK SHIFT

SLOG BINARY SARI to the right:


Shift type: LOGICAL SHIFT
The bit position released by the shift is replaced by the va-
lue 0.
The contents of the CARRY FLAG are replaced by the bit
MSB ..... ................ LSB C
shifted out.
After the shift, the result and the contents of the CARRY
FLAG are available at the block’s outputs.

SLOG to the right:


SARI to the left:(Identical with SLOG to the left)
0 MSB ..... ................ LSB C
C MSB ..... ................ LSB 0

SLOG to the left:

C MSB ..... ................ LSB 0


LSB: Least significant bit
MSB: Most significant bit
LSB: Least significant bit
MSB: Most significant bit
CY_E BINARY
Initial value for the CARRY FLAG with shift type ROTC.
SARI BINARY
For the shift type “ROTATE by the CARRY FLAG”, an ini-
Shift type: ARITHMETIC SHIFT
tial value is needed for the CARRY FLAG. This initial val-
ARITHMETIC SHIFT to the right: ue is specified at the CY_E input.
The bit position 15 (MSB, sign bit) released by the shift
operation is replaced by itself. The contents of the CAR-
RY FLAG are replaced by the bit shifted out. After the CY_A BINARY
shift, the result and the contents of the CARRY FLAG are State of the CARRY FLAG after the shift. After the shift,
available at the block’s outputs the current value of the CARRY FLAG is available at this
ARITHMETIC SHIFT to the left (identical with SLOG left): output.
The bit position 0 released by the shift is replaced by the
value 0. The contents of the CARRY FLAG are replaced
by the bit shifted out. After the shift, the result and the con- A WORD/DOUBLE WORD
tents of the CARRY FLAG are available at the block’s out- Result of the shift
puts. After the shift, the result is available at this output.

907 PC 331/Issued: 11.98 19–11


SHIFT SHIFT BLOCK

Example

FBD/LD IL

SHIFT
!BA 0
MD 00,00 E SHIFT
M 00,00 D/W MD 00,00
MW 00,00 ANZ M 00,00
M 00,01 LKS MW 00,00
M 00,02 ROT M 00,01
M 00,03 ROTC M 00,02
M 00,04 SLOG M 00,03
M 00,05 SARI M 00,04
M 00,06 CY_E CY_A M 00,07 M 00,05
A MD 00,01 M 00,06
M 00,07
MD 00,01

CE FBD Definition

SHIFT
E
D/W
ANZ
LKS
ROT
ROTC
SLOG
SARI
CY_E CY_A
A

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E X N P Y 0 0
D/W E L N P Y 0 0
ANZ E W N P Y 0 0
LKS E L N P Y 0 0
ROT E L N P Y 0 0
ROTC E L N P Y 0 0
SLOG E L N P Y 0 0
SARI E L N P Y 0 0
CY_E E L N P Y 0 0
CY_A A L N P Y 0 0
A A X N P Y 0 0

19–12 907 PC 331/Issued: 11.98


SHIFT BLOCK SHIFT

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 SHIFT
00002 PP 0 E Operand to be shifted (WORD/DOUBLE WORD)
00003 PP 0 D/W Format selection (BINARY)
00004 PP 0 ANZ Number of bit positions (WORD)
00005 PP 0 LKS Shift direction (BINARY)
00006 PP 0 ROT Rotate (BINÄR)
00007 PP 0 ROTC Rotate by the Carry flag (BINARY)
00008 PP 0 SLOG Logical shift (BINARY)
00009 PP 0 SARI Arithmetic shift (BINARY)
00010 PP 0 CY_E Carry input (BINARY)
00011 PP 0 CY_A Carry output (BINARY)
00012 PP 0 A Result of the shift (WORD/DOUBLE WORD)

907 PC 331/Issued: 11.98 19–13


SIN1 Sine 0.0 to 360.0 degrees

FBD/LD IL

SIN1 SIN1
!BA 0
ANG AD MW 00,02 ANG AD MD 04,00 SIN1
ERR ERR M 05,00 MW 00,02
MD 04,00
M 05,00

Parameters
ANG WORD EW, AW, MW Angle 0...3600 (corresponds to 0.0o....360.0o)
AD DOUBLE WORD MD Sine of the input value
ERR BINARY M, A Error, if input value is negative or greater than 3600
____________________________________________________________________________________________

Description ERR BINARY


This output indicates whether the input value is within the
The function block calculates the sine value from input correct range (0 < ANG < 3600).
ANG and assigns it to the output AD. The result is within
the range of –100,000 to +100,000. Input 0 < ANG < 3600
If the value at ANG is negative or greater than 3600 (360o) –> ERR = 0 and AD = SIN(ANG)
the output AD is set to 0 and the error output ERR is set Input ANG < 0 or ANG > 3600
to 1. –> ERR = 1 and AD = 0
The maximum deviation of the result is + 0.5.
Examples for sine values
ANG WORD
sin(x) sin(90)=100000
The sine value from the input operand ANG is calculated.
The result is available as the output operand at AD. sin(45)=70711

Input values: sin(0)=0


0000 for 0 degrees sin(180)=0
0001 for 0.1 degrees sin(360)=0
0010 for 1.0 degrees
.. sin(x)
3600 for 360.0 degrees x

AD DOUBLE WORD sin(236)=–82904


The sine value of the input ANG is available at the output
sin(270)=–100000
AD.
____________________________________________________________________________________________

CE data
Runtime: 07 KR 91 / 07 KT 92 / 07 KT 93 / 07 KP 62
Basic runtime: 47 – 69 µs
Additional runtime: –––
Updating of the outputs: yes
Number of historical values: 0 words
Available as of: ABB Procontic CS31 07KT92 R202/R262, 07KT93 R171
ABB Procontic T200 07KP62 R202

19–14 907 PC 331/Issued: 11.98


INITIALIZATION AND CONFIGURATION
OF THE SERIAL INTERFACES SINIT

The function block SINIT is processed once with every


0 –> 1 edge at the FREI input. It initializes the serial inter-
face specified at the SSK input (COM1, COM2). FBD/LD IL

SINIT !BA 0
SINIT
FREI
FREI
SSK
SSK
BAUD
BAUD
STOP
STOP
ZL
ZL
PTY
PTY
E/O
E/O
ECHO
ECHO
SBRK
SBRK
FEND
FEND
ENDS
ENDS
ENDE
ENDE

____________________________________________________________________________________________

Parameters
FREI BINARY A, E, S, M, K Enable processing of the block, 0 –> 1 edge
SSK WORD AW, EW, MW, KW Interface identifier (1 or 2)
BAUD WORD AW, EW, MW, KW Baud rate; 300 ... 9600 Baud
STOP WORD AW, EW, MW, KW Number of stop bits; input has no effect
ZL WORD AW, EW, MW, KW Character length, 7 or 8 data bits per character
PTY BINARY A, E, S, M, K Parity, enable/disable
E/O BINARY A, E, S, M, K Parity even/odd
ECHO BINARY A, E, S, M, K Echo, on/off
SBRK BINARY A, E, S, M, K Send break character
FEND BINARY A, E, S, M, K Enable end of text character for transmitting direction
ENDS WORD AW, EW, MW, KW End of text character for transmitting direction
ENDE WORD AW, EW, MW, KW End of text character for receiving direction
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 25 µs 865 µs
Additional runtime: ––– –––
Output updating: not applicable not applicable
Number of historical values:1 word 1 word
Available as of: ABB Procontic CS31 / 07 KR 31 V 1.0
Commun. module 07 KP 62 07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description The serial interface COM1 is available to the user. In case


of 07 KT 92 and 07 KP 62 COM2 is additionally avail-
The function block SINIT is processed once with every able. These interfaces can be operated by the PLC pro-
0 –> 1 edge at the FREI input. It initializes the serial inter- gram (e. g. with the DRUCK and EMAS blocks). Please
face specified at the SSK input (COM1, COM2). also refer to the chapter entitled “serial interface” in the
System Description, ABB Procontic CS31, Vol. 2. Before
The inputs can neither be duplicated nor negated/in- use of one of these interfaces, it must be initialized. The
verted. function block SINIT is available for this purpose.

907 PC 331/Issued: 11.98 19–15


INITIALIZATION AND CONFIGURATION
SINIT OF THE SERIAL INTERFACES

Serial interfaces of the PLC ECHO BINARY


Whether the characters received through the applicable
The following serial interfaces can be initialized by the SI-
interface are to be reflected (echoed) by the PLC is speci-
NIT block:
fied at the input ECHO. In this way, the sender of a cha-
racter, for example, can determine whether or not it has
Central unit 07 KR 31: COM1
arrived correctly in the PLC.
Central unit 07 KR 91: COM1
ECHO = 0 –> No echo, character is not reflected
Central units 07 KT 92/93: COM1, COM2
ECHO = 1 –> Echo, character is reflected
Communication Processor 07 KP 62: COM1, COM2
Synchronization between the serial interfaces and the
SBRK BINARY
connected module is always achieved with the signals
The state of the transmit line TxD can be influenced at the
RTS and CTS.
input SBRK (send break character).
SBRK = 0 –> Normal state of the transmit line TxD for
FREI BINARY transfer of characters
The block is run through once when a 0–>1 edge is speci- SBRK = 1 –> Transmit line TxD set to “0”
fied at the FREI input. As the result of this, the serial inter-
face whose number is specified at the SSK input is initial-
ized and the interface is then operable.
FEND BINARY
Whether or not the end of text character planned at input
SSK WORD ENDS is output at the same time is specified at the input
The number of the interface to be initialized is specified at FEND (enable end character)
the input SSK. FEND = 0 –> End of text character in transmitting
The following applies: direction is not output
COM1: number = 1 FEND = 1 –> End of text character in transmitting
COM2: number = 2 direction is output

BAUD WORD
The value for the baud rate is specified at the BAUD input. ENDS WORD
Baudrate: 300 ... 9600 Baud A freely selectable end of text character for the transmit-
ting direction can be specified at the ENDS input. This
end character is then appended automatically to every
STOP WORD
text (telegram) which the DRUCK block sends to the out-
The number of stop bits is set to 1 and can not be modi-
side world through the serial interface. However, a pre-
fied. The value for the number of stop bits specified at the
condition is that input FEND is enabled.
input STOP has no significance.

The end of text character is specified as a numeric va-lue.


ZL WORD
Example:
The required character length is specified at the input ZL.
3 or 03H signifies <ETX>
The character length signifies the number of data bits per
4 or 04H signifies <EOT>
character.
13 or 0DH signifies <CR>
7 or 8 data bits per character are possible.
10 or OAH signifies <LF>
32 or 20H signifies <SP>
PTY BINARY . . . . .
Whether a character is transferred with or without a parity . . . . .
bit is specified at the input PTY. . . . . .
PTY = 0 –> Transfer without parity bit
PTY = 1 –> Transfer with parity bit
ENDE WORD
A freely selectable end of text character for the receiving
E/O BINARY direction can be specified at the ENDE input. When a tele-
Whether an even or odd parity bit is required is specified gram is received through the serial interface, the PLC rec-
at the input E/O. ognizes the end of the telegram by virtue of this end cha-
E/O = 0 –> Odd parity bit racter. The end character is specified in the same way as
E/O = 1 –> Even parity bit in the case of the ENDS input.

19–16 907 PC 331/Issued: 11.98


INITIALIZATION AND CONFIGURATION
OF THE SERIAL INTERFACES SINIT

Example

FBD/LD IL

!BA 0
SINIT SINIT
M 00,00
M 00,00 FREI
MW 06,00
MW 06,00 SSK
MW 07,05
MW 07,05 BAUD
MW 10,01
MW 10,01 STOP
MW 12,00
MW 12,00 ZL
M 01,00
M 01,00 PTY
M 01,05
M 01,05 E/O
M 01,08
M 01,08 ECHO
M 01,07
M 01,07 SBRK
M 02,00
M 02,00 FEND
MW 11,00
MW 11,00 ENDS
MW 13,09
MW 13,09 ENDE

907 PC 331/Issued: 11.98 19–17


INITIALIZATION AND CONFIGURATION
SINIT OF THE SERIAL INTERFACES

CE FBD Definition

SINIT
FREI
SSK
BAUD
STOP
ZL
PTY
E/O
ECHO
SBRK
FEND
ENDS
ENDE

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
SSK E W N P Y 0 0
BAUD E W N P Y 0 0
STOP E W N P Y 0 0
ZL E W N P Y 0 0
PTY E L N P Y 0 0
E/O E L N P Y 0 0
ECHO E L N P Y 0 0
SBRK E L N P Y 0 0
FEND E L N P Y 0 0
ENDS E W N P Y 0 0
ENDE E W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (vorbelegt 0)
00001 SINIT
00002 PP 0 FREI Input BINARY (block enable)
00003 PP 0 SSK Input WORD (interfaces)
00004 PP 0 BAUD Input WORD (baud rate)
00005 PP 0 STOP Input WORD (number of stop bits)
0006 PP 0 ZL Input WORD (character length)
0007 PP 0 PTY Input BINARY (parity)
0008 PP 0 E/O Input BINARY (parity even/odd)
0009 PP 0 ECHO Input BINARY (echo)
00010 PP 0 SBRK Input BINARY (send break)
00011 PP 0 FEND Input BINARY (output ENDS)
00012 PP 0 ENDS Input WORD (send end of text character)
00013 PP 0 ENDE Input WORD (receive end of text character)

19–18 907 PC 331/Issued: 11.98


CONDITIONAL JUMP TO LABEL SPBM

This function block produces a jump to the target label


specified at the MRK input if the jump condition at the in-
put E is fulfilled. FBD/LD IL

!BA 0
SPBM SPRUNG
E E
MRK MA NR
#0
#0

____________________________________________________________________________________________

Parameters
E BINARY E, M, A, K, S Jump condition
MRK SPECIAL MRK Target label
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 26 µs 9 µs
Additional runtime: ––– –––
Output updating: not applicable not applicable
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description place. It is possible for several jump blocks to jump to one


and the same label.
This function block produces a jump to the target label
specified at the MRK input if the jump condition at the in- A label may occur several times in the program. If this is
put E is fulfilled. case, the jump block and the next one of these identically
named labels always belong together.
To avoid endless loops as the result of incorrect planning,
the PLC accepts FORWARD JUMPS only. On the basis of the labels, the PLC calculates the follow-
ing:
The target label’s designation consists of a key word and
a number. – The number of historical values to be skipped

FBD/LD – The address of the target label


Designation of the target label: MRK No. The PLC enters the two computed values at the intended
Where: MRK Key word points in the jump block. When planning the jump block in
0 < No. < 999 Number of the label instruction list, these two program words may basically be
written with any contents. However, it is advisable to enter
IL
the number 0 here.
Designation of the target label: MA No.
Where: MA Key word Caution:
0 < No. < 999 Number of the label
However, the two program words should not be written
The label specified in the block is also specified at the po- with NOP because NOP values are removed when opti-
sition in the user program to where the jump is to take mizing the user program.

907 PC 331/Issued: 11.98 20–1


SPBM CONDITIONAL JUMP TO LABEL

Example of a jump block in IL:

!E0,0
&E0,1
/M0,0
=M0,1
!BA 123
SPRUNG Jump block
M0,1 Jump condition
MA 99 Target label’s name
#0 Free space for number of historical
values to be skipped
(not used in 07 KR 31)
#0 Free space for target address
!E1,5
&E4,9
=A6,8
=M9,7
.
.
.
MA 99 Target label, jump target for the jump
block
!E10,12
/E10,13
&E10,14
=A14,15
!PE

20–2 907 PC 331/Issued: 11.98


CONDITIONAL JUMP TO LABEL SPBM

Example

FBD/LD IL

!BA 0
SPBM SPRUNG
E 01,00 E E 01,00
MRK 0 MRK MA 0
#0
#0

CE FBD Definition

SPBM
E
MRK

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E L N P Y 0 0
MRK S S N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 SPRUNG
00002 PP 0 E Jump condition BINARY
00003 MA PP 0 MRK Target lable
00004 # 0
00005 # 0

907 PC 331/Issued: 11.98 20–3


SQRT SQARE ROOT

The function block SQRT generates the square root of the


value at the input E. The result is available at the output A FBD/LD IL
and is always rounded down to an integral number. The
value at the input E must be a positive number. If the value
at the input is negative, the value ’zero’ is output through !BA 0
SQRT SQRT
the output A and the value ’1’ is output through the ERR
output. E E
D/W D/W
A A
ERR ERR

Parameters

E WORD, EW, AW, MW, KW , Input


DOUBLE WORD MD, KD
D/W BINARY E, A, M, K, S Format of the input/output
A WORD, EW, AW, MW, KW,
DOUBLE WORD MD, KD Square root of the input value
ERR BINARY E, A, M, K Error if the input value is negative
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 55 µs ... 193 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description A WORD/DOUBLE WORD


The value of the square root is available at the
The function block SQRT generates the square root of the
output A.
value at the input E. The result is available at the output A
and is always rounded down to an integral number. The
ERR BINARY
value at the input E must be a positive number. If the value
The ERR output indicates whether the value of the input
at the input is negative, the value ’zero’ is output through
operand E is positive (> 0) or negative (< 0).
the output A and the value ’1’ is output through the ERR
Input E > 0 –> ERR = 0 and A = square root
output.
Input E < 0 –> ERR = 1 and A = 0

E WORD/DOUBLE WORD
The square root of the value at the input operand E is ge-
nerated and is available as a value of the output operand
A.

D/W BINARY
The input D/W defines the format of the input/output oper-
and.
D/W = 0 –> WORD
D/W = 1 –> DOUBLE WORD

20–4 907 PC 331/Issued: 11.98


SQARE ROOT SQRT

Example

FBD/LD IL

SQRT !BA 0
SQRT
MD 00,00 E MD 00,00
K 00,00 D/W K 00,00
A MD 00,01 MD 00,01
ERR A 00,00 A 00,00

CE FBD Definition

SQRT
E
D/W
A
ERR

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E X N P Y 0 0
D/W E L N P Y 0 0
A A X N P Y 0 0
ERR A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr. Block number (pre–assigned 0)


00001 SQRT
00002 PP 0 E Input (WORD, DOUBLE WORD)
00003 PP 0 D/W Format (BINARY)
00004 PP 0 A Output (WORD, DOUBLE WORD)
00005 PP 0 ERR Error (BINARY)

907 PC 331/Issued: 11.98 20–5


SR RESET MEMORY, DOMINATING

This connection element realizes a binary memory with


the “dominating reset” characteristic.
FBD/LD IL
The operand Q, which performs the storage function, is
Q
entered above the graphical symbol. The status of the op-
erand Q is allocated to the operand at the output Q. ! S
SR =S Q
A status 1 at the input S sets the operand Q to a S ! R
status 1. R Q =R Q

A status 1 at the input R resets the operand Q to the status


0.

A simultaneous 1 status at the inputs S and R resets the


operand to a status 0 (dominating reset).

A status 0 at the input S or R has no influence on the oper-


and Q.
____________________________________________________________________________________________

Parameters
S BINARY E, M, A, S, K Set input
R BINARY E, M, A, S, K Reset input
Q BINARY M, A Flip–flop output
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 8.6 µs 30 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description A status 1 at the input R resets the operand Q to the sta-


tus 0.
The operand Q, which performs the storage function, is
A simultaneous 1 status at the inputs S and R resets the
entered above the graphical symbol. The status of the op-
operand to a status 0 (dominating reset).
erand Q is allocated to the operand at the output Q.
A status 0 at the input S or R has no influence on the oper-
A status 1 at the input S sets the operand Q to a
and Q.
status 1.
The inputs and the output cannot be duplicated.
The inputs R and S can be inverted.

20–6 907 PC 331/Issued: 11.98


RESET MEMORY, DOMINATING SR

Example

FBD/LD IL
M 00,00

! E 00,00
SR =S M 00,00
E 00,00 S ! E 03,11
E 03,11 R Q A 02,00 =R M 00,00
! M 00,00
= A 02,00

CE FBD Definition

SR
S
R Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

S E L Y P Y 0 0
R E L Y P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 ! PP 0 S Input BINARY


00002 =S PP 0 Q Output BINARY
00004 ! PP 0 R Input BINARY
00006 =R PP 0 Q Output BINARY

907 PC 331/Issued: 11.98 20–7


TESTB TESTING BIT IN WORD/DOUBLE WORD

The bit at input #BIT (#) is tested in word/double word E


and assigned to the binary variable A. Valid values at input
# BIT: 0...31.
FBD/LD
If a word variable is entered at input E and #BIT is greater
than 15, the corresponding bit of the following word varia- TESTB
ble is tested and assigned.
E
Example: E = MW 00,00 and #BIT = 16 → bit 0 of #BIT A
MW 00,01 is assigned to output A.

Parameters
E WORD EW, MW Input
DOUBLE WORD MD
#BIT DIRECT #,#H Bit position; admissible values: 0...31
CONSTANT
A BINARY A, M Output

CE data
Output updating: yes
Number of historical values: none

Available as of: 07 KR 91 R2 Index c, 07 KT 92 R2 Index c,


07 KT 93 R2 Index f, 07 KT 94

Description
E WORD/DOUBLE WORD #BIT Direct constant (#,#H)
The bit at input #BIT (#) is tested in word/double word E At input #BIT, the position of the corresponding bit is spec-
and assigned to the binary variable A. ified.
If a word variable is entered at input E and #BIT is greater Admissible values: 0...31
than 15, the corresponding bit of the following word vari-
able is tested and assigned to output A.
Example: E = MW 00,02 and #BIT = 18 → bit 2 of A BINARY
MW 00,03 is assigned to output A. Output A is set (Bit = 1) or reset (Bit = 0) depending on the
corresponding bit in E.

7 20-8 907 PC 331 / Issued: 08.99


TESTING BIT IN WORD/DOUBLE WORD TESTB

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

TESTB

WORT_IN Y N Y 0 00 E

DIREKT_KONS Y N Y 0 00 #BIT A 00 0 Y N Y BIT_OUT

Source

SN ZN Command / Variable Symbol Long text

00000 00000 TESTB


00001 PP 00 E
00002 PP 00 #BIT
00003 PP 00 A
00004

907 PC 331 / Issued: 08.99 20-9


7
TOF OFF DELAY

The 1/0 edge at input IN is delayed by the time PT and


output as a 1/0 edge at output Q.
FBD/LD
Output ET displays the current time.
TOF
If the input IN returns to the 1 level before the time PT IN Q
has expired, the output Q remains on the 1 level. PT ET

Parameters
IN BINARY E, M, A, S, K Input signal
PT WORD/DOUBLE WORD MW&MW+1, MD, Delay time
KW&KW+1, KD
EW&EW+1, AW&AW+1
Q BINARY M, A Delayed signal
ET WORD/DOUBLE WORD MW&MW+1, MD Time display

Available as of: Advant Controller 31, series 40 and 50

Description
The 1/0 edge at input IN is delayed by the time PT and
output as a 1/0 edge at output Q. IN

If the input IN returns to the 1 level before the time PT


has expired, the output Q remains on the 1 level.
Q t t t
The output ET indicates the current time. t0 PT t0 t < PT t0 PT

For times less than 65 s, variables of the type WORD can


be used at input PT and output ET: flags, constants, other Maximum time offset at the output: < 1 cycle time
WORD functions (+, -, AWT) and the potentiometer inputs Sensible range for PT: > 1 cycle time
of the CPU.
The inputs and the output can neither be duplicated nor
In this case MW, KW, EW and AW assign two successive inverted.
addresses. MW+1, KW+1, EW+1 and AW+1 must no
longer be used in the program. General behavior

Time is entered in milliseconds. - Started timers are processed by the PLC operating
Valid time range: 5 ms ... 24,8 days. system and are therefore completely independent
of the PLC program processing. The operating system
For the indirect constant KD, the value for the pulse length does not issue a corresponding message to the corre-
sponding timer block in the PLC program until the tim-
is entered in long text.
er has elapsed.
- The timer processing in the PLC operating system is
not affected by the following commands:
- Abort program
- Start program
- Stop program
- Continue program

7 20-10 907 PC 331 / Issued: 08.99


OFF DELAY TOF

That means if a timer is started, its processing in the PLC Cold start:
operating system is also continued if the corresponding
PLC program is aborted, started or stopped again or con- - Command KALT <CR>
tinued. - First switching-on of the voltage
Warm start:
Initialization - Command WARM <CR>
The timers are generally initialized with each PLC cold or - Switching on voltage
warm start. Therefore a running timer is always aborted by
a PLC cold or warm start.

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

TOF
BIT_IN Y N Y 0 00 IN Q 00 0 Y N Y BIT_OUT
ALLE Y N Y 0 00 PT ET 00 0 Y N Y ALLE

Source

SN ZN Command / Variable Symbol Long text

00000 00000 !BA 000


00001 TOF
00002 PP 00 IN
00003 PP 00 PT
00004 PP 00 ET
00005 PP 00 Q

907 PC 331 / Issued: 08.99 20-11


7
TON ON DELAY

The 0/1 edge at input IN is delayed by the time PT and


output as a 0/1 edge at output Q.
FBD/LD
Output ET displays the current time.
TON
If the input IN returns to the 0 level before the time PT IN Q
has expired, the output Q remains on the 0 level. PT ET

Parameters
IN BINARY E, M, A, S, K Input signal
PT WORD/DOUBLE WORD MW&MW+1, MD,, Delay time
KW&KW+1, KD,
EW&EW+1, AW&AW+1
Q BINARY M, A Delayed signal
ET WORD/DOUBLE WORD MW&MW+1, MD Time display

Available as of: Advant Controller 31, series 40 and 50

Description
The 0/1 edge at input IN is delayed by the time PT and
output as a 0/1 edge at output Q. IN

If the input IN returns to the 0 level before the time PT


has expired, the output Q remains on the 0 level.
Q
t t
The output ET indicates the current time. t0 PT t0 t < PT

For times less than 65 s, variables of the type WORD can


be used at input PT and output ET: flags, constants, other Maximum time offset at the output: < 1 cycle time
WORD functions (+, -, AWT) and the potentiometer inputs Sensible range for PT: > 1 cycle time
of the CPU.
The inputs and the output can neither be duplicated nor
In this case MW, KW, EW and AW assign two successive inverted.
addresses. MW+1, KW+1, EW+1 and AW+1 must no
longer be used in the program. General behavior

Time is entered in milliseconds. - Started timers are processed by the PLC operating
Valid time range: 5 ms ... 24,8 days. system and are therefore completely independent
of the PLC program processing. The operating system
does not issue a corresponding message to the corre-
For the indirect constant KD, the value for the pulse length
sponding timer block in the PLC program until the tim-
is entered in long text.
er has elapsed.
- The timer processing in the PLC operating system is
not affected by the following commands:
- Abort program
- Start program
- Stop program
- Continue program

7 20-12 907 PC 331 / Issued: 08.99


ON DELAY TON

That means if a timer is started, its processing in the PLC Cold start:
operating system is also continued if the corresponding
PLC program is aborted, started or stopped again or con- - Command KALT <CR>
tinued. - First switching-on of the voltage
Warm start:
Initialization - Command WARM <CR>
The timers are generally initialized with each PLC cold or - Switching on voltage
warm start. Therefore a running timer is always aborted by
a PLC cold or warm start.

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

TON
BIT_IN Y N Y 0 00 IN Q 00 0 Y N Y BIT_OUT
ALLE Y N Y 0 00 PT ET 00 0 Y N Y ALLE

Source

SN ZN Command / Variable Symbol Long text

00000 00000 !BA 000


00001 TON
00002 PP 00 IN
00003 PP 00 PT
00004 PP 00 ET
00005 PP 00 Q

907 PC 331 / Issued: 08.99 20-13


7
TP MONOSTABLE ELEMENT "CONSTANT"

The 0/1 edge at input IN produces a 0/1 edge at output Q.


After the time PT has expired, output Q is reset to the 0
level. FBD/LD
TP
Output ET displays the current time.
IN Q
A second 0/1 edge at input IN which occurs before the PT ET
time period PT has elapsed is ignored.
Output ET displays the elapsed time.

Parameters
IN BINARY E, M, A, S, K Input signal
PT WORD/DOUBLE WORD MW&MW+1, MD, Pulse duration
KW&KW+1, KD,
EW&EW+1, AW&AW+1
Q BINARY M, A Pulse
ET WORD/DOUBLE WORD MW&MW+1, MD Time display

Available as of: Advant Controller 31, series 40 and 50

Description
The 0/1 edge at input IN produces a 0/1 edge at output Q.
After the time PT has expired, output Q is reset to the 0 IN
level. A second 0/1 edge at input IN which occurs before
the time period PT has elapsed is ignored.
Q PT PT
The output ET indicates the current time.
For times less than 65 s, variables of the type WORD can
be used at input PT and output ET: flags, constants, other
WORD functions (+, -, AWT) and the potentiometer inputs Maximum time offset at the output: < 1 cycle time
of the CPU.
Sensible range for PT: > 1 cycle time
In this case MW, KW, EW and AW assign two successive
addresses. MW+1, KW+1, EW+1 and AW+1 must no The inputs and the output can neither be duplicated nor
longer be used in the program. inverted.

Time is entered in milliseconds. General behavior


Valid time range: 5 ms ... 24,8 days - Started timers are processed by the PLC operating
For the indirect constant KD, the value for the pulse length system and are therefore completely independent
is entered in long text. of the PLC program processing. The operating system
does not issue a corresponding message to the corre-
sponding timer block in the PLC program until the tim-
er has elapsed.
- The timer processing in the PLC operating system is
not affected by the following commands:
- Abort program
- Start program
- Stop program
- Continue program

7 20-14 907 PC 331 / Issued: 08.99


MONOSTABLE ELEMENT "CONSTANT" TP

That means if a timer is started, its processing in the PLC Cold start:
operating system is also continued if the corresponding
PLC program is aborted, started or stopped again or con- - Command KALT <CR>
tinued. - First switching-on of the voltage
Warm start:
Initialization - Command WARM <CR>
The timers are generally initialized with each PLC cold or - Switching on voltage
warm start. Therefore a running timer is always aborted by - RESET switch
a PLC cold or warm start.

Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

TP
BIT_IN Y N Y 0 00 IN Q 00 0 Y N Y BIT_OUT
ALLE Y N Y 0 00 PT ET 00 0 Y N Y ALLE

Source

SN ZN Command / Variable Symbol Long text

00000 00000 !BA 000


00001 TP
00002 PP 00 IN
00003 PP 00 PT
00004 PP 00 ET
00005 PP 00 Q

907 PC 331 / Issued: 08.99 20-15


7
UHR CLOCK

This function block allows users to set and display the cur-
rent time and the current date.
FBD/LD IL

!BA 0
UHR
UHR
FREI AKT FREI
S FEHL S
SEC ASEC SEC
MIN AMIN MIN
H AH H
TAG ATAG TAG
MON AMON MON
JHR AJHR JHR
WTG AWTG WTG
AKT
FEHL
ASEC
AMIN
AH
ATAG
AMON
AJHR
AWTG

____________________________________________________________________________________________

Parameters
FREI BINARY E, A, M, K, S Enable block processing
S BINARY E, A, M, K, S 0/1 edge sets the time and date
SEC WORD EW, AW, MW, KW Set input for the seconds
MIN WORD EW, AW, MW, KW Set inputs for the minutes
H WORD EW, AW, MW, KW Set inputs for the hours
TAG WORD EW, AW, MW, KW Set inputs for the days
MON WORD EW, AW, MW, KW Set inputs for the months
JHR WORD EW, AW, MW, KW Set inputs for the years
WTG WORD EW, AW, MW, KW Set inputs for the weekdays
AKT BINARY A, M Topicality (usefulness) of the data at the outputs
FEHL WORD AW, MW Error identifier
ASEC WORD AW, MW Seconds output
AMIN WORD AW, MW Minutes output
AH WORD AW, MW Hours output
ATAG WORD AW, MW Days output
AMON WORD AW, MW Months output
AJHR WORD AW, MW Years output
AWTG WORD AW, MW Weekday No. output
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 60 µs – Display of time and date 409 µs
200 µs – Setting time and date 4697 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: 1 word none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 KR 51, 07 KT 51

20–16 907 PC 331/Issued: 11.98


CLOCK UHR

Description MIN WORD


Set input for the minutes.
This function block allows users to set and display the cur- Value range: 0...59.
rent time and the current date.

The inputs and outputs can neither be duplicated nor in- H WORD
verted nor negated. Set input for the hours.

The clock is set by means of the set inputs for the time and The clock operates in 24 hour mode, i.e. it changes from
date. The values present at the set inputs are adopted by 23:59:59 h to 0:0:0 h.
a 0/1 edge at the input S. As long as a 1 signal is present Value range: 0...23.
at the FREI input, the current date and time are indicated
at the block’s outputs. TAG WORD
Set input for the days (which day of the month)
FREI BINARY
Block enable Not The clock knows the number of days depend-
for ing on the months and leap years. For the
07 clock, a leap year exists when the year num-
FREI = 0: The block is not processed. The AKT
KR 31 ber is an integral multiple of 4. The maximum
and FEHL outputs are set to 0. The time
value for the days (28, 29, 30, 31) depends
and date outputs are no longer changed
on the month.
by the block.
Value range: 1...28, 29, 30, 31.

FREI = 1: Block is processed


MON WORD
Set input for the month.
S BINARY Value range: 1...12.

0/1 edge –> the clock is set to the values present at the
time and date inputs. JHR WORD
Set input for the years.
During the setting, the time and date at the block’s output
are invalid (output AKT = 0). The clock only indicates the years and decades.
Value range: 0...99.
Set inputs for date and time WTG WORD
Set input for the number of the weekday.
In the event of a 0/1 edge at the input S, the clock is set to
the values present at the set inputs. If the specified set This input specifies which day of the week the day is on
values are inadmissible, the AKT output is set to 0 and an which input is made. That is to say, it is possible to deter-
error message appears at the FEHL output. The values mine which day of the week the day with the number 1 is to
present at the time and date outputs are invalid in this be (e. g. Sunday or Monday).
case. The clock has to be set again. Value range: 1...7.
Example:
SEC WORD The clock is set on Friday, 01.07.88. If the value 6 is en-
Set input for the seconds. tered for the week day number, Friday is now the 6th day
Value range: 0...59. of the week and Sunday is defined as the 1st day of the
week.

907 PC 331/Issued: 11.98 20–17


UHR CLOCK

AKT BINARY FEHL = 10: Date/time are currently being set; this
Indication of the topicality (usefulness) of the outputs. may take several PLC cycles.

FEHL = 11: Setting was not successful, please


AKT is 1 if:
repeat (unknown request code).
– The date and time outputs were updated in the current FEHL = 12: Setting was not successful, please
cycle; repeat (invalid mail parameter).

– The values at the outputs are consistent, i.e. none of FEHL = 13: Setting was not successful, please
the values at the date or time outputs has changed du- repeat (request code cannot be
ring updating. They all originate from the same clock excecuted).
pulse;
– Error when displaying date and time:
– The clock was set correctly; FEHL = 9: Date/time at the outputs are invalid.

Outputs for date and time


AKT = 1 –> FEHL = 0: Date/time are valid.
The outputs are updated whenever a 1 signal is present at
AKT = 0 –> FEHL > 0: Date/time are invalid.
the FREI input and the clock has been set once. During
The reason why is displayed at
the setting the outputs for date and time are invalid.
the output FEHL as error
identifier.
If the AKT output is equal to 1, the outputs for the date and
FEHL WORD time are valid. In the event of an error, an error identifier is
output through the output FEHL.
In the event of an error, the relevant error identifier is
available at the output FEHL.
ASEC WORD
Meanings of the error identifiers: Seconds output.
Value range: 0...59
– No error has occurred:
FEHL = 0: No error has occurred or FREI = 0,
i. e. block disabled AMIN WORD
Minutes output.
Value range: 0...59.
– Error when setting the clock:
FEHL = 1: 0 < SEC < 59 has not been obeyed
AH WORD
FEHL = 2: 0 < MIN < 59 has not been obeyed Hours output.
Value range: 0...23.
FEHL = 3: 0 < H < 23 has not been obeyed

FEHL = 4: 1 < TAG < 28, 29, 30, 31 (depending on ATAG WORD
the month, not tested in 07 KR 31) has Days output.
not been obeyed Value range: 1...28, 29, 30, 31.

FEHL = 5: 1 < MON < 12 has not been obeyed


AMON WORD
FEHL = 6: 0 < JHR < 99 has not been obeyed Months output.
Value range: 1...12.
FEHL = 7: 1 < WTG < 7 has not been obeyed

The following errors are not used in the 07 KR 31: AJHR WORD
Years output.
FEHL = 8: The transmission mailbox is currently Value range: 0...99.
occupied by another user. The block
waits till the mailbox is free and thereafter
sets date/time. AWTG WORD
Weekday No. output.
FEHL = 9: Date/time at the outputs are invalid. Value range: 1...7.

20–18 907 PC 331/Issued: 11.98


CLOCK UHR

Example

FBD/LD IL

!BA 0
UHR
UHR
M 00,00 FREI AKT M 00,01 M 00,00
M 00,02 S FEHL MW 00,03 M 00,02
MW 00,04 SEC ASEC MW 00,05 MW 00,04
MW 00,06 MIN AMIN MW 00,07 MW 00,06
MW 00,08 H AH MW 00,09 MW 00,08
MW 00,10 TAG ATAG MW 00,11 MW 00,10
MW 00,12 MON AMON MW 00,13 MW 00,12
MW 00,14 JHR AJHR MW 00,15 MW 00,14
MW 01,00 WTG AWTG MW 01,01 MW 01,00
M 00,01
MW 00,03
MW 00,05
MW 00,07
MW 00,09
MW 00,11
MW 00,13
MW 00,15
MW 01,01

907 PC 331/Issued: 11.98 20–19


UNPACK UNPACKING A WORD INTO BINARY VARIABLES

This function block unpacks the word variable at the input


WORT. Each bit of the input variable is allocated to one
binary variable each (BI0...BIn) at the output. FBD/LD IL

!BA 0
UNPACK UNPACK
WORT WORT
#n BI0 #n
BI0

____________________________________________________________________________________________
Parameters
WORT WORD EW, AW, MW, KW Word variable to be unpacked
#n DIRECT #, #H Number of output variables BI0 ... BIn–1
CONSTANT
BI0 BINARY A, M 1st binary output variable; the output can be duplicated
____________________________________________________________________________________________
CE Data Series 90 Series 30, 40, 50
Runtime:
Basic runtime: 23.5 µs 32 µs
Additional runtime: 9.5 µs per planned binary variable
33 µs per
planned binary variable
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331 907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________
Description Affiliation
Input variable Bit0 –> BI0
This function block unpacks the word variable at the input Input variable Bit1 –> BI1
WORT. Each bit of the input variable is allocated to one . . . .
binary variable each (BI0...BIn–1) at the output. . . . .
Input variable Bit15 –> BI15
WORT WORD
The variable to be unpacked is specified at the input
WORT. Each bit (bit 0...bit 15) of this input variable is allo-
cated to the affiliated output variable (BI0...BIn–1).

#n DIRECT CONSTANT (#,#H)


The number of planned binary outputs (BI0...BIn–1) is
specified at the input #n. This is specified as a direct con-
stant.

The following applies: 1 < n < 16


BI0 BINARY
The output BI0 can be duplicated (BI0...BIn–1). The affili-
ated bits of the variable at the input WORT are allocated
to the binary outputs BI0...BIn.

20–20 907 PC 331/Issued: 11.98


UNPACKING A WORD INTO BINARY VARIABLES UNPACK

Example

FBD/LD IL

!BA 0
UNPACK UNPACK
MW 07,05 WORT MW 07,05
#2 #n BI0 M 08,03 #2
BI1 M 08,04 M 08,03
M 08,04

CE FBD Definition

UNPACK
WORT
#n BI

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

WORT E W N P Y 0 0
#n K W N P Y 0 0
BI A L N P Y 1 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 UNPACK
00002 PP 0 WORT Input WORD
00003 PP 0 #n # CONSTANT (number of BITs)
[ 1
00004 PP 1 BI Output BINARY
] 1

907 PC 331/Issued: 11.98 20–21


UNPACKD UNPACKING A DOUBLE WORD INTO BINARY VARIABLES

This function block unpacks the double word variable at


the input DW. Each bit of the input variable is allocated to
one binary variable each (BI0...BIn) at the output. FBD/LD IL

!BA 0
UNPACKD UNPAD
DW DW
#n BI0 #n
BI

____________________________________________________________________________________________

Parameters
DW DOUBLE WORD MD, KD Double word variable to be unpacked
#n WORD #,#H Number of output variables at BIO... BIn–1
BI0 BINARY A, M 1st binary output variable; the output can be duplicated
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 40 µs
Additional runtime: 9 µs per output
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description Affiliation
Input variable Bit0 –> BI0
Input variable Bit1 –> BI1
This function block unpacks the double word variable at . . . .
the input DW. Each bit of the input variable is allocated to . . . .
one binary variable each (BI0...BIn–1) at the output. Input variable Bit31 –> BI31

DW DOUBLE WORD
The variable to be unpacked is specified at the input DW.
Each bit (bit 0...bit 31) of this input variable is allocated to
the affiliated output variable (BI0...BIn–1).
#n DIRECT CONSTANT (#,#H)
The number of planned binary outputs (BI0...BIn–1) is
specified at the input #n. This is specified as a direct con-
stant. The following applies: 1 < n < 32

BI0 BINARY
The output BI0 is capable of duplication (BI0...BIn–1).
The affiliated bits of the variable at the input DW are allo-
cated to the binary outputs BI0...BIn.

20–22 907 PC 331/Issued: 11.98


UNPACKING A DOUBLE WORD INTO BINARY VARIABLES UNPACKD

Example

FBD/LD IL

!BA 0
UNPACKD UNPAD
MD 07,05 DW MD 07,05
#2 #n BI0 M 08,03 #2
BI1 M 08,04 M 08,03
M 08,04

CE FBD Definition

UNPACKD
DW
#n BI

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

DW E D N P Y 0 0
#n K W N P Y 0 0
BI A L N P Y 1 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 UNPAD
00002 PP 0 DW Input DOUBLE WORD
00003 PP 0 #n # CONSTANT (number of BITs)
[ 1
00004 PP 1 BI Output BINARY
] 1

907 PC 331/Issued: 11.98 20–23


USM SWITCHOVER MULTIPLEXER

This function block allocates the value from the input E to


an operand, using the method of indirect addres-sing.
FBD/LD IL
Note: The USM block can only be used meaningfully in
conjunction with the ADRWA block.
!BA 0
USM USM
ADR
ADR E
E

____________________________________________________________________________________________

Parameters
ADR WORD EW, AW, MW, KW Indirect address of the operand to be written
E WORD AW, MW Value to be allocated to the operand
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 225 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This function block allocates the value from the input E to
an operand, using the method of indirect addressing.
Note: The USM block can only be used meaningfully in
conjunction with the ADRWA block.
The value of the operand at the input ADR is interpreted
as the address of the operand to be written (indirect ad-
dressing).
Therefore, the operand at the input ADR and its value rep-
resent an indirect address. This indirect address is gener-
ated by the ADRWA function block.
The inputs can neither be duplicated nor negated.
Note: Refer to the function block ADRWA for an explana-
tion of the method of indirect addressing and the
possibilities of using the USM function block.

20–24 907 PC 331/Issued: 11.98


SWITCHOVER MULTIPLEXER USM

Example

FBD/LD IL

!BA 0
USM USM
AW 09,00
AW 09,00 ADR EW 10,02
EW 10,02

CE FBD Definition

USM

ADR A
E

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

ADR E W N P Y 0 0
E E W N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 USM
00002 PP 0 ADR Input WORD (operand address)
00003 PP 0 E Input WORD (operand value)

907 PC 331/Issued: 11.98 20–25


UST SWITCHOVER GATE

A 0 signal at the binary input 0/1 allocates the value of the


word operand at the input E1 to the word operand at the
output 0. FBD/LD IL

A 1 signal at the binary input 0/1 allocates the value of the !BA 0
word operand at the input E1 to the word operand at the UST UST
output 1. 0/1 0/1
E1 0 E1
The respective output that is not allocated retains its old 1 0
value, but the old value is not updated. 1

____________________________________________________________________________________________

Parameters
0/1 BINARY E, M, A, S, K Switchover input
E1 WORD EW, MW, AW, KW Input
0 WORD AW, MW Output for 0/1 = 0
1 WORD AW, MW Output for 0/1 = 1
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 31 µs
Additional runtime: –––
Output updating: no; recommendation: Allocate the output directly to a flag or use a global
intermediate flag; see volume 3, chapter 2.5.3
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
A 0 signal at the binary input 0/1 allocates the value of the
word operand at the input E1 to the word operand at the
output 0.
A 1 signal at the binary input 0/1 allocates the value of the
word operand at the input E1 to the word operand at the
output 1.
The respective output that is not allocated retains its old
value, but the old value is not updated.
The inputs and outputs can neither be duplicated nor ne-
gated/inverted.

20–26 907 PC 331/Issued: 11.98


SWITCHOVER GATE UST

Example

FBD/LD IL

!BA 0
UST UST
E 01,00 0/1 E 01,00
MW 05,00 0 MW 08,15 MW 05,00
1 MW 09,00 MW 08,15
MW 09,00

CE FBD Definition

UST
0/1
E1 0
1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0/1 E L N P Y 0 0
E1 E W N P N 0 0
0 A W N P Y 0 0
1 A W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 UST
00002 PP 0 0/1 Input BINARY (selector)
00003 PP 0 E1 Input WORD
00004 PP 0 0 Output WORD
00005 PP 0 1 Output WORD

907 PC 331/Issued: 11.98 20–27


UST SWITCHOVER GATE

20–28 907 PC 331/Issued: 11.98


SWITCHOVER GATE, DOUBLE WORD USTD

A 0 signal at the binary input 0/1 allocates the value of the


double word operand at the input E1 to the double word
operand at the output 0. FBD/LD IL

A 1 signal at the binary input 0/1 allocates the value of the


double word operand at the input E1 to the double word !BA 0
operand at the output 1. USTD USTD
0/1 0/1
The respective output that is not allocated retains its old E1 0 E1
value, but the old value is not updated. 1 0
1

____________________________________________________________________________________________

Parameters
0/1 BINARY E, M, A, S, K Switchover input
E1 DOUBLE WORD MD, KD Input
0 DOUBLE WORD MD Output for 0/1 = 0
1 DOUBLE WORD MD Output for 0/1 = 1
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 35 µs
Additional runtime: –––
Output updating: no; recommendation: Allocate the output directly to a flag or use a global
intermediate flag; see volume 3, chapter 2.5.3
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
A 0 signal at the binary input 0/1 allocates the value of the
double word operand at the input E1 to the double word
operand at the output 0.

A 1 signal at the binary input 0/1 allocates the value of the


double word operand at the input E1 to the double word
operand at the output 1.

The respective output that is not allocated retains its old


value, but the old value is not updated.
The inputs and outputs can neither be duplicated nor ne-
gated/inverted.

907 PC 331/Issued: 11.98 21–1


USTD SWITCHOVER GATE, DOUBLE WORD

Example

FBD/LD IL

!BA 0
USTD USTD
E 01,00 0/1 E 01,00
MD 05,00 0 MD 08,15 MD 05,00
1 MD 09,00 MD 08,15
MD 09,00

CE FBD Definition

USTD
0/1
E1 0
1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0/1 E L N P Y 0 0
E1 E D N P N 0 0
0 A D N P Y 0 0
1 A D N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 USTD
00002 PP 0 0/1 Input BINARY (selector)
00003 PP 0 E1 Input DOUBLE WORD
00004 PP 0 0 Output DOUBLE WORD
00005 PP 0 1 Output DOUBLE WORD

21–2 907 PC 331/Issued: 11.98


SWITCHOVER GATE WITH RESET USTR

A 0 signal at the binary input 0/1 allocates the value of the


word operand at the input E1 to the word operand at the
output 0. FBD/LD IL

A 1 signal at the binary input 0/1 allocates the value of the


word operand at the input E1 to the word operand at the !BA 0
output 1. USTR USTR
0/1 0/1
The respective output that is not allocated is set to 0. E1 0 E1
1 0
1

____________________________________________________________________________________________

Parameters
0/1 BINARY E, M, A, S, K Switchover input
E1 WORD EW, MW, AW, KW Input
0 WORD AW, MW Output for 0/1 = 0
1 WORD AW, MW Output for 0/1 = 1
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 35 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
A 0 signal at the binary input 0/1 allocates the value of the
word operand at the input E1 to the word operand at the
output 0.

A 1 signal at the binary input 0/1 allocates the value of the


word operand at the input E1 to the word operand at the
output 1.

The respective output that is not allocated is set to 0.


The inputs and outputs can neither be duplicated nor ne-
gated/inverted.

907 PC 331/Issued: 11.98 21–3


USTR SWITCHOVER GATE WITH RESET

Example

FBD/LD IL

!BA 0
USTR USTR
E 01,00 0/1 E 01,00
MW 05,00 0 MW 08,15 MW 05,00
1 MW 09,00 MW 08,15
MW 09,00

CE FBD Definition

USTR
0/1
E1 0
1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0/1 E L N P Y 0 0
E1 E W N P N 0 0
0 A W N P Y 0 0
1 A W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 USTR
00002 PP 0 0/1 Input BINARY (selector)
00003 PP 0 E1 Input WORD
00004 PP 0 0 Output WORD
00005 PP 0 1 Output WORD

21–4 907 PC 331/Issued: 11.98


SWITCHOVER GATE WITH RESET, DOUBLE WORD USTRD

A 0 signal at the binary input 0/1 allocates the value of the


double word operand at the input E1 to the double word
operand at the output 0. FBD/LD IL

A 1 signal at the binary input 0/1 allocates the value of the


double word operand at the input E1 to the double word !BA 0
operand at the output 1. USTRD USTRD
0/1 0/1
The respective output that is not allocated is set to 0. E1 0 E1
1 0
1

____________________________________________________________________________________________

Parameters
0/1 BINARY E, M, A, S, K Switchover input
E1 DOUBLE WORD MD, KD Input
0 DOUBLE WORD MD Output for 0/1 = 0
1 DOUBLE WORD MD Output for 0/1 = 1
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 43 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
A 0 signal at the binary input 0/1 allocates the value of the
double word operand at the input E1 to the double word
operand at the output 0.

A 1 signal at the binary input 0/1 allocates the value of the


double word operand at the input E1 to the double word
operand at the output 1.

The respective output that is not allocated is set to 0.


The inputs and outputs can neither be duplicated nor ne-
gated/inverted.

907 PC 331/Issued: 11.98 21–5


USTRD SWITCHOVER GATE WITH RESET, DOUBLE WORD

Example

FBD/LD IL

!BA 0
USTRD USTRD
E 01,00 0/1 E 01,00
MD 05,00 0 MD 08,15 MD 05,00
1 MD 09,00 MD 08,15
MD 09,00

CE FBD Definition

USTRD
0/1
E1 0
1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

0/1 E L N P Y 0 0
E1 E D N P N 0 0
0 A D N P Y 0 0
1 A D N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (presest to 0)


00001 USTRD
00002 PP 0 0/1 Input BINARY (selector)
00003 PP 0 E1 Input DOUBLE WORD
00004 PP 0 0 Output DOUBLE WORD
00005 PP 0 1 Output DOUBLE WORD

21–6 907 PC 331/Issued: 11.98


COMPARATOR WITH 3–POINT RESPONSE VGL3P

The value of the operand at the input E is compared to the


values of the operands at the inputs OG and UG.
FBD/LD IL
The possible results are signalled at the outputs E>OG,
E<UG and Q.
The following applies: !BA 0
VGL3P VGL3P
E < UG –––> E>OG = 0, E<UG = 1, Q = 0 E E
UG < E < OG –––> E>OG = 0, E<UG = 0, Q = 1 OG OG
E > OG –––> E>OG = 1, E<UG = 0, Q = 0 UG E>OG UG
E<UG E>OG
Q E<UG
Q

____________________________________________________________________________________________

Parameters
E WORD EW, MW, AW, KW Input value
OG WORD EW, MW, AW, KW High limit
UG WORD EW, MW, AW, KW Low limit
E>OG BINARY A, M Value > high limit
E<UG BINARY A,M Value < low limit
Q BINARY A,M Low limit < input value < high limit
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 48 µs
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description

The value of the operand at the input E is compared to the


values of the operands at the inputs OG and UG.

The possible results are signalled at the outputs E>OG,


E<UG and Q.
The following applies:
E>OG = 0 E>OG = 0 E>OG = 1
E<UG = 1 E<UG = 0 E<UG = 0
E < UG –––> E>OG = 0, E<UG = 1, Q = 0 Q =0 Q =1 Q =0
UG < E < OG –––> E>OG = 0, E<UG = 0, Q = 1
E > OG –––> E>OG = 1, E<UG = 0, Q = 0

The inputs can neither be duplicated nor negated. The UG OG E


outputs can neither be duplicated nor inverted.

907 PC 331/Issued: 11.98 21–7


VGL3P COMPARATOR WITH 3–POINT RESPONSE

Number range
Integer word (16 bits)
The following especially applies here to the non–
negated inputs:
– Low level 8000H –32768
– High level 7FFFH +32767
The following generally applies:
– Low limit: 8001H – 32767
– High limit: 7FFFH + 32767
– Inadmissible value: 8000H –––
In the two’s complement arithmetic, the value 8000H
(–32768) lies outside of the number range and is neither
generated nor processed correctly by the PLC. If this for-
bidden value reaches the PLC
– by bit manipulations of the user or
– by being read from outside the PLC or
– by an indirect word constant
under no circumstances may negation or subtraction be
carried out on this value.
An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
On allocation (=), the forbidden value 8000H (–32768) is
corrected to the allowed value 8001H (–32767).

21–8 907 PC 331/Issued: 11.98


COMPARATOR WITH 3–POINT RESPONSE VGL3P

Example

FBD/LD IL

!BA 0
VGL3P VGL3P
EW 00,00 E EW 00,00
MW 01,00 OG MW 01,00
KW 00,00 UG E>OG A 00,00 KW 00,00
E<UG M 02,00 A 00,00
Q M 00,00 M 02,00
M 00,00

CE FBD Definition

VGL3P
E
OG
UG E>OG
E<UG
Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E W N P Y 0 0
OG E W N P Y 0 0
UG E W N P Y 0 0
E>OG A L N P Y 0 0
E<UG A L N P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 VGL3P
00002 PP 0 E Input WORD (input value)
00003 PP 0 OG Input WORD (high limit)
00004 PP 0 UG Input WORD (low limit)
00005 PP 0 E>OG Output BINARY (value > high limit)
00006 PP 0 E<UG Output BINARY (value < low limit)
00007 PP 0 Q Output BINARY (UG < E < OG)

907 PC 331/Issued: 11.98 21–9


VGLEH COMPARATOR WITH UNILATERAL HYSTERESIS

The values of the operands at the inputs E1 and E2 are


compared to each other. Taking the hysteresis at the input
HSY into account, the result is signalled at the output Q. FBD/LD IL

The following applies:


!BA 0
VGLEH VGLEH
E1 > E2 –––> Q = 1 E1 E1
E1 < E2 – HYS –––> Q = 0 E2 E2
E2 – HYS < E1 < E2 –––> Q as in the previous HYS Q HYS
cycle Q

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Input value 1
E2 WORD EW, MW, AW, KW Input value 2
HYS WORD EW, MW, AW, KW Hysteresis
Q BINARY A, M Result of the comparison
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 56 µs
Additional runtime: –––
Output updating: yes
Number of historical values: 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
Q

The values of the operands at the inputs E1 and E2 are


compared to each other. Taking the hysteresis at the input
HSY into account, the result is signalled at the output Q.
1
The following applies:

E1 > E2 –––> Q = 1
E1 < E2 – HYS –––> Q = 0 HYS
E2 – HYS < E1 < E2 –––> Q as in the previous
cycle 0
E2–HYS E2 E1

The inputs can neither be duplicated nor negated.


The output can neither be duplicated nor inverted. HYS = Hysteresis

21–10 907 PC 331/Issued: 11.98


COMPARATOR WITH UNILATERAL HYSTERESIS VGLEH

Number range
Integer word (16 bits)

– Low limit: 8001H – 32767


– High limit: 7FFFH + 32767
– Inadmissible value: 8000H –––

The following especially applies here to the specification


for the left edge of the hysteresis:
E2 – HYS > –32 767 (8001H)
In the two’s complement arithmetic, the value 8000H
(–32768) lies outside of the number range and is neither
generated nor processed correctly by the PLC. If this for-
bidden value reaches the PLC
– by bit manipulations of the user or
– by being read from outside the PLC or
– by an indirect word constant
under no circumstances may negation or subtraction be
carried out on this value.
An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
On allocation (=), the forbidden value 8000H (–32768) is
corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 21–11


VGLEH COMPARATOR WITH UNILATERAL HYSTERESIS

Example

FBD/LD IL

!BA 0
VGLEH VGLEH
EW 00,00 E1 EW 00,00
MW 01,00 E2 MW 01,00
KW 00,00 HYS Q A 02,00 KW 00,00
A 02,00

CE FBD Definition

VGLEH
E1
E2
HYS Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P Y 0 0
E2 E W N P Y 0 0
HYS E W N P Y 0 0
Q A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 VGLEH
00002 PP 0 E1 Input WORD
00003 PP 0 E2 Input WORD
00004 PP 0 HYS Input WORD (hysteresis)
00005 PP 0 Q Output BINARY

21–12 907 PC 331/Issued: 11.98


COMPARATOR WITH ASYMMETRICAL HYSTERESIS VGLUH

The values of the operands at the inputs E1 and E2 are


compared to each other. Taking the hystereses at the in-
puts OHYS (high hysteresis) and UHYS (low hysteresis) FBD/LD IL
into account, the result is signalled at the output Q.

The following applies: !BA 0


VGLUH VGLUH
E1 < E2 – UHYS –––> Q = 0 E1 E1
E1 > E2 + OHYS –––> Q = 1 E2 E2
E2–UHYS < E1 < E2+OHYS –––> Q as in the pre– OHYS OHYS
vious cycle UHYS Q UHYS
Q

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Input value 1
E2 WORD EW, MW, AW, KW Input value 2
OHYS WORD EW, MW, AW, KW High hysteresis
UHYS WORD EW, MW, AW, KW Low hysteresis
Q BINARY A, M Output
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 58 ... 63 µs
Additional runtime: –––
Output updating: yes
Number of historical values: 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
Q
The values of the operands at the inputs E1 and E2 are
compared to each other. Taking the hystereses at the in-
puts OHYS (high hysteresis) and UHYS (low hysteresis)
into account, the result is signalled at the output Q.
1
The following applies:

E1 < E2 – UHYS –––> Q = 0


E1 > E2 + OHYS –––> Q = 1
E2–UHYS < E1 < E2+OHYS –––> Q as in the pre–
vious cycle UHYS OHYS

The inputs can neither be duplicated nor negated. 0


The output can neither be duplicated nor inverted. E2–UHYS E2 E2+OHYS E1

907 PC 331/Issued: 11.98 21–13


VGLUH COMPARATOR WITH ASYMMETRICAL HYSTERESIS

Number range
Integer word (16 bits)
The following especially applies here:
E1 > 8000H (– 32768)
E2 – UHYS > 8001H (– 32767)
The following generally applies:
– Low limit: 8001H – 32767
– High limit: 7FFFH + 32767
– Inadmissible value: 8000H –––
In the two’s complement arithmetic, the value 8000H
(–32768) lies outside of the number range and is neither
generated nor processed correctly by the PLC. If this for-
bidden value reaches the PLC
– by bit manipulations of the user or
– by being read from outside the PLC or
– by an indirect word constant
under no circumstances may negation or subtraction be
carried out on this value.
An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
On allocation (=), the forbidden value 8000H (–32768) is
corrected to the allowed value 8001H (–32767).

21–14 907 PC 331/Issued: 11.98


COMPARATOR WITH ASYMMETRICAL HYSTERESIS VGLUH

Example

FBD/LD IL

!BA 0
VGLUH VGLUH
EW 00,00 E1 EW 00,00
MW 01,00 E2 MW 01,00
KW 00,00 OHYS KW 00,00
MW 00,00 UHYS Q A 02,00 MW 00,00
A 02,00

CE FBD Definition

VGLUH
E1
E2
OHYS
UHYS Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P Y 0 0
E2 E W N P Y 0 0
OHYS E W N P Y 0 0
UHYS E W N P Y 0 0
Q A L N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 VGLUH
00002 PP 0 E1 Input WORD
00003 PP 0 E2 Input WORD
00004 PP 0 OHYS Input WORD (high hysteresis)
00005 PP 0 UHYS Input WORD (low hysteresis)
00006 PP 0 Q Output BINARY

907 PC 331/Issued: 11.98 21–15


VRZ UP / DOWN COUNTER

This function block serves to count pulses. During count-


ing, the positive edge of the pulse is evaluated in each
case. The counter is capable of counting both up and FBD/LD IL
down and the counting increment can be specified. It is
possible to preset the counter content to an intermediate
value. !BA 0
VRZ VRZ
FREI R
ZV DIFF
ZR S
DIFF ZW
S FREI
ZW ZV
R Z ZR
Z

____________________________________________________________________________________________

Parameters
FREI BINARY E, M, A, K, S Enable block processing
ZV BINARY E, M, A, K, S Pulse input, up counting
ZR BINARY E, M, A, K, S Pulse input, down counting
DIFF WORD EW, MW, AW, KW Counter content change per positive edge
(increment)
S BINARY E, M, A, K, S Set counter to an intermediate value
ZW WORD EW, MW, AW, KW Intermediate value
R BINARY E, M, A, K, S Reset counter
Z WORD AW, MW Output for counter content
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 92 µs 241 µs
Additional runtime: ––– –––
Output updating: yes if FREI = 1 yes if FREI = 1
Number of historical values: 2 words 3 words
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description ZV BINARY
Each positive edge (0–>1 edge) at the input ZV increases
This function block serves to count pulses. During count- the current counter content by the increment specified at
ing, the positive edge of the pulse is evaluated in each the DIFF input.
case. The counter is capable of counting both up and
down and the counting increment can be specified. It is ZR BINARY
possible to preset the counter content to an intermediate
Each positive edge (0–>1 edge) at the input ZR de-
value.
creases the current counter content by the increment
specified at the DIFF input.

FREI BINARY DIFF WORD


Counting is enabled or disabled by means of the FREI in- The increment for the counting operation is specified at
put. the DIFF input. The increment is the value by which the
The following applies: FREI = 0 –> Counting disabled counter is changed at the input ZV or ZR with each posi-
FREI = 1 –> Counting enabled tive edge.

21–16 907 PC 331/Issued: 11.98


UP / DOWN COUNTER VRZ

S BINARY
By means of a 1 signal at the input S, the counter content
is set to the value specified at the input ZW. Counting is
blocked as long as 1 signal is present at the input S. Set-
ting is also effective when a 1 signal is present at the FREI
input.

ZW WORD
The value to which the counter content is set by a 1 signal
at the input S is specified at the input ZW.

R BINARY
A 1 signal at the input R sets the counter content to the
value 0. The reset input R has the highest priority of all in-
puts.

Z WORD
The current counter content is available at the output Z.

If the counter reaches the positive or negative limit of the


number range, the counter is limited to this value.

The inputs and the output can neither be duplicated nor


negated/inverted.

Number range
Integer word (16 bits)
– Low limit: 8001H – 32767
– High limit: 7FFFH + 32767
– Inadmissible value: 8000H –––
In the two’s complement arithmetic, the value 8000H
(–32768) lies outside of the number range and is neither
generated nor processed correctly by the PLC. If this for-
bidden value reaches the PLC
– by bit manipulations of the user or
– by being read from outside the PLC or
– by an indirect word constant
under no circumstances may negation or subtraction be
carried out on this value.
An admissible value is generated again by means of an
allocation (=), addition (+), multiplication (*) or division (:).
On allocation (=), the forbidden value 8000H (–32768) is
corrected to the allowed value 8001H (–32767).

907 PC 331/Issued: 11.98 21–17


VRZ UP / DOWN COUNTER

Example

FBD/LD IL

!BA 0
VRZ VRZ
E 01,00 FREI E 01,04
E 01,01 ZV KW 00,00
E 01,02 ZR E 01,03
KW 00,00 DIFF KW 00,01
E 01,03 S E 01,00
KW 00,01 ZW E 01,01
E 01,04 R Z MW 07,00 E 01,02
MW 07,00

CE FBD Definition

VRZ
FREI
ZV
ZR
DIFF
S
ZW
R Z

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
ZV E L N P Y 0 0
ZR E L N P Y 0 0
DIFF E W N P Y 0 0
S E L N P Y 0 0
ZW E W N P Y 0 0
R E L N P Y 0 0
Z A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 VRZ
00002 PP 0 R Input BINARY (Reset counter = 0)
00003 PP 0 DIFF Input WORT (change per edge)
00004 PP 0 S Input BINARY (set counter = ZW)
00005 PP 0 ZW Input WORT (initial value)
00006 PP 0 FREI Input BINARY (block enable)
00007 PP 0 ZV Input BINARY (counter input, upward)
00008 PP 0 ZR Input BINARY (counter input, downward)
00009 PP 0 Z Output WORD (counter content)

21–18 907 PC 331/Issued: 11.98


UP / DOWN COUNTER, DOUBLE WORD VRZD

This function block serves to count pulses. During count-


ing, the positive edge of the pulse is evaluated in each
case. The counter is capable of counting both up and FBD/LD IL
down and the counting increment can be specified. It is
possible to preset the counter to an intermediate value.
!BA 0
VRZD VRZD
FREI R
ZV DIFF
ZR S
DIFF ZW
S FREI
ZW ZV
R Z ZR
Z

____________________________________________________________________________________________

Parameters
FREI BINARY E, M, A, K, S Enable block processing
ZV BINARY E, M, A, K, S Pulse input, up counting
ZR BINARY E, M, A, K, S Pulse input, down counting
DIFF DOUBLE WORD MD, KD Counter content change per positive edge
(increment)
S BINARY E, M, A, K, S Set counter to an intermediate value
ZW DOUBLE WORD MD, KD Intermediate value
R BINARY E, M, A, K, S Reset counter
Z DOUBLE WORD MD Output for counter content
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 38 ... 113 µs (according to the mode)
Additional runtime: –––
Output updating: yes if FREI = 1
Number of historical values: 3 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description the DIFF input.


This function block serves to count pulses. During count-
ing, the positive edge of the pulse is evaluated in each
case. The counter is capable of counting both up and ZR BINARY
down and the counting increment can be specified. It is
Each positive edge (0–>1 edge) at the input ZR de-
possible to preset the counter to an intermediate value.
creases the current counter content by the increment
FREI BINARY specified at the DIFF input.
Counting is enabled or disabled by means of the FREI in-
put.
The following applies: FREI = 0 –> Counting disabled DIFF DOUBLE WORD
FREI = 1 –> Counting enabled
The increment for the counting operation is specified at
ZV BINARY the DIFF input. The increment is the value by which the
Each positive edge (0–>1 edge) at the input ZV increases counter is changed at the input ZV or ZR with each po-si-
the current counter content by the increment specified at tive edge.

907 PC 331/Issued: 11.98 21–19


VRZD UP / DOWN COUNTER, DOUBLE WORD

S BINARY
By means of a 1 signal at the input S, the counter content
is set to the value specified at the input ZW. Counting is
blocked as long as 1 signal is present at the input S. Set-
ting is also effective when a 1 signal is present at the FREI
input.

ZW DOUBLE WORD
The value to which the counter content is set by a 1 signal
at the input S is specified at the input ZW.

R BINARY
A 1 signal at the input R sets the counter content to the
value 0. The reset input R has the highest priority of all in-
puts.

Z DOUBLE WORD
The current counter content is available at the output Z.

If the counter reaches the positive or negative limit of the


number range, the counter is limited to this value.

The inputs and the output can neither be duplicated nor


negated/inverted.

Number range
Integer double word (32 bits)
– Low limit: 8000 0001H –2 147 483 647
– High limit: 7FFF FFFFH +2 147 483 647
– Inadmissible value: 8000 0000H –––
All blocks for double word arithmetic subject values to be
processed for admissibility. If the inadmissible value oc-
curs, it is corrected to the admissible value 8000 0001H
(–2 147 483 647)

21–20 907 PC 331/Issued: 11.98


VRZD UP / DOWN COUNTER, DOUBLE WORD

Example

FBD/LD IL

!BA 0
VRZD VRZD
E 00,00 FREI K 00,00
M 01,00 ZV MD 00,00
A 02,00 ZR M 00,00
MD 00,00 DIFF KD 01,00
M 00,00 S E 00,00
KD 01,00 ZW M 01,00
K 00,00 R Z MD 02,00 A 02,00
MD 02,00

CE FBD Definition

VRZD
FREI
ZV
ZR
DIFF
S
ZW
R Z

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
ZV E L N P Y 0 0
ZR E L N P Y 0 0
DIFF E D N P Y 0 0
S E L N P Y 0 0
ZW E D N P Y 0 0
R E L N P Y 0 0
Z A D N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 VRZD
00002 PP 0 R Input BINARY (Reset counter = 0)
00003 PP 0 DIFF Input DOUBLE WORD (change/pulse)
00004 PP 0 S Input BINARY (set counter = ZW)
00005 PP 0 ZW Input DOUBLE WORD (initial value)
00006 PP 0 FREI Input BINARY (block enable)
00007 PP 0 ZV Input BINARY (counter input, upward)
00008 PP 0 ZR Input BINARY (counter input, downward)
00009 PP 0 Z Output DOUBLE WORD (counter content)

907 PC 331/Issued: 11.98 21–21


VRZD UP / DOWN COUNTER, DOUBLE WORD

21–22 907 PC 331/Issued: 11.98


VARIABLE DELAY ELEMENT VVZ

A 0–1 edge at the input t I I T is delayed by the time tD


and output through the output Q. A subsequent 1–0 edge
at the input t I I T is delayed by the time TD and output FBD/LD IL
through the output Q.

If the input t I I T changes again to 0 level before the time !BA 0


tD has elapsed, the output Q retains 0 level. VVZ VVZ
t I IT t I I T
Maximum time offset at the output: < 1 cycle time tD tD
TD Q TD
Q

____________________________________________________________________________________________

Parameters
t I IT BINARY E, M, A, S, K Input signal
tD DOUBLE WORD MD, KD Delay time 0–1 edge
TD DOUBLE WORD MD, KD Delay time 1–0 edge
Q BINARY M, A Output signal
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 46 µs, 0–1 edge 566 µs, 1–0 edge 283 µs
Additional runtime: –––
Output updating: yes
Number of historical values: 2 words
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
A 0–1 edge at the input t I I T is delayed by the time tD
and output through the output Q. A subsequent 1–0 edge T
t
at the input t I I T is delayed by the time TD and output
through the output Q.
Q
If the input t I I T changes again to 0 level before the time
tD has elapsed, the output Q retains 0 level. tD TD tD

The time is specified in milliseconds. Only integral multi-


ple of 5 ms are admissible (Examples: 5 ms, 500 ms,
100 000 ms, ...). Time range which can be specified:
5 ms ... 24.8 days.
In case of the indirect constants KD the values of the
delay times are specified in the long text.
Maximum time offset at the output: < 1 cycle time
Meaningful range for tD and TD: > 1 cycle time
The inputs and the output can neither be duplicated nor
inverted.

907 PC 331/Issued: 11.98 22–1


VVZ VARIABLE DELAY ELEMENT

General response Important note


● Started timers are processed by the PLC’s operating The behaviour of the timers has been changed. All run-
system and are therefore completely independent of ning timers are stopped when one of the following actions
processing of the PLC program. An appropriate mes- occurs:
sage of the operating system is not issued to the affilia-
ted timer block in the PLC program until the timer has – Abort PLC program
elapsed. – RUN/STOP switch from RUN –> STOP
● Processing of a timer in the PLC’s operating system is This modification is valid as of:
not influenced by the following commands: 07 KR 91 Index g
– Abort program 07 KT 92 Index g
– Start program 07 KT 93
– Stop program
– Continue program
That is to say, processing of a started timer is continued
in the PLC’s operating system even if the affiliated PLC
program is aborted, restarted or stopped and continued
again.

Initialization
The timers are always initialized each time a cold or warm
start of the PLC is executed. A running timer will always
be aborted by a cold or warm start of the PLC.
Cold start:
– KALT <CR> command
S Activating the voltage for the first time
Warm start:
– WARM <CR> command
– Activating the voltage
– RESET switch

22–2 907 PC 331/Issued: 11.98


VARIABLE DELAY ELEMENT VVZ

Example

FBD/LD IL

!BA 0
VVZ VVZ
E 01,00 t I IT E 01,00
KD 03,00 tD KD 03,00
KD 03,01 TD Q M 07,06 KD 03,01
M 07,06

CE FBD Definition

VVZ
t I IT
tD
TD Q

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

t I IT E L N P Y 0 0
tD E D N P Y 0 0
TD E D N P Y 0 0
Q A L N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 VVZ
00002 PP 0 t I IT Input BINARY (start time)
00003 PP 0 tD Constant DOUBLE WORD (time value)
00004 PP 0 TD Constant DOUBLE WORD (time value)
00005 PP 0 Q Output BINARY (time)

907 PC 331/Issued: 11.98 22–3


WAES WRITE WORD IN THE EVENT OF VALUE CHANGE

If the value of the operand at the input E1 compared to the


value during previous processing of the block changes,
the value of the operand at the input E1 is written to the FBD/LD IL
specified physical address.

!BA 0
WAES WAES
E1 E1
#OFF #OFF
#SEG #SEG

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Input for the operand to be read
#OFF DIRECT #, #H Offset address of the memory location to which the
CONSTANT value of E1 must be written in the event of a change.
#SEG DIRECT #, #H Segment address of the memory location to which the
CONSTANT value of E1 must be written in the event of a change.
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 23 µs, no reading; 33 µs, reading
Additional runtime: –––
Output updating: yes
Number of historical values: 1 word
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description E1 WORD
If the operand at the input E1 changes, its value is written
to the address specified at the inputs #OFF and #SEG.
If the value of the operand at the input E1 compared to the
value during previous processing of the block changes,
the value of the operand at the input E1 is written to the #OFF DIRECT CONSTANT (#, #H)
specified physical address. The offset of the address to be written is specified at the
input #OFF. This is specified as a direct constant.
The physical address consists of a segment and offset.
#SEG DIRECT CONSTANT (#, #H)
The segment of the address to be written is specified at
The inputs can neither be duplicated nor negated. the input #SEG. This is specified as a direct constant.

22–4 907 PC 331/Issued: 11.98


WRITE WORD IN THE EVENT OF VALUE CHANGE WAES

Example

FBD/LD IL

!BA 0
WAES WAES
MW 08,03 MW 08,03
#H ABE0 #OFF #H ABE0
#H 8800 #SEG #H 8800

CE FBD Definition

WAES
E1
#OFF
#SEG

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
#OFF K W N P Y 0 0
#SEG K W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 WAES
00002 PP 0 E1 Input WORD (value)
00003 PP 0 #OFF # CONSTANT (offset address)
00004 PP 0 #SEG # CONSTANT (segment address)

907 PC 331/Issued: 11.98 22–5


WAND AND COMBINATION, WORD

This function block generates, bit by bit, the AND combi-


nation of the operands present at the inputs E1 and E2.
The result is allocated to the operand at the output A1. FBD/LD IL

!BA 0
WAND WAND
E1 E1
E2 A1 E2
A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Operand 1
E2 WORD EW, MW, AW, KW Operand 2
A1 WORD MW, AW Result of the AND combination
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 28 µs 46 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description Example:
This function block generates, bit by bit, the AND combi-
nation of the operands present at the inputs E1 and E2.
The result is allocated to the operand at the output A1. E1 0.0.0.0 0.0.1.1 0.0.1.0 0.1.1.0

The inputs and the output can neither be duplicated nor


inverted/negated.
E2 1.0.0.1 0.0.0.0 0.0.1.0 1.1.1.1

A1 0.0.0.0 0.0.0.0 0.0.1.0 0.1.1.0

22–6 907 PC 331/Issued: 11.98


AND COMBINATION, WORD WAND

Example

FBD/LD IL

!BA 0
WAND WAND
MW 00,00 MW 00,00
KW 00,01 MW 08,00 KW 00,01
MW 08,00

CE FBD Definition

WAND
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
E2 E W N P N 0 0
A1 A W N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 WAND
00002 PP 0 E1 Input WORD
00003 PP 0 E2 Input WORD
00004 PP 0 A1 Output WORD

907 PC 331/Issued: 11.98 22–7


WDEC WORD DECODER

This function block compares the value of the operand at


the input E to the reference values of the operands at the
inputs EC0...ECn–1. The result of the comparison is sig- FBD/LD IL
nalled at the outputs.

!BA 0
WDEC WDEC
E E
#n #n
EC0 E=EC EC
NR E=EC
NR

____________________________________________________________________________________________

Parameters
E WORD EW, AW, MW, KW Input
#n DIRECT #, #H Number of reference values
CONSTANT
EC0 WORD EW, AW, MW, KW Reference value; input can be duplicated
E=EC BINARY A, M Coincidence indication
NR WORD AW, MW Number of the reference value in the event of coincidence
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 22 µs
Additional runtime: 4 µs (max.) per entered reference value
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description E WORD
The operand whose value is to be compared to the refer-
This function block compares the value of the operand at
ence values at the inputs EC0...ECn–1 is specified at the
the input E to the reference values of the operands at the
input E.
inputs EC0...ECn–1. The result of the comparison is sig-
nalled at the outputs.

If the input E agrees with at least 1 of the n reference val- #n DIRECT CONSTANT (#, #H)
ues EC, the output E=EC is set to 1. The number of the
1st reference value EC agreeing with the input E is allo- The number n of planned reference values is specified at
cated to the operand at the output NR. Therefore, the the input #n. This is specified as a direct constant.
number may assume a value from 1 to n.

The outputs E=EC and NR are set to 0 if no agreement


EC0 ... ECn–1 WORD
between the input value E and the reference value EC is
determined. The input EC0 must be duplicated according to the re-
quired number of reference values. The operands for the
The input EC (input code) is capable of duplication. The reference values are specified at the inputs
number of inputs EC must be specified as a direct con- EC0...ECn–1. The value of the operand at the input E is
stant at the input #n. compared to these reference values.

22–8 907 PC 331/Issued: 11.98


WORD DECODER WDEC

E=EC BINARY
Coincidence of the operand value at the input E with one
of the reference values is signalled at the output E=EC.
The following applies: E=EC = 0 –> No coincidence
E=EC = 1 –> Coincidence

NR WORD
The number of the reference value that agrees with the
value of the operand at the input E is signalled at the out-
put NR.

The following applies:

No coincidence –> NR = 0
Coincidence–> NR = n where n > 1

E = EC0 –> NR = 1
E = EC1 –> NR = 2
. . .
. . .
E = ECn–1 –> NR = n

907 PC 331/Issued: 11.98 22–9


WDEC WORD DECODER

Example

FBD/LD IL

!BA 0
WDEC WDEC
MW 08,03 E MW 08,03
#2 #n #2
MW 05,00 EC0 E=EC M 08,13 MW 05,00
MW 05,01 EC1 NR MW 08,13 MW 05,01
M 08,13
MW 08,13

CE FBD Definition

WDEC
E
#n
EC E=EC
NR

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E W N P Y 0 0
#n K W N P Y 0 0
EC E W N P Y 1 0
E=EC A L N P Y 0 0
NR A W N P Y 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 WDEC
00002 PP 0 E Input WORD (input value)
00003 PP 0 #n # CONSTANT (number of ECs)
[ 1
00004 PP 1 EC Input WORD (input code)
] 1
00005 PP 0 E=EC Output BINARY (input value=Ecode)
00006 PP 0 NR Output WORD (number)

22–10 907 PC 331/Issued: 11.98


WORD TO DOUBLE WORD CONVERSION WDW

The value of the word operand at the input E1 is con-


verted to a double word quantity and the result is allocated
to the double word operand at the output A1. FBD/LD IL

!BA
WDW WDW
E1 A1 E1
A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, AW, MW, KW Word quantity to be converted
A1 DOUBLE WORD MD Result of conversion, double word quantity
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 26 µs 51 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 2.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
The value of the word operand at the input E1 is conver-
ted to a double word quantity and the result is allocated to
the double word operand at the output A1.

Value range for E1:


8000 H < E1 < 7FFF H
– 32768 < E1 < 32768

The input and the output can neither be duplicated nor ne-
gated.

907 PC 331/Issued: 11.98 22–11


WDW WORD TO DOUBLE WORD CONVERSION

Example

FBD/LD IL

!BA 0
WDW WDW
EW 00,00 MD 02,00 EW 00,00
MD 02,00

CE FBD Definition

WDW
E1 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
A1 A D N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 WDW
00002 PP 0 E1 Input WORD
00003 PP 0 A1 Output DOUBLE WORD

22–12 907 PC 331/Issued: 11.98


READ WORD WITH ENABLING WOL

When the FREI input has a 1 signal, the value of the spe-
cified physical address is read and is allocated to the op-
erand at the output A1. FBD/LD IL

!BA 0
WOL WOL
FREI FREI
#OFF #OFF
#SEG A1 #SEG
A1

____________________________________________________________________________________________
Parameters
FREI BINARY E, M, A, S, K Enable block
#OFF DIRECT #, #H Offset address of the memory location whose value
CONSTANT must be read
#SEG DIRECT #, #H Segment address of the memory location whose value
CONSTANT must be read
A1 WORD AW, MW Output to which the read value is allocated.
____________________________________________________________________________________________
CE Data Series 90 Series 30, 40, 50
Runtime:
Basic runtime: 20 µs, no reading; 33 µs, reading
146 µs
Additional runtime: ––– 48 µs reading
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 2.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________
Description #OFF DIRECT CONSTANT (#,#H)
When the FREI input has a 1 signal, the value of the spe-
cified physical address is read and is allocated to the op- The offset of the address to be read is specified at the in-
erand at the output A1. put #OFF. This is specified as a direct constant.

No reading and no allocation take place if the input FREI


#SEG DIRECT CONSTANT (#,#H)
has a 0 signal.

The physical address consists of a segment and offset. The segment of the address to be read is specified at the
Thus, the attainable address space is 1 MByte. input #SEG. This is specified as a direct constant.

The inputs and the output can neither be duplicated nor A1 WORD
negated.

The read value is allocated to the operand at the output


FREI BINARY A1.
Processing of the block is enabled or disabled with the op-
erand at the FREI input. The following applies:
FREI = 0 –> Processing disabled
FREI = 1 –> Processing enabled

907 PC 331/Issued: 11.98 22–13


WOL READ WORD WITH ENABLING

Example

FBD/LD IL

!BA 0
WOL WOL
E 01,00 FREI E 01,00
#H E500 #OFF #H E500
#H 2000 #SEG MW 08,03 #H 2000
MW 08,03

CE FBD Definition

WOL
FREI
#OFF
#SEG A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
#OFF K W N P Y 0 0
#SEG K W N P Y 0 0
A1 A W N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 WOL
00002 PP 0 FREI Input BINARY (block enable)
00003 PP 0 #OFF # CONSTANT (offset address)
00004 PP 0 #SEG # CONSTANT (segment address)
00005 PP 0 A1 Output WORD (value)

22–14 907 PC 331/Issued: 11.98


OR COMBINATION, WORD WOR

This function block generates the bit–by–bit OR combina-


tion of the operands present at the inputs E1 and E2. The
result is allocated to the operand at the output A1. FBD/LD IL

!BA 0
WOR WOR
E1 E1
E2 A1 E2
A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Operand 1
E2 WORD EW, MW, AW, KW Operand 2
A1 WORD MW, AW Result of the OR combination
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 29 µs 46 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________
_________

Description Example
This function block generates the bit–by–bit OR combina-
tion of the operands present at the inputs E1 and E2. The
result is allocated to the operand at the output A1. E1 0.0.0.0 0.0.1.1 0.0.1.0 0.1.1.0

The inputs and the output can neither be duplicated nor


negated nor inverted.
E2 1.0.0.1 0.0.0.0 0.0.1.0 1.1.1.1

A1 1.0.0.1 0.0.1.1 0.0.1.0 1.1.1.1

907 PC 331/Issued: 11.98 22–15


WOR OR COMBINATION, WORD

Example

FBD/LD IL

!BA 0
WOR WOR
MW 00,00 MW 00,00
KW 00,01 MW 08,01 KW 00,01
MW 08,01

CE FBD Definition

WOR
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
E2 E W N P N 0 0
A1 A W N P N 0 0

CE IL Definition

00000 !BA 0 Nr Block No. (preset to 0)


00001 WOR
00002 PP 0 E1 Input WORD
00003 PP 0 E2 Input WORD
00004 PP 0 A1 Output WORD

22–16 907 PC 331/Issued: 11.98


WRITE WORD WITH ENABLING WOS

When the input FREI has a 1 signal, the value of the oper-
and at the input E1 is read and is then written to the speci-
fied physical address. FBD/LD IL

!BA 0
WOS WOS
FREI FREI
E1 E1
#OFF #OFF
#SEG #SEG

____________________________________________________________________________________________
Parameters
FREI BINARY E, M, A, S, K Enable block
E1 WORD EW, MW, AW, KW Input for the operand to be written
#OFF DIRECT #, #H Offset address of the memory location to which the
CONSTANT value of E1 must be written
#SEG DIRECT #, #H Segment address of the memory location to which the
CONSTANT value of E1 must be written
____________________________________________________________________________________________
CE Data
Runtime:
Basic runtime: 25 µs, no writing; 39 µs, writing
Additional runtime: –––
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________
Description E1 WORD
When the input FREI has a 1 signal, the value of the oper- The operand at the input E1 is read and its value is written
and at the input E1 is read and is then written to the speci- to the address defined by the inputs #OFF and #SEG.
fied physical address.
#OFF DIRECT CONSTANT (#,#H)
The block is not processed if there is a 0 signal at the FREI The offset of the address to be written is specified at the
input. input #OFF. This is specified as a direct constant.

The physical address consists of a segment and offset.


Thus, the attainable address area is 1 MByte. #SEG DIRECT CONSTANT (#,#H)
The segment of the address to be written is specified at
The inputs can neither be duplicated nor negated. the input #SEG. This is specified as a direct constant.

FREI BINARY
Processing of the block is enabled or disabled with the
operand at the input FREI.
The following applies:
FREI = 0 –> Processing disabled
FREI = 1 –> Processing enabled

907 PC 331/Issued: 11.98 22–17


WOS WRITE WORD WITH ENABLING

Example

FBD/LD IL

!BA 0
WOS WOS
E 01,00 FREI E 01,00
MW 08,03 MW 08,03
#H FFF0 #OFF #H FFF0
#H 2000 #SEG #H 2000

CE FBD Definition

WOS
FREI
E1
#OFF
#SEG

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

FREI E L N P Y 0 0
E1 E W N P N 0 0
#OFF K W N P Y 0 0
#SEG K W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 WOS
00002 PP 0 FREI Input BINARY (block enable)
00003 PP 0 E1 Input WORD (value)
00004 PP 0 #OFF # CONSTANT (offset address)
00005 PP 0 #SEG # CONSTANT (segment address)

22–18 907 PC 331/Issued: 11.98


WRITE BINARY VALUES INTO
HISTORICAL VALUES MEMORY WRB

This function block stores the values of the operands at


the input BI0...BIn–1 in the historical values memory. The
affiliated function block RDB reads these values out of the FBD/LD IL
historical values memory again. The function blocks
WRB and RDB always occur in pairs.
!BA 0
WRB WRB
#n #0
BI0 #n
BI0

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of inputs BI0 ... BIn–1
CONSTANT
BI0 BINARY A, M Input for the binary values to be written, capable of
duplication (BI0 ... BIn–1)
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: see RDB block
Additional runtime: –––
Output updating: not applicable
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description
This function block stores the values of the operands at values of the binary inputs in the historical values memory
the input BI0...BIn–1 in the historical values memory. The of the affiliated RDB block. The number of binary inputs is
affiliated function block RDB reads these values out of the specified as a direct constant at the input #n. This quantity
historical values memory again. The function blocks must agree with the quantity of outputs belonging to the
WRB and RDB always occur in pairs. affiliated RDB block. At the intended input, the editing pro-
gram “PA” enters the pointer to the historical values
To be able to use ready–made program parts several memory of the affiliated RDB block in the instruction list of
times in one user program (e. g. 907 PC 31/32 connection the WRB block.
elements), it may be necessary to work with local vari-
ables within this part of the program. These local vari-
ables lose their validity outside of this program part. At the #0 DIRECT CONSTANT
end of the program part, the values of these local vari-
ables are stored in the historical values memory of the af- This input does not exist in FBD/LD. In the instruction list,
filiated RDB block by the WRB block and are allocated to the value 0 is specified as a direct constant at this point.
the local variables at the start of the program part by the The PLC then enters the pointer to the historical values of
RDB block. For this purpose, the WRB block stores the the affiliated RDB block at this point.

907 PC 331/Issued: 11.98 23–1


WRITE BINARY VALUES INTO
WRB HISTORICAL VALUES MEMORY

#n DIRECT CONSTANT BI0...BIn–1 BINARY

The number of inputs BI0...BIn–1 is specified at the input The input BI0 is capable of duplication (BI0...BIn–1). The
#n. This is specified as a direct constant. values of the operands specified at the inputs BI0...BIn–1
Note: are written into the historical values memory of the affili-
ated RDB block.
The value specified at the input #n must also agree with
the number of outputs belonging to the affiliated RDB
block.
____________________________________________________________________________________________

Example

FBD/LD IL

!BA 0
RDB RDB
#3 #n BI0 M 03,00 #3
BI1 M 03,01 M 03,00
BI2 M 03,02 M 03,01
M 03,02

The program part, which is used multiply and in


which the variables M 03.00 ... M 03,02 are
needed in the next cycle, is located here. For this
purpose, the values are written into the historical
values memory by means of the WRB block and
are read out again in the next cycle by means of
the RDB block.

!BA 0
WRB WRB
#3 #n #0
M 03,00 BI0 #3
M 03,01 BI1 M 03,00
M 03,02 BI2 M 03,01
M 03,02

23–2 907 PC 331/Issued: 11.98


WRITE BINARY VALUES INTO
HISTORICAL VALUES MEMORY WRB

CE FBD Definition

WRB
#n
BI

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
BI E L N P Y 1 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 WRB
00002 # 0
00003 PP 0 #n DIRECT CONSTANT (number of bits)
[ 1
00004 PP 1 BI Input BINARY
] 1

907 PC 331/Issued: 11.98 23–3


WRITE DOUBLE WORD VALUES INTO
WRDW HISTORICAL VALUES MEMORY

This function block stores the values of the operands at


the inputs DW0...DWn–1 in the historical values memory.
The affiliated function block RDDW reads these values FBD/LD IL
out of the historical values memory again. The WRDW
and RDDW function blocks always occur in pairs.
!BA 0
WRDW WRDW
#n #0
DW0 #n
DW0

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of inputs DW0 ... DWn–1
CONSTANT
DW0 DOUBLE WORD MD Input for the double word values to be written
capable of duplication (DW0 ... DWn–1)
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: see RDDW block
Additional runtime: –––
Output updating: not applicable
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description the WRDW block stores the values of the double word in-
puts in the historical values memory of the affiliated
This function block stores the values of the operands at RDDW block. The number of double word inputs is speci-
the inputs DW0...DWn–1 in the historical values memory. fied as a direct constant at the input #n. This quantity must
The affiliated function block RDDW reads these values agree with the number of outputs belonging to the affili-
out of the historical values memory again. The WRDW ated RDDW block. The editing program “PA” enters the
and RDDW function blocks always occur in pairs. pointer to the historical values memory of the affiliated
To be able to use ready–made program parts multiply in a RDDW block at the input provided for this purpose in the
user program (e.g. 907 PC 31/32 connection elements), it instruction list of the WRDW block.
may be necessary to work with local variables within this
part of the program. These local variables lose their validi- #0 DIRECT CONSTANT
ty outside of this program part. At the end of the program
part, the WRDW block stores the values of these local This input does not exist in FBD/LD. In the instruction list,
variables in the historical values memory of the affiliated the value 0 is specified here as a direct constant. At this
RDDW block and the RDDW block allocates them to the point, the PLC then enters the pointer to the historical val-
local variables at the start of the program part. To do this, ues of the affiliated RDDW block.

23–4 907 PC 331/Issued: 11.98


WRITE DOUBLE WORD VALUES INTO
HISTORICAL VALUES MEMORY WRDW

#n DIRECT CONSTANT DW0...DWn–1 DOUBLE WORD


The number of inputs DW0...DWn–1 is specified at the in- The input DW0 is capable of duplication (DW0...DWn–1).
put #n. This is specified as a direct constant. The values of the operands specified at the inputs
DW0...DWn–1 are written into the historical values
Note: memory of the affiliated RDDW block.
The value specified at the input #n must also agree with
the number of outputs of the affiliated RDDW block.

907 PC 331/Issued: 11.98 23–5


WRITE DOUBLE WORD VALUES INTO
WRDW HISTORICAL VALUES MEMORY

Example

FBD/LD IL

!BA 0
RDDW RDDW
#3 #n DW0 MD 03,00 # 3
DW1 MD 03,01 MD 03,00
DW2 MD 03,02 MD 03,01
MD 03,02

The program part, which is used multiply and in


which the variables MD 03,00 ... MD 03,02 are
needed in the next cycle again, is located here.
For this purpose, the WRDW block writes the
values into the historical values memory and the
RDDW block reads them out again in the next
cycle.

!BA 0
WRDW WRDW
#3 #n # 0
MD 00,00 DW0 # 3
MD 00,01 DW1 MD 00,00
MD 00,02 DW2 MD 00,01
MD 00,02

23–6 907 PC 331/Issued: 11.98


WRITE DOUBLE WORD VALUES INTO
HISTORICAL VALUES MEMORY WRDW

CE FBD Definition

WRDW
#n
DW

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
DW E D N P Y 1 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 WRDW
00002 #0
00003 PP 0 #n # CONSTANT (number of double words)
[ 1
00004 PP 1 DW Input DOUBLE WORD
] 1

907 PC 331/Issued: 11.98 23–7


WRITE WORD VALUES TO HISTORICAL
WRW VALUES MEMORY

This function block stores the values of the operands at


the inputs WO0...WOn–1 in the historical values memory.
The affiliated function block RDW reads these values out FBD/LD IL
of the historical values memory again. The function
blocks WRW and RDW always occur in pairs.
!BA 0
WRW WRW
#n #0
WO0 #n
WO0

____________________________________________________________________________________________

Parameters
#n DIRECT #, #H Number of inputs WO0 ... WOn–1
CONSTANT
WO0 WORD AW, MW Input for the word values to be written, capable
of duplication (WO0 ... WOn–1)
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: see RDW block
Additional runtime: –––
Output updating: not applicable
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description stores the values of these local variables at the end of the
program part in the historical values memory of the affili-
This function block stores the values of the operands at ated RDW block and the RDW block allocates them to the
the inputs WO0...WOn–1 in the historical values memory. local variables at the start of the program part. To do this,
The affiliated function block RDW reads these values out the WRW block stores the values of the word inputs
of the historical values memory again. The function WO0...WOn–1 in the historical values memory of the affil-
blocks WRW and RDW always occur in pairs. iated RDW block. The number of word inputs is specified
as a direct constant at the input #n. This number must
To be able to use ready–made program parts multiply in a agree with the number of outputs belonging to the affili-
user program (e.g. 907 PC 31/32 connection elements), it ated RDW block. At the intended input in the instruction
may be necessary to work with local variables within the list of the WRW block, the editing program “PA” enters the
program part. These local variables lose their validity out- pointer to the historical values memory of the affiliated
side of the program part concerned. The WRW block RDW block.

23–8 907 PC 331/Issued: 11.98


WRITE WORD VALUES TO HISTORICAL
VALUES MEMORY WRW

#0 DIRECT CONSTANT WO0 ... WOn–1 BINARY


This input does not exist in FBD/LD. In the instruction list, The input WO0 can be duplicated (WO0...WOn–1). The
the value 0 must be specified here as a direct constant. values of the operands specified at the inputs
The PLC then enters the pointer to the historical values of WO0...WOn–1 are written into the historical values
the affiliated RDW block at this point. memory of the affiliated RDW block.

#n DIRECT CONSTANT
The number of the inputs WO0...WOn–1 is specified at
the input #n. This is specified as a direct constant.

Note:
The value specified at the input #n must also agree with
the number of the outputs belonging to the affiliated block
RDW.
____________________________________________________________________________________________

Example

FBD/LD IL

!BA 0
RDW RDW
#3 #n WO0 MW 03,00 #3
WO1 MW 03,01 MW 03,00
WO2 MW 03,02 MW 03,01
MW 03,02

The program part which is used multiply and in which


the variables MW 03,00 ... MW 03,02 are used in the
next cycle is located here. For that the values are
written into the historical values memory by the WRW
block and are being read out by the RDW block in the
next cycle.

!BA 0
WRW WRW
#3 #n # 0
MW 03,00 WO0 # 3
MW 03,01 WO1 MW 03,00
MW 03,02 WO2 MW 03,01
MW 03,02

907 PC 331/Issued: 11.98 23–9


WRITE WORD VALUES TO HISTORICAL
WRW VALUES MEMORY

CE FBD Definition

WRW
#n
WO

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

#n K W N P Y 0 0
WO E W N P Y 1 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 WRW
00002 #0
00003 PP 0 #n #CONSTANT (number of words)
[ 1
00004 PP 1 WO Input WORD
] 1

23–10 907 PC 331/Issued: 11.98


WORD RECODER WUMC

This function block compares the value of the operand at


the input E to the reference values of the operands at the
inputs EC0...ECn–1. If the input E agrees with at least FBD/LD IL
one of the reference values EC, the output E=EC is set to
1. The output A receives the value of the output code AC,
which is allocated to the reference value EC found. !BA 0
WUMC WUMC
E E
#2*n #2*n
EC0 E=EC EC
AC0 A AC
E=EC
A

____________________________________________________________________________________________

Parameters
E WORD EW, AW, MW, KW Input
#2*n DIRECT #, #H Quantity n of reference values (multiplied by 2)
CONSTANT
EC0 WORD EW, AW, MW, KW Reference value; input can be duplicated
AC0 WORD EW, AW, MW, KW Output code; input can be duplicated
E=EC BINARY A, M Coincidence indication
A WORD AW, MW Output of the output code’s value
____________________________________________________________________________________________

CE Data
Runtime:
Basic runtime: 40.0 µs
Additional runtime: 7.5 µs per entered comparison value
Output updating: yes
Number of historical values: none
Available as of: ABB Procontic CS31 / 907 PC 331
____________________________________________________________________________________________

Description E WORD
This function block compares the value of the operand at The operand whose value is to be compared to the values
the input E to the reference values of the operands at the of the n reference values (EC0...ECn–1) is specified at
inputs EC0...ECn–1. If the input E agrees with at least the input E.
one of the reference values EC, the output E=EC is set to #2*n DIRECT CONSTANT (#, #H)
1. The output A receives the value of the output code AC,
which is allocated to the reference value EC found. The total number (2*n) of the reference values
(EC0...ECn–1) and output codes (AC0...ACn–1) is speci-
Each reference value at the inputs ECi is assigned an op- fied at the input #2*n. This is specified as an indirect con-
erand for the output code ACi. The affiliation of EC to AC stant.
is recognizable by the index i. The index begins with 0 and
is generated automatically in the event of duplication. EC0 ... ECn–1 WORD
The input EC0 must be duplicated according to the re-
The number of inputs EC and AC must be specified as a quired number of reference values. The operands for the
direct constant at the input #2*n. reference values are specified at the inputs
EC0...ECn–1. The value of the operand at the input E1 is
The inputs and outputs cannot be negated/inverted. compared to the reference values.

907 PC 331/Issued: 11.98 23–11


WUMC WORD RECODER

AC0 ... ACn–1 WORD


By duplication of the input EC0, the input AC0 is automati-
cally also duplicated.

The output codes are specified at the inputs


AC0...ACn–1. The output code ACi is output through the
output A if the input E agrees with one of the reference
values ECi.

Affiliations between the reference values and output co-


des:
EC0 <–> AC0
EC1 <–> AC1
. .
. .
ECn–1 <–> ACn–1

E=EC BINARY
Agreement between the operand value of the input E and
one of the reference values is signalled at the output
E=EC.
The following applies: E=EC = 0 –> No coincidence
E=EC = 1 –> Coincidence

A WORD
The output code ACi is output through the output A if the
input E agrees with one of the reference values ECi.
The following applies: A=0 –> No coincidence
A = ACi –> Coincidence

23–12 907 PC 331/Issued: 11.98


WUMC WORD RECODER

Example

FBD/LD IL

!BA 0
WUMC WUMC
MW 08,03 E MW 08,03
#4 #2*n #4
MW 05,00 EC0 E=EC M 08,14 MW 05,00
MW 05,01 EC1 A MW 08,14 MW 05,01
MW 05,02 AC0 MW 05,02
MW 05,03 AC1 MW 05,03
M 08,14
MW 08,14

CE FBD Definition

WUMC
E
#2*n
EC E=EC
AC A

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E E W N P Y 0 0
#2*n K W N P Y 0 0
EC E W N P Y 1 0
AC E W N P Y 1 0
E=EC A L N P Y 0 0
A A W N P Y 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 WUMC
00002 PP 0 E Input WORD (input value)
00003 PP 0 #2*n # CONSTANT (number of EC and AC)
[ 1
00004 PP 1 EC Input WORD (reference value)
] 1
[ 1
00005 PP 1 AC Input WORD (output code)
] 1
00006 PP 0 E=EC Output BINARY (input value=Ecode)
00007 PP 0 A Output WORD (output value)

907 PC 331/Issued: 11.98 23–13


WWDW CONVERTER 2 WORDS TO DOUBLE WORD

The function block packs 2 16 bit words into one 32 bit


double word.
FBD/LD

WWDW
E1
E2 A

Parameters
E1 WORD EW, MW Input E1 becomes the low word of output A
E2 WORD EW, MW Input E2 becomes the high word of output A
A DOUBLE WORD MD Double word output

CE data
Output updating: yes
Number of historical values: none

Available as of: 07 KR 91 R2 Index c, 07 KT 92 R2 Index c,


07 KT 93 R2 Index f, 07 KT 94

Description E1 WORD
The function block packs 2 16 bit words into one 32 bit The value of E1 becomes the low word (bit 0 to bit 15) of
double word. The value of E1 becomes the low word of output A.
output A and the value of E2 becomes the high word of
output A (double word). E2 WORD
The value of E2 becomes the high word (bit 16 to bit 31) of
output A.

A DOUBLE WORD
Generated double word from E1 and E2
Graphic

Plaus group Dty Inv Disp Mode No. No. Mode Disp Inv Dty Plaus group

WWDW

WORD_IN Y N Y 0 00 E1
WORD_IN Y N Y 0 00 E2 A 00 0 Y N Y DWORT_OUT

Source
SN ZN Command / Variable Symbol Long text

00000 00000 WWDW


00001 PP 00 E1
00002 PP 00 E2
00003 PP 00 A
00004

7 23-14 907 PC 331 / Issued: 08.99


EXCLUSIVE OR COMBINATION, WORD WXOR

This function block generates the bit–by–bit XOR combi-


nation of the operands present at the inputs E1 and E2.
The result is allocated to the operand at the output A1. FBD/LD IL

!BA 0
WXOR WXOR
E1 E1
E2 A1 E2
A1

____________________________________________________________________________________________

Parameters
E1 WORD EW, MW, AW, KW Operand 1
E2 WORD EW, MW, AW, KW Operand 2
A1 WORD MW, AW Result of the XOR combination
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 28 µs 46 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values: none none
Available as of: ABB Procontic CS31 / 907 PC 331
907 PC 331 / 07 KR 31 V 1.0
07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description Example
This function block generates the bit–by–bit XOR combi-
nation of the operands present at the inputs E1 and E2.
The result is allocated to the operand at the output A1. E1 0.0.0.0 0.0.1.1 0.0.1.0 0.1.1.0

The inputs and the output can neither be duplicated nor


negated nor inverted.
E2 1.0.0.1 0.0.0.0 0.0.1.0 1.1.1.1

A1 1.0.0.1 0.0.1.1 0.0.0.0 1.0.0.1

907 PC 331/Issued: 11.98 23–15


WXOR EXCLUSIVE OR COMBINATION, WORD

Example

FBD/LD IL

!BA 0
WXOR WXOR
MW 00,00 MW 00,00
KW 00,01 MW 08,02 KW 00,01
MW 08,02

CE FBD Definition

WXOR
E1
E2 A1

Param. Param. Param. Inv. Occupation Displ. Param. Dupli.


Group Type Screen Block Type

E1 E W N P N 0 0
E2 E W N P N 0 0
A1 A W N P N 0 0

CE IL Definition
00000 !BA 0 Nr Block No. (preset to 0)
00001 WXOR
00002 PP 0 E1 Input WORD
00003 PP 0 E2 Input WORD
00004 PP 0 A1 Output WORD

23–16 907 PC 331/Issued: 11.98


ALLOCATION DIRECT CONSTANT TO WORD VARIABLE ZUDKW

The function block serves to allocate a numerical value to


a word variable. The numerical value is specified as a di-
rect constant. FBD/LD IL

!BA 0
ZUDKW ZUDKW
#
# V V

____________________________________________________________________________________________

Parameters
# DIRECT #, #H Numerical value which is to be allocated to the word
KONSTANT variable at output V
V WORD EW, MW, AW Word variable to which the numerical value of input # is
to be allocated
____________________________________________________________________________________________

CE Data Series 90 Series 30, 40, 50


Runtime:
Basic runtime: 10 µs 20 µs
Additional runtime: ––– –––
Output updating: yes yes
Number of historical values:none none
Available as of: ABB Procontic CS31 / 07 KR 31 V 1.0
Comm. module 07 KP 62 07 CR 41, 07 CT 41, 07 KR 51, 07 KT 51
____________________________________________________________________________________________

Description
The function block serves to allocate a numerical value to
a word variable. The numerical value is specified as a di-
rect constant.

# DIRECT CONSTANT (#, #H)


This numerical value is allocated to the word variable at
output V.

V WORD
Word variable to which the numerical value of input # is
allocated.

907 PC 331/Issued: 11.98 23–17


ZUDKW ALLOCATION DIRECT CONSTANT TO WORD VARIABLE

Example

FBD/LD IL

!BA 0
ZUDKW ZUDKW
# 1234
#1234 # V MW 00,01 MW 00,01

23–18 907 PC 331/Issued: 11.98


Printed on chlorine-free bleached paper

ABB Schalt- und Steuerungstechnik GmbH


Eppelheimer Straße 82 Postfach 10 50 09
D-69123 Heidelberg D-69040 Heidelberg

Telephone +49 6221 777-0


Telefax +49 6221 777-111
E-Mail desst.helpline@de.abb.com
Internet http://www.abb-sst.de Printed in the Federal Republic of Germany (08.99)

You might also like