Download as pdf or txt
Download as pdf or txt
You are on page 1of 181

SINUMERIK 840C

Software Versions 1, 2, 3, 4, 5 and 6


135 WB2/WD PLC Function Blocks
Package 0: Basic Functions
Planning Guide 01.99 Edition

Manufacturer Documentation
SINUMERIK 840C
Software Versions 1, 2, 3, 4, 5 and 6
135 WB2/WD PLC Function Blocks
Package 0: Basic Functions

Planning Guide

Manufacturer Documentation

Applies to:

Control Software versions

SINUMERIK 840C/CE
(Standard/Export Version) 1, 2, 3, 4, 5 and 6

01.99 Edition
SINUMERIK® documentation

Printing history

Brief details of this edition and previous editions are listed below.
The status of each edition is shown by the code in the "Remarks" column.
Status code in ”Remarks” column:

A . . . New documentation
B . . . Unrevised reprint with new Order No.
C . . . Revised edition with new status.
If factual changes have been made on a page since the last edition, this is
indicated by a new edition coding in the header on that page.

Edition Order No. Remarks


06.93 6FC5197-2AA30-0BP0 A
12.93 6FC5197-3AA30-0BP0 C
10.94 6FC5197-4AA30-0BP0 C
09.95 6FC5197-5AA30-0BP0 C
04.96 6FC5 197-5AA30-0BP1 C
07.97 6FC5 197-6AA30-0BP0 C
01.99 6FC5 197-6AA30-0BP1 C

This manual is included in the documentation on CD-ROM (DOCONCD)


Edition Order No. Remarks
01.99 6FC5198-6CA00-0BG1 C

Other functions not described in this documentation might be


executable in the control. This does not, however, represent an
For more information, refer to the Internet: obligation to supply such functions with a new control or when
http://www.a&d.siemens.de/sinumerik servicing.

The publication was produced on the Siemens 5800 0ffice System. We have checked that the contents of this publication agree with
the hardware and software described herein. The information given
The reproduction, transmission or use of this document or its in this publication is reviewed at regular intervals and any
contents is not permitted without express written authority. corrections that might be necessary are made in the subsequent
Offenders will be liable for damages. All rights, including created by printings. Suggestions for improvement are welcome at all times.
patent grant or registration of a utility model or design, are reserved,
Subject to change without prior notice.
© Siemens AG 1993, 1994, 1995, 1996, 1997, 1998, 1999
All Rights Reserved

Order No. 6FC5197-6AA30-0BP1 Siemens-Aktiengesellschaft


Printed in the Federal Republic of Germany
Definitions 1

Data Sheets for Digital Functions 2

Data Sheets 3
for Scanning/Displaying Messages

Data Sheets for Sequencer Blocks 4

Block Data 5

Appendix 6
Preliminary Remarks

Notes for the reader

This documentation is intended for manufacturers of machine tools using SINUMERIK 840C.
The publication explains the application of the complete Software Package 0, Basic Functions,
which the machine tool manufacturer can incorporate in his PLC program.
The SINUMERIK documentation is organized in 4 levels:

• General documentation
• User documentation
• Manufacturer documentation
• Service documentation

The Manufacturer Documentation for the SINUMERIK 840C control is divided into the
following parts:

• Interface Description
Part 1: Signals
Part 2: Connection Conditions
• 135 WB/WB2/WD PLC Planning Guide
• Function Macros
• Function Blocks
Paket 0: Basic Functions
Paket 1/2: Tool Management
Paket 4/5: Computer Link
Paket 7: Code Carriers
Paket 8: PLC Controlled Data Input/Output

In addition, there are SINUMERIK publications applying to all SINUMERIK controls


(e.g. Measuring Cycles, Cycles Language CL 800).
Please contact your Siemens regional office for further details.
Technical Comments

The diskette for package 0 contains package versions 16, 20, 21 and 22. Depending on the
SINUMERIK 840C software version being used, one of the following package 0 versions must
be used.

SW Package 0 version File

1 and 2 16 P00416ST.S5D
3 20 P00420ST.S5D
4 21 P00421ST.S5D
5 22 P00422ST.S5D
6 23
a
a
a
aaaaaaaaaaaaaaaaaa a

a
a
a
aaaaa a
a
a
a
a

a
a
a
a
a
a
a
a

a
a
a
a
a
a
a
a

a
a
a
a
aaaaaaaaa a
a
a
a
a

a
a
a
a
aa
aaaaaaaaaa
a
a
a
a
a

a
a
a
a
aaaa
a
a
a
a
a

a
a
a
a
a
a
a
a
a

a
a
a
a
aaaaaa
aa
a
a
a
a

a
a
a
a
This documentation is valid for software versions 1, 2, 3, 4, 5 and 6.
a
a
a
a

a
a
a
a
a
a
a
a
a

a
a
a
a
aa
a
a
a
a
a

a
a
a
a
aaaa
a
a
a
a
a

a
a
a
a
a
a
a
a
a
a

a
a
a
aaaaa a
a
a
a
a

a
a
a
a
a
a
a
a

a
a
a
a
a
a
a
a

a
a
a
a
a
a
a
a

a
a
a
a
Contents

Page

1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1

1.1 Explanations of FB designations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1


1.2 Overview of PLC interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
1.2.1 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
1.2.2 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
1.2.3 Flags, data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–3
1.3 Data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–4
1.3.1 Class DB data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–4
1.3.2 Class DX data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–6
1.4 Function blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–7
1.4.1 Class FB function blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–7
1.4.2 Class FX function blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–11

2 Data Sheets for Digital Functions ........................... 2–1

FB 30 MUL:16 Multiplier:16 . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1


FB 32 DIV:16 16-bit binary divider . . . . . . . . . . . . . . . . . . . . . 2–3
FB 33 DIV:32 Divider:32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–5
FB 35 DIV/100 Divide by 100 . . . . . . . . . . . . . . . . . . . . . . . . . 2–8
FB 36 ADD:32 Adder:32 bits . . . . . . . . . . . . . . . . . . . . . . . . . . 2–10
FB 37 SUB:32 Subtracter: 32 bits . . . . . . . . . . . . . . . . . . . . . . 2–12
FB 39 DUAL/BCD 3-decade binary/BCD converter . . . . . . . . . . . . . 2–14
FB 40 COD:16 Binary/BCD converter . . . . . . . . . . . . . . . . . . . . 2–16
FB 41 COD:32 Binary/BCD converter . . . . . . . . . . . . . . . . . . . . 2–18
FB 42 COD:B4 BCD/binary converter . . . . . . . . . . . . . . . . . . . . 2–20
FB 43 COD:B8 BCD/binary converter . . . . . . . . . . . . . . . . . . . . 2–22
FB 110 SUCH Search for word . . . . . . . . . . . . . . . . . . . . . . . . 2–24
FX 31 GRAYDUAL Gray code/binary converter . . . . . . . . . . . . . . . . 2–28
FX 32 DUALGRAY Binary/Gray code converter . . . . . . . . . . . . . . . 2–30
FX 35 RESREQ Triggering link bus reset . . . . . . . . . . . . . . . . . . 2–31
FX 38 PRO-KO1 Program coordination . . . . . . . . . . . . . . . . . . . . 2–32
FX 81 IKONEN Icon display . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–34
FX 82 STERNDRE Star-delta switchover . . . . . . . . . . . . . . . . . . . . 2–36

3 Data Sheets for Scanning/Displaying Messages ................ 3–1

3.1 Error and operational messages (840C SW 1 and 2) . . . . . . . . . . . . . . . . 3–1


3.1.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1
3.1.2 Program overview for error messages, operational messages and
message groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–2
3.1.3 Block calls for EMs/OMs/MGs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–6
FB 54, FB 57 Scan and display error messages . . . . . . . . . . . . . . . . . . . 3–7
FB 55, FB 58 Scan and display operational messages . . . . . . . . . . . . . . 3–8
FB 56, FB 59 Scan and display message groups
(SW1 and SW2 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–9
3.2 Error and operational messages (840C SW 3 and higher) ............ 3–10
3.2.1 General ............................................. 3–10
3.2.2 Program overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–11
3.2.3 Block calls for EMs/OMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–12
3.2.4 Data sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–13
FB 45 ANLAUF Initial settings for error messages and operational
messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–13
FB 57 FM-ABFR Scan error messages . . . . . . . . . . . . . . . . . . . . 3–14
FB 58 BM-ABFR Scan operational messages . . . . . . . . . . . . . . . 3–15

4 Data Sheets for Sequencer Blocks .......................... 4–1

4.1 Programming of sequencers (FB 91, FB 92) . . . . . . . . . . . . . . . . . . . . . 4–1


4.1.1 General notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–1
4.1.1.1 Sequencers with OR branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–6
4.1.1.2 Sequencer with AND branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–9
4.1.1.3 Sequencer modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–11
4.1.1.4 Step display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–14
4.1.1.5 Status words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–15
4.1.1.6 Behaviour when execution is aborted . . . . . . . . . . . . . . . . . . . . . . . . . . 4–16
4.1.2 Data sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–17
FB 91 AK 2:V/R Sequencer forwards/backwards . . . . . . . . . . . . . 4–17
FB 92 AK 3:AUT Sequencer automatic . . . . . . . . . . . . . . . . . . . . 4–23
4.1.3 Programming examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–27
4.1.3.1 Programming example for a driver control with FB 92 (AK 3:AUT) . . . . . . 4–27
4.1.3.2 Programming example for a tool change with FB 91 (AK 2: V/R) . . . . . . . 4–30
4.2 General notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–30
4.2.1 What is GRAPH 5? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–32
4.2.2 The elements of GRAPH 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–35
4.2.3 Program structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–39
4.3 Data sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–41
FB 93 ALS:V/R GRAPH 5 sequencer forwards/backwards . . . . . . 4–41
FB 94 ALS:AUT GRAPH 5 automatic sequencer . . . . . . . . . . . . . 4–49
4.4 Program examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–54
4.4.1 Program example for a drive control sequencer with
GRAPH 5 block FB94 (ALS:AUT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–54
4.4.2 Program example of a tool change with GRAPH 5 block FB 93 (ALS: V/R) 4–57
4.5 Function block FB 27 (SW 6.1 and higher) . . . . . . . . . . . . . . . . . . . . . . 4–59

5 Block Data ............................................ 5–1

6 Appendix ............................................. 6–1

6.1 Appendix 1 ............................................ 6–1


6.2 Appendix 2 ............................................ 6–23
06.93 1 Definitions

1 Definitions

1.1 Explanations of FB designations

FB call Parameter Type of parameter Allowed actual operand

I Input IB Operand with I n.m Input


FB name Q Output bit address Q n.m Output
F n.m Flag

BY Operand with IB n Input byte


I,.. Q,... byte address QB n Output byte
FB n Flag byte
I,BI - Q Q - Q,BI DL n Data byte left
DR n Data byte right
I,BI - I I- Q,BI PB n I/O byte

D,.. W Operand with IW n Input word


word address QW n Output word
BO FW n Flag word
DW n Data word
T PW n I/O word

BO Block Not applicable DB n Data block


C
FB n Function block
PB n Program block
$F... $F... SB n Sequence block

$DW... $DW... T Timer Not applicable T n No. of timer

C Counter Not applicable C n No. of counter


*F... *F...
D Data KM Binary pattern, 16 positions
*DW.. *DW... KY Two absolute values from 0 to 255
KH Hexadecimal number, max. of 4 positions
.
KS Two alphanumeric characters
-%1 KT Time (1.0 to 999.3)
KC Count (0 to 999)
- %v1 KF Fixed-point number (-32768 to +32767)

I,BI Input signal, statically effective


I,BI -Q Input signal which is acknowledged by the FB
I,BI -/ Input signal whose leading edge is evaluated

I,.. No DW allowed as parameter


$... Input signal which must be applied before the FB call

*... Defined input signal which need not be applied,


e.g. NC signal
Q,BI Output signal, statically effective
Q- Q,BI Output signal which must be acknowledged by the
user
I- Q,BI Output signal for one cycle (pulse)
$... Output signal on defined flag or data word which
can be evaluated immediately after the FB

*... Defined output signal, e.g. NC signal


%1 Error number ACCU2 for system stop (STS); ACCU1
FB number
%v1 Additional specification of interface byte number
in high byte ACCU2

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 1–1


SINUMERIK 840C (PJ)
1 Definitions 06.93
1.2 Overview of PLC interface

1.2 Overview of PLC interface


1.2.1 Inputs

Inputs

Byte Bit No.


No.
7 6 5 4 3 2 1 0
0
Physical interface with process image
(Input modules, DMP submodules, machine control panel)
127

128
Physical interface without process image
(Input modules, DMP submodules)
255

1.2.2 Outputs

Outputs

Byte Bit No.


No.
7 6 5 4 3 2 1 0
0
Physical interface with process image
(Output modules, DMP submodules, machine control panel)
127

128
Physical interface without process image
(Output modules, DMP submodules)
255

1–2 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
06.93 1 Definitions
1.2.3 Flags, data formats

1.2.3 Flags, data formats

FY 0 Basic signals
.
24
25 e.g. auxiliary flags or
. dynamically assignable by
. interface signals
. e.g. interface Channel 1
. Channel 2
. etc.
99
100 User assignable
.
.
.
.
.
199
200 Reserved for function
. blocks (see note)
224
. Area saved on change of level
. and warm restart
.
255

Notes:
1. To simplify programming, the interface signals from data blocks can be copied into flag
area FY 25 - 99 using function macros FB 70, FB 71.
Function macros are function blocks programmed in Assembler and integrated in the PLC
operating system.
2. Flag area FY 224 - 255 is saved by the basic program integrated in the system software
on a level change and on a warm restart. The flag area is reloaded when the relevant
program has ended.
This flag area can also be used to store intermediate results.
Flag area FY 200 - 223 is used in part by function blocks (see FB Package Description). If
the user does not require these function blocks, these flags can be used in the same
manner as those in flag area FY 25 - 199.

Caution:
Flag area FY 200 - 255 is also used in part by SIMATIC FBs. Flag area FY 200 - 255 is saved;
this setting is performed via PLC MD.

Data formats:
All word-oriented interface signals are input and output as fixed-point numbers. Exceptions
are expressly indicated.

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 1–3


SINUMERIK 840C (PJ)
1 Definitions 04.96
1.3 Data blocks

1.3 Data blocks


1.3.1 Class DB data blocks
Data blocks DB 1-149 are used or reserved for Siemens applications.
Data blocks DB 150-255 are available to the user.

DB DB desig. DB name Pack.


No.

1 DIAG-DB Diagnostic DB OS
2 STATUS-DB PLC status channel (up to SW2, not used in SW3), from OS
SW4 used for ”Rapid data channel” function
3 DATKAN-DB PLC data channel (up to SW2, not used in SW3), from OS
SW4 used for ”Rapid data channel” function
4 FM/BM-DB Error and operational messages OS
10 * NS KN 1 Interface NC channel 1 OS
11 * NS KN 2 Interface NC channel 2 OS
12 * NS KN 3 Interface NC channel 3 OS
13 * NS KN 4 Interface NC channel 4 OS
14 * NS KN 5 Interface NC channel 5 OS
15 * NS KN 6 Interface NC channel 6 OS
16-17 Reserved
28 SI Interface Signals for Safety Integrated FB
29 NS ELG GI signals and 611D signals (GI=gearbox interpolation) OS
30 * DEC MFU Decoded M functions (list) OS
31 * SPI SIG Interface for spindle-specific signals OS
32 * ACHS SIG Interface for axis-specific signals OS
33 Reserved CL
34 E-PU Input buffer, computer link CL
35 A-PU Output buffer, computer link OS
36 * DUE NC Interface for data transfer NC <-> PLC OS
37 * SER SCH. Data transfer control CL
38 RK : ZW-DB Status DB computer link OS
40 * NS BEDT. Interface for operator panel OS
41 * NS KK Interface for command channel OS
48 * NS COM Interface for NC/PLC communication OS
50 E : PLC 1 Input signals from PLC 1 880/880 GAZ only OS
51 A : PLC1 Output signals to PLC 1 880/880 GAZ only OS
52 E : PLC 2 Input signals from PLC 2 880/880 GAZ only OS
53 A : PLC2 Output signals to PLC 2 880/880 GAZ only OS
54 E : PLC 3 Input signals from PLC 3 880/880 GAZ only OS
55 A : PLC3 Output signals to PLC 3 880/880 GAZ only OS
56 E : PLC 4 Input signals from PLC 4 880/880 GAZ only OS
57 A : PLC4 Output signals to PLC 4 880/880 GAZ only OS
58 * MELD Interface for general messages OS
59 DB-ZENTRAL Central DB in link RAM 880/880 GAZ only OS
60 * MDG WO MD words operating system OS
61 * MDF WO MD words function blocks OS
62 * MDA WO MD words user OS
63 * MDG BI MD bits operating system OS
64 * MDF BI MD bits function blocks OS
65 * MDA BI MD bits user OS
66 IKO-DB Icon control in MMC OS
67 INT-MSTT Internal machine control panel OS
68 * SEA WO SE user words OS
71 * SEA BI SE user bits

Abbreviations: Note:
OS PLC operating system Data blocks marked * are generated and initialized by the PLC
CL Computer link operating system on each cold restart, after a general reset. These
SE setting data blocks are always reinitialized with every automatic cold restart.

FB Description of
Functions
Safety Integrated

1–4 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
12.93 1 Definitions
1.3 Data blocks

DB
No. DB design. DB name Pack.

76 Quit FM/BM EM/OM acknowledgement signals (up to SW2) 0


77 DB FM/BM DB status words for EMs/OMs (up to SW2) 0
78 Quit FM/BM EM/OM acknowledgement signals (up to SW2) 0
79 QUITFMBM EM/OM acknowledgement signals (up to SW2) 0
80 LMDKN 1 List for M decoding, NC Channel 1 UR
81 LMDKN 2 List for M decoding, NC Channel 2 UR
82 LMDKN 3 List for M decoding, NC Channel 3 UR
83 LMDKN 4 List for M decoding, NC Channel 4 UR
99 Log-Part Assignment user-interface/logical peer destination CL
100 NCDAT-T Texts for file transfer display (operator request) CL, 4
101 EIN ASS Input user interface CL
102 AUS ASS Output user interface CL
103 ZWSP-WZD Buffer for tool data CL, 4
104 WZ-V-BO Tool management, operator interface
105 Reserved CL
. . CL
. . CL
. . CL
CL
122 Reserved CL
125 S-SIGNALE Standard signals CL
126 FORM-DB Format list 6
127 ZUST-DB Status DB 6
128 E-PUFFER Input useful data DB 6
129 A-PUFFER Output useful data DB 6
130 Reserved 6
1
134 ZW-STAZ Status DB for tool life, quantity 1
135 ZW Status word DB for punched tape input 1
136 DYNPUFF 1 Dynamic buffer 1
137 DYNPUFF 2 Dynamic buffer 1
138 DYNPUFF 3 Dynamic buffer 1
139 DYNPUFF 4 Dynamic buffer 1
140 DYNPUFF 5 Dynamic buffer 1
141 DYNPUFF 6 Dynamic buffer 1
142 DYNPUFF 7 Dynamic buffer 1
143 DYNPUFF 8 Dynamic buffer 1
144 ZW-DATVT Status word DB data distributor 1) 1
145 ZW-BT Status word DB operator panel 1) 1
146 ZW-ANZBT Display parameters, operator panel 1
147 ZW-MESS Interface, measurement 1
148 TO-DATVT TO memory distributor 1
149 TO-DATLS Buffer for read/write TO data (FB 61/FB 62) 1
150 ZW-WZV Status words, tool management 1

Abbreviations: Note:
OS PLC operating Data blocks marked * are generated and initialized by the PLC
system operating system on each cold restart, after a general reset. These
0 FB Package 0 blocks are always reinitialized with every automatic cold restart.
CL Computer link
Data blocks marked 1) are created contiguously according to the
UR User
tool management configuration.
1 FB Package 1
6 FB Package 6

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 1–5


SINUMERIK 840C (PJ)
1 Definitions 12.93
1.3 Data blocks

DB
No. DB desig. DB name Pack.

151 KENN 1 Identifiers 1


152 KENN 2 Identifiers 1
153 KENN 3 Identifiers 1
154 IDENT 1 Ident. number 1
155 IDENT 2 Ident. number 1
156 DUPLO Duplo number 1
157 ANWEND 1 User data 1) 1
158 ANWEND 2 User data 1) 1
159 ANWEND 3 User data 1) 1
160 ANWEND 4 User data 1) 1
161 ANWEND 5 User data 1) 1
162 ANWEND 6 User data 1) 1
163 ANWEND 7 User data 1) 1
164 D-NR. 1 Reference list 1) 1
165 D-NR. 2 Reference list 1) 1
166 D-NR. 3 Reference list 1) 1
167 D-NR. 4 Reference list 1) 1
168 D-NR. 5 Reference list 1) 1
169 D-NR. 6 Reference list 1) 1
170 D-NR. 7 Reference list 1) 1
171 D-NR. 8 Reference list 1) 1
172 D-NR. 9 Reference list 1) 1
173 ERSATZPL Replacement location number 1) 1
174 WZAUF1 L1 Tool holder L1 1) 1
175 WZAUF2 L1 Tool holder L1 1) 1
176 WZAUF1 L2 Tool holder L2 1) 1
177 WZAUF2 L2 Tool holder L2 1) 1
178 ADAGE1 L1 Adapter geometry L1 1) 1
179 ADAGE2 L1 Adapter geometry L1 1) 1
180 ADAGE1 L2 Adapter geometry L2 1) 1
181 ADAGE1 L2 Adapter geometry L2 1) 1
182 ADALAGE Adapter position 1) 1

Abbreviations: Note:
OS PLC operating Data blocks marked * are generated and initialized by the PLC
system operating system on each cold restart, after a general reset. These
0 FB Package 0 blocks are always reinitialized with every automatic cold restart.
CL Computer link
Data blocks marked 1) are created contiguously according to the
UR User
tool management configuration.
1 FB Package 1

DBs 150 to max. DB 182 are needed when tool management is used. The
actual number of data blocks depends on the "width" of the magazine
table (see documentation: SINUMERIK 840/840C/880/880 GA2, Function
Blocks for PLC 135 WB, Package 1 and 2: Tool Management).

1.3.2 Class DX data blocks


Data blocks DX 0-105 are used or reserved for Siemens applications.
Data blocks DX 106-255 are available to the user.

1–6 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
01.99 1 Definitions
1.4 Function blocks

1.4 Function blocks

1.4.1 Class FB function blocks


Function blocks FB 0-199 are used or reserved for Siemens applications.
Function blocks FB 200-255 are available to the user.

FB
No. FB desig. FB name Pack.

11 * EINR-DB Create data blocks OS


12 * WDTGR Retriggering cycle monitoring OS
17 STATUS PLC status channel (840C SW 1 and 2) 0
27 IM308C Profibus interface for 840C (SW 6.1 and higher) 0
30 MUL:16 Multiplication of two 16-bit binary numbers 0
32 DIV:16 Division of two 16-bit binary numbers 0
33 DIV:32 Division of two 32-bit binary numbers 0
35 DIV/100 Division by 100 0
36 ADD:32 Addition of two binary numbers 0
37 SUB:32 Subtraction of two binary numbers 0
39 DUAL/BCD Convert binary to BCD, 4 decades 0
40 COD:16 Convert fixed-point binary number (16 bits) to BCD
41 COD:32 number 0
Convert fixed-point binary number (32 bits) to BCD
42 COD:B4 number (flags used: FW 220, 238) 0
Convert BCD number (4 decades) to fixed-point binary
43 COD:B8 number 0
Convert BCD number (8 decades) to fixed-point binary
number 0

45 GST-FMBM Initial settings for error messages/operational messages 0


45 ANLAUF Initial settings for error messages/operational messages
(840C SW 3) 0
47 PSP:FMBM Buffer, error/operational messages 0
48 FMBM:HSG Auxiliary signals for EMs/OMs 0
48 FMBM:MMC Auxiliary signals for EMs/OMs (840C SW 3) 0
49 UP:57/58 Subroutine FB57, FB58 0
50 UP:FB49 Subroutine FB49 0
51 UP:FB45 Subroutine FB45 0
52 * BTR 8-16 Block transfer between 8 bit and 16 bit memory OS

54 FM-ANZ Display error messages (840C SW 1 and 2) 0


55 BM-ANZ Display operational messages (840C SW 1 and 2) 0
56 MG-ANZ Display message groups (840C SW 1 and 2) 0
57 FM-ABFR Scan error messages 0
58 BM-ABFR Scan operational messages 0
59 MG-ABFR Scan message groups (840C SW 1 and 2) 0
60 * BLOCK-TR Block transfer OS
61 * NCD-LESE Read NC data OS
62 * NCD-SCHR Write NC data OS
63 * PCD-LESE Read PLC data from PLC 1/2/3/4 (applies to 880 only) OS
64 * PCDSCHR Write PLC data to PLC 1/2/3/4 (applies to 880 only) OS

Abbreviations: Note:
OS PLC operating system Blocks marked * are function macros which are integrated in
0 FB Package 0 the PLC operating system.
(see description of FUNCTION MACROS)

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 1–7


SINUMERIK 840C (PJ)
1 Definitions 12.93
1.4.1 Class FB function blocks

FB
No. FB desig. FB name Pack.

65 * M-STACK Transfer flags --> flag stack OS


66 * STACK-M Flag stack --> transfer flags OS
67 * T:RI->ACH Transfer direction keys (840C T version) to axes OS
68 * AP RUF Aperiodic program call OS
69 * G-DECOD G functions decoding OS
70 * T:NS->EAM Transfer interface DB to I/Q/F OS
71 * T:EAM->NS Transfer I/Q/F to interface DB OS
72 * T:NCK->DB Transfer NC channel --> DB channel OS
73 * T:DB->NCK Transfer DB channel --> NC channel OS
74 * T:SPI->DB Transfer spindle --> DB spindle OS
75 * T:DB->SPI Transfer DB spindle --> spindle OS
76 * T:ACH->DB Transfer axis --> DB axis OS
77 * T:DB->ACH Transfer DB axis --> axis OS
78 * T:MS->KN Transfer machine control panel --> NC channel OS
79 * T:MS->ACH Transfer machine control panel --> DB axis (840C M version) OS
88 * BA-LAMPE Mode LED driver OS
89 * BAA-LESE Read block start address OS
91 AK2:V/R Sequencer forwards/reverse 0
92 AK3:AUT Sequencer reverse 0
93 ALS:V/R Sequencer forwards/reverse Graph 5 0
94 ALS:AUT Sequencer automatic Graph 5 0
95 RK:S880 Computer link FB CL, 4
96 RK:TWZD Reserved, transfer tool data CL, 5
97 Reserved CL
98 Reserved CL
99 Reserved CL
100 RK:GLOBA Global functions CL, 4
101 RK:MELDG Messages CL, 4
102 RK:NCDAT File transfer (operator request) CL, 4
103 Reserved CL
104 Reserved CL
105 Reserved CL
106 Reserved CL
107 UP:FB101 Subroutine for FB 101 CL, 4
108 UP:RK880 Subroutine CL, 4
109 Reserved CL
110 SUCH Search for word 0
111 SUCHROUT Search routine 1
112 LEERPL1 Search for empty location without default 1
113* SUCH-SYM Direction of search, symmetrical OS
114 SUCH-VOR Forward search 1
115 SUCH-RWS Backward search 1
116 WZV-INIT Initialize tool management
117 EINR-MAG Create magazine table 1
118 WZ-GR:ST Standard tool size 1
119 Reserved 1
120 Reserved 1

Abbreviations: Note:
OS PLC operating system Blocks marked * are function macros which are integrated in the
0 FB Package 0 PLC operating system
1 FB Package 1 (see description of FUNCTION MACROS).
4 FB Package 4 of
computer link
CL Computer link

1–8 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
06.93 1 Definitions
1.4.1 Class FB function blocks

FB
No. FB desig. FB name Pack.

121 Reserved 1
122 LEERPL2 Search for empty location with default 1
123 WZ-BS Prepare tool 1
124 UP: T=ID Subroutine tool search T = ident 1
125 UP: T=PL Subroutine tool search T = location 1
1
127 UP:ZW-SP 1
128 TRANSFER Transfer tool data 1
129 Reserved 1
130 TOS-VER Subroutine 1
131 UP: MD-B Subroutine MD bits 1
132 UP: MD-W Subroutine MD words 1
133 RI-AUSW Direction selection 1
134 TODAT-W Reserved 1
135 D-NR:WZW Prepare D number after tool change 1
136 WZDAT-LS Read tool data 1
137 Subroutine 1
138 DYN-PUFF Management of data I/O buffers 1
139 DAT-VERT Processing of data I/O buffers 1
140 UP: FB139 Subroutines of FB 139 1
141 UP: KC-0 Subroutines of FB 139 1
142 UP: KC1-4 Subroutines of FB 139 1
143 UP: KC5-7 Subroutines of FB 139 1
144 UP:KC8+9 Subroutines of FB 139 1
145 BEL-CDTR Load tool with code carrier 6
146 ENT-CDTR Unload tool with code carrier 6
147 CT-FORMAT Formatting 6
148 Reserved 6
149 Reserved 6
150 Reserved 1
151 Reserved 1
152 NP-SIF Subroutine 1
153 AD-AD Subroutine 1
154 RK: AW-SS User interface for CL (processing) 1
155 LOCHSTEG Punched tape input 1
156 STAZ/VWG Tool life monitor (prewarning limit) 1
157 STUE/VWG Monitor for no. of pieces (prewarning limit) 1
158 WZ-SPER Tool lockout 1
159 BCD-DUAL BCD/binary conversion 1
160 1) Central calling block 1
161 1) Subroutine check 1
162 1) Spare 1
163 1) Spare 1
164 1) Transfer tool selection 1
165 1) Reserved 1
166 1) Signal: load spindle 1
167 1) Signal: unload spindle 1
168 1) Acknowledge spindle 1
169 1) Spare 1
170 1) Assignments, buffer 1

Abbreviations: Note:
1 FB Package 1 Blocks marked 1) are part of the user interface example of tool
6 FB Package 6 management.

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 1–9


SINUMERIK 840C (PJ)
1 Definitions 06.93
1.4.1 Class FB function blocks

FB
No. FB desig. FB name Pack.

171 1) Magazine assignments 1


172 1) Selection tool according to T number 1
173 1) Load/unload magazine from preselect/spindle 1
174 1) Spare 1
175 1) Display tool data from buffer assignments 1
176 1) Change tool data from buffer assignments 1
177 1) Display tool data from magazine assignments 1
178 1) Change tool data from magazine assignments 1
179 1) Selection tool according to cursor position from magazine 1
assignments 1
180 1) Additional cutter from buffer and magazine 1
181 1) Additional cuffer from loading 1
182 1) Load 1
183 1) Unload 1
184 1) Spare 1
185 1) Manual acknowledgement 1
186 1) Abort manual magazine/spindle 1
187 1) Display next cutter 1
188 1) Reactivate tool 1
189 1) Delete last cutter 1
190 1) Select loading display, punched tape 1
191 1) Acknowledge punched tape positive/negative 1
192 1) Abort punched tape 1
193 1) Spare 1
194 1) Spare 1
195 Reserved 1
196 WZ-LISTE Reserved 1
197 TAUSCHL Open tool list 1
198 FIFO Open swap list 1
199 Buffer processing

Abbreviations: Note:
1 FB Package 1 Blocks marked 1) are part of the user interface example of tool
management.

1–10 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
09.95 1 Definitions
1.4.2 Class FX function blocks

1.4.2 Class FX function blocks


Function blocks FX 0-99 are used or reserved for Siemens applications.

FX No. FX desig. FX name Pack.

1 SI Self-start-up OS
2 Reserved
3 Reserved
4 Reserved
5 Reserved
6 Reserved
7 SIMULAT Simulation of a part program 1
8 WZ-GRIEP Presetting tool size via EPROM 1
9 Reserved 1
10 Reserved 1
11 Reserved 1
12 Reserved 1
13 Reserved
14 BEL-CDTR Load code carrier 7
15 ENT-CDTR Unload code carrier 7
16 UP-CDTR Subroutine code carrier 7
17 Reserved CL
: Reserved CL
21 Reserved CL
22 Reserved
23 Reserved
24 Reserved
25 Reserved
26 DAT-EIN PLC-controlled data input 8
27 DAT-AUS PLC-controlled data output 8
28 DAT-UHR Date/time 8
29 Reserved CL
30 Reserved CL
31 GRAYDUAL Gray code/binary converter 0
32 DUALGRAY Binary/gray code converter 0
33 RECHNEN Contour and technology calculation CP
34 MESSEN Measuring in JOG mode CP
35 RESREQ Triggering link bus reset 0
36 Reserved CL
37 Reserved CL
38 PRO-KO1 Program coordination (840C SW 2 and higher) 0
39 PRO-KO2 Subroutine FX 38 0
40 RK:WZABF Computer link, interrogate tool 5
41 RK: WZM Computer link, report tool 5
42 RK: WZBEL Computer link, load tool 5
43 RK: WZENT Computer link, unload tool 5
44 RK:WZBGB Computer link, load magazine assignment data 5
45 RK:KASSE Tool cassette processing 5
46 Reserved
47 Reserved
48 UPWZKASS Subroutine tool cassette processing 5
49 EA-TRAN Data transfer I/O buffer Tool management 5
50 UPWZDIAL Subroutine tool dialog 5
51 Reserved
: Reserved
54 Reserved

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 1–11


SINUMERIK 840C (PJ)
1 Definitions 12.93
1.4.2 Class FX function blocks

FX No. FX desig. FX name Pack.

55 DIAGNOSE Diagnostics main module


56 ALLFUNK 1 General functions 1
57 ALLFUNK 2 General functions 2
58 SINFUNKT SINUMERIK-dependent functions
59 PLCFUNKT PLC-dependent functions
60 Reserved
67 Reserved
68 PRO-MESS Logging measuring data
69 TP-UEB Transfer part program
70 TP-BEARB Process part program
71 DRU-AUSG Printer output
72 PRO-UP1 Subroutine
73 OEM-SEND Send data to MMC (reserved for OEM customers) 8
74 OEM-EMPF Receive data from MMC (reserved for OEM customers) 8
75 AX-G-FKT Decode axis-specific G functions (840C SW 3 and higher) 8
76 Reserved 8
77 Reserved address calculation flag area 8
78 Reserved OS
79 Reserved OS
80 Reserved OS
81 IKONEN Icon display
82 STERNDRE Star-delta switchover (840C SW 3)
83 Reserved PG functions
84 Reserved PG functions
85 Reserved PG functions
86 Reserved PG functions 0
87 Reserved PG functions 0
88 Reserved PG functions
89 Reserved
:
99 Reserved

Abbreviations:
0 FB Package 0 8 FB Package 8
1 FB Package 1 OS PLC Operating System
5 FB Package 5 CP Cycles Package
7 FB Package 7 CL Computer Link

Caution:
1. Make sure that no confusion with SINUMERIK blocks is possible. The user must not utilize
a SINUMERIK standard block name, nor may he assign a SINUMERIK library number to
his user blocks.
2. In the range of FB 0 - FB 199
FX 0 - FX 99 SINUMERIK blocks have absolute priority.
If SINUMERIK blocks must be used at a later time that overlap user block numbers, the
user blocks must be given a new number.

END OF SECTION

1–12 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions

2 Data Sheets for Digital Functions

FB 30 MUL:16
Multiplier:16

1. Description

The ”Multiplier:16” function block can be used to multiply two fixed-point binary numbers
(15+1 bits).
The result is a fixed-point binary number (31 + 1 bits).

The function block also scans the result for ”zero”.

If 8-bit numbers are to be multiplied, they must be transferred to 16-bit words.

Function: Y=AxB
Y = Z32, Z31; A = Z1; B = Z2

2. Block data

Lib. No. : E88530-B 6030-A-_ _


FBs to be loaded : FB30

DBs to be loaded : None


Type of FB call : Unconditional

DBs to be input : None


Error messages : None

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 2–1


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 30 MUL:16 Multiplier:16

3. Block call

FB 30 MUL:16

I,W – Z1 Z3=0 – Q,BI

I,W – Z2 Z32 – Q,W

Z31 – Q,W

4. Signal descriptions

Z1, Multiplicand, multiplier


Z2 The multiplicand must be stored in Z1, the multiplier in Z2.

Z3=0 Result = 0
A ”1” signal indicates that the arithmetic result is zero.

Z32, Product H word, product L word


Z31 The high word of the arithmetic result is stored (with sign) in Z32, the low word in
Z31.

5. Program example

: L KF +512
: T FW 100
: L KF +1024
: T FW 102
: JU FB 30
NAME : MUL: 16
Z1 : FW 100
Z2 : FW 102
Z3=0 : F 104.0
Z32 : FW 106
Z31 : FW 108

2–2 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 32 DIV:16 16-bit binary divider

FB 32 DIV:16
16-bit binary divider

1. Description

The ”Divider:16” function block is used to divide two fixed-point binary numbers (15+1 bits).
The result (quotient and remainder) is a fixed-point binary number (15 + 1 bits).

The function block also scans the result for ”zero”.

If 8-bit numbers are to be divided, they must be transferred to 16-bit words.

Function: A
Y = –––
B

Y = Z3; remainder = Z4

A = Z1, B = Z2

2. Block data

Lib. No. : E88530-B 6032-A-_ _

FBs to be loaded : FB32

DBs to be loaded : None


Type of FB call : Unconditional or conditional

DBs to be input : None


Error messages : None

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 2–3


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 32 DIV:16 16-bit binary divider

3. Block call

FB 32 DIV:16

I, W – Z1 OV – Q,BI

I, W – Z2 FEH – Q,BI

Z3=0 – Q,BI

Z4=0 – Q,BI

Z3 – Q,W

Z4 – Q,W

4. Signal descriptions

Z1, Z2 The dividend must be stored in Z1, the divisor in Z2.

OV A ”1” signal indicates overflow (divisor is negative).

FEH Output FEH is set on division by zero.

Z3=0 A ”1” signal indicates that the arithmetic result is zero.

Z4=0 A ”1” signal indicates that the remainder is zero.

Z3, Z4 The result of the division is stored in Z3, the remainder in Z4.

5. Program example

: L KF +1025
: T FW 100
: L KF +512
: T FW 102
: JU FB 32
NAME : DIV: 16
Z1 : FW 100
Z2 : FW 102
0V : F 104.0
FEH : F 104.1
Z3=0 : F 104.2
Z4=0 : F 104.3
Z3 : FW 106
Z4 : FW 108

2–4 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 33 DIV:32 Divider:32

FB 33 DIV:32
Divider:32

1. Description

The ”Divider:32” function block divides two fixed-point binary numbers (31+1 bits).
The result (quotient and remainder) is a fixed-point binary number (31 + 1 bits).

The function block also scans the result for ”zero”.

Function: A
Y= ––––
B

Y = Z32, Z31; remainder = Z42, Z41

A = Z12, Z11; B = Z22, Z21

2. Block data

Lib. No. : E88530-B 6033-A-_ _

FBs to be loaded : FB33


DBs to be loaded : None

Type of FB call : Unconditional

DBs to be input : None


Error messages : None

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–5


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 33 DIV:32 Divider:32

3. Block call

FB 33 DIV:32

I, W – Z12 OV – Q,BI

I, W – Z11 FEH – Q,BI

I, W – Z22 Z3=0 – Q,BI

I, W – Z21 Z4=0 – Q,BI

Z32 – Q,W

Z31 – Q,W

Z42 – Q,W

Z41 – Q,W

4. Signal descriptions

Z12, High-word dividend, low-word dividend


Z11 The high word of the dividend must be stored in Z12 and the low word in Z11.

Z22, High-word divisor (bits 16 to 31), low-word divisor (bits 0 to 15)


Z21 The high word of the divisor must be stored in Z22 and the low word in Z21.

OV Overflow
A ”1” signal signifies an overflow.

FEH Fault (division by 0)


Output FEH is set on division by zero.

Z3=0 Quotient equal to zero


A ”1” signal indicates that the arithmetic result is zero.

Z4=0 Remainder equal to zero


A ”1” signal indicates that the remainder of the division is zero.

Z32, High-word quotient (bits 16 to 31), low-word quotient (bits 0 to 15)


Z31 The high word of the arithmetic result (with sign) is stored in Z32, the low word in
Z31.

Z42, High-word remainder (bits 16 to 31), low-word remainder (bits 0 to 15)


Z41 The remainder of the division is output in words Z42 (high word) and Z41 (low
word).

2–6 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 33 DIV:32 Divider:32

5. Program example

: L KF +8
: T FW 100
: L KF +1
: T FW 102
: L KF +4
: T FW 104
: L KF +0
: T FW 106
: JU FB 33
NAME : DIV:32
Z12 : FW 100
Z11 : FW 102
Z22 : FW 104
Z21 : FW 106
0V : F 108.0
FEH : F 108.1
Z3=0 : F 108.2
Z4=0 : F 108.3
Z32 : FW 110
Z31 : FW 112
Z42 : FW 114
Z41 : FW 116

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–7


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 35 DIV/100 Divide by 100

FB 35 DIV/100
Divide by 100

1. Description

The "Divide by 100" function block divides a positive binary number (max. 6553500) by 100.
The result is also a binary number.

The divisor is not subjected to a range check.

2. Block data

Lib. No. : E88530-B 6035-A-_ _


FBs to be loaded : FB35

DBs to be loaded : None

Type of FB call : Unconditional


DBs to be input : None

Error messages : None

2–8 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 35 DIV/100 Divide by 100

3. Block call

FB 35 DIV/100

I, W – Z12 Z2 – Q,W

I, W – Z11

4. Signal descriptions

Z12, High word dividend, low word dividend


Z11 The high word of the dividend is stored in Z12 (right justified), the low word in Z11.

Z2 Result
Word in which the result of the division is stored (must always be interpreted as a
positive number).

5. Program example

: L KF 10
: T FW 100
: L KF +1000
: T FW 102
: JU FB 35
NAME : DIV/100
Z12 : FW 100
Z11 : FW 102
Z2 : FW 104

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–9


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 36 ADD:32 Adder: 32 bits

FB 36 ADD:32
Adder:32 bits

1. Description

The ”Adder:32” function block adds two fixed-point binary numbers (31+1 bits).
The result is a fixed-point binary number (31 + 1 bit).

The function block additionally contains a scan of the result for "zero".

If 8-bit numbers are to be added, they must be transferred to 16-bit words.

Function: Y=A+B

Y = Z32, Z31; A = Z12, Z11; B = Z22, Z21

2. Block data

Lib. No. : E88530-B 6036-A-_ _


FBs to be loaded : FB36
DBs to be loaded : None
Type of FB call : Unconditional
DBs to be input : None
Error messages : None

2–10 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 36 ADD:32 Adder: 32 bits

3. Block call

FB 36 ADD:32

I, W – Z12 Z3=0 – Q,BI

I, W – Z11 OV – Q,BI

I,W – Z22

I,W – Z21 Z32 – Q,W

Z31 – Q,W

4. Signal descriptions

Z12, Summand 1, H word


Z11 L word

Z22, Summand 2, H word


Z21 L word

Z3=0 A ”1” signal indicates that the arithmetic result is zero.

OV A ”1” signal indicates an overflow.

Z32, Sum, H word (with sign)


Z31 L word

5. Program example

: L KF +4
: T FW 100
: L KF +256
: T FW 102
: L KF +2
: T FW 104
: L KF +128
: T FW 106
: JU FB 36
NAME : ADD: 32
Z12 : FW 100
Z11 : FW 102
Z22 : FW 104
Z21 : FW 106
0V : F 108.0
Z3=0 : F 108.1
Z32 : FW 110
Z31 : FW 112

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–11


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 37 SUB:32 Subtracter: 32 bits

FB 37 SUB:32
Subtracter: 32 bits

1. Description

The ”Subtracter:32” function block is used to subtract two fixed-point binary values
(31+1 bits).
The result is a fixed-point binary number (31 + 1 bit).

The function block additionally contains a scan of the result for "zero".

If 8-bit numbers are to be subtracted, they must be transferred to 16-bit words.

Function: Y=A-B

Y = Z32, Z31; A = Z12, Z11; B = Z22, Z21

2. Block data

Lib. No. : E88530-B 6037-A-_ _

FBs to be loaded : FB37


DBs to be loaded : None

Type of FB call : Unconditional


DBs to be input : None

Error messages : None

2–12 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 37 SUB:32 Subtracter: 32 bits

3. Block call

FB 37 SUB:32

I, W – Z12 Z3=0 – Q,BI

I, W – Z11 OV – Q,BI

I,W – Z22

I,W – Z21 Z32 – Q,W

Z31 – Q,W

4. Signal descriptions

Z12, Minuend 1, high word


Z11 Low word

Z22, Subtrahend 2, high word


Z21 Low word

Z3=0 A ”1” signal indicates that the arithmetic result is zero.

OV A ”1” signal indicates an overflow.

Z32, Difference, high word (with sign)


Z31 Low word

5. Program example

: L KF +8
: T FW 100
: L KF +512
: T FW 102
: L KF +4
: T FW 104
: L KF +256
: T FW 106
: JU FB 37
NAME : SUB: 32
Z12 : FW 100
Z11 : FW 102
Z22 : FW 104
Z21 : FW 106
OV : F 108.0
Z3=0 : F 108.1
Z32 : FW 110
Z31 : FW 112

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–13


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 39 DUAL/BCD 3-decade binary BCD converter

FB 39 DUAL/BCD
3-decade binary/BCD converter

1. Description

This function block converts a binary number (0-999) into BCD.

The binary number is not checked for validity.

If data words are to be converted, they must be located in a DB and this DB must be invoked
prior to conversion.

2. Block data

Lib. No. : E88530-B 6039-A-_ _


FBs to be loaded : FB39

DBs to be loaded : None

Type of FB call : Unconditional or conditional (JU FB39 or JC FB39)


DBs to be input : None

Error messages : None

2–14 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 39 DUAL/BCD 3-decade binary BCD converter

3. Block call

FB 39 DUAL/BCD

I, W – DUAL BCD – Q,W

4. Signal descriptions

DUAL Word containing the binary-coded number.


BCD Word in which the BCD-coded number is to be stored.

5. Program example

: L KF +1234
: T FW 100
: JU FB 39
NAME : DUAL/BCD
DUAL : FW 100
BCD : FW 102

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–15


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 40 COD:16 Binary/BCD converter

FB 40 COD:16
Binary/BCD converter

1. Description

The ”Binary/BCD converter” function block converts a fixed-point binary number (15+1 bits)
into a signed BCD number.

Binary number : 15 + 1 bits

Result : 6-decade signed BCD number

2. Block data

Lib. No. : E88530-B 6040-A-_ _

FBs to be loaded : FB40


DBs to be loaded : None

Type of FB call : Unconditional or conditional

DBs to be input : None


Error messages : None

2–16 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 40 COD:16 Binary/BCD converter

3. Block call

FB 40 COD:16

I, W – DUAL SBCD – Q,BI

BCD2 – Q,BY

BCD1 – Q,W

4. Signal descriptions

DUAL Binary number, permissible range -32768 to +32767

SBCD Sign of BCD number; ”1” = negative


BCD2 BCD number, decades 4 to 5

BCD1 BCD number, decades 0 to 3

5. Program example

: L KF -32768
: T FW 100
: JU FB 40
NAME : COD: 16
DUAL : FW 100
SBCD : F 102.0
BCD2 : FB 103
BCD1 : FW 104

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–17


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 41 COD:32 Binary/BCD converter

FB 41 COD:32
Binary/BCD converter

1. Description

The ”Binary/BCD converter” function block converts a fixed-point binary value (31+1 bits) into
a signed BCD number.

Binary number : 31+1 bits

Result : 10-decade signed BCD number

2. Block data

Lib. No. : E88530-B 6041-A-_ _

FBs to be loaded : FB41


DBs to be loaded : None

Type of FB call : Unconditional or conditional

DBs to be input : None


Error messages : None

2–18 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 41 COD:32 Binary/BCD converter

3. Block call

FB 41 COD:32

I, W – DU 2 SBCD – Q,BI

I, W – DU 1 BCD3 – Q,BY

BCD2 – Q,W

BCD1 – Q,W

4. Signal descriptions

DU 2 Binary number, range -32768 to +32767, high word

DU 1 Binary number, range -32768 to +32767, low word

SBCD Sign of the BCD number, ”1” = negative

BCD3 BCD number, decades 8 to 9

BCD2 BCD number, decades 4 to 7

BCD1 BCD number, decades 0 to 3

5. Program example

: L KF +1024
: T FW 100
: L KF +4096
: T FW 102
: JU FB 41
NAME : COD: 32
DU 2 : FW 100
DU 1 : FW 102
SBCD : F 104.0
BCD3 : FB 105
BCD2 : FW 106
BCD1 : FW 108

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–19


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 42 COD:B4 BCD/binary converter

FB 42 COD:B4
BCD/binary converter

1. Description

The"Binary/BCD converter" function block converts a BCD number (+/-9999) into binary.

BCD number : 4 decades + sign

Result : Fixed-point binary number comprising 15+1 bits

2. Block data

Lib. No. : E88530-B 6042-A-_ _

FBs to be loaded : FB42


DBs to be loaded : None

Type of FB call : Unconditional or conditional


DBs to be input : None

Error messages : None

2–20 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 42 COD:B4 BCD/binary converter

3. Block call

FB 42 COD:B4

I, W – BCD DUAL – Q,W

I, BI – SBCD

4. Signal descriptions

BCD BCD number, permissible range -9999 to +9999

SBCD Sign of the BCD number, "1" = negative


DUAL Binary number comprising 15 + 1 bits

5. Program example

: L KH 1024
: T FW 100
: L KF +0
: T FW 102
: JU FB 42
NAME : COD: B4
BCD : FW 100
SBCD : F 102.0
DUAL : FW 104

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–21


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 43 COD:B8 BCD/binary converter

FB 43 COD:B8
BCD/binary converter

1. Description

The ”BCD/binary converter” function block converts a BCD number (+/– 99 999 999) into
binary.

Input, BCD number : 8 decades + sign

Result : Fixed-point binary number 31 + 1 bit

2. Block data

Lib. No. : E88530-B 6043-A-_ _

FBs to be loaded : FB43


DBs to be loaded : None

Type of FB call : Unconditional or conditional

DBs to be input : None


Error messages : None

2–22 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 43 COD:B8 BCD/binary converter

3. Block call

FB 43 COD:B8

I, W – BCD2 DU 2 – Q,W

I, W – BCD1 DU 1 – Q,W

I, BI – SBCD

4. Signal descriptions

BCD2 BCD number, decades 4 to 7

BCD1 BCD number, decades 0 to 3


SBCD Sign of the BCD number; "1" = negative

DU 2 Binary number, bits 16 to 31


DU 1 Binary number, bits 0 to 15

5. Program example

: L KH 0419
: T FW 100
: L KH 4304
: T FW 102
: L KF +0
: T FW 104
: JU FB 43
NAME : COD: B8
BCD2 : FW 100
BCD1 : FW 102
SBCD : F 104.0
DU 2 : FW 106
DU 1 : FW 108

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–23


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 110 SUCH Search for word

FB 110 SUCH
Search for word

1. Description

This block scans a specific data field for the specified search key. If the search key exceeds
one word, the related words may be located either in contiguous data words in a single data
block (serial) or in a group of corresponding data words in two or more data blocks (parallel)
(see figure). Information can be masked out by defining an appropriate mask.

The search key and the mask must be stored in free data words of the data block to be
searched prior to the scan.

If a value which is identical to the variable is found, the function block outputs the address of
the data word containing that value.

In the case of serial storage of data, where the information width exceeds one word, the
address of the high word is output, if it exists. Otherwise the low word is output.

Parallel storage Serial storage

DB n DB n+1 DB

DW0 DW0

Mask high word Mask low word DW1 (DWM) Mask high word DW1 (DWM)

Variable high Variable low DW2 (DWV) Mask low word


word word

High word Low word DW3 (ANF) Variable DW3 (DWV)


high word
. .
. . Variable
low word
. .
. .
High DW5 (ANF)
. . word
. .
. . Low
word

.
.
.
.
DW40 (END) High DW39 (END)
word

Figure: Example: Search key with two words

2–24 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 110 SUCH Search for word

2. Block data

Lib. No. : E88530-B 6110-A-_ _

FBs to be loaded : FB110


DBs to be loaded : None

Type of FB call : Unconditonal (JU FB110)


DBs to be input : DB for storage of data in series
DB - DBx (x = DB + ANZ - 1) for parallel storage of data

Error messages : None

3. Block call

FB 110 SUCH

I,BY – DB ENDE – Q,BI

I,BY – DMV GEF – Q,BI

I,BY – DWM ADR – Q,BY

I,BY – ANZ

I,BI – P/R

I,BY – ANF

I,BY – END

I,W – ZW

*F 2.1 – GST

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–25


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FB 110 SUCH Search for word

4. Signal descriptions

DB Number of data block


If P/R = 1: Number of first data block when ANZ > 1
DWV Data word containing variable (search key)
Number of DW containing search key (first DW if ANZ > 1)

DWM Data word containing mask


Number of DW containing mask (first DW if ANZ > 1). The mask is used to mask
out bits, i.e. only those bits in the data words are taken into account during the
search for which ”1” was defined in the mask.

ANZ Number of data words in a search key


P/R Parallel or serial
P/R = 1: Data are stored in parallel
P/R = 0: Data are stored serially
ANF Start address
Start address (DW no.) of search area

END End address


End address (DW no.) of search area

ZW Status word
ENDE End of search operation (static signal)

GEF Found
Search key has been found (static signal)
ADR Address (binary)
DW number of data word containing the value found (= search key)

GST Initial state

Note:
All values must be specified in binary.

2–26 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FB 110 SUCH Search for word

5. Program example

: C DB 110
: L KH FFF0
: T DW 2
: L KH 1234
: T DW 1
: T DW 101
: L KH 1235
: T DW 100
: L KF +110
: T FY 100
: L KF +1
: T FY 101
: L KF +2
: T FY 102
: L KF +1
: T FY 103
: U F 0.0
: = F 104.0
: L KF +10
: T FY 105
: L KF +210
: T FY 106
: JU FB 110
NAME : SUCH
DB : FY 100
DWV : FY 101
DWM : FY 102
ANZ : FY 103
P/R : F 104.0
ANF : FY 105
END : FY 106
ZW : MW 107
ENDE : F 104.1
GEF : F 104.2
ADR : FY 109

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–27


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FX 31 GRAYDUAL Gray code/binary converter

FX 31 GRAYDUAL
Gray code/binary converter

1. Description

The ”GRAYDUAL” function block converts a Gray-coded numeric value (cyclically permuted
code) to a fixed-point binary number.

Input : Gray-coded number with up to 15 tracks

Result : Fixed-point number, 15 + 1 bits

Representation
Decimal in Gray code
equivalent 5-digit

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

2–28 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FX 31 GRAYDUAL Gray code/binary converter

2. Block data

Lib.-No. : E88530-B 6231-A-_ _


FBs to be loaded : FX31

DBs to be loaded : None


Type of FB call : Unconditional or conditional

DBs to be input : None


Error messages : % 1: Track 16 used by GRAY

3. Block call

FB 31 GRAY DUAL

I, W – GRAY DUAL – Q,W

– %1

4. Signal descriptions

GRAY GRAY-coded number, max. 15 tracks


DUAL Binary number 15 bits (always positive)
permissible range: 0 to +32767

5. Program example

: L KF +1234
: T FW 100
: BA FX 31
NAME : GRAY DUAL
GRAY : FW 100
DUAL : FW 102

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–29


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FX 32 DUALGRAY Binary/Gray code converter

FX 32 DUALGRAY
Binary/Gray code converter

1. Description

Function block DUALGRAY converts a positive, fixed-point binary number to a Gray-coded


numeric value (cyclically permuted code).
Input: Fixed-point binary number of up 15 bits, values from 0 to +32767
Result: Gray-coded numeric value with up to 15 tracks (5-digit Gray code, see FX 31).

2. Block data

Lib.-No. : E88530-B 6232-A-_ _


FBs to be loaded : FX32

DBs to be loaded : None


Type of FB call : Unconditional or conditional

DBs to be input : None


Error messages : % 1: bit 16 used by binary

3. Block call

FB 32 DUAL GRAY

I, W – DUAL GRAY – Q,W

– %1

4. Signal descriptions

DUAL Fixed-point binary number, 15 bits, permissible range: 0 to +32767, lowest bit: .0
GRAY GRAY-coded number, up to 15 tracks used (always positive)

5. Program example

: L KF +1234
: T FW 100
: BA FX 32
NAME : DUAL GRAY
DUAL : FW 100
GRAY : FW 102

2–30 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
09.95 2 Data Sheets for Digital Functions
FX 35 RESREQ Triggering link bus reset

FX 35 RESREQ
Triggering link bus reset

1. Description

When this block is called, a link bus reset is triggered.


Depending on the ”NEUS” parameter, a PLC cold or warm restart is triggered.
"NEUS"=1, e.g. through connection with flag F01, => PLC cold restart is triggered.
"NEUS"=0, e.g. through connection with flag F00, => PLC warm restart is triggered.

Caution:
If the PLC machine data MD 6049.1, cold restart on reset=1, a PLC cold restart is always
triggered, independent of the ”NEUS” parameter.
The block is written in the C high-level language and must not be edited.

2. Block data

Lib. No.: E88530-B 6235-A-_ _ (current version is 22)

FBs to be loaded: None


FXs to be loaded: None

DBs to be loaded: None


DXs to be loaded: None

Type of call: Conditional


DBs to be input: None

DXs to be input: None

Error messages: None

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–31


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FX 38 PRO-KO1 Program coordination

FX 38 PRO-KO1
Program coordination

1. Description

Function blocks FX 38 and FX 39 (SW2 and higher) support program coordination in the NC.
The PLC basic program checks the channel-specific NC coordination commands, conditions
them suitably for MC-5 and transfers them to the user interface. FX 38 and FX 39 check the
interface data blocks DB 10 - DB 25 (DW 52 - DW 55) for a coordination command and
evaluate it.

On cold and warm restarts, the entire user interface area for program coordination is reset in
the channel data blocks (DW 52 - DL 62). The buffer (DW 56 - DL 62) is erased on reset,
thus enabling restart of the NC part program.

DW 61 contains a detailed error code:

The following error numbers exist (detailed error code in DW 61):


Process Response Detailed error code
– FB62 ended with error Read-in disable 1
– Not all programs ended None 2
– Not all wait-M marks reached None 3
– The channels addressed are not enabled Read-in disable 4
– Incorrect command code None 5
– Start command not enabled for block search None 6

2. Block data

Lib.No. : E88530-B 6238-A-_ _


FBs to be loaded : None

FXs to be loaded : FX 38, FX 39


DBs to be loaded : None

DXs to be loaded : None

Type of FX call : Unconditional


DBs to be input : None

DXs to be input : None


Error messages : % 1: Block FX 39 not loaded

2–32 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FX 38 PRO-KO1 Program coordination

3. Block call

FX 38 PRO-KO1

D, KF – NSBY –

– %1

4. Signal descriptions
NSBY Interface byte
Interface byte in DB 36 to initiate a program with FB 62

5. Program example

: BA FX 38
NAME : PRO-KO1
NSBY : KF+5 Unassigned interface byte e.g. ”5”

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–33


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 06.93
FX 81 IKONEN Icon display

FX 81 IKONEN
Icon display (SW 2 and higher)

1. Description

The function block supplies the interface in DB66 for display of ICONS integrated in the MMC.
A maximum of 4 different icons can be displayed. They appear in the two right-hand of the
three icon fields underneath the system clock. The 1st icon field (far left) is supplied by the
MMC sitself, the 2nd and 3rd fields are supplied by the FX81 as follows:

2nd field: ”Axis traversing” or ”Override = 0%”


3rd field ”Program running” or ”Program interrrupted” or Stop (M00/M01) or Block Search.

Representation:
aaaaaa
a
aaaaaa
aaa

0%
a
aa
a
a
a
a
a

aaa
aaa
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
Program interrupted or Stop or Block Search
aaa
aa
aaaaaaaaaaa a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
aaa
aaaaaaa
aa
a
aa
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
aa
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
aaa
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
Program running
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
aaa
aa
a
aa
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
aaa
aaa
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
aaa
Axis traversing
aa
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaa
aaa
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
Feed override = 0%
aa
aa
aaa a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
aaa
aa
aa
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
aaa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
The icons are displayed for all channels and axes.

The following priorities apply:

Axis traversing: As soon as an traversing command for any axis is active and
the overrride at the machine control panel is set to 0%.
Override = 0%: When feed override is on 0% at one or more machine control
panel.
Program running: If the signal ”Program running” is active in any channel.
Program interrupted: If the signal ”Program running” is not active in any channel
and if, in addition, a program interrupt has been triggered in
any channel by means of STOP, change of mode or
M00/M01 or if block search has been activated. In the case
of single block operation, ”Programm interrupted” is dis-
played after the respective block has been executed.

2. Block data:

FBs to be loaded: None


FXs to be loaded: FX81
DBs to be loaded: None
DXs to be loaded: None
Type of call: Unconditional
DBs/DXs to be input: None
Error messages: None

2–34 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 2 Data Sheets for Digital Functions
FX 81 IKONEN Icon display

3. Block call

FX 81 IKONEN

Block data:
Processing time 0.2 ms
Nesting depth: 0
Block length: 100
Assigned variables: FW 250, FW 254
Call length: 4

4. Program example

: = F...
: DO FX 81
NAME : IKONEN
: A I...

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 2–35


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 12.93
FX 82 STERNDRE Star-delta switchover

FX 82 STERNDRE
Star-delta switchover

1. Description

The function block, "Star-delta switchover" (SW 3 and higher) performs a defined reversing
logic (time-controlled) from a star to a delta connection and vice versa. The block must be
called up separately for each spindle.

The function block can only be used with digital main spindle drives. Two separate contactors
perform the switchover which is executed in the following four steps:

Step 1: Interface signal "Motor selection made" cleared and switchover process
signalled with motor selection bit 0

Step 2: As soon as the return message "Pulse disable" and an acknowledgement


from the drive for the motor selection has been received, contactor 1 (old
state) is switched off

Step 3: After a defined delay, contactor 2 (new state) is switched on

Step 4: After another delay, the drive receives a message that the switchover has
been successfully completed.

If using a star-delta switchover, please follow the instructions in the


Planning Guide "SIMODRIVE 611-A/611-D Transistor PMW Inverters for
AC Feed Drives and AC Main Spindle Drives".

2. Block data

Lib No.:
FBs to be loaded: FX 82

DBs to be loaded: None


Type of call: Unconditional

DBs to be input: None


Error messages: % 1: Stated spindle number is incorrect or the associated spindle is not
defined.

2–36 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
12.93 2 Data Sheets for Digital Functions
FX 82 STERNDRE Star-delta switchover

3. Block call

FX 82 STERNDRE

I,BI – S-D K-S – Q,BI

D,KF – SPIN K-D – Q,BI

D,KT – TW

T – T

– %1

4. Signal description

S-D Command for star-delta switchover


positive edge (0/1 edge): star/delta switchover
negative edge (1/0 edge): delta/star switchover

SPIN Spindle no. (1-6)

TW Delay during switchover


Three different possibilities:
– TW = 0.0 Use a standard value (100 ms)
– 0.0 < TW < 5.0 Use a minimum value of 50 ms
– TW > = 5.0 Use a parameterized value, as parameterized

T Time element for programming the delay

K-S Contactor for star connection

K-D Contactor for delta connection

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 2–37


SINUMERIK 840C (PJ)
2 Data Sheets for Digital Functions 12.93
FX 82 STERNDRE Star-delta switchover

5. Program flowchart

aaa aaaaaa
aaaaaa
aaaaaa
aaaaaa
aaaaaa
aaaaaa
aaaaaa
Initial setting?

aaaaaa

aaaaaa
aaa
n Y
Clear status data

aaaaa
aaaaaaa
aaaaaaaa
aaaaaaaa
aaaaaaaa
aaaaa
aaaaaaaa
aaaaaaaa
aaaaaaa
Parameter test ?
aaaaaa
aaa

aaaaaa aaa
aaaaaa aaaaaa
Y n

aaaa
aaaaaa
aaaaaa
aaaaaaaa

aaaaaa
aaaaaa
aaaaaa
aaaaaa
aaaa
aaaaa
Delay time still running?
Determine flag for
delay time used
aaaaaaaa

aaaaaaaaaa
aaaaaaaaaa
Y n

a aaaaaaaaa
aaaaaa
aaaaaa
aaaaaa
aaaaaa
aaaaaa

aaaaaaaaa
Switchover running?

aa

aa
aa
a
n Y

aa

aa
a

a
a
Check spindle no. aaa
a
a
a
a
a
a
a
a
a
a
a
a
a
aaaa
Edge available?
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaa a

a
a
a
a
a
a
a
a
a
a
a
a
a
Error? a
a
a
a
a
a
a
a
a
a
a
a
a
a

aa
aa
a

aaa
n Y
aa

aa
a
a

n Y a
aa
aa
a

aa
aa
a
aa

aa
a
a

a
a

PLC stop
aaaaa
a
a
a
a
a
a
a
a
a
a
a
a
a
aaaaa a
a
a
aaa
Sequence processor
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
switch
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a

Description ”Sequence processor switchover”:

Step 1: – Delete acknowledge bit ”Motor selection mode” (DB 31, DW K+74, bit 5)
– Set motor selection bit according to switching command (DB 31, DW K+74,
bit 3), K = 0, 4, 8, 12, 16, 20.

Step 2: Is not executed until pulse disable signalled by the drive and motor selection
acknowledged
– Switch on contactor 1
– Start defined delay time

Step 3: Not executed until delay time has elapsed


– Switch on contactor 2
– Start defined delay time

Step 4: Not executed until delay time has elapsed


– Acknowledgement "Motor selection made" to drive

END OF SECTION

2–38 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
03.95 3 Data Sheets for Scanning/Displaying Messages
3.1 Error and operational messages (840C SW 1 and 2)

3 Data Sheets for Scanning/Displaying


Messages

3.1 Error and operational messages (840C SW 1 and 2)

3.1.1 General

The FBs for error messages (EMs) and operational messages (OMs) are not called by the
operating system. They must be loaded in the PLC and called accordingly.

The bytes for error and operational messages are defined via PLC machine data.

Functions: FBs to be loaded/called:

17 45 47 48 49 50 51 54 55 56 57 58 59

Error PLC Scan and * * X * X X X X *


messages display

Operational PLC Scan and * * X * X X X X *


messages display

Message PLC Scan and * * X X *


groups display

Explanation of table:
The table provides information on the desired functions and the functions blocks to be
loaded/called.
(x = only load FB, *= load and call FB)
The functions comprising error messages, operational messages and message groups operate
independently of each other and can be implemented in any combination.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 3–1


SINUMERIK 840C (PJ)
3 Data Sheets for Scanning/Displaying Messages 06.93
3.1 Error and operational messages (840C SW 1 and 2)

3.1.2 Program overview for error messages, operational messages


and message groups

Overview for error messages and operational messages

FB45 FB51

CRB GST- SR: Store OP code of message byte


EMOM FB45 and error number if corresponding
PLC-MD for EM/OM is set.

CRB (cold
restart Generate lists of EM and
Common to branch) OM bytes
EMs and OMs

FB48

UP EMOM: Generate auxiliary signals:


HSG - Acknowledge error messages
- Evaluate signals from PLC1 and
PLC2
- Scroll through message line, etc.

UP (cyclic user program)

3–2 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
03.95 3 Data Sheets for Scanning/Displaying Messages
3.1 Error and operational messages (840C SW 1 and 2)

Overview for error messages only

FB57 FB49 FB50 FB47

UP FM- SR: SR: PSP:


ABFR *) **) FMBM

Scan FMs

Error messages Coordinate


only
buffer entry

FB54

FB FM-
***) ANZ

FB17 (status channel)


UP (cyclic user program)

Explanation of error messages:

*) Call only if PLC-MD signals from/to channel, axes, spindles are set
**) Call only if a bit at the interface has changed.
***) Call only possible with softkey "PLC interrupt" in PLC1.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 3–3


SINUMERIK 840C (PJ)
3 Data Sheets for Scanning/Displaying Messages 03.95
3.1 Error and operational messages (840C SW 1 and 2)

Overview for operational messages only

FB58 FB49 FB50 FB47

UP BM- SR: SR: PSP:


ABFR *) **) FMBM

Scan OMs
Coordinate
Operational buffer entry
messages only

FB55

FB BM-
***) ANZ

FB17 (status channel)


UP (cyclic user program)

Explanation of operational messages:

*) Call only if PLC-MD signals from/to channel, axes, spindles are set
**) Call only if a bit at the interface has changed
***) Call only possible with "PLC messages" softkey in PLC1

The program parts (FBs) for EMs and OMs can be used jointly or as alternatives.

3–4 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 3 Data Sheets for Scanning/Displaying Messages
3.1 Error and operational messages (840C SW 1 and 2)

Overview for message groups

Message groups (MGs) are displayed irrespective of whether the PLC machine data for
error messages or operational messages or no MD is set.

Program structure:

FB59

UP MG-
ABFR

Scan MGs

Message groups
only

FB56

FB MG-
***) ANZ

Display MGs

FB17 (status channel)


UP (cyclic user program)

Explanation of message groups:

***) Call only possible with "PLC diagnostics" softkey in PLC1

A message is unambiguously assigned to each set bit in the interface signals provided for this
purpose.

Application:

Display of messages which are not to be shown on the message line (second line on the NC
monitor).

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 3–5


SINUMERIK 840C (PJ)
3 Data Sheets for Scanning/Displaying Messages 06.93
3.1 Error and operational messages (840C SW 1 and 2)

3.1.3 Block calls for EMs/OMs/MGs


Example
a) In the user's cold restart branch:

:
: JU FB45 EM and OM initial state
Name : GST-FMBM
:

b) In the user's cyclic program part :

:
: JU FB48 EM and OM auxiliary signals
Name : FMBM:HSG
:
: JU FB57 Scan EMs *)
Name : FM-ABFR
:
: JU FB58 Scan OMs *)
Name : BM-ABFR
:
: JU FB59 Scan MGs *)
Name : MG-ABFR
:
: JU FB17 PLC status channel
Name : STATUS
:

*) FB is called only if the corresponding function is required.

3–6 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 3 Data Sheets for Scanning/Displaying Messages
3.1 Error and operational messages (840C SW 1 and 2)

FB 54, FB 57
Scan and display error messages

1. Description

PLC error messages can be displayed on the screen of the SINUMERIK 840C by means of
function blocks FB54, FB57.

The bytes for error messages are defined via PLC machine data.

The error message buffer has a capacity of 44 entries.

The function blocks must be loaded in the PLC *). They must be called in the user program
because they are not called in the operating system.

Structure and description of the error messages are discussed in the Interface Description.

*) See block data

2. Block data

Lib. No.: E88530-B 6054-A-_ _


E88530-B 6057-A-_ _

FBs to be loaded: PLC1: FB45 - FB51, FB54, FB57, FB17


DBs to be loaded: None

Type of FB call: Unconditional


DBs to be input: None

Error messages: None

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 3–7


SINUMERIK 840C (PJ)
3 Data Sheets for Scanning/Displaying Messages 06.93
3.1 Error and operational messages (840C SW 1 and 2)

FB 55, FB 58
Scan and display operational messages

1. Description

PLC error messages can be displayed on the screen of the SINUMERIK 840C by means of
function blocks FB54, FB57.

The bytes for error messages are defined via PLC machine data.

The error message buffer has a capacity of 44 entries.

The function blocks must be loaded in the PLC *). They must be called in the user program
because they are not called in the operating system.

Structure and description of operational messages are discussed in the Interface Description,
Part 1: Signals.

*) See block data

2. Block data

Lib. No.: E88530-B 6055-A-_ _


E88530-B 6058-A-_ _

FBs to be loaded: PLC: FB45 - FB51, FB55, FB58, FB17


DBs to be loaded: None

Type of FB call: Unconditional


DBs to be input: None

Error messages: None

3–8 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 3 Data Sheets for Scanning/Displaying Messages
3.1 Error and operational messages (840C SW 1 and 2)

FB 56, FB 59
Scan and display message groups

1. Description

PLC message groups can be displayed on the screen of the SINUMERIK 840C by means of
function blocks FB56, FB59.

The message groups are displayed irrespective of whether the machine data for error
messages or operational messages is set. A message is assigned to each set bit.

The function blocks must be loaded in the PLC *). They must be called in the user program
because they are not called in the operating system.

Structure and description of message groups are discussed in the Interface Description,
Part 1: Signals.

*) See block data

2. Block data

Lib. No.: E88530-B 6056-A-_ _


E88530-B 6059-A-_ _

FBs to be loaded: PLC: FB56, FB59, FB17, FB45, FB51


DBs to be loaded: None

Type of FB call: Unconditional


DBs to be input: None

Error messages: None

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 3–9


SINUMERIK 840C (PJ)
3 Data Sheets for Scanning/Displaying Messages 10.94
3.2 Error and operational messages (840C SW 3 and higher)

3.2 Error and operational messages (840C SW 3 and higher)


3.2.1 General

The blocks for scanning and displaying alarms (error messages, EMs) and messages
(operational messages, OMs) are not called by the PLC operating system. They must be
loaded into the PLC and called accordingly in the ramp-up branch (OB 20) or cyclic branch
(OB 1).

Blocks to be loaded/called

FB FB FB FB FB FB FB FB FB FX FX
Functions 45 46 47 48 49 50 51 57 58 73 74
Ramp up * x

Cyclic operation Integrated


scan/display of x x * x x * in the PLC
alarms OS
Cyclic operation Integrated
scan/display of x x * x x * in the PLC
messages OS

Notes:
• * =ˆ load and call block, x =ˆ load block
• FB 46 only has to be called for alarm and message expansion.
• The error and operational messages are enabled or defined via the PLC machine data.
• All the required data blocks (DB 4, 76, 77, 78 and 79) are set up by FB 45 (GST-FMBM)
on cold restart.
• The function macros FX 73 and FX 74 are used to send and receive information packages
to/from the MMC.

3–10 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
10.94

aa a a a
a aaaa
aaaa
aaaaaa
aaaaaaaaaa
aaaa
aaaa
aaaa
a aaaaaa
aaaa
a aaaa
aaaa
aaaaaa
aaaaaaaaaaaa
a aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3.2.2

a
a
a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
aa
a a
aa
a a
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a
a aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa
a
aaa a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
aa
a a
aa
a a
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a
a aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

FB 46
FB 51
FB 45
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa
a a

program
ERWEIT
ANLAUF
a aaaa
aaaa
aaaaaa
aaaa
aa aaaa
aaaa
aaaa
aaaa
aaaaaaaa
aaaa
aaaaaa
aaaa
aaaaaa
aaaa
aa aaaaaa
aaaaaa
aa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Ramp-up

UP:FB 45
a
a a
aaaa
aaaa
aaaaaa
aaaa
aa aaaa
aaaa
aaaa
aaaa
aaaaaaaa
aaaa
aaaaaa
aaaa
aaaaaa
aaaa
aa aaaaaa
aaaaaa
aa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Cyclic user
a
a a
aaaa
aaaa
aaaaaa
aaaa
aa aaaa
aaaa
aaaa
aaaa
aaaaaaaa
aaaa
aaaaaa
aaaa
aaaaaa
aaaa
aa aaaaaa
aaaaaa
aa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa

SINUMERIK 840C (PJ)


a
a a
a a
aaaaaa
a a
a a a a aa a
a
aaa
aa
a
aaaaaaa
aa aa
a a a aaaaa aaaaaaaaaa aaaaaaaaaa
a a a a aa a aa aa aa a a a
aaaaa a a aa

data
a a a a aa a aa aa aa a a aa a a aa
a a aaaaaaaaaa aaaaaaaaaa

DB 63
Axis

Machine
a a a a a a aa aa a a a a a aaaa

DB 58
Alarms
DB 32
Alarms

DB 31
Spindle
aa
a aa
a aaaa a aaa a aaaaaaaaaa aaaaaaaaaa

Channel

Messages
Messages

DB 10...15
aa
a aaaaaa a aa
a
aa
aaaa
aa a aa
aaaaaaa a a
aaaaa
aa
a a aa
aaaa aaaaaaaaaa aaaaaaaaaa
aaaaa aaaaa

© Siemens AG 1993 All Rights Reserved


Program overview

a
a a a a a
a
aaa
a
aaa
a
aaaaa
a
aaaaaaaaa
a
aaa
a
aaa
a
aaa
a a
aaaaa
a
aaa
a a
aaa
a
aaa
a
aaaaa
a
aaaaaaaaaaa
a a
aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaa
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa aaaaaaaaaaaaaa
a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa aaaaaaaaaaaaaa
FX 74

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
Alarms

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa aaaaaaaaaaaaaa
a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaa
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a

6FC5 197- AA30


a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaa
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a

DB 4
OEM-EMPF

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaa

DB 79
DB 78
DB 77
DB 76
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaa
MMC

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa
a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaaaaa
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa
a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
FB 57 FM-ABFR

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaa
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaa
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa
a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
FB 50 UP:FB49
FB 49 UP:57/58

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaa
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
DB FM/BM
FM/BM-DB

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaa
FB 47 PSP:FMBM

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
FB 48 FMBM:MMC

a a aa aa a aa aa a aa aa aa a
QUIT FM/BMa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaa
QUIT FM/BM
QUIT FM/BM

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaaaa
a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaa
a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaaaa
a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaa
a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaaaa
FX 73

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa
Messages

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaaaa
a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaa
a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaaaa
a
a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaa aaaaaaaaaaaaaa
FB 58 BM-ABFR

aaaaaa
aaaa
aaaaaa
aaaa
aa aaaa
aaaa
aaaa
aaaa
aaaaaaaa
aaaa
aaaaaa
aaaa
aaaaaa
aaaa
aa aaaaaa
aaaaaa
aa
OEM-SEND

a a aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa
aaaaaaaaaaaaaaaaaaa
a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaa

aaaaaaaa aaaaaaaa
aaaaaaaa aaaaaaaa
PLC

aaaaaaaa
MMC

aaaaaaaa
aaaaaaaa
3.2 Error and operational messages (840C SW 3 and higher)

3–11
3 Data Sheets for Scanning/Displaying Messages
3 Data Sheets for Scanning/Displaying Messages 10.94
3.2 Error and operational messages (840C SW 3 and higher)

3.2.3 Block calls for EMs/OMs

Example

a) In the user's cold restart branch (OB 20):

:
: JU FB 45 Initial settings for EMs & OMs
Name : ANLAUF
: JU FB 46 Expansion for DB 58*)
Name : ERWEIT
:

b) In the user's cyclic program part (OB 1):

:
: JU FB 48 EM & OM auxiliary signals
Name : FMBM:MMC
:
: JU FB 57 Scan EMs *)
Name : FM-ABFR
:
: JU FB 58 Scan OMs *)
Name : BM-ABFR
:

*) Call the FB only if the function in question is required.

3–12 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
12.93 3 Data Sheets for Scanning/Displaying Messages
3.2 Error and operationalmessages (840C SW 3 and higher)

3.2.4 Data sheets

FB 45 ANLAUF
Initial settings for error messages and operational messages

1. Description

FB 45 (ANLAUF) must be loaded and called in the ramp-up branch (OB 20). This block does
the following:

• Sets up all the required data blocks (DB 4, 76, 77, 78 and 79)
• Clears data areas
• Presets data
• Prepares machine data for quicker access

2. Block data

Lib. No.:
FBs, FXs to be loaded: FB 45, FB 51

DBs, DXs to be loaded: None


Type of FB call: Unconditional, in OB 20

DBs to be input: None


Error messages: None

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 3–13


SINUMERIK 840C (PJ)
3 Data Sheets for Scanning/Displaying Messages 12.93
3.2 Error and operationalmessages (840C SW 3 and higher)

FB 57 FM-ABFR
Scan error messages

1. Description

PLC error messages can be displayed on the screen of the SINUMERIK 840C with function
block FB 57.

The bytes for error messages are defined in the PLC machine data.

Structure and description of the error messages are discussed in the INTERFACE
DESCRIPTION, PART 1 - SIGNALS.

2. Block data

Lib No.: E88530-B 6057-A-_ _

FBs to be loaded: FB 45 - FB 51, FB 57


DBs to be loaded: None

Type of FB call: Unconditional, in OB 1


DBs to be input: None

Error messages: None

3–14 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
12.93 3 Data Sheets for Scanning/Displaying Messages
3.2 Error and operationalmessages (840C SW 3 and higher)

FB 58 BM-ABFR
Scan operational messages

1. Description

PLC operational messages can be displayed on the screen of the SINUMERIK 840C with
function block FB 58.

The bytes for operational messages are defined in the PLC machine data.

Structure and description of the error messages are discussed in the INTERFACE
DESCRIPTION, PART 1 - SIGNALS.

2. Block data

Lib No.: E88530-B 6058-A-_ _

FBs to be loaded: FB 45 - FB 51, FB 58


DBs to be loaded: None

Type of FB Call: Unconditional, in OB 1


DBs to be input: None

Error messages: None


END OF SECTION

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 3–15


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1 Programming of sequencers (FB 91, FB 92)

4 Data Sheets for Sequencer Blocks

4.1 Programming of sequencers (FB 91, FB 92)

4.1.1 General notes

On a machine control, functions are often required which call for a sequence of events, such
as a change in the stage in the machine process, tool change etc. As long as a sequence of
this type does not include more than a few steps you can still implement it as a logic control.
If, however, the sequence is longer, it is too complicated to be implemented as a logic control.
It is then better to describe and control such sequences with a sequencer. This has the
advantage that it is

• easy to design,
• simple to program and
• simple to test
Moreover, you can find the cause of an error quickly by reading the current step.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–1


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.1 General notes

Fig. 4.1 shows the general structure of a drive control implemented with a sequencer. In
addition to the sequencer with its steps, subordinate individual control elements are required to
actuate and monitor the drive. The sequencer is subordinate to a function block which
organizes and checks the sequence.

FB AK
X (X+1) Function block to call and check the sequence
SB0 (1)
n ANZ
– «Start» STA

Individual control:
Sequencer:
Interlock condition (I.)
SBx

Start conditions
Drive X
«Start» SBx+1
SP
S1 IS Drive X forwards 1 F BV
tW Delay 2
1 F BZ
2
RMV
SBx+2 RMH
S2 IS Drive Y on 1
tuE Timeout –
I.
1
Drive Y

SP
F BE
F BA
SBx+n

Sn IS Drive X back . 1
RME
SP Acknowledge start – RMA
1
& Transfer flags

Fig. 4.1 Structure of a drive control

4–2 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.1 General notes

The sequencer consists of steps that contain the commands and step enabling conditions. If
required, the start can be made dependent on start conditions.
The commands and step enabling conditions of a step are put together in a sequence block.
The controlling function block only calls the current step. The commands in this step are then
output and the associated step enabling conditions scanned (Fig. 4.2). This is repeated until
the step enabling conditions have been fulfilled. When the conditions have been fulfilled the
nonretentive timers are reset and the next step called.

OB 1

SB 11
PB
FB AK 3 Commands
DB Step 1
DW Scans
Load 0
current SB 1 SB No.
No. into SB 12
C DB DW1
JU FB
SB 1: 11 Step 2
ANZ: 5
JU PB STA: F...
n
RLO1)=1
j
Call SB 15
current
step with
RLO 0 Step 3

SB No.+1

Set RLO to
”1”

Call
current
block

1) RLO=result of logic operation

Fig. 4.2 Structure of a sequential control

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–3


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.1 General notes

The command signals from the sequencer are passed on to the subordinate individual controls
through transfer flags. The individual control controls and monitors the drivers. This means that
you only have to program the commands and step enabling conditions for each step in the
sequencer.
Fig. 4.3 shows the required program structure for a drive control implemented with a
sequencer.
The parameters that the controlling function block requires in order to be able to organize the
sequencer are:
• the number of the sequence block with the first step or the start conditions
• the number of steps and
• the number of the flag by which the sequence is started.

OB 1
PB...
JU PY...
A F Start
conditions FB AK SB x
A F
S -ST Step 1
Q DB
JU FB SB x+1

Param. Step 2
SB1: X
ANZ: n
STA: -ST
• FB SLIDE
• SB x+m

Step n
JU FB Param.
SP: -SP X
BV: -X
VOR
BZ: -X ZUR
• FB FAN


JU FB Param.
SP: -SP Y



BE

Fig. 4.3 Program structure for drive control

4–4 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.1 General notes

Fig. 4.4 shows the basic programming rules for the sequencers.

Sequence block without branching;


forwards only (AK 2, 3):
S SP Command 1 –
IS Command 2 1 Commands and timers
tü Timeout –
tw Delay 2
1 Scans
2

Commands and timers:

SP: S M (A) . . . Retentive commands


or R M (A) . . .

NS: = M (A) . . . Nonretentive commands

tü: L KT . . . Timeout 1) for 1 step


SE T . . .

or L KT . . . Timeout 1) for n steps


SS T . . .

tw: L KT . . .
SE T . . . Delay

1) The timeouts are scanned in the controlling FB.

Scans:
1 A I... Step enabling conditions
2 A T...


• End of a sequence block
BE

Fig. 4.4 Basic programming rules for sequencers

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–5


SINUMERIK 840C (PJ)
4–6
Fig. 4.5
a
aa
aaaaa a
aaaa
a a
a a
a a
aaaa
a a
a a
a a
aaaa
aaaa
a a
a a
a a
aaaa
aaaa
a a
a a
a a
aaaaaa
aaaaaa
a aaaaaaaaaaaaaa
a a aa a a a aa a a aa aa a a aa aa a a aa a a aa

&
S6
S3
S2
S1
aa
aaa a aa a a aaa aa a aaa aa aa a aaa aa aa a aaa aa a a aa aaaaaaaaaaaaaa

S 12
a
aa
a a
a a
a a
aa
a a
a a a
a a
a a
aa
a a a
a a
a a
aa
a a
aa
a a a
a a
a a
aa
a a
aa
a a a
a a
a a
aa
a a
a a
a a
aa aaaaaaaaaaaaaa repeated.
aaaaaaaa a aaaaa a aaaaaaa a aaaaaaa a aaaaaaaa a aaaaaaa
a
aa
a a
a a
a a
aaaa
a a
a a
a a
aaaa
aaaa
a a
a a
a a
aaaa
aaaa
a a
a a
a a
aaaaaa
aaaaaa
a aaaaaaaaaaaaaa aaaaaaaaaa
aa a a aa a a a a a a aa a a a a a aa a a a aa a aa a

SP
4.1.1 General notes

a
a
a a a a
aaaaaaaa a
a a
a
a a a
aaaaaaaa
a a
a
a a a
aaaaaaaa
a
aaaa
a a aa a
a
a aa
aaaaaa aaaa
a
aaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaa

Start
a
aa
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
aaaa
a a
a a
a a
a a
a a
aaaa
a a
a a
a a
a a
a
a
a a
a a
aaaa
a a
a a
aaaa
a
aaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa
aa a a aa a a a a a aa a a a a a aa a a a aa a a aa a a aa aaaaaaaa aaaaaaaaaaaaaa aaaaaa
aa
aaaaaaaaa
aaaaa
a a
a a
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
aa
a a
a aa
a aaaa
a a
a a
a a
aa
a a
a a
a a
aa
a
a aaaaaaaaaaaaaa aaaaaaaaaa
a
aa
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
a a
a
a
a a
a a
a a
aa
a a
a a
a a
aa
a
aaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaa
a
aa
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a aa a a aa a a aa aaaaaaaa
a aa a a aa a a aa aaaaaaaaaaaaaa aaaaaa
a
aa a a aa a a a a a a aa a a a a a aa a a a aa a a aa a a aa aaaaaaaa
a a a aa a a a a a a aa a a a a a aa a a a aa a a aa a a aa
aaaaaaaaa aaaaaaaa
a
aa a a aa a a a a a a aa a a a a a aa a aaaa a a aa a a aa aaaaaaaa
a a a aa a a a a a aa a a a a aa a a a a a aa a a a
aaaaaaaaaaaaaa aaaaaaaa
aaaaaaaa a aaaaaaa a aaaaaaa a aaaa a aaaaaaaa a aaaaaaaa aaaaaaaaaaaa
4 Data Sheets for Sequencer Blocks

aa a a aa a a a a a aa a a a a aa a aa a a aa a a a
aaaaaaaa
Start conditions

aaaaaaaa a aaaaaaa a aaaaaaa a aaa aa aaaaaaaa a aaaaaaaa aaaaaaaaaaaaaa


aa a a aa a a a a a aa a a a a aa a a aa a a aa a a a
aaaaaaaaaa
aaaaaaaa aaaaaaa aaaaaaa a a aa aaaaaaaa aaaaaaaa aaaaaaaaaaaaaa
aaa aaa aaa a aa
a a

Acknowledge start
aa
aaaaaaaaa
aa a aa
a aaaaaaaa a aa
a aaaaaaaa a aa
a aaaa aa
a aaaa
aaaaaa a
a
aa
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
a a
a
a
a a
a a
a a
aa
a a
a a
a a
aa
a
aaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa
a
aa
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
a a
a
a
a a
a a
a a
aa
a a
a a
a a
aa
a
aaaaaaaa aaaaaaaaaaaaaa

Step enabling conditions


Step enabling conditions
a
aa
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
a a
a a
a a
aa
a a
a a a
aaaaaa a
a a
a a
aa
a a
a a
a a
aa
a
aaaaaaaa
aaa a
aaaaaaaaaaaaaa
a
aa a a aa a a a a a aa a a a a a aa a a a aa a a aa a aaaaaaaaaaaaaa
aa
a a
a a
a a
aa
a a
a a
a
a
a a
a a
a a
a a
aa
a a
a
a
a a
a a
a a
a a
aa
a a
a
a
a a
a a
aa
a
a
a a
a a
aa
a
aaaaaaaaa

Sequencer with OR branch (1 sequencer)


a
aa a a aa a a a a a a aa a a a a a aa a a a aa a a aa
a a a aa a a a a a aa a a a a aa a a aa a a a
aaaaaaaaaaaaaaaaaaa
aaaaaaaa a aaaaaaa a aaaaaaa a aaaaaaaa a aaaaaaa
a
a aa a a a a a
aa a a a
aaa
a a a
aaa
a
aaaaaaaaaa aaaaaaaa
a
a aa a a a aa a a aa
aa a a a aa a a aa
aaaaaaaaaa aaaaaaaa
4.1.1.1 Sequencers with OR branches

a aa a a a aa a a aa

SB 32
SB 26
SB 23
SB 21

a aa a a aa a a aa
aaaaaaaaaa aaaaaaaa
aaaa a a aaaa a aa aa a a a a aa a aa aa a a a a aa aaaaa
SB 20 1)

a
a a aa a a a a a aa a a a aa aa a
aaaaaaaa
a a
a a
aa
a
a
a
a
a a
a a
a
a
a a
aa
a
a
a
a
a a
a a
a
a
a a
aa
a
a
a
aaa a

&
S7
a a aa a a a aaaa a a aaaa

S 11
a
a a aa a a aaaa aa a a aa aa aa a
a a
aaaaaa a
a
aaaaaaaaaa
aaa
a
aaaa aa
aaaa
aaa
a a a a a a
a aaaa
a
aaa
a a a aaaa
a
aaa
a a a
a a
a a
a a aa a a a aa aa a
a a a a
a
a
a
a
a a
a
a
a a
a
a
aa
a
a
a
a
a a
a
a
a a
a a
a aa a a a a a aa a aaaaaa
a
a a a a
a
a
a
a
a a
a
a
a a
a
a
aa
a
a
a
a
a a a aa
a a a a aa a a a aa aa a
a
a
a
a
a
a
a
a
a a
a a
a a aa a a a aa aa a a aa
a a a a
a
a
a
a
a a
a
a
a a
a
a
aa
a
a
a
a
a a a aa
a a a a aa a a aa aa a
a
a
a
a
a
a
aa
a aaaaaa aa
aa a aa aa
a
a
aa
a aa aa
aa aa
a
aa
a a a a aa a a a aa aa a a
a a a a aa a a a aa aa a
a
a
a
a
a
a
a
a
a a
a a
a a aa a a a aa aa a a aa
a a a a
a
a
a
a
a a
a
a
a
a
a
a
aa
a
a
a
a
a a a aa
a a a a aa a a a aa aa a
a
a
a
a
a
a
a

© Siemens AG 1993 All Rights Reserved


a a a a aa a a a a aa a a a aa aa a a aa
a a a aaaa
a aa a a a a aa a a a aa aa a a aa

1)
a a a a aa aa a a a a aa a a a aa aa a a aa
Branch conditions

a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a a
a
a
a
a
a a
a
a
a
a
a
a
aa
a
a
a
a
a a a aa
a a a a aa a a a a a aa a a aa aa a
a a aa
aa aa
a aaa aa aa
a
aaaaaaaa
aa
a
aa
a aaaaaaaa
a
aa
a aa
a
aa
a
a a a a aa aa a a a a aa a a a aa aa a
a
As the examples show, all the steps in an OR branch belong to the same sequencer.

a a a a aa aa a a aa aa a a a a a a

_______
a a a a aa aa a a a aa a a a a aaaaaa a
in step 2, either steps 3 to 6 or steps 7 to 11 are executed. In Fig. 4.6 steps 2 and 3 are

a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a a
a a a a aa a a a aa aa a
a a a a aa aa a a
a a
a
a
a a
aa
a
a
a
a
a a
a a
a
a
a a
aa
a
a
a
a a a a aa aa a a a a aa a a aa aa
a a a a aa aa aaaaaaa a a a a a aa aa
a aaaa
a a a a aa aa a a aaa a
a aaaaaaa a a a aa a a
aaaaa

not with FB 92
a a a a aa aa a a aa a a aa a a
Figs. 4.5 and 4.6 show sequencers with OR branches. In Fig. 4.5, depending on the condition

a a a a aa a a a aa a a aa a a aaa

6FC5 197- AA30


aaaaaaaa a a
a a aa a
a a aa a
a aaaaa
SB 31
SB 27
SB 22

SINUMERIK 840C (PJ)


aaaa aa
a aaaaaa
a aaaaaa
07.97
06.93

aa

Fig. 4.6
aaaa
a
a aa
a a
a
a
a
a aa aa

&
a
a a
aa
a a
a
a
a
a aa
aaaaaaa
a
a aaa
a aa a
aa
a aaaa
a
a a
a a
aa
a
a
a a aa
a aa

SINUMERIK 840C (PJ)


a
a a aa
a
aaaaa
a a aa
aaaa a
a a
aaaaa
a a aa
a
a
a a aa
a
aaaaaa
a
a a aa
a a
a a
aa
a

Branching conditions
a a
aaaaaa

© Siemens AG 1993 All Rights Reserved


Sequencer with repetition (loop)
E

aaaaaaaa
aaaa

6FC5 197- AA30


a a a a a a a a a a a a

E
aaaaaa a aaaaaa a a a aaaaaa
aaaaa a a aaaaaaaaaaa a
aaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaa
aaaa a a a a aa a a a a aa a a a a a a a a a a a a
&

a a a aa a a a a aa a a a a a a a a a a a a
aaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaa

S5
S4
S3
S2
S1

a
a a
a a
a a
aa
a a
a a
a a a
a a
aa
a a
a a
a a
a a a
a a
a a
a a
a a
a a
a a
a a aaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaa
aaaaaaaa a aaaaaaa a aaaaaaaa a aaaaaaaa aaaaa aaaaaaaa
a a a aa a a a aa aa a a a a a a aa a a a
a a a aa a a a a aa a a a a a a a a a a a a
aaaaaaaaaaaaaa aaaaaaaaaaaaaa
a a a aa a a a a aa a a a a a a a a a a a a
aaaaaaaa

SP
a a a aa a a a a aa a a a a a a a a a a a a a
aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa
a a a aa a a a a aa a a a a aaaa
aaaa
a a a a a a a a a
aaaaaaa aaaaaaaaaaaaaaa
Start

a a a aa a a aa a a a a a aa aa a a a aa a a
aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa
aaa aaa a aa aa aaa
aaaaaaaa aaaaaaaaaaaaaaaa
aa
a
aaaaaa
aaaa a aa
a
aa
aaaaaa a a aa aa
aa
a
aaaaaaaaaa a
a a a aa a a a a aa a a a a a aa aa a a a a a a a a aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaa
a a a aa a a a a aa a a a a a aa aa a a a a a a a a
a a a aa a a a a aa a a a a a aa aa a a a a a a a a
aaaaaaaaaaaaaaaa aaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaa
a
a a
a a
a a
aa
a a
a a
a
a
a a
a a
aa
a a
a a
a a
a
a
a
a
a a
aa
a a
aa a a a a a a a a
a a a a a a a a a aaaaaaaaaaaaaaaa aaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaa
a a a aa a a a a aa a a a a a aa aa a a a a a a a a
a a a aa a a a a aa a a a a a aa aa a a a a a a a a
aaaaaaaaaaaaaaaa aaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaa
a
a a
a a
a a
aa
a a
a a
a
a
a a
a a
aa
a a
a a
a a
a
a
a
a
a a
aa
a a
aa a a a a a a a a
a a a a a a a a a aaaaaaaaaaaaaaaa aaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaa
a
a a
a a
a a
aa
a a
a a
a
a
a a
a a
aa
a a
a a
a a
a
a
a
a
a a
aa
a a
aa a a a a a a a a
a a a a a a a a a aaaaaaaaaaaaaaaa aaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaa
a a a aa a a a a aa a a a a a aa aa a a a a a a a a
Start conditions

a a a aa a a a a aa a a a a a aa aa a a a a a a a a aaaaaaaaaaaaaaaa aaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaa


a a a a a aa a a a a aa a a a a a aa aa a a a a a a a a aaaa

1)
a
aaa
a
aaaaa
a a a a a aa a a a a aa a a a a a aa aa a a a a a a a a aaaaaaaaaaaaaaaa aaaaaaaa aaaaaaaaaaaaaaaa
a aa a aa a a a a aa a a a a aa a a a a a aa aa a a a a a a a a
a aa a aa a a a a aa a a a a aa a a a a a aa aa a a a a a a a a aaaaaaaaaaaaaaaa aaaaaa aaaaaaaaaaaaaaaa

Acknowledge start
a aa a aa a a a a aa a a a a aa a a a a a aa aa a a a a a a a a
a aa a aa a a a a aa a a a a aa a a a a a aa aa a a a a a a a a aaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaa
a aa a aa a a a a aa a a a a aa a a a a a aa aa a a a a a a a a
Step enabling conditions
Step enabling conditions

a aa a aa a a a a aa a a a a aa a a a a a aa aa a a a a a a a a aaaaaaaaaaaaaaaa aaaaaa aaaaaaaaaaaaaaaa


a aa a aa a a a a aa a a a a aa a a a a a aa aa a a a a a a a a
a aa a aa a a a a aa a a a a aa a a a a a aa aa a a a a a a a a aaaaaaaaaaaaaaaa aaaaaaaaaa
a
aaaaaaaaaaaaaaaa

_______
a aa a aa a a a a aa a a a aa a a a a a a a a aa a a a
a
a aa a aa a a a a aa a a a a aa a a a a a a a a a a a a
aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa
aa a aa
aa a a a aa a a a aa a a a a a a a a a a a
a aaa aa aaa
aa aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa
a aa
aaaaaa
a aa
a
aaaaaa
aaaa aa
a
aaaaaa aa
a
aaaaaaaaaa
a
a aa a aa a aaaaaaaa aaaaaa aaa aaaaaaaa
aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaa
aa a aa a aaaaa a aaaaa a aaaa

not with FB 92
a
a aa a aa a a a aa a a aa a a aaa aaaaaaaa aaaaaaaa aaaaaaaaaa
aa a
aaaaaaaaa a a aa a a aa a a aaa
a a a aa a a aa a a aaa aaaaaaaa aaaaaaaa aaaaaaaaaa
a a aa a a aa a a aaa
SB 20 1)

SB 15
SB 14
SB 13
SB 12
SB 21
4 Data Sheets for Sequencer Blocks

a a a a a aa a aa aaaaaaaa aaaaaaaa aaaaaaaaaa


4.1.1 General notes

4–7
aaaa a aaaaa a aaaaa aaaa aaaa aaaaa
a
a a
a
aa
aa
aaaaa

4–8
a
a a
a a
a
a
a
aaaaaaaa

Fig. 4.7
a
a a
aaaa
a a
a a
a a
a a
a a
aaaaaa
a a
a a
aa
a a
aaaa
a a
a a
a a
a a
a
a
a a
aaaa
aa
a a
aaaa
a aaaaaaaaaaaaaa aaaaaaaa
a a a a a a a a aa a a a aa a a a a a aa a aa

&
S6
S3
S2
aaaa a a a a aaa a aa aaaa a aa a aaaa a aaaaa a aa aaaaaaaaaaaaaa aaaaaaaa

S 12
a
a a
aa
a a
a a
a a
a a a
a a
a a
a a
aa a
a a
aa
a a
a a
aa
a a a a aa a aaa a aa
a a aa a aaa a a aaaaaaaaaaaaaa aaaaaaaa
aaaaaaa a aaaaa a aaaaaaa a a a aa aaaaaaa a aaaaaaa
a a aa
aaaaaaaa
a a aa
Please note:

a aa a a a a a
aaaaaaaa
a aa a a a aa a aa a a a aa a a a a a a a aa aaaaa a aaaa a aaaaaaaaaaaaaa

2
1
2
1
aa a a a aa a a aa a a a aa a aaaa
a a a aaaa
a a a a aa a a a a a a a a a a
aaaaaaaa

IS
IS

SP
SP
4.1.1 General notes

aa a a a aa a a aa a a a aa a a aa a a a aa a aaaa
aa
aaaa
aaa a aa a a a aaaa a aaaaaa
a aaaa
a aaaaaaaaaaaaaa

BE
aa a a a aa a a aa a a a aa a a aa a a a aa a a aaaaaa a a a aa a aa a aa aaaaaaaaaaaa aaaaaaaa
aa
aa a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a
a
a a
a a
aa
a a
a a
a a
a a
a a
a a
a a
a
a
a
aa
a
a
a aa
aa a
aaaa
aa a
aaaaaaaaaaaaaa aaaaaaaa

R -Y
aa a a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a a a aa a a aaaaaaaaaaaaaa

SB 26:
aa a a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a a a aa aaaa
aaaaaa
aa a
aaaaaaaa
aa a a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a a a aa aa
a aa a aa a aaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaa a aa a a a a a a aa a a aa a aa
aaaaaaaa

T DW 0
L KB 12
aa a a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a a a aa a aaaaaaa a
aaaaaaaaaaaaaa

Branching
aaaaaaaaaaaaaaaaaaaaaaaaaa a aa a a a a a a aa a a aa a aa
aaaaaaaa

A -Y OFF
condition A
aa a a aa a a a a a a aa a aaaaaaa aaaaaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaa
aaaaaaaaaa
aaaaaaaa
aaaaaaaaaa
aa a aa a a a a a a aa aaaaaaaa a
aaaaaaaa

A -X BACK
aa a a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a a a a
aaaaaaaaa

Drive Y on

Drive Y off
aa a a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a aaaa a
aaaaaaaa
aa a a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a a a
aaaaaaaaaaaaaa
aa a a a aa a a aa a a a aa a a aa a a a aa a aaaaaaa a aaaa a aaaaaaaaaaaa
aaaaaaaa
4 Data Sheets for Sequencer Blocks

aa a a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a a a

= -X REVERSE
aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaa a aaaa a a a a aaaaaaaaaaaaaa aaaaaaaa

Drive X reverse
a aa a a a a a a aaaa
aa aaaa
a
Drive X forwards
aaaaaaa a aaaa a aa a aa aaaaaaaaaaaaaa aaaaaaaa
aaa aa aaaaa a aa

S7
aa
a aa
aaaaaa a aa
a aa a a aaa a aa
aaaaaaaa
a
a a
aa
a a
a a
a a
a a
a a
a a
a a
aa
a a aaa a
aaaaaaa a
a
aaaaaaaaaaaaaaaaaaaaa aaaaaaaa

Joining after an OR branch:


a
a a
aa
a a
a a
a a
a a
a a
a a
a a
aa
a
aaaaaaaaaaaaaa aaaaaaaa
a
a a
aa
a a
a a
a a
a a
a a a
aaaaaa a aaa
aaaaaaaaaaaaaa aaaaaaaa

2
1
a
a aa a a a a aaaaaa
a a aa aa a a a a aaaaaaaaaaa
aa a a a a a aa a aa
aaaaaaaa
a aa a a a a aaa aa a aa aaaaaa aaaaaaaaaaaaaaaaa

2
1
2
1

a aa a a a a a a aa a aa
aaaaaaaa
a aa a a a a a aa a aa
aaaaaaaaaaaaaa
aaaaaaa a a a aa a aa aaaaaaa
aaaaaaaaaaa

Programming sequencers with OR branching


a
aa a a a a a aa a aa
a a a aaaaaa
a a a a aa a aa
a a a a a aa a a aa a aa
Branching aaaaaaaaaaaa
aa a a a a aa a a aa a aa
condition B
aa a a a a aa a aaaaaaaa

SB 32
SB 26
aa a a a aa aaaaaa
aaaaaa
a
aaaa a a aaaa a aa aa a a a a aa
aaaaaa
a
a a a aa a aa a aa a
a a aa a aa a aa a
aaaaaaaaaa
a a a aa a aa a aa a

&
a a a aa a aaaaaa aaaaaa

S 11
a a a aa a aa aa aa
Sequence block with OR branch (AK 2, 3):

a a a aa a aa a a a aa a a a a a a a a a a a a a a a
aaaaaaaaaa
a a aa a a aa a a a aa a aaaa
a a a aaaa
a a aaaaa a aaaa
aaaaaa
aaa a aaaaaa
aaaa
a aaaa
aaaa
aaaaaa
aaaaaaaaaaaa
a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a a aa a a aa a a a aa a a aa a a a aa a a a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaa

BE
BE
a a aa a a aa a a a aa a a aa a a a aa a a a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaa
a a aa a a aa a a a aa a a aa a a a aa a a a a a a a aa aa a aa aa a aa aa a a aa a aa a
BEC

a a aa a a aa a a a aa a a aa a a a aa a aaa a a
aaaa a
aaa
a a a a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

2
1
a a aa a a aa a a a aa a a aa a a a aa a a aaaa
aa a a a a a a a aa aa a aa aa a aa aa a a aa a aa a

IS
tw

SB 31:
SB 22:

a a aa a a aa a a a aa a a aa a a a aa a aaaa
aa
aaaaaa a
a aa a a a a a a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A I...
A I...
A I...
A I...

a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a a a a aa aa a aa aa a aa aa a a aa a aa a
T DW0
S F...
= F...

A -TUE
SE -TUE
Fig. 4.7 shows the programming rules for branching and joining.

a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a a a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

= -Z ON
a
a
a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a
a
a a
a
a
a a
a
a
a
a
a a
a
a
a
a
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a
a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
L KB 7 1)

a
a
a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a
a
a
a
a
a
a a
a
a
a
a
a a
a
a
a
a
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a
a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

L KT 100.1
a
a
a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a
a
a a
a
a
a a
a
a
a
a
a a
a a
a
a
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a
a aaaaaaaaaaaaaaaaa
a a aa a a aa a a a aa a a aa a a a aa a a aa a a a a
A br. cond. B
A br. cond. A

a a aa a a aa a a a aa a a aa a a a aa a aaa a aa
aa
a
1) aaaa
aaaa
aaaaaa
aaaa
aaaaaa
aaaa
aa aaaaaa
aaaaaa
aa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a a aa a a aa a a a aa a a aa a a a aa aa
a aa
aaaaaa
a a a
aaaaaa
aaaa
aaaa
a aa a a aa aa a aa aa a aa aa a a aa a aa a

A -Z RUNNING
a aaaaaaaaaaaaaaaaaaaaaa a aa a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Drive X on
aaaaaaaaaaaaaaaaaaaaaaa a a aa a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaa
DB is no changed the step number is incremented by 1 (linear sequence).

a
a a
aa
a a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
a a a a a a a aa aa aa aa a a aa aa a aa aa a a aa a aa

Delay on 10 s
a
a a
aa
a a a a a a a a aa aa aa aa a a aa aa a aa aaaaaaa
aaaa
a a a aa a aa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a

© Siemens AG 1993 All Rights Reserved


a aa a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
_______

a aa a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
a
a a
aa
a a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a aa a
a
a
a
a
a a
a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a aa a a a a a a
aa
a aa
aaaaaaaaa aaaaaa
aaaa
aaaa
aaaa
aaaaaaaa
aaaa
aaaaaa
aaaa
aaaaaa
aaaa
aa aaaa
aaaaaa
aa
a aa
a a aa aa aa aa a a aa aa a aa aa a aa aa aa
a aa a aa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a
step to which the branch is to lead is loaded to data word 0 of the current data block.
For a branch, first the step enabling conditions and then the branching conditions are

a aa a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
Branching

after DW 0
conditions
conditions

a aa a aa a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Commands

a aa a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
Loading the

a aa a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

2
1
a aa a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
the branch is to lead
Step enabling

sequence No.

a aa a a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a aa a a a a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a
aaaaaaa a a
aaaaaa a a a aa aa aa aa a a aa aa a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a a a a aa aa aa a
No. of the step to which
programmed (after the commands). Straight after the branching conditions the number of the

a a aa a a a aa aa aa a
Evaluation is performed automatically by the main sequencer block. If the DW0 of the current

a a aa a a

6FC5 197- AA30


a a a
aa a aaaaaa
aaaa
aaaa
aa
a aaaaaaaaaa a
SB 31

SINUMERIK 840C (PJ)


aa
a
aa
a
06.93
aaaaaaa

E1
06.93

aaaaaaaa
aaaaa

Fig. 4.8
a
a a
a a
aa
a aa a aaaaa a aaaaaa a aaaaaa a a
a a aa a aa a a a a a aa aa a a a aa aaa aaaa
a a a
aaaaa aaaaaaaaaaaaaa

E1
a aa
aaaa
aa
a a
aa
a a
a a
aa
a a
a a
a
a
a a
a a
a a
aa
a a
aa
a
a
a a
a a
a a
aa
a a
aa
a
a
a a
a a
aa
a a
a a
aa
a
a
a aaaaaaaaaaaaaa

S5
S4
S3
S2
S1
a
aa
a a
a a
aa
a a
a a
a
a
a a
a a
a a
aa
a a
aa
a
a
a a
a a
a a
aa
a a
aa
a
a
a a
a a
aa
a a
a a
aa
a
a
a aaaaaaaaaaaaaa
aaaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa
a
aa
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aaaa
a a
aaaa
aaaaa a
a a
a a
aaaaaaaaaaa a
aaaaa a
aaaa
aaaaaaaa
a a
aaaaaa
a aaaaaaaaaaaaaa aaaa
aa a aa a a a a aa a a a aa a aa a a a aaa a a a a a a a a a a a a a a aa a a aa a aa a

2
1
2
1

SINUMERIK 840C (PJ)


IS

SP
SP
SP
SP
SP
a
aa
a a
a a
aa
a a
a a
a a
a aaaa
aa
aaaaaaa a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
a a
a a
a a
aaaa
a
aaa
aa
a a
a aa
aa
aaaa
aaa a
a a
a a
a a
a a
a a
a a
a aaaa
aa aaaa
aaa a
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a
a
aaaaaaaaaaaaaa aaaaaaaa aaaaaaaa
a
a a
aaa a
aa
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aaaa
a a
aaaa
a a
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
a a
aaa a
a a
a a
a a
a a
a a
aaaa
a a
a a
aaaa
a a
aaaa
a a
a
aaaaaaaaaaaaaa aaaaaaaa aaaaaaaa
a
aaa a
a a
aa
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
a a
a a
a a
aaaa
a a
aa
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a
a
aaaaaaaaaaaaaa aaaaaaaa aaaaaaaa
a a a aa a aa a a a aa a a a aa a aa a a a a aa aa a a a a a a a a a a a a aa a a aa a aa a aaaaaaaaaaaaaa aaaaaaaa
aa a aa a aa a a a aa a a a aa a aa a a a a aa aa a a a a a a a a a a a a aa a a aa a aa a Start AK 1
aaaaaaaa
a a a aa a aa a a a aa a a a aa a aa a a a a aa aa a a a a a a a a a a a a aa a a aa a aa a aaaaaaaaaaaaaa aaaaaaa
aa a aa a aa a a aa a a a aa a aa a a a a aa aa a a a a a a a a a a a aa a a aa a aa a aaaaaaaa
aa aaa a a aa aa a aaa aaa aaaaaaaaaaaaaa
a aaa aa
aaaaaaa
aaaa a aa
aaaaaaaaaaa
aaaaaa
aaaaaa
a aa aa a aa
a aaaaaaaa a aa
a aaaaaaaa
aaaaaaaa
aaaaaa a aaaaaaaa
a a aa a aa a a aa a a a aa a aa a a a a aa aa a a a a a a a a a a a aa a a aa a aa
aaaaaaaa
a a a a a a

AK 4 executed
AK 3 executed
Start AK 2
Start AK 3
Start AK 4
a
a
aa
a
a a
aaaaa
a a aa aaa
a a
a a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a a
a
a
a
a
a a
a
a
a a
a
a
a aaaaaa
a a a a a
a a
a aaaaaaaaa
a a a aa a a aa aaaa
a aa
a aaaaaaaa aaaaaaaa

Command X
a aaa aaaaaaaa a aaaaaaaaaaaaa aaaaaaa a aaaaaaaaaaaaaa a aaaaaaaaaaaaa aaaaaaaa

© Siemens AG 1993 All Rights Reserved


a a a aa a aa a a aa a a a aa a aa a a a a a a a a a a a a a aa a a aa a aa

Main sequencer
Start conditions

a
aaaaa
aaaaaaaa
aa a aa a a a aaaaaaaaaaaaa
a a a a aa a aa a a a
aaaaaaa
a a a a a a a aaaaaaaaaaaaaa
a a a a aa a a aa a aa a aaaaaaaaaaaaaa aaaaaaaa
aaaa
aaaaaaaa a aa
a a a a aa a aa a a a aaaaaaa a aaaaaaaaaaaaaa a aaaaaaaaaaaaaa
a
aa
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a
a aaaaaaaaaaaaaa
a
aa
a a
a a
aa
a a
a a
a a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
a a
a a a
a a
a a
a a
a a
a a
a a a
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a aaaaaaaaaaaaaa
aaa aaa aaa aaa

SP Acknowledge start AK1


a
aa
aaaaaa
aaaa
a a
aa
aaaaaaaaaa
aaaaaa
aaaa
a a
aaaaaaaaaa
a a
aaaaaaaaaa
aaaaaaaa
aaaaaa
a

Acknowledge start AK4


Acknowledge start AK3
aa a aa a a a aa a a a aa a aa a a a a a a a a a a a a a aa a a aa a aa a
aaaaaaaaaaaaaaaaaaaaa
aa a aa a a a aa a a a aa a aa aa a a a aa a a aa a aa aa aa a aa a
aa a aa a a a aa a a aa a aa a a a a a a a aa
aaaa
a a a a aa a a aa a aa a a
aaaaaaaaaaaaaa
aa a aa a a a aa a a a aa a aa a a a a a a a a a a a a a a aa a a aa a aa a
aa a aa a a a aa a a a aa a aa a a a a a a a a a a a a a a aa a a aa a aa a
aaaaaaaaaaaaaa

-
-

2
1
2
1
aa a aa a a a aa a a a aa a aa a a a a a a a a a a a a a a aa a a aa a aa a
aa a aa a a a aa a a a aa a aa a a a a a a a a a a a a a a aa a a aa a aa a
aaaaaaaaaaaaaa
aa a aa a a a aa a a a aa a aa a a a a a a a a a a a a aa a a aa a aa
aaaaaaa a aaaaaaaaaaaaa aaaaaaa aaaaaaaaaaaaaa
aaaaaaaaaaaaaa

6FC5 197- AA30


a a a aaaa aaaaaa a aaaa
4.1.1.2 Sequencer with AND branching

a aaaaa a a a aa aa a a
aaaaaaa aaaaaaaa
a a aaaa
a a a a a aaaa
a

SB
SB
SB
SB
SB

aaaaaaa a aaaaaa
aa
aaaaaaaa a a a
aaaaaaaa aaaaaaaa
a a a a aaaaaa
a a a aaaa a a a a aaaaaa aaaaa

E2
aa a a a a a a aaaaaaaa
a aa aa a a aa a aa a a a a a aa a a a a a a a

Sequencer with AND branching (1 sequencer per branch)


SB 10 1)

a aa aa a a a aa a aa a a a a a a a a
aaaaaaaa

E2
a
a aa aa a a a aa a aa a a a a a a a a a a a a aaaa
aa aa a a a aa a aa a a a a a a a a a a a a

S4
S1
a
a aa a aa a aa a a a a a a a a a a a a
aa a aa a aa a a a a a a a a a a a a
a
a a
aa
a
a aa a
aaaaaaaaa
a
a a a a
aaaaaaa a a a a
aFa
a a
a a
a
a
a aa a a a aa a a a a a a
aa a aaaa a aa a a a a a

SB
SB
a aa a a aa a

Sequencer 2
a a aaaaaa
a aaaa
aaaa a
a a
a a
a
a
a
a
a
a a a a a
E3

a a a a a a
a
aaa
a a aa a a a a a a aa a a a a a a a
aa aaaaa
a a
aaa
a a
aaa
a a a a a a a a a

E3
a
a aa a a aa a aa a a a a a a a a a a a a
aa aa
aaaa
a a aa a aa a a a a a a a a a a a a

S7
S1
a
a aa a aa a aa a a a a a a a a a a a a
aa a aa a aa a a a a a a a a a a a a
F

a
a aa a aa a aa a a a a a a a a a a a
a a
a
a aaaaaaa a a a aaaaaaa aa a a
a
a a
a
a
a a
a a a a aa a a
aa a aaaaa a aaaa a

SB
SB

a a a aa a a
aa
a a a a
aaaa
aa

1)
Sequencer 3
a a a aa a a a a aaaa aa
a aaaa
parallel with AND branching, a separate sequencer is required for every branch.

a
a a a aa a a aaaa
a a
a a
a a
aa
a a
a
a
a a
a a
a a
a
a
a
a
a
a a a aa a a a a a a a
E4
the last step of the subordinate sequencer and are scanned in the main sequencer.

a
a a a aa a a a a a a a a
a a aa a a aaaa
a aa a a a a a a aa a a a a a a a
It is advisable to create one sequencer as a main sequencer which starts and checks

a a a aa a a a aa aaaaa
a a
aaa
a a
aaa
a a a a a a a a a

_______
E4
a a a aa a a a aa a a aa a aa a a a a a a a a a a a a
a a a aa a a a aa aa
aaaa
a a aa a aa a a a a a a a a a a a a

S6
S1

a a a aa a a a aa a aa a aa a a a a a a a a a a a a
a a a aa a a a a a aa a aa a a a a a a a a a a
F

a a a aa a a aaaa aaa a aaa


a a a aa a a a aa
aa
a aa
aaaaaa
a
aa
a aaaaaaaaaa aa
a a aa a
a a aa a a a aa a a aa a a a a a
subordinate sequences. The subordinate sequences are started using start flags. Flags are

not with FB 92
a a a aa a a a aa a aaaaa a aa a aaaa a
also used to scan whether the subordinate sequencer has terminated. These flags are set in
The figure shows a sequencer with AND branching. Because the branches have to be run in

SB
SB

a a a aa a a aa a a aa a

Sequencer 4
aaaaaaa a a a
aaa aaaa aa
a aaaa
a
4 Data Sheets for Sequencer Blocks
4.1.1 General notes

4–9
a
a a
a
aa
a a a
aaa
aaa
aa a aaaaaaaa
a aa a a a aa a

4–10
a aa a a a aa a aaaaaaaa

Fig. 4.9
a
a a
aa
a
a
a a
a a
a a
aa
a
a
a aaaaaaaa
a
a a
a aa a aa a a a a aa
aaaa a a a a
aaaaaa a a a a a a a aaaaaaaa
a aaaa
a aaaa a aaaa a a aa a a a aa a aaaaaaaaaaa a aaaaaa
aaaaaaa

E2
a a aa a a aa a a aa a a a aa a a aa a a aa a a a aa a a a aaaaaaaaaaaaaaaaaa
a
aaaaaa
sequencer.

aaaaaa
a a aa a a aa a a aa a a aaa a a aa a a aa a a aa a a a aa a a a a

S4
S4
S3
S2
a aa a a aa a aa a a a aa a a aa a a aa a a aa a a aa a a a
aaaaaaaaaaaa aaaaaaaa
a aaaaaaa a a aa a a a aa a a aa a a aaaaaaa a a aaaaaa a a aaaaaa
Please note:
aaaaaaaa a aa a a aa a a aa a aaaaaaaa aaaaaaa aaaaaaaa
aaaaaaa
aaaa a a a aa a a aa a aaaaaaa
a aa a a aa a a aa a
4.1.1 General notes

a
a a
aaaa
a
aaaa
a a a aaaa
a aa
a a
a a
a a
a
a
a a
a a
a a
aa
a
a a
a a
aaaaaa
a aaaaaaa aaaaa
a a a a a
a a
a
aaaaa
aa a a a
aaaa
a
aaaaaaaaaaa
a a a
aaaaaaaa
a aa a aaaa a aaaa a a a aa aaaaa a aaaaaaa a a aa a a a aa
a a aaaa a a aa aa a a a a aaaa a a a a aa aaaa a aaaaaaaaaaa aaaaaaaa

2
1
2
1

IS
IS
IS
a aa a a aa a a aa a a aa a a aa a a a aa a a a aa a a aa a aaaaa aa aaa
aa a aaaaa
a a a aa a a a a aaaaaaaa a aa a aa a aaaaaa

SP
SP
SP
SP
SP
SP
SP
a aa a a a
aaaaaa a aaaa
a aa
a
a a
a aa aa aaaa aaaaaaa a
a a
aa
a
a aaaaaaa
a a a aa a a a aa a a
aaaaaaaa aa a a
aaaa
aa
aaaaaaaaa a a aa a a aa a
aaaaa a aaaaaaaaaa
a a aa a aa a aaaaaaaa

21
4
- START AK
aa
a aa
aa a aa a a aa a aaaa aa
aa aaa aaaaa aaa a aa a aa
a aaaa
aaaaaa aa a a aa a a aaa a a a aa
a aaaa a a a aaaa
a
aaaaaaaaaaaaaaaaaa
a aa a aaaaa aaaaaaaa
a aa a a aa a aa a a a aa a a a aa a a a aa a a aa aa aa a a a a a aa a a a a aa a aa a

Main sequencer:
a
a a
aa
a a
a
aaaa
a aa
a
a a
a a
aa
a
a
a a
a a
a a
aa
a
a
a a
a a
a a
aa
a a
a a
a a
a
aaaaaaa
aa a a aa
a
a a aaa a a a a a aaaaa a aa aaaaaaaa
a aaaa aa a a aa aa a a aa
aaaaaaaaaaaaaaaaa
a aa a

Call a main block:


a
a a
aa
a a
a a
aaaa
a
a
a a
a a
aa
a
a
a a
a a
a a
aa
a
a
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aaaa
a
a
a a a a a a aa a a a aa a a a aaaaaaaaaaa aaaaaaaa
a aa a a aa a a aa a a a aa a a a aa a a a aa a a aa a a
a
aa
a
aa
aa
a
aa
a
aa
a
a
a
a
a a
a a
a
aa
a a
a a
a
a
a a
a a
aa
a
aa
a a
aa
a a
a aaaaaaaaaaaa
a
a a
aa
a a
a a aa
aaaa a a
a aa a a aa a a a a a a aa a a aa a a a aa a a aa a aaaaaa a a aa a a a aa a a a
aa a a a aa a a a a a aa a a aa a a a aaaaaaa a a aaa a a a a a aaaaa a a aa aaaa a aaaaaaaaaaaa
a aa a a aa a aa a a a aa a a a a a aa a a aa a a a aa a a aa a aaaaaa a a aa a a a aaa aa
4 Data Sheets for Sequencer Blocks

AK 4 executed
AK 3 executed

STA
ANZ
Start AK 2
Start AK 3
Start AK 4
a aa a aaaa a a aa a a aa aa a a aa a a a aaaaaaa a a a a aaaaa a a aa aaaa a aaaaaaaa

SB 1
a aa a a aa a aa a aaaaaa
aaaa aaa a a aa a a a aa a a aa aaaa
aa
aaaaaaa a a aa a a a aaa aa aaaaaaaaaa

Command z
Command y
Command X
a
aaaa
aaaa
aaaa
aa
a a aa
aaaa a aaaaaaaa
a a
aaaaaa
aaaa aaaa
aaaaaaa
a a a aa
a a
aaaa
aaaa
aa a a
a a aa
aaaa
aaa
aa
a a
a aaaaaaaaaaaa
aaaa a a aa aaaa a aaaa a

AK 2 executed
R. command U
a
aaaa
aaaa aa a aaaa a a
aaaa aa
aa aa aaaaaaaa
a a aa a a
aaaaaa a a a a
aa aa
aa aaaa
aa aaaaaaaaaaaaa
a aa a a
aaaaaaaa aa a a
aaaa
a a
a a a aa a a a
aaaaaaaaaaaaaaaa a a aa a a a aa
aaaaaaaa a a a aa a aa a
a aa a a aa a aa a a a aa a a a aa a a aa a a aa a a
aaaaaaaaaaaaaaaaaaaa
a aa a aaaa a a aa a a a aa a a a aaaaaaa a a a aaaaa a a
a a
aa
a a
aaaa
a a
a aaaaaaaaaaa
a
a a
aa
a a
a a
a aa
a
a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
a a
aa a
a a
a aa
a
a
a a
a a
a a
aa
a a a
a
a
a a
a a
aa
a a
a a
aa
a a
a aaaaaa
a aa a aaaa a a aa a a a aa a a a aa
a a aaaa a a a aaaa a a a aa

Last step in a main sequencer:


a aa a a aa a a aa a a a aa a a a aa a a aa a a a aa a a a a aa
aaaaaaaaaaaaaaaaa
a aa a

Acknowledge start AK4


Acknowledge start AK3
a
a a
aa
a a
a a
a a
aa
a
a
a a
a a
aa
a a
a a
a a
aaaa
a a
a a
a a
aaaa
a a
a a
aaaa
a
a
a a
a a
aaaa
a a
a a
a
a
a a
aaaa
a a
aaaa
a a
a
aaaaaaaaaaa
a aa a a aa a aaaa a a aa a a a aa a a aa a a a aa a a a a aa a aa a aaaaaaaaaaaa
a aa a a aa a a a aa a a a aa a a aa a a a aa a a a a aa a aa a

Programming rules for branching and joining


-
-

1
1
2
1
2
1
2
a aa a a aa a a a aa a a a aa a a aa a a a aa a a a a 1
aa a aa a aaaaaaaaaaaa
a
a aa a a aa a a a aa a a a aa a a aa a a a aa a a a a aa a aa a aaaaaa
aa a a
aaaaaaaa aa a a aa a a a aa a a aa a a aa a a a
a aaaaaaaaaaaaaa a aaaaaaa a aaaa
aaaaaa
aaaaaaaaaaaaaaa
a a a a a
a aaaa
a a a
aaa
a a
aaa
aaa
aaaaaaaa

SB
SB
SB
SB

a a a
aaaaaa
a aaaaaa
a aaaa
aaa
aaaaaaaa
a ”retentive” command which you must cancel after the ”joining”.




a
a a
aaaa
a a
a a
aa
a a
a a
a a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaaaa
a
aaa
a
a
a
aaa
a
aaa
a
aaaaa
a
aaaaaaaaa
a
aaa
a
aaa
a
aaa
a
a
a
a
a
a
a
aaa
a
aaa
a
aaaaa
a
aaaaaaaaaaa
a
a
a
aaaaaaaaaaaaaaaaaaaaaaaaaa
a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a

BE
a a aa aa a aa aa a aa aa a aa aa aa aa a a a a
BE

a aa a aa aa a a aa a aa a
a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaa
signalled to the subordinate sequencer as a ”nonretentive” command.

a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a a
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
aa
a a
aa
a a
a
a
a
a
a a
aa
a a
aa
a a
a a
aa
a a
aa
a a
a a
a a
aa
a a
a a
aa
a a
a aaaaaaaaaaaaaaaaaaaa
a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a

SB 24:
SB 14:
SB 13:
SB 12:

a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaa
a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a

© Siemens AG 1993 All Rights Reserved


a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaa
a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a
A - RM Z aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a
A - RM Y
A - RM X

a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaa
a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a
a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaa
a aa a a aa a a a a a a a a aa aa aa aa aa aa aa a a a aa aa a aa aa a aa aa a aa aa aa aa a a
a aa
a aaa aaa aaaa
aaaa
aaaaaa
aaaa
aa aaaaaa
aaaaaa
aa

= - AK 2END
A - AK 4END
A - AK 3END
A - AK 2END

a
aa
a
aaaaaaaa
aaaaaaaa a aa
a aaaaaaaa
aaaa
aaaa
aaaa
aaaa
aaaa
aaaa a aa
a
aaaaaa
aaaa
aaaaaa
aaaa
aaaaaa
aaaa
aa aaaa
aaaa
aaaa
aaaa
aa a a aa aa a aa aa a a aa a aa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a
1. If you program the start of a subbordinate sequencer and the scan for completed

a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aaaaaaaaaaaaaaaaaaaa
a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a

R - START AK 4
R - START AK 3
= - START AK 2
S - START AK 3
S - START AK 4

a aa a a aa a a a aa a a a a aa aa aa aa aa aa aa a a a aa aa a aa aa a aa aa a aa aa aa aa a a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaa
S - COMMAND Z
= - COMMAND Y
S - COMMAND X

R - COMMAND U
example for the parameterization of a subordinate sequencer and the last step of a main

a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a aaaaaaaaaaaaaaaaaaa a a a a aa aa a aa aa a aa aa
aaaaaaaaaaaaaaaaaaaaaaaaaaaa
a aa aa aa aa a
a
a
aaaa
aaaa
aaaaaa
aaaa
aa aaaaaa
aaaaaa
aa aaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaa a
3. Program the setting of the fla with which completed execution of the main sequencer is
2. If you program the scan for completed execution in a different block, program the start as
Fig. 4.9 shows the programming rules for ”branching” and ”joining” in the main sequencer, for

execution in the same step, program the start as a ”nonretentive” command (assignment).

6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93
06.93 4 Data Sheets for Sequencer Blocks
4.1.1 General notes

4.1.1.3 Sequencer modes


Sequencers in ”Automatic” mode
The simplest sequencer only has ”Automatic” mode (e.g. FB 92; AK3:AUT). A sequencer of
this type is enough to be able to control simple processes, such as gear changing. If execution
has to be aborted because of a defective actuator, the sequencer has to be restarted when the
actuator has been repaired.
(Sequencer started with block 1).

Please note:
If you reset the starting flag to abort execution you must also reset the flags set in the steps of
the sequencer. The nonretentive commands are automatically reset.

Sequencers with the modes ”Automatic and manual”


For large sequencers, for example, to actuate a tool changer, ”Automatic” mode is no longer
enough. Additional ”Manual” modes are required for testing and setting up the machine.

FB 91 (AK 2:V/R) has the following modes:


1. Automatic mode
The sequencer is automatically executed in accordance with its step enabling conditions,
delays and monitoring times after the start command.
2. Manual modes
– Step selection (without conditions)
With step selection, every step of the sequencer can be selected without having to
fulfill the step enabling conditions. No command is output.
– Step control (with conditions)
In step control you can move one step forwards or backwards in a sequencer if the
step enabling conditions are fulfilled. No command is output.
– JOG (with conditions)
In JOG mode, you can move one step forwards or backwards in the sequencer if the
step enabling conditions are fulfilled. Moreover, the signals ”JOG mode” and ”JOG”
are output for a subordinate actuator. This makes positioning possible. No command is
output.

When you have selected a step you can switch over to ”Step control” without conditions. To
prevent impermissible commands being output because of this switchover, you must program
the appropriate interlocking conditions for the subbordinate individual control modules.
The structure of the drive circuit required for forwards and backwards operation is shown in
Fig. 4.10. The controlling function block not only organizes the execution of the sequencer, but
also influences the subordinate actuators. You must observe the following points with forwards,
backwards and JOG mode.
1. In the steps, you must program not only step enabling conditions for forwards mode but
also the ”Step enabling conditions” for reverse mode. The step enabling condition is
selected by the signal ”Control backwards” (STR).
2. The individual control modules must have an input for reversal of the command direction
(UMST) which is also controlled by the signal ”Control backwards”.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–11


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.1 General notes

3. The actuators whose movements are to be stopped by JOG mode must have an input for
”JOG mode” and an input for ”JOG”. If the input ”JOG mode” carries a ”1” signal, the
retentiveness of commands is suppressed if the actuator is not in an end position. In JOG
mode, commands are only output to the actuator as long as the input ”JOG” is carrying a
”1” signal (exception: end position reached).

FB AK 2:V/R
• •
• •
• •
H/A
SST+ STR
SST- TIPB
TIP+ TIP
TIP-
SVOR
• •
• •
• •

} Start conditions
Start Drive X
S1 IS Drive X forwards 1 M BV VV
1 (RMH) tw Delay 2
M BZ
UMST VZ
TIPB
1 (RMV)
& 2 TIP

R S2 IS Drive Y on 1
1 (RMA) tü Timeout – Drive Y

1 (RME) M BE
& S3
M BA

R UMST
Sn IS Drive X reverse 1
tw Delay 2 Individual control
Control signals modules
for forward, reverse and
Sequencer JOG mode

Fig. 4.10 Sturcture of a drive circuit for forwards and backwards mode

With this sequencer you can control composite mechanical movements manually in any
direction. If a part of the motion is to be skipped, you can select the required step using ”Step
selection”. Switchover from step selection to step control (SST+) is only possible if the
required step enable or power on conditions are fulfilled (programmed in the previous step).
Interlocking conditions for the subordinate individual control modules are therefore not needed
in most cases.

4–12 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
aaaaaaa
06.93

aaaaaaa
aaaaaa

SB n

Fig. 4.11
aaaaaaa
aaaaa

R
&
R
&
Please note:

1
a
aaaa
aaa a

1
commands.

aaaaaaaaa
a
a a
a a
a a
a
FB 91 (AK 2:V/R).

a a a a

SINUMERIK 840C (PJ)


a a a a

S3
a a a a

Sn
a a a a

Sn

SB 27
a
a a
a a
a a
aaaa a

&

Sn
IS
a

2
1
a aaaaa
a
IS
tw

1
a
aaaa
aa
aaa aaaa

© Siemens AG 1993 All Rights Reserved


Cond. branch A

S7
Delay

1
a aaa

1
a
aaaa
aa
a

Step blocks OR branching (AK 2)

STR
Drive Y forward

STR

6FC5 197- AA30


Drive X forward

Cond. branch B
1
2
1

STR (control backwards)

IS Drive Z open
.

=
=

a a a a a a a

A
A
A
A
A
A
A
A
A
A

a a
aaa
a
aaaaa
a
aaaaaaaaa
a
aaa
a
aaa
a
aaa
a a
aaaaa
a
aaa
a a
aaa
a
aaa
a
aaaaa
a
aaaaaaaaa
a
aaa
a
aaa
a a a
aaa
a
aaa
a
aaaaa
a
aaaaaaaaaaa
a a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

BE
BE
SE

AN
AN
AN

a
a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a
a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaa

BEC
BEC

LK7

Programming rules for forwards and backwards mode of a sequencer


SB n:

aa aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa aa aa aa a aa aa a a aa a aa a
a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaa
SB 22:
step number for backwards mode into DW 1 of the current DB.

T DW 0
a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a
a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaa

.
.
.
aa a a

A
a a aa a aa a a a aa a aa

A
a a

A
a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaa
K.....

BE
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a

- STR
- STR
- STR
- TUE
- STR
- STR
- TUE

BEC
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaa

LK2
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a

SB 27:
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaa

T DW 1
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a
a
aa
a a
a a
a a
a a
a a
aa
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
a a
aa
a a
a a
aa
a a
a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaaa
a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaa
Step block without branching: forwards and reverse (AK 2)

AN - STR
- STR
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a a
aa
a a a aa a aa aa a aa aa aa aa a a aa aa a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aa aa a aa aa a aa aa a a a aa aa a aa aa a a aa a aa a
a

- Cond. bra. B
- Cond. bra. A
aa
a
aaaaaaaaaaaa
aaaaaa
aaaaaaaaaa
aaaaaa
aaaaaaaaaaaa
aaaa
aaaaaaaaaaaa
aaaa
a a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a a aa aa a aa aa a a aa a aa a
- X REVERSED

- Y ADVANCED
- Y ADVANCED
- Y ADVANCED
- X ADVANCED

aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaaaaaaaaaaaaaaa

- Z OPEN
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa aa a a aa aa a aa aa a a aa a aa a aaaaaaaaaaaaaa
- Y FORWARDS
- X FORWARDS

aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa a a aa a aa aa a aa aa aa aa a a aa aa a aa aa a aa aa a aa aa a a a aa aa a aa aa a a aa a aa a
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

- Z CLOSED
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa
aa a a a a aa a aa a a a aa a aa a a a a aa aa a a a a aa a aa
aa a
aaaa a a
a a
a a
aa
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
a a
aa
a a
a a
aa
a a a a a a a
a a aa a a a aa a a a a aaaa
aaaa
aaaa
a a aaaaaa
aaaa
a a aaaa
aaaaaaaa
a a
aaaaa
a
aaaaa
a a
aaaaaaaaaaaaa
a a aa a a a aa a a a a a aa aa aa a a a aa aa a a aa aa aa a a aa aa a a aa a
a
a a aa a a a
a aa a a a a a aa aa aa a a a aa aa a a aa aa aa a a aa aa a a aa a aaaaaa
aaaaaa
aaaa a aa aa aa a a a aa aa a a aa aa aa a a aa aa a a aa a
a aaaa
aaaaaaaaa a aa aa aa a a a aa aa a a aa aa aa a a aa aa a a aa a aaaaaa
2. With branches, the step number for forwards mode must be loaded into DW 0 and the
1. Actuators for forwards, backwards and JOG mode can only be actuated by conditional

a a aa a a a aa a a a a a aa aa aa a a a aa aa a a aa aa aa a a aa aa a a aa a
forwards
forwards

forwards
forwards

a a aa a a a aa a a a a a aa aa aa a a a aa aa a a aa aa aa a a aa aa a a aa a aaaaaa
branching

a a aa a a a aa a a a a a aa aa aa a a a aa aa a a aa aa aa a a aa aa a a aa a
backwards
backwards

backwards
a
a a aa a a a aa a a a a a aa aa aa a a a aa aa a a aa aa aa a a aa aa a a aa a aaaaaa
a aa a a a aa a a a a a aa aa aa a a a aa aa a a aa aa aa a a aa aa a a aa a
Fig. 4.11 shows the programming rules for forwards and backwards mode of a sequencer with

a a aa a a a aa a a a a a aa aa aa a a aa aa a aa aa a a a aa aa a a aa a aaaaaa
Conditions for
Conditions for
Conditions for
Conditions for

Conditions for
Conditions for
Conditions for

a a aa a a a aa a a a aaaaaaaa a aaaaaaa a aaaaaaa a a a aa aa a a


4 Data Sheets for Sequencer Blocks

aaaaaa aaaaaaa a aaaaaaa a a aa


aa
4.1.1 General notes

4–13
aaaaaa
aaaaaaaa
4 Data Sheets for Sequencer Blocks 06.93
4.1.1 General notes

4.1.1.4 Step display


For manual operation of a sequencer (for FB 91 and FB 92) it is important to display the
current step. The monitor for System 880 permits step display in plain text. Figure 4.12 shows
an example of a step display.
With sequencer 2 (FB 91) it makes sense not only to display the current step but also the
current mode. This is required because with an appropriately configured operator panel it is
possible to actuate almost any number of sequences. The sequencer whose mode is switched
over is selected using the selector switch. The currently active sequencer is displayed on the
NC screen if you press the appropriate softkeys.
You create the displays using an NC workstation; you must create a separate display for every
sequencer. To display variable data from the PLC, such as step number and mode, you must
configure the fields so that they can be supplied with the appropriate data according to the
parameterization rules of the block.
Example:In FB 91 (AK 2:V/R) the current step in ZW4 is stored.
If, during parameterization of the FB 91, the ZW 4 was parameterized as DW 100 in
DB 170, you must define DW 100 as the data source for the field ”Step number” in
the display.

3 STEP DISPLAY
4
5 SEQUENCE SEQUENCER TOOL CHANGE STEP --
6 _AUT _VOR _ST+ _ST- _TP+ _TP– _RLO
7
8 SR NO FUNCTION SR NO FUNCTION
9 01 START CONDITIONS 06 END
10 02 GRIPPER RIGHT 07 .................
11 03 GRIPPER BACK 08 .................
12 04 RELEASE GRIPPER 09 .................
13 05 GRIPPER LEFT 10 .................
14
15

16
17

Fig. 4.12 Example: configured diagnostics display for sequencer 2 forwards/backwards

4–14 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.1 General notes

4.1.1.5 Status words


Because several sequences are usually executed with one function block, status words are
required to store the current state of the sequences (including step number). The numbers of
the data words are parameters of the function block (Fig. 4.13).

Please note on FB 92 (AK 3:AUT) and FB 91 (AK 2:V/R):


You must leave data words 0 and 1 of the data block to which the sequencer is assigned free.
This is because the step blocks are called via DW 1 and the number of the step to which the
branch is to lead is loaded in DW 0.
It is advisable to set up the data block for the status words in OB 20 using FB 11, i.e., a RAM
area is reserved for the DB in question and in this area the variables of the PLC program are
stored.

OB 1 PB 1

JU PB 1 PLC aux.
programs
PB 2

JU PB 2 NC oriented
FBs

PB 3
JU PB 3 Enable
DB
SB 1
PB 4
S DW Step
y JU PB 4 O F FB AK 3 0 1
s O F 1 SB No.
t S F 2 •
e C DB •
3 •
m JU FB 92
AK3 :AUT 4
5 ZW 1 SB 5
p :
r ZW 1 :DW 5 {6 ZW 2 Step
o ZW 2 :DW 6 •
g 5

r PB n
a •
m JU PB n User
OB 20 program
JUFB 10
GST-PC
JU FB 11
EINR-DB
OB 21, 22
JU FB 10
GST-PC

Fig. 4.13 Assignment of data block for status words

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–15


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.1 General notes

4.1.1.6 Behaviour when execution is aborted


When execution of a sequencer is aborted, different cases are possible:

• Sequencer stopped
• Execution aborted
• Interruption through power off

Sequencer stopped
The sequencer is processed as long as input STA (Start) is carrying a ”1” signal. If the signal
changes to ”0”, execution is interrupted and the sequencers stopped. Execution continues
from the point of interruption when input STA has changed to ”1” again. In this way,
mechanical movements for which several steps are required can easily be stopped, e.g. for
setup purposes.

Execution aborted
Execution aborted means that execution of the sequencer is interrupted and the sequencer
goes into its initial setting (the last step).
This is achieved with the reset input R. If this input changes to ”1”, processing of the
sequencer is interrupted the assignments and timers in the current step are reset and the last
step (initial setting) is called.
It is advisable to reset all flags in the last step that can have been set by the sequencer during
execution. In this way you can be sure that the sequencer is in a defined initial setting no
matter where it was interrupted.

Interruption by power off


If execution of the sequencer is interrupted by power off, the current state of the sequencer is
stored retentively. You can set the parameters of the FB so that after switching on the power
supply again the sequencer is either set to the basic state (e.g. for gear changing) or, after a
restart, the sequencer is processed again continuing from the point of interruption (e.g. for a
tool change).
If you want the sequencer to be reset to the initial setting after the power has been switched,
the input R must carry a ”1” signal during the startup phase (e.g. by parameterizing the input
R with flags GST = F 2.1).
If you want the sequencer to continue from the point of interruption when the power has been
switched on, input R must carry a ”0” signal during the startup phase (i.e. as long as the flag
GST = F 2.1 is carrying a ”1” signal). So that the sequencer continues, input STA must
change to ”1” i.e. must be restarted.

4–16 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.2 Data sheets

4.1.2 Data sheets


FB 91 AK 2:V/R
Sequencer forwards/backwards
1. Description
With the function block AK 2:V/R six modes can be implemented:
1. Automatic mode
- Automatic with and without delay/monitoring time
2. Manual modes
- Step selection (SVOR)
With step selection you can select any step of the sequencer (without commands
being output).
If you press the key SVOR for longer than 0.5 s, the sequencer moves to the step
whose enabling conditions are fulfilled.
- Step control forwards (SST+)
- Step control backwards (SST-)
- JOG mode forwards (TIP+)
- JOG mode backwards (TIP-)
In the manual modes mode switching is triggered by the first pulse and further step
enabling by the following pulses. During this time no more than one mode may be
active.
In the modes SST+ to TIP- steps are enabled if the conditions are fulfilled and the
signal changes from ”0” to ”1”.
The mode after a cold or warm restart is automatic. See AK 3:AUT for behaviour of the
sequencer on cold restart, warm restart and automatic.
Only one OR joining per step
With OR branching or joining the constants for the jumps must be programmed even if
reverse mode (SST- or TIP-) is used.
In all other steps constants must not be programmed.
AND branching and AND joining must be implemented using several sequences.
The constants for SST- or TIP- must be programmed as the first elements.
If you use several OR branches in a step the condition for the linear behaviour (without
constants) programmed first must be the forwards condition.
The maximum number of steps: 64 (0-63).

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–17


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.2 Data sheets

The constants for forwards mode must be loaded into DW 0 and for reverse mode into DW 1
of the current DB.
With SST+ and Tip+ step enabling from the first step to step ”0” is not possible.
First select step ”0” with SVOR.
With branches to an impermissible step, the number of the sequence block or step last
processed can be taken from the status words (ZW 3 and ZW 4).

2. Supplementary information
Lib. No.: E88530-B 5491-A-_ _
FBs to be loaded: FB 91
DBs to be loaded: None
Type of FB call: Unconditional
DBs to be input: DB for status words
Error messages: FLFZ, FGST
Error with system stop: %1: Sequence block not in the PLC or error step No. (e.g. branch to
an impermissible step)

4–18 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.2 Data sheets

3. Block call

FB 91 AK 2:V/R

D,KF – SB 0 VKE – Q,BI


D,KF – ANZ STR – Q,BI
E,BI – H/A TIPB – Q,BI
I,BI – STA TIP – Q,BI
I,BI – R FLFZ – Q,BI
I,BI – SVOR FGST – Q,BI
I,BI – SST+
I,BI – SST-
I,BI – TIP+
I,BI – TIP-
T – TW
D,KT – BW
T – TUE
B – DBZW
I,W – ZW 1

$F 3.1 – NST – %1
$F 2.1 – GST ZW 3 – $ FW 244
$F 0.7 – TB ZW 4 – $ FW 242
$:= defined
parameters

4. Signal descriptions

SB0 Number of the sequence block for step ”0” (starting conditions).
ANZ Number
Number of the step without step 0; permissible number of steps: less than 64
H/A Manual/automatic
”0” = Automatic mode (continuous signal)
”1” = and rising edge of SVOR, SST+/- or TIP +/- = manual mode.
STA,R Start or enable automatic, reset
Inputs STA and R are not active in the manual modes. See FB92 (AK3:AUT) for
description.
SVOR Step selection
Using SVOR and H/A = ”1” you can select any step in the sequencer. If the signal
SVOR is active for longer than 0.5 seconds, the sequencer moves to the step
whose conditions are fulfilled.
No commands are output; internal edge evaluation.
SST+ Step control forwards,

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–19


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.2 Data sheets

TIP+ JOG forwards


The switchover to SST+ or TIP+ is possible from all modes. With the switchover
from SVOR to SST+ or TIP+, the condition is scanned in the previous step and
the RLO displayed. If the condition is not fulfilled no commands are output.
Internal edge evaluation.
SST- Step control backwards,
TIP- JOG backwards
The switchover from SVOR to SST- or TIP- is not possible directly, you must first
select SST+ or TIP+.
TW, BW Delay, length of the delay
Timer cell for delay. (When BW 0 the delay applies to any step except step 0.)
TUE Timer cell of the monitoring time.
Starting the monitoring time in the sequencer step in question.
The monitoring time is automatically reset in the last step if RLO = 1.
DBZW Data block for status words of the sequencer.
ZW 1 Status word 1
The status words for internal flags and step registers are in the parameterized DB.
Four data words starting with ”ZW 1” are assigned. DW 0 and DW 1 must not be
used.
VKE Result of logic operation
Displayed with SST+, SST-, TIP+, TIP- and SVOR.
STR Control backwards
Control backwards. For SST- or TIP- a ”1” signal, for AUTO, SVOR, SST+, TIP+
a ”0”signal.
TIPB,TIP JOG mode, JOG
TIPB signal is output if a switchover is made to JOG mode because of TIP+ or
TIP- 0. It is cancelled if one of the other modes is selected.TIP signal is output as
long as input TIP+ or TIP- carries a ”1” signal.
FLFZ Error runtime
Error runtime; Timeout TUE elapsed. The error is reset for STA = ”1”.
FGST Error initial setting
Operational message is output if the sequencer is not started and is not in the initial
setting. (STA = 0 and the sequencer is not in the last step, the so-called initial
setting step).
NST Cold restart
When NST=1 the step registers and flags are reset
GST Initial setting
On warm restart (GST=”1”) the status flags are reset. If input ”R” carries the
same signal the sequencer goes into the initial setting (last step) after a warm
restart.

4–20 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.2 Data sheets

TB Blinking frequency 0.5 Hz


ZW3 Status word 3
In the low byte of ZW 3 the current sequence block number is stored.
ZW4 Status word 4
In the high byte of ZW 4 the current step number is stored.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–21


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.2 Data sheets

Begin

Cold restart
y n
Initial setting
n y
R=1
y
n
Set step
Mode register

AUTO SVOR SST- TIP- SST+ TIP+

Current step Set TIPB Set TIPB


Auto with RLO = 0
Switch over SVOR
AK 3 Previous step TIP+
or SVOR
with RLO = 0
n y
Set STR
Move to block Prevous step
with RLO = 0
n y
Step enabling condition Step enabling
Pulse fulfilled condition fulfilled

n y n y y n

Last step Last step


Current step
y n n y with RLO=1

Step enabling condition fulfilled

Set step Step register +1 y n


register to ”0”
Pulse

y n

Manual AK 3

END

Fig. 4.14 Flow diagram of FB 91

4–22 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.2 Data sheets

FB 92 AK 3:AUT
Sequencer automatic

1. Description
The function block organizes simple sequences without modes with up to 63 steps per
sequencer.
Behaviour of the sequencer;
STA = ”0”, R = ”0”: The current step is executed if RLO = ”0”. No further execution.
STA = ”1”, R = ”0”: The current step is executed if RLO= ”1”. The RLO of the current
step is evaluated.
R = ”1”: The current step is executed if RLO= ”0” and then the last step is
executed if RLO= ”1”. The timeout TUE is reset.
Change of STA signal from ”0” to ”1”:

• If the sequencer is in the last step, it is restarted.


• If the sequencer is not in the last step the sequencer is executed from the current step
onwards.
Behaviour of the sequencer on warm restart and cold restart, see GST and NST.
If the timeout TUE elapses only an error message is output. The commands are still output.
Branching:

• AND branching and AND joining must be implemented using several sequencers.
• OR branching and OR joining can be implemented in any way.
• With branching to an impermissible step, the PLC goes into the stop state. The step
number last executed is stored in status word 2. The commands (assignments) are rest.
• If a branch is made to the first step, the sequencer is executed again if STA = ”1”.
• The constant for an OR branch must be loaded into DW 0 of the current DB.
The last step must only contain commands, no scans and branches. The last step is called
with the state of input STA (if R = ”0”).

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–23


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.2 Data sheets

2. Block data
Lib. No.: E88530-B 5492-A-_ _

FBs to be loaded: FB 92
DBs to be loaded: None

Type of FB call: Unconditional


DBs to be input: DB for status words

Error messages: FLFZ, FGST


Error with system stop: %1: Sequence block not in the PLC or error step number (i.e.
branching to an impermissible step)

3. Block call

FB 92 AK 3:AUT

D,KF – SB 1 FLFZ – Q,BI


D,KF – ANZ FGST – Q,BI
I,BI – STA
I,BI – R
T – TUE
B – DBZW
I,W – ZW 1
I,W – ZW 2

$F 3.1 – NST – %1
$F 2.1 – GST AZW 2 – $ FW 244
$:= defined
parameters

4–24 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.2 Data sheets

4. Signal description
SB 1 Number of the first sequence block of the sequencer (= first step).
ANZ Number
Number of steps including step 0.
STA Start and enable automatic
STA = ”0”: Sequencer is not executed.
STA = ”1”: Sequencer is executed.
If the sequencer is in the last step, the sequencer is restarted on the
signal change of the input STA from ”0” to ”1”.
R Reset
If input R carries a ”1” signal, the current block is called if RLO = ”0” and then the
last block is called of RLO = ”1”; the timer specified at input TUE is reset.
TUE Timer cell of the timeout.
Start the timeout in the current step.
The timeout is automatically reset in the last step if RLO= ”1”.
DBZW Data block for status words of the sequencer.
ZW 1 Status words
ZW 2 Inputs for the numbers of the status words. Two data words are assigned.
FLFZ Error runtime
Error runtime; timeout TUE elapsed. The error is reset if STA = ”1”.
FGST Error initial setting
Operational message is output if the sequencer is not started and is not in the initial
setting.
(STA = 0 and the sequencer is not in the last step the so-called initial setting step.)
NST Cold restart
On NST = ”1” the step registers and flags are reset.
GST Initial setting
On a warm restart (GST = ”1” signal) the status flags are reset. If during this time in
R carries a ”1” signal, the sequencer goes into the initial setting (last step).
AZW 2 Output for status word 2
The current step number is located in the high byte of AZW 2 and the current
sequence block number in the low byte.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–25


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.2 Data sheets

Begin
Cold restart
n y
Initial setting
n y
Auto

R=1 R=1
n y
y n
AK 2
Sequencer in last step Reset step
Current step register
with RLO=0 and STA from 0 1
y n
Reset status
flag
Step register to Step register to Current step with
last step first step status of STA
Reset TUE

Current step Hand


with RLO=1
AK 2
Step enabling condition fulfilled
y n

STA=1 STA=1
y n n y

Branch Timeout TUE elapsed


n y
y n
Last step Permissible step
Input FLZ in
y n y n
buffer

Reset timeout Current step Input FSNR


TUE with RLO=0 to buffer

Update step register Last step


y n
Current step
with RLO=1 Set output
FGST

END

Fig. 4.15 Flow chart of FB 92

4–26 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.3 Programming examples

4.1.3 Programming examples


4.1.3.1 Programming example for a driver control
with FB 92 (AK 3:AUT)
We have chosen gear changing as an example for the use of FB 92 (AK 3:AUT). This example
covers driving of the gear train as well as signals for read-in disable, feed disable, spindle stop
and set direction of rotation.

Figure 4.16 shows the block diagram for the complete gear change. Gear changing is triggered
by the commands M 41, M 42, etc., that are stored as flags for starting gear changing. With
these, the sequencer is started. Commands are output by the sequencer both to the NC and
to the subordinate individual control module (not in this example). For the signals read-in
disable, feed disable, spindle stop and set direction of rotation that do not only come from the
sequencer but are also dependent on other criteria it is advisable to perform logic operations
on the various signals so that the cause is always recognizable.

NC PLC
NC M word M decoding
M change
M03 M04 ... M 41 M 42

R S Starting flag
Switch
direction

Disable read-in
Sequencer

1 D S=0

Disable feed
Spindle
control 1 D
Mesh Gear
Spindle stop gear drive

D M
1
Gear
Select oscillation speed meshed
Spindle in set range
M
Actual gear stage
Gear

Spindle

Fig. 4.16 Block diagram of gear change

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–27


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.3 Programming examples

Fig. 4.17 shows the structure of the program for the example. In the program block for the
spindle control (PB), first the logic operations for start and reset of the sequencer are
programmed. Then the sequencer with which the gear change is controlled is called. Then the
signals are transferred to the interface.

PB spindle control
from OB 1

O – F 41
Start of the
sequencer O – F 42

S – START AK

AN – START AK SB
Resetting the A – T-RESET
sequencer • Step 1

= – RESET AK

FB

Sequencer JU FB Sequencer Step 2

C – DB-K 1
Transfer •
signals to • Step 5
interface •

to OB 1

Fig. 4.17 Program structure for gear change

4–28 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.1.3 Programming examples

Fig. 4.18 shows the gear change performed by the sequencer automatic FB 92 (AK 3:AUT).

START AK

S1 SP Read-in disable -
SP Feed disable -
SP PLC spindle control -
IS Spindle disable -
tUE Timeout 10s -

S=0

S2 IS Set direction right -


SP Change gear -
SP Set oscillation speed -
tW Delay 1s 1

1
S3 tW Delay 1s 1

1
& RM: Gear changed

S4 SP Reset oscillation speed -


SP Reset change gear -
SP Reset PLC control -
SP Reset command change gear -
tW Delay 0.2s 1
tUE Timeout 10s -
1
Spindle in set range

S5 SP Reset start sequencer -


SP Reset read-in disable -
SP Reset feed disable -
SP Reset change gear -
SP Reset PLC spindle control -
SP Reset oscillation speed -
SP Reset spindle disable -

Fig. 4.18 Gear change with FB 92

The software listing for this is given in Section 6 (Appendix) PB ”Spindle control”.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–29


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.1.3 Programming examples

4.1.3.2 Programming example for a tool change with


FB 91 (AK 2: V/R)
As an example for the use of FB 91 (AK 2: V/R), we have chosen part of the function ”Deposit
tool” for a tool changer. The tools are changed between the magazine and the spindle using a
gripper. The example shows how to program sequencers for forward and backwards operation.
The individual control modules that perform the signal reversal with ”STR” are not part of the
example.

4.2 General notes

Programming of a sequencer using conventional methods (Fig. 4.19) is difficult for the user,
and is even more so when there is a need to handle complex sequences (branching and
jumps). The user must define the sequence structure by programming sequence blocks. In the
case of branches and jumps, the sequence is governed by load and transfer commands within
the sequence blocks. The handling of timers is also quite complicated.

Previously the user had access only to inconvenient methods for programming sequencers,
which made it difficult to implement programmable sequential control systems and required a
relatively large amount of programming.

Start
conditions

Step 1 Command 1

Step enabling conditions


for step 2

Step 2 Command 2

Command 3

Command 4
Step enabling conditions
for step n

Step n Command x

Fig. 4.19 Representation of the step-by-step sequence in the method of representation previously used
(DIN 40719)

4–30 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.2 General notes

There was a need for a new language for sequencer programming, one which would be easier
to use and would enable clearer, user-friendly programming.

These requirements are met by the new graphic programming language: GRAPH 5.

With GRAPH 5, programming is limited to a single sequence block. The user defines the
sequence structure graphically and then need only program the real sequence actions and
step enabling conditions. He need no longer concern himself with program-related conversion
of branches and times.

Start conditions

Step 1

Step enabling condition 1

Step 2

Step enabling condition 2

Step 3

Step enabling condition n -1

Step n

Fig. 4.20 Representation of the step-by-step sequence in GRAFCET notation (to IEC Draft SC 65 A/WG 6)

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–31


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.2.1 What is GRAPH 5?

4.2.1 What is GRAPH 5?

GRAPH 5 is a graphic language for programming sequencers.

GRAPH 5 • is a new language for describing the structure of sequencers. It is at a higher


level than the ladder diagram (LAD), control system flowchart (CSF) and
statement list (STL) languages.

GRAPH 5

LAD CSF STL


• Like the other languages, it can be used on a programmer (PG 675, PG 685,
PG 750).

• It allows a system to be described by arranging the structure in


- steps (actions) and
- transitions (step enabling conditions).

• It supports:
- Configuring
- Programming
- Documentation
- Testing/diagnostics

A sequencer is programmed with GRAPH 5 on two representation levels (Fig. 4.21):

1. Overview level:

The structure of the sequencer is defined in this first phase.


The overview level describes the sequence structure of the steps, particularly the
branches and junctions in the sequence.

2. Zoom-in level:

In the second phase, the contents of the steps and transitions are defined at the ”zoom-
in” level.
The program stipulates:
- Which actions take place in the s t e p
- Which step enabling conditions are in the t r a n s i t i o n

4–32 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.2.1 What is GRAPH 5?

Overview level Zoom-in level


Transition 3: Part inserted
I 7.1
S1
I 7.2 &

T1 T6

S2 S6
I 7.3
T2 T7 & >1
I 7.4
S3 S7
I 7.5

T3 T8
I 7.6 Auto
S4 S8 enable
I 7.7 &
T4 T9

Step enabling condition


Step 4: Retract arm
S5
Auto
enable
&
T5 Branch 1 =Q1.0
>1
Manual
&
S1 Branch =Q2.0

Overview structure with GRAPH 5 Actions

Fig. 4.21 Representation levels

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–33


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.2.1 What is GRAPH 5?

The sequencer's program is fully defined by configuring the sequence structure at the
overview level, and programming the steps and transitions at the zoom-in level.

GRAPH 5 is thus a language which the user can easily assimilate, allowing him to develop
clearly arranged sequence control systems with little effort.

GRAPH 5 provides support for documentation and testing/diagnostics in addition to configuring


and programming.

Documentation:

GRAPH 5 sequences documentation comprises:


- Documentation for the overview level
- Documentation for the zoom-in level

The steps and transitions can have comments both at the overview and zoom-in
levels.

Testing/diagnostics:

The status of a sequencer is shown in a status display. The status can be traced at
the zoom-in level, with indication of the status of individual operands and logic
operations. The exact cause of a fault can be determined at the zoom-in level.

The "GRAPH 5" software package from SIMATIC S5 is used for programming sequencers
with the FB93 or FB94.

4–34 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.2.2 The elements of GRAPH 5

4.2.2 The elements of GRAPH 5

Prerequisites for using the GRAPH 5 sequencer for SINUMERIK:

The full capabilities of the GRAPH 5 method of representation cannot yet be fully exploited
with the function blocks from this package. The various limitations are explained in more detail
on the basis of these language elements.

Initial step Selective step

Sn Sn

Jump Linear sequence

Sn Sn

Ti Ti

Sk Sn+1

Fig. 4.22 Language elements

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–35


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.2.2 The elements of GRAPH 5

Differences compared to GRAPH 5, FB70 (main sequencer):


- FB 70 to FB 74 are used in place of FB 93 and FB 94.
- Only selective processing of the sequencer
- Main DB (RAM) is the DB corresponding to the SB number
- A maximum of 4 simultaneous branches are possible
- The DB corresponding to the SB number + 1 must be stored in a PROM and is
copied into the main DB on a cold restart
- The first step must be defined as the initial step
- No secondary sequencer (such as FB71) can be implemented
- SB 2 and SB 3 are not used.

The SIMATIC S5 ”GRAPH 5” Manual provides further information for programming.

Initial step (Fig. 4.22):

The initial step (also known as init step) is activated on sequencer startup by an FB sequencer
call without testing for conditions. It corresponds to the last step of the sequencer, which
cannot be programmed in the GRAPH 5 method of representation.

Limitation:

It is only possible to define Step S1 as the initialization step.


In the initialization step, the sequencer start may be reset only in conjunction with a logic
operation.
E.g.: A - RESETAK
R - STARTAK

Selective step (Fig. 4.22):

The action part of a step declared as selective is processed only when the step is activated.
Normally (no selective steps), all steps of the sequencer are processed cyclically. When a
selective step is involved, the action part is skipped if the step is not active.

Limitation:

All steps, including the first step (init step) S1, must be programmed as selective steps.

Note:

In the case of selective steps, non-storing commands must also be reset by the user in
subsequent steps.

Linear sequence (Fig. 4.22):

The commands of Step Sn are output and Transaction Ti is scanned. If the step enabling
condition of Ti is fulfilled, the sequencer switches to the next step, i.e. Sn + 1 is activated.

4–36 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.2.2 The elements of GRAPH 5

Jump (Fig. 4.22):

Programming of the jump function is possible in a linear sequence (or as an alternative


branch), but without graphic connection.

Limitation:

A jump can be implemented in all steps of the sequencer except in Step S0.

Alternative branch, alternative junction (Fig. 4.23):

One of the branches is to be processed. Of transitions Ti1 to Tin, the one whose step enabling
condition is fulfilled will be switched. If two or more transitions are simultaneously fulfilled, the
one furthest left will be switched.

In the case of a junction of alternative branches, the same applies as to the linear sequence.

Alternative branch

Sn

Ti1 Ti2 Tin

Sn+1 Sk1 Ski

Alternative junction

Sn Sk1 Ski

Ti1 Ti2 Tin

Sn+1

Fig. 4.23 Alternative branch, alternative junction

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–37


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.2.2 The elements of GRAPH 5

Simultaneous branch, synchronization (Fig. 4.24):

Two or more steps are activated simultaneously, depending on only one step enabling
condition.

Merging of parallel branches into a junction takes place via the synchronization.

Simultaneous branch

Sn

Ti

Sn+1 Sk1 Ski

Synchronization

Sn Sk1 Ski

Ti

Sn+1

Fig. 4.24 Simultaneous branch, synchronization

4–38 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.2.3 Program structure

4.2.3 Program structure

The program structure shown (Fig. 4.25) for a sequential control system (SCS) is largely
generated and managed by the GRAPH 5 system. The user need only concern himself with
the overall structure.

The PG685/PG730/PG750 programmer with the GRAPH 5 operating system is needed for
programming. The entire program creation process is supported by the PG685/PG730/PG750.

Function block FB93/FB94, a jog block (SB0), and a main DB generated by the GRAPH
system allow the processing of GRAPH 5 sequencers in the PLC.

Explanation of program structure:

The user calls standard function block FB Sequencer (FB94:ALS:AUT) and assigns sequencer
parameters to it (sequence block number, etc.). The structure of the sequencer, as well as all
actions and step enabling conditions, are contained in sequence block SBx.

Another function block, FB Jog (SB0), is invoked for each transition (see block data and
program structure).

DBn is the main DB for SBx. Like the executable SBx, DBn is automatically generated by the
system (programmer software) with the FB Jog calls.

However, DBn + 1, i.e. the DB with SB number x +1, must be transferred to the PLC.

Example:

For SB150, the GRAPH 5 programmer operating system generates DB150 when function keys
F6 and F5 are actuated. This DB150 must be transferred from the floppy disk to the PLC as
DB151. DBn + 1 (DB151) can be transferred later to PROM.

DBn (DB150) is generated in the PLC on a cold restart, and the contents of DBn + 1 are
copied into DBn; FB94 then opens DBn as the current main DB.

A precisely defined starting condition is thus obtained for a cold restart.

If the diagnostic function is also invoked on the PG685/PG730/PG750, the diagnostic DB


(DB255) must be located in the RAM area.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–39


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.2.3 Program structure

Preparations for execution in the PLC:

• Generate the sequence block with the PG685/PG730/PG 750 and load it into the PLC.
• Generate the main DB with DBGEN on the PG685/PG730/PG 750 and load the DB into
the PLC with SB number + 1.
• If necessary, load the diagnostic DB into the PLC.
• Load the GRAPH 5 standard function block and SB0 into the PLC.
• A PB invokes and initiates the FB.
• When all blocks have been transferred, the user must initiate a cold restart.

The designation "GRAPH 5 standard FB" applies to FB93: ALS:V/R and FB94: ALS:AUT.

PB FB sequencer SB 150 SB 0
GRAPH 5

JU FB Actions
SB :150
..
.

Structure and
step enabling
conditions
FB Jog

Current SBx

DB 255 DB 151 DB 150

Diagnostic DB Main DBn + 1 Main DBn


EPROM RAM

Fig. 4.25 Program structure

4–40 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.3 Data sheets

4.3 Data sheets

FB 93 ALS:V/R
GRAPH 5 sequencer forwards/backwards

1. Description

Sequencers (up to 127 steps per sequencer) with six modes can be implemented with this
function block. The steps must be programmed with the PG685/PG730/PG750 in the GRAPH
5 method of representation.

1. Automatic mode
- Automatic with and without delays/timeouts.

2. Manual modes
- Step selection (S-NR), (S-AZ)
Any step of the sequencer can be selected via decade switches in BCD code (without
command output). Starting with the current step number or preset step number, an
indication of whether the step enabling condition is fulfilled is displayed. The selection is
rejected in the event of an illegal step number.

- Control forward (SST+)


(With condition, i.e. step enabling conditions for forward operation).

- Control backward (SST-)


(With condition, i.e. step enabling conditions for backward operation).

- Jog forward (TIP+)


(With condition).

- Jog backward (TIP-)


(With condition).

In the manual modes, the mode is changed by the first pulse and the step is indexed by
further pulses. No more than one mode may apply at any one time.

In modes SST+ to TIP-, stepping takes place when the enabling conditions are fulfilled and
when the relevant signal changes from 0 to 1.

The mode after a cold or warm restart is the automatic mode.

For sequencer performance following a cold or warm restart and in automatic mode, see
function block ALS:AUT Automatic sequencer GRAPH 5.

Sequencer performance in branches:


- No restrictions are placed on sequencers without branches.
- When alternative branches and backward operation (SST- or TIP-) are involved, the jump
function can be used to jump to the step in a previous sequencer branch.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–41


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.3 Data sheets

– When simultaneous branches and backward operation (SST- or TIP-) are involved, the
Jump function can be used to jump to a previous sequencer branch.
– In transitions in which a simultaneous branch is opened or closed, there can be no
backward jump.

Stepping from the last step to step S1 is not possible with SST+ and TIP+, without first
switching to step selection mode.

2. Block data

Lib. No.: E88530-B 6093-A-_ _

FBs to be loaded: FB93

SBs to be loaded: SB0


DBs to be loaded: -

Type of FB call: Unconditional


DBs to be input: Main DB
DB number (No. = SB No. + 1)
Diagnostic DB if applicable
Error messages: STO and SSTO

Error with system stop: %1 : Number of programmed SB not in permissible range


(Range: 150 SB no. 255)
(#) %2: Programmed SB is not in PLC.

%3: Programmed SB was not created with GRAPH 5.


%4: Step 1 was not defined as INIT step.

(#) %5: DB (SB no.+ 1) not in PLC.

%6: Number of programmed diagnostic DB not within the


permissible range.
(Range: 150 DB no. 255)

(#) %7 : Diagnostic DB not in PLC.

Errors %6 and %7 are output only if the diagnostic function has


been selected (DIAG = 1).

(#) This parameter assignment error results in a PLC stop in FB89


(BAA:LESE) with identifier %4 Block does not exist.

4–42 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.3 Data sheets

3. Block call

FB 93 ALS:V/R

D,KF – SB SANZ – Q,W


I,BI – H/A S+AK – Q,BI
I,BI – STA STO – Q,BI
I,BI –/ R SSTO – Q,BI
I,BI – SAN VKE – Q,BI
I,BI –/ ANZ+ STR – Q,BI
I,BI – DIAG TIPB – Q,BI
I,BI –/ QIT TIP – Q,BI
I,BI –/ UQIT
I,W – S-NR
I,BI –/ S-AZ
I,BI –/ SST+
I,BI –/ SST-
I,BI –/ TIP+
I,BI –/ TIP-

$F3.1 – NST – %1
$F2.1 – GST – %2
– %3
– %4
– %5
– %6
– %7

$:= Specified
parameter

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–43


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.3 Data sheets

4. Signal descriptions

SB Number of the sequence block in the sequencer.


Max. 52 sequencers per PLC (150 number 255) as two DBs are reserved.
A main DB is generated for each step sequencer on the PG675/PG685/PG 750 via
function keys F6, F5 (DBGEN: See GRAPH 5 Description).

H/A Manual/automatic
”0” = Automatic (continuous signal)
”1” and leading edge of S-AZ or SST +/- or TIP +/- = Manual

STA Sequencer start


STA = ”1”: Sequencer will be processed
If the sequencer is at the first step, it is restarted
when Input STA changes from ”0” to ”1”.
STA = ”1” is not possible in manual modes.
The ”STA” signal must be reset by the user program, not in the init step.

R Reset
If Input R is at logic ”1”, the sequencer proceeds to the first step.
The preset monitoring times TUE and waiting times TWA are reset.
R = ”1” is not possible in manual modes.

SAN Step display


The step display is updated when SAN=”1”.

ANZ+ Advance step display


If two or more steps are simultaneously active (observe signal S + AK when
simultaneous branches are involved) these step numbers can be displayed
successively with a change of signal at Input ANZ + from ”0” to ”1” (evaluation only
when SAN = 1).

DIAG Diagnostic function


When DIAG = ”1”, the diagnostic function for the sequencer is executed on the
programmer and relates to the diagnostic data block generated with DBGEN (must be
loaded in the PLC for this purpose). This function helps detect the cause of error,
which can then be traced at the zoom-in level (PG675, PG685 or PG 750
programmer).

QIT Acknowledge a fault (conditional)


Effective on a change of signal at Input QIT from ”0” to ”1” when there is a fault
caused by a TUE timeout and the subsequent fulfillment of the step enabling
condition for the current step.

UQIT Acknowledge a fault (unconditional)


Effective on a change of signal at Input UQIT from ”0” to ”1” when there is a fault
caused by a TUE timeout and the step enabling condition is not fulfilled, but the
number of the faulty step appears on the step display.

4–44 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.3 Data sheets

S-NR, Step number, step selection


S-AZ Each step of the sequencer, specified by step number, can be selected with H/A = 1
and a leading edge of
S-AZ.
The sequencer processes INIT Step S1 for one PLC cycle. There is no further
command output.

SST+, Step control (with condition)


SST- + : forward
– : backward

TIP+, Jog mode (with condition)


TIP- + : forward
– : backward
Direct changeover from S-AZ to SST- or TIP- not possible; select SST+ or TIP+
beforehand.
The step enabling condition (RLO) for the current step is displayed following a
change from S-AZ to SST+ or TIP. Commands are output irrespective of the
condition.

NST Cold restart


A branch is executed with a Stop loop with STS when a parameter error is detected
in the FB (see errors %1 ... %7) . When the cause of the error has been eliminated,
the NST function is required.

GST Initial setting


ST0 and SST0 are reset on a warm restart (GST = ”1”).

SANZ Output of the step No.


The step No. is displayed in BCD code (3 places).

S+AK Two or more steps simultaneously active


Output S + AK = ”1” when more than one step is simultaneously active in a
sequencer.

STO Fault in the sequencer


STO = ”1” if a fault occurs due to a TUE timeout.
Note:
Step sequencing is possible only with QIT or UQIT.

SSTO Step with fault


SSTO = ”1” if a fault occurs due to a TUE time-out and a faulty step is displayed.
Note:
Step sequencing can be forced with UQIT.

VKE RLO of the current transition


Signal VKE active only in mode H/A = ”1” (manual).
Indication for SST+, SST-, TIP+, TIP- and S-AZ that step enabling is possible.

STR Control backward


Logic ”1” when SST- or TIP-; logic ”0” is present when AUTO, S-AZ, SST+, TIP+.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–45


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.3 Data sheets

TIPB Jog mode


Signal TIPB is output in the event of changeover to jog mode via TIP+ or TIP-. It is
removed if one of the other modes is selected.

TIP Jog signal


Signal TIP is output as long as Input TIP+ or TIP- is at logic ”1”.

5. Additional information

Programming aid

The following program chart serves to create a step sequencer for the forwards and
backwards operation of a sequence controller with FB ALS:V/R in GRAPH 5 representation.
Backward jumps must always be programmed as alternative branches.

a) Programming for the linear part of the sequencer is in the transition part, as follows:

Tk

S
S n-1
Transition K/1
A -STR Backwards
A I ... Jump to S
BE step S n-1 Sn

Transition n/1
AN -STR
A I ... Forwards Tn Tk
BE
S n-1

4–46 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.3 Data sheets

b) Transitions are programmed as follows for alternative branches and junctions:

Tk
- Step enabling condition at the
beginning of an alternative branch S

S n-1
Transition K/1
A -STR Backwards
A I ... Jump to S
BE step S n-1 Sn

Transition n/1
AN -STR
A I ... Forwards Tn Tk Tm
BE
S S n-1 S
Transition m/1 S Sm
AN -STR n+1
A I ... Forwards
BE

- Step enabling condition at the end Tl Tm


of an alternative branch
S S
Transition l/1
S n-1 Sm
A -STR Backwards
A I ... Jump to
step S n-1 T T
BE

Transition m/1
A -STR Backwards S
A I ... Jump to Sn
BE step S m

Transition n/1 Tn Tl Tm
AN -STR
A I ... Forwards
BE S n-1 Sm

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–47


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.3 Data sheets

c) Transitions are programmed as follows for simultaneous branches and junctions:

aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
Tm

Tl
- Step enabling condition at the
beginning of a simultaneous branch S
S n-1
Transition l/1
A -STR Backwards
A I ... Jump to
BE step S n-1
S S
Transition m/1
A -STR Backwards Sn Sm
A I ... Jump to
BE step S n-1
Tl Tm

S n-1 S n-1

- Step enabling condition at the end Tr Tp


of a simultaneous branch
S S
Transition r/1
A -STR Backwards Sn Sm
A I ... Jump to
BE step S n

Transition p/1
A -STR Backwards
A I ... Jump to S
BE step S m S
n+1

Tr Tp

Sn Sm

Note: Transitions in which a simultaneous branch is opened or closed, must not contain a
backward jump.

4–48 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.3 Data sheets

FB 94 ALS:AUT
GRAPH 5 automatic sequencer

1. Description

The function block organizes simple sequencers without modes and with up to 127 steps per
sequencer. The steps must be programmed on the PG685/PG730/PG 750 in GRAPH 5.

Sequencer performance:
Change of signal STA from ”0” to ”1”:
- If the sequencer is at the first step, it is started.
- If the sequencer is not at the first step, it is processed further, starting at the current step.

For sequencer performance following a warm or cold restart, see GST and NST.

An error message is output on a TUE time-out. Commands output is continued. The current
step remains in force, and sequencing to the next step is not possible.

Waiting time TWA, if specified, is taken into account.

Differences compared to GRAPH 5, FB 70:


- Selective processing of the sequencer only
- Main DB (RAM) is the DB corresponding to the SB number.
- Maximum of 4 simultaneous branches possible.
- The DB corresponding to SB number + 1 must be resident in PROM and is copied into
the main DB on a cold restart.
- The first step must be defined as the INIT step.

See the GRAPH 5 Description for programming instructions.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–49


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.3 Data sheets

2. Block data

Lib. No.: E88530-B 6094-A-_ _


FBs to be loaded: FB94
SBs to be loaded: SB 0
DBs to be loaded: -
Type of FB call: Unconditional
DBs to be input: Main DB
DB number (no. = SB no. + 1)
Diagnostic DB if applicable
Error messages: STO and SSTO
Error with system stop: %1: Number of programmed SB not in permissible range
(Range: 150 SB number 255)
(#) %2: Programmed SB is not in PLC.
%3: Programmed SB was not created with GRAPH 5.
%4: Step 1 was not defined as INIT step.
(#) %5: DB (SB number + 1) not in PLC.
%6: Number of programmed diagnostic DB not in permissible range
(Range: 150 DB number 255)
(#) %7: Diagnostic DB not in PLC.

Errors %6 and %7 are output only if the diagnostic function is


selected (DIAG = ”1”).

(#) This parameter error results in a PLC stop in FB 89 (BAA:LESE) with


identifier %4 Block does not exist.

4–50 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.3 Data sheets

3. Block call

FB 94 ALS:AUT

D,KF – SB SANZ – Q,W


I,BI – STA S+AK – Q,BI
I,BI – R STO – Q,BI
I,BI – SAN SSTO – Q,BI
I,BI – ANZ+
I,BI – DIAG
I,BI – QIT
I,BI – UQIT

$F3.1 – NST – %1
$F2.1 – GST – %2
– %3
– %4
– %5
– %6
– %7

$:= Specified
parameter

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–51


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.3 Data sheets

4. Signal descriptions

SB Number of the sequence block in the sequencer.


Max. 52 sequencers per PLC (150 < number <255) as two DBs are reserved. A
main DB is generated for each sequencer on the PG685/PG730/PG 750 via function
keys F6, F5 (DBGEN: see GRAPH 5 Description).

STA Sequencer start


STA = ”1”: Sequencer will be processed.
If the sequencer is at the first step, it is restarted when Input STA changes from ”0”
to ”1”.
The ”STA” signal must be reset by the user program, not in the init step.

R Reset
If Input R is ”1”, the sequencer proceeds to the first step.
The set timeouts TUE and delays TWA are reset.

SAN Step display


The step display is updated when SAN = ”1 ”.

ANZ+ Advance step display


If two or more steps are simultaneously active (observe signal S + AK when
simultaneous branches are involved) these step numbers can be displayed
successively with a change of signal at Input ANZ+ from ”0” to ”1” (evaluation only
when SAN = 1).

DIAG Diagnostic function


If DIAG = ”1” the diagnostic function for the sequencer is executed on the PG and
relates to the diagnostic data block generated with DBGEN (must be loaded into the
PLC for this purpose). This function is an aid for recognizing the cause of a fault,
which can then be traced at the zoom-in level (PG = PG685, PG730, PG 750).

QIT Acknowledge a fault (conditional)


Effective with a change of signal at Input QIT from ”0” to ”1” when there is a fault
caused by a TUE timeout and subsequent fulfillment of the step enabling condition
for the current step.

UQIT Acknowledge a fault (unconditional)


Effective with a change of signal at Input UQIT from ”0” to ”1” when there is a fault
caused by TUE timeout and the step enabling condition is not fulfilled, but the
number of the faulty step appears on the step display.

NST Cold restart


A branch is executed to the stop loop with STS when a parameter error is detected
in the FB (see errors %1...%7) . When the cause of error has been eliminated, the
NST function is required.

GST Initial setting


STO and SSTO are reset on a warm restart (GST = ”1”).

4–52 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.3 Data sheets

SANZ Output step number


The step number is displayed in BCD code (3 digits).

S+AK Two or more steps simultaneously active.


Output S + AK = ”1” if more than one step is active in a sequencer.

STO Fault in the sequencer


STO = ”1” when a fault occurs due to a TUE timeout.
Note:
Step sequencing is only possible with QIT or UQIT.

SSTO Step with fault


SSTO = ”1” if a fault occurs due to a TUE timeout and a faulty step is displayed.
Note:
Step sequencing can be forced with UQIT.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–53


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.4 Program examples

4.4 Program examples


4.4.1 Program example for a drive control sequencer with GRAPH 5
block FB94 (ALS:AUT)
A gear change has been chosen as an example of the use of FB94 (ALS: AUT) with the
Graph 5 block FB94. This example covers driving of the gear train as well as signals for read-
in disable, feed disable, spindle stop and specified direction of rotation.

Fig. 4.26 shows the block diagram for the complete gear change. Gear changing is initiated
with commands M41, M42, etc. which are buffered as flags to start gear changing, i.e. the
sequencer.The sequencer outputs commands to the NC as well as to the subordinate
individual control module (not included in this example) for the gear train. The read-in disable,
feed disable, spindle stop and specified direction of rotation signals should be gated so that
the reason for them is clearly recognizable, as these signals not only come from the
sequencer, but are also dependent on other criteria.

NC PLC
NC M word M decoding

M
change M03 M04 ... M41 M42

>1

R S Start flag
Change
direction

Read-in disable
Sequencer
>
1 D S=0

Feed disable
Spindle >
control 1 D
Mesh Gear
Spindle stop gear drive

> M
1 D
Gear
Select oscill. speed meshed
Spindle in spec. range
M
Actual gear

Gear

Spindle

Fig. 4.26 Block diagram for gear changing

4–54 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.4.1 Program example for a drive control sequencer with GRAPH 5 block FB 94 (ALS:AUT)

Fig. 4.27 shows the program structure for the example. First, the logic operations for starting
and resetting the sequencer are programmed in the program block for spindle control (PB18).
The sequencer with which gear changing is controlled is called. The signals are then
transferred to the interface.

PB spindle control
From OB 1

O – F 41
Sequencer
start O – F 42

S – START AK

AN – START AK SB
Reset A – T-RESET
sequencer • Step 1

= – RESET AK
FB

Sequencer Sequenc-
JU FB er Step 2

Q – DB-K1
Transfer •
signals to • Step 6
interface •

To OB 1

Fig. 4.27 Program structure for gear changing

Fig. 4.27 shows the process for gear changing with the GRAPH 5 automatic sequencer FB94
(ALS:AUT).

The corresponding software listing for the sequencer is given in Appendix 1, PB 18.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–55


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.4.1 Program example for a drive control sequencer with GRAPH 5 block FB 94 (ALS:AUT)

S
SP Reset gear changing -
S1
SP Reset PLC spindle control -
SP Reset oscillation speed -
SP Reset set direction CW -
SP Reset spindle disable -
SP Reset mesh gear command -
SP Reset read-in disable -
SP Reset feed disable -

S
SP PLC spindle control -
S2
SP Spindle disable -
SP Read-in disable -
SP Feed disable -
tue Timeout 10s -
S=0
S
SP Reset spindle disable -
S3
SP Set direction CW -
RM: Gear SP Oscillation speed -
meshed SP Mesh gear command -
tW Delay 1s 1
&
1
S
SP Reset set direction CW -
S4
tW Delay 1s 1
RM: Gear
meshed
1
& RM: Gear changed

S
SP Reset oscillation speed -
S5
SP Reset gear changing -
SP Reset PLC spindle control -
SP Reset set direction CW -
SP Reset mesh gear command -
tue Timeout 10s -
tW Delay 0.2s 1

1
Spindle in specified range
S
SP Reset read-in disable -
S6
SP Reset feed disable -
SP Reset mesh gear command -
SP Reset PLC spindle control -
SP Reset oscillation speed -
SP Reset spindle disable -

Fig. 4.28 Procedure for gear changing with FB94

4–56 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 4 Data Sheets for Sequencer Blocks
4.4.2 Program example of a tool change with Graph 5 block FB 93 (ALS: V/R)

4.4.2 Program example of a tool change with Graph 5 block FB 93


(ALS: V/R)

As an example for using FB93 (ALS:V/R) a part sequence for the "Deposit tool" function with
a tool changer has been chosen, as for FB91; tools are changed between the magazine and
the spindle by means of a gripper (Fig. 4.29). The example shows the Graph 5 programming
for the sequence steps for forward and backwards operation.
The individual control elements which execute the change of signal for "STR" are not part of
the example.
Fig. 4.29 shows the procedure for depositing the tool with the Graph 5 forwards/backwards
sequencer (FB93: ALS:V/R).
The associated software listing is given in the Appendix.

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 4–57


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 06.93
4.4.2 Program example of a tool change with Graph 5 block FB 93 (ALS: V/R)

S
SP Reset deposit tool -
S1

Start cond.
STR
S
NS Gripper 90 ° to the right 1
S2
STR SP Reset magazine positioning -

RM-SENKR 1
STR
S
& NS Retract gripper 1
S3
R
STR
RM-VORN 1
STR
S
& NS Clamp spindle 1
S4
NS Clamp tool in magazine 2
R 1
STR 2
SP-DRUCK STR
WZM-GESP SP-DRUCK SP-LEER
SP-LEER WZM-GESP
SP-LEER STR
& & S NS Relocate magazine data -
S5

STR
STR
S
& NS Release gripper 1
S6
R

STR STR
GR-GESP GR-GESP 1
SP-LEER SP-LEER
STR
S
& & NS Gripper 90 ° to the left 1
S7
R R after S3

RM-WAAGR 1
STR STR
& &

Fig. 4.29 Procedure for depositing a tool with FB93

4–58 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
01.99 4 Data Sheets for Sequencer Blocks
4.5 Function block FB 27 (SW 6.1 and higher)

4.5 Function block FB 27 (SW 6.1 and higher)


General

The IM308C adapter enables you to use the SIMATIC module IM308C (a PROFIBUS-DP
interface) in the SINUMERIK 840C system. The standard function block FB 27, which handles
the communication, is required for operation of the IM308C.
The function block FB 27 is part of the basic function of package 0, version 23. Examples for
direct programming of FX 92 and indirect programming of FX 93 are also part of version 23.

Notes on configuration
If only the conventional I/O range from 0 to 255 is used, i.e. PAB 0 to 127 (U E ...) and I/Os
(LEW; TAW), it is sufficient to specify S5 CPU 922 when programming with COM PROFIBUS
V2.x.
With COM-PROFIBUS V3.2 and higher, the IM308C module can be directly configured with
SINUMERIK 840C.
If the diagnostic functions, direct and indirect programming are required, as for FB 192 with
S5, FB 27 must be used for the 840C. FX 92 and FX 93 are given as FX examples for direct
and indirect programming respectively in the new FB package 0, version 23.

Description of function block FB 27

Description of functions

If FB 27 is used, the IM308C must be addressed in the memory area F800h to F9FF of the IM.
The segment address is pre-defined with number 4.
The offset address is derived from the IM address /. E000h.
This produces the following assignment of absolute addresses for the PLC:

IM address Segment number 135 WD Offset address 135 WD

F800h 4 1800h

Other DP window addresses offered by the COM PROFIBUS software are not supported by
the IM308C adapter for the SINUMERIK PLC and are not necessary because SINUMERIK
cannot accommodate multiprocessors.

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 4–59


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 01.99
4.5 Function block FB 27 (SW 6.1 and higher)

FB 27 transfers data between a memory area of the central processor (flag area, data block
area) and the IM308C module via one of the stated address areas (IM link). The following
functions are possible in this context:
– Read inputs of a slave
– Read/write outputs of a slave
– Read diagnostic information of a slave
– Read the master diagnosis
– Change the PROFIBUS-DP address of a slave

Writing the outputs is possible only if no outputs have been programmed in COM PROFIBUS.
Otherwise, the programmed outputs are given preferential treatment by the firmware of the
IM308C.

The following functions are possible for the connection of the DP/AS interface to the left of the
IM308C:
– Initiate write job and write data (Data_Write)
– Read acknowledgement for previously initiated write job
– Initiate read job (Data_Read)
– Read data and acknowledgement of previously initiated read job

The following are permissible as memory areas: flag area M, data blocks DB and expanded
data blocks DX.

Besides the data transfer functions stated, FB 27 can also be used to execute so-called Global
Control Commands. The following Global Control Commands are possible:
– SYNC: simultaneous output and freezing of output states for the DP slaves
– UNSYNC: cancels the SYNC command
– FREEZE: freezes input states
– UNFREEZE: cancels the FREEZE command

FB 27 can also be used to initiate a combination of the Global Control Commands stated
above. Here, it is possible to edit the Global Control Commands for individual slaves or slave
groups.
In addition, FB 27 can be used to check whether a Global Control Command that has already
been initiated has been fully processed. This is done with the function:
Check Global Control Command.

If the address area contains a different module than the IM308C module, it is not recognized
by the function block.
The standard function block may be stored in an EPROM module. The user is allowed to
change the number of FB 27.

4–60 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
01.99 4 Data Sheets for Sequencer Blocks
4.5 Function block FB 27 (SW 6.1 and higher)

Calling FB 27
The simplest case is where FB 27 is called only during cyclic program processing. If it is
necessary to call FB 27 again on the process-alarm or time-alarm processing levels (e.g. if the
outputs of a slave are to be written very quickly after a process alarm or the inputs of a slave
are to be read continuously at recurring intervals, the programming in the application program
must ensure that FB 27 does not interrupt itself. This is done by blocking the alarms before
each FB 27 call and releasing them again after the call.

STL representation: LAD/CSF representation:

FB 27
: SPA FB 27 +––––––––––+
NAME : IM308C ! IM308C !
DPAD : – – ! DPAD ERR ! – –
IMST : – – ! IMST !––
FCT : – – ! FCT !––
GCGR : – – ! GCGR !––
TYPE : – – ! TYPE !––
STAD : – – ! STAD !––
LENG : – – ! LENG !––
ERR : ––!––––––––– !––

The function block can be called with direct or indirect programming.

Direct programming of the function block call


In direct programming, the actual operands specified for the module apply for all parameters.
The user selects direct programming by specifying a valid function (except for ”XX”) for the
FCT parameter.

Indirect programming of the function block call


In indirect programming, the parameters must be entered in the parameter DB. The user
selects indirect programming by specifying the actual operand ”XX” for the FCT parameter.
The parameter DB must be opened before the user calls FB 27. If the parameter DB is too
short or the IM number does not exist, or has been programmed incorrectly, the PLC goes into
the STOP state. All other programming errors are detected by the function block and entered
in the parameter DB.

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 4–61


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 01.99
4.5 Function block FB 27 (SW 6.1 and higher)

Description of the block parameters of FB 27

Name Kind Type Designation Permissible assignment

DPAD D KH Address range of KH = F800 (default value):


IM308C, (DP Only the value F800h is permissible for SINUMERIK PLC 135
window, DP WD, since multiprocessor-mode is not implemented.
window address)
IMST D KY Number of the KY = x,y:
IM308C x: Number of the IM308C
PROFIBUS-DP x = 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, ..., 240
address of the y: PROFIBUS-DP address of the slave
slave (station y = 1 to 123 (if FCT=WO, RO, RI, SD)
number) y = 1 to 126 (if FCT =CS)
y = Irrelevant (if FCT=MD, GC, CC)
FCT D KC Function of FB27 WO = Write outputs RO = Read outputs
(see table on the RI = Read inputs
next page for MD = Read master diagnosis
precise SD = Read slave diagnosis
explanation) GC = Global Control (execute control command)
CC = Check Global Control (check control command)
CS = Change Station Number (change PROFIBUS-DP
address)
XX = Switchover to indirect programming
GCGR D KM Control KM = xxxxxxxx yyyyyyyy; (only relevant if FCT=GC, CC)
commands xxxxxxxx: Select control command
yyyyyyyy: Select group of DP slaves for which the control
command is to apply.
TYPE D KY TYPE of the PLC KY = x,y:
memory area x = 0: Data block DB; x = 1: Extended data block
(Global
Command, group DX
selection) x = 2: Flag area M
y = 10 to 255; DB or DX number (only relevant if
x = 0 or x = 1)
STAD D KF Start of PLC KF = +x:
memory area x value range depends on TYPE
(start address)
x: Number of the first data word (if TYPE: x = 0 or x = 1)
x: First flag byte1) (if TYPE: x = 2)
LENG D KF Number of bytes KF = +x:
to be transferred x: Number of bytes to be transferred
(Length) If FCT = DW or CR: x = 1 to 240
If FCT >< CS: x = 1 to 2442) or c = -1; joker length4)
If FCT = CS: x = 4 to 2442)
ERR A W Error word (Error) Data, flag1) or output word5)

1) No scratch flags (MB200 to MB255) may be used.


2) The area to be transferred must fully lie in the permissible range or data block.
3) The data word resides in the data block opened prior to calling the FB. If the data word does not exist, the
PLC goes into the STOP state. Only the range MW 0 to MW 198 may be used for flags.
4) The user may specify the joker length -1. In this case, the FB transfers all permissible bytes. If the source or
target range is not long enough, the FB does not transfer any data, but issues an error to the ERR para-
meter.
5) The data word resides in the data block opened prior to calling FB27. If the data block does not exist, the
PLC goes into the STOP state. Only the range MW 0 to MW 198 may be used for flags.

4–62 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
01.99 4 Data Sheets for Sequencer Blocks
4.5 Function block FB 27 (SW 6.1 and higher)

The parameters are checked for valid limits and any errors found notified via the ERR
parameter.

FCT parameter: function of FB 27

Meaning of the FCT parameter


The user specifies the function to be executed with the FCT parameter.

Function
Meaning Sequence
FCT =

WO Write Outputs FB 27 transfers the number of bytes specified in the LENG


parameter from the PLC source area to the DP slave (IM308C).
The data in the DP window are ignored if absolute addressed are
specified via COM PROFIBUS. These addresses are then
preferred in order to avoid inconsistencies.
RO Read Outputs FB 27 reads the number of bytes (outputs) specified by the LENG
parameter from the DP slave (IM308C) and transfers them to the
target area of the PLC.
RI Read Inputs FB 27 transfers the number of bytes specified in the LENG
parameter from the DP slave (inputs) to the PLC target area.
MD Read Master FB 27 transfers the master diagnosis of the specified IM308C to
Diagnosis the PLC target area.
SD Read Slave FB 27 transfers the slave diagnosis of the specified DP slaves to
Diagnosis the PLC target area.
GC Global Control FB 27 initiates the control command (Global Control) specified in
the GCGR parameter.
CC Check Global FB 27 checks whether the Global Control Command specified in
Control the GCGR parameter is still being processed.
As long as ERR = DCh is output, the inputs affected by the
control command must not be read, nor may the outputs be set.
CS Change Station FB 27 transfers a new PROFIBUS-DP address to the DP slave
Number specified in the IMST parameter. The new PROFIBUS-DP
address is defined in the PLC source area. Prior to calling the
command, the new PROFIBUS-DP address must be programmed
in the IM308C.
XX Switchover to FB 27 fetches the programming data from the data block opened
indirect before calling the function block.
programming

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 4–63


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 01.99
4.5 Function block FB 27 (SW 6.1 and higher)

GCGR parameter: issuing control commands

Meaning of the GCGR parameter


FB 27 interprets this parameter only if the user initiates a Global Control Command or checks
whether a particular control command is still being processed (FCT = GC, CC). The COM
PROFIBUS programming determines which DP slaves are contained in which groups.
If the FREEZE and UNFREEZE commands are present at the same time, only UNFREEZE is
executed. The same applies to the SYNC and UNSYNC control commands.

Structure of the control commands

Bit 15 ... ... 8 7 ... ... 0

Global Control (control commands) Group selection

Bit Meaning of control command Bit Meaning of group selection

15 0 7 1: Group 8 selected
14 0 6 1: Group 7 selected
13 1: SYNC command is executed 5 1: Group 6 selected
12 1: UNSYNC command is executed 4 1: Group 5 selected
11 1: FREEZE command is executed 3 1: Group 4 selected
10 1: UNFREEZE command is 2 1: Group 3 selected
executed
9 0: Reserved 1 1: Group 2 selected
8 0: Reserved 0 1: Group 1 selected

ERR parameter: length byte and error byte of FB 27

ERR parameter assignments


Structure of the ERR parameter:

Bit Name Meaning

Bit 15 to 8 Length byte The length byte indicates how many bytes the FB 27 has
transferred. The length byte is always updated when FB 27 is
called with LENG = -1 (joker length).
Bit 7 Group error bit 1: Error
Bit 6: IM error 1: Error
Bit 4 and 5 Programming error 1: Programming error (at least one of the parameters specified
when calling FB 27 is invalid)
Bit 0 to 3 Error number1 to F See following table

4–64 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
01.99 4 Data Sheets for Sequencer Blocks
4.5 Function block FB 27 (SW 6.1 and higher)

If FB 27 accesses a DP slave for which the error message module ”QVZ” is selected, and this
DP slave does not exist, ”QVZ” is not sent as error message; rather, the corresponding error
message is given in the ERR parameter of FB 27. If IM308C parameters are incorrect or do
not exist, the CPU goes into the STOP state.

Error numbers in the ERR parameter


The function block outputs an error message in the low byte of the ERR parameter.

Low byte of
ERR para-
meter Meaning Explanation/remedy

hex dec

00 00 No error No error has occurred on calling the function


block.
A2 162 IM No. (high byte of IMST IM No. may only take the following values:
parameter) not permissible 0, 16, 32, 48, 64, 96, 112, 128 to 240.
A3 163 PROFIBUS-DP address of the slave The PROFIBUS-DP address must lie in the range
not permissible (low byte of the 1 ST 123.
IMST parameters)
A4 164 LENG parameter not permissible The LENG parameter must either be in the range
0 to 240, 1 to 244 or 4 to 244 depending on the
function.
A5 165 TYPE parameter not permissible The TYPE parameter must lie in the range
0 to 2.
A6 166 GCGR parameter not permissible The low byte of the GCGR parameter must not
be equal to 0.
A9 169 TYPE parameter not permissible: The specified source/target data block must be
the specified DB/DX data block created in the user module.
does not exist.
AA 170 TYPE parameter not permissible: The specified source/target data block must be
specified DB/DX data block too long enough in the application memory:
short • For LENG -1
Minimum length (word) = STAD+LENG/2 -1
• For LENG = -1
Minimum length depends on the structure of
the DP slave
STAD min. length (word) STAD+122
AB 171 TYPE parameter not permissible: The data to be transferred must fully fit into the
specified flag memory area M too following area:
small • Valid area for flags:
0 MB 199
AC 172 FCT parameter not permissible FB 27 does not recognize the specified function.
A valid function must be programmed in KC
format.

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 4–65


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 01.99
4.5 Function block FB 27 (SW 6.1 and higher)

Low byte of
ERR para-
meter Meaning Explanation/remedy

hex dec

AD 173 STAD parameter not permissible The STAD parameter is valid in the following
range:
• Valid range for flags:
0 STAD 199
• Valid range for data words:
0 STAD 255
AE 174 Slave has failed, is not configured, Evaluation of the slave diagnosis will produce
no I/Os are configured or the more detailed information.
IM308C is in STOP state.
AF 175 LENG parameter > length byte on The IM308C does not possess the required
the IM308C number of data bytes for the specified slave.
Reduce LENG or call the function block with the
joker length LENG = -1.
B1 177 TYPE parameter not permissible: The DB/DX No. must be 10.
specified DB/DX No. invalid
B2 178 DPAD parameter not permissible Depending on the CPU type, only the address
F800h may be set at the DPAD parameter.
C1 193 Error message from IM308C: At this point in time, only one CS command or
The requested command has two GC commands are possible.
already been executed; the IM308C
has no further resources.
C2 194 Error message from IM308C: The control command is only possible in the
The IM308C has the wrong IM308C modes RUN or CLEAR.
operating mode.
C3 195 Error message from IM308C: A control command is only possible when a
No corresponding group has been corresponding group has been configured with
configured or the GCGR parameter COM PROFIBUS.
has not been input correctly. Check the structure and contents of the control
command.
C5 197 Error message from IM308C: In order to be able to change a PROFIBUS-DP
PROFIBUS-DP address not address, the relevant PROFIBUS-DP address
configured. must have been configured with COM
PROFIBUS.
C6 198 Error message from IM308C: The DP slave must physically exist and be
DP slave does not respond to the connected to the PROFIBUS-DP
PROFIBUS-DP address change
(PROFIBUS-DP address does not
exist).
C7 199 Error message from IM308C: DP slave has responded with incorrect data; the
DP slave does not respond correctly CS command has not been processed by the
to the PROFIBUS-DP address DP slave.
Repeat the function FCT = CS.
If the error message does not change, check
the DP slave.

4–66 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
01.99 4 Data Sheets for Sequencer Blocks
4.5 Function block FB 27 (SW 6.1 and higher)

Low byte of
ERR para-
meter Meaning Explanation/remedy

hex dec

C8 200 Error message from IM308C: DP slave has responded with incorrect data; the
DP slave responds incorrectly to the CS command has not been processed by the
PROFIBUS-DP address change DP slave.
The function FCT = CS must be repeated.
If the error message remains, check the DP
slave.
C9 201 Error message from IM308C: DP slave has responded with incorrect data; the
DP slave responds incorrectly to the CS command has not been processed by the
PROFIBUS-DP address change DP slave.
The function FCT = CS must be repeated.
If the error message remains, check the DP
slave.
CA 202 Error message from IM308C: DP slave cannot change the PROFIBUS-DP
DP slave responds incorrectly to the address; the corresponding SAP is not available
PROFIBUS-DP address change at the DP slave.
DC 220 The control command is still being The control command specified in the GCGR
processed. parameter is still being processed.
Inputs and outputs affected must not be
processed. The function FCT = CC must be
repeated.
DE 222 The IM308C is currently performing The function can be re-initiated.
data transfer to the DP slaves.
The desired function could not be
carried out.
DF 223 No acknowledgement received from The IM308C has not sent back an acknowl-
IM308C. edgement to the FB after initiating the function.
or
IM308C has not sent an acknowledgement to
FB 27 within 5 ms.
Possible cause: the baud rate is too low.

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 4–67


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 01.99
4.5 Function block FB 27 (SW 6.1 and higher)

Indirect programming
Assignment of the parameter data block
The assignment of the parameter data block is only relevant for indirect programming of
FB 27. During indirect programming (FCT = ”XX”), the function block takes the programming
data from the parameter data block, not from the block parameters. The parameter data block
must be opened by the user prior to calling FB 27. If the parameter data block is too short, the
CPU assumes the STOP state.

The parameter data block has the following structure:

Recommended
Data word Block parameter
data format

DW 0 Reserved KH
DW 1 DPAD KH
DW 2 IMST KY
DW 3 FCT KC
DW 4 GCGR KM
DW 5 TYPE KY
DW 6 STAD KF
DW 7 LENG KF
DW 8 ERR KY
DW 91) Slot number of DP/AS link Data record number KY
DW 101) Reserved KH
DW 111) Error code 1 Error code 2 KY
DW 121) Reserved KH

Programming FB 27 for the DP/AS interface module


FB 27 can be used to access the DP/AS interface module via the IM308C. To do this, FB 27
must be programmed indirectly, i.e. all required parameters are stored in a data block and the
function is programmed with XX (FCT = XX). The precise programming of the DP/AS interface
module is described in the device manual ”Decentralized I/O system ET 200” Document No.
EWA 4NB 780 6000-01b.

1) The data words DW 9 to DW 12 are required for the DP/AS interface. Even if FB 27 does not activate the
DP/AS link, the parameter data block must always be present up to DW 12.

4–68 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
01.99 4 Data Sheets for Sequencer Blocks
4.5 Function block FB 27 (SW 6.1 and higher)

FCT parameter
The following functions can be initiated via indirect programming (DW 3) for the DP/AS
interface:

FCT Description

DW Initiate write job and write data (Data_Write)


CW Acknowledgement of write job initiated previously (Check_Write)

DR Initiate read job (Data_Read)

CR Read data and acknowledgement of previously initiated read job (Check_Read)

In order to prevent incorrect processing of the read and write jobs,


• a Check_Write is required after each Data_Write
• a Check_Read is required after each Data_Read.

FCT parameter=DW
You can use this function to change the address of an AS interface slave or to write
parameters to the AS interface. The selected function and the associated parameters must be
written to the PLC memory area defined by the parameters TYPE, STAD and LENG before the
FB is called. The function FCT=DW can only be executed via indirect programming. The data
block used has the following structure:

Data word Parameter DL DR

DW 0 -- Not relevant
DW 1 DPAD Address range of IM308C, here: F800h
DW 2 IMST Number of IM308C PROFIBUS-DP address of the slave
Range 1 to 123
(is currently not checked)
DW 3 FCT Function of FB 27: here DW
DW 4 GCGR Not relevant
DW 5 TYPE Type of PLc memory area: here 0Ah (DB 15)
DW 6 STAD Start of memory area: here 01h
DW 7 LENG Length of PLC memory area in bytes: here 03h
DW 8 ERR Error word of FB 27
DW 9 Slot number: here 04h Data record number: here 84h
DW 10 Not relevant
DW 11 Error code 1 Error code 2
DW 12

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 4–69


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 01.99
4.5 Function block FB 27 (SW 6.1 and higher)

Allocation of the PLC memory area for FCT=DW:

DB/DX M Modify operating address Write parameter

DL (n) Byte (n) OPCODE: 02h OPCODE: 03h


DR (n) Byte (n+1) PARAMETER1: 00h to 1Fh PARAMETER1: 01h to 1Fh
Source address Slave address
DL (n+1) Byte (n+2) PARAMETER2: 00h to 1Fh PARAMETER2: 00h to 0Fh
Destination address Parameter for AS interface slave

FCT parameter=CW
This function reads the acknowledgements of the FCT=DW function initiated previously. The
acknowledgements indicate how the function FCT=DW has been terminated (DW 8:
parameter ERR of FB 27; DW 11: error codes 1 and 2).
The function FCT=CW can only be executed via indirect programming. The data block used
has the following structure:

Data word Parameter DL DR

DW 0 -- Not relevant
DW 1 DPAD Address range of IM308C, here: F800h
DW 2 IMST Number of IM308C PROFIBUS-DP address of the slave
Range 1 to 123
(is currently not checked)
DW 3 FCT Function of FB 27: here CW
DW 4 GCGR Not relevant
DW 5 TYPE Not relevant
DW 6 STAD Not relevant
DW 7 LENG Not relevant
DW 8 ERR Acknowledgement: error word of FB 27
DW 9 Not relevant
DW 10 Not relevant
DW 11 Acknowledgement: error code 1 Acknowledgement: error code 2
DW 12

4–70 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
01.99 4 Data Sheets for Sequencer Blocks
4.5 Function block FB 27 (SW 6.1 and higher)

FCT parameter=DR
This function reads the parameters of the DP/AS interface. The function FCT=CR can be only
be executed via indirect programming. The data block used has the following structure:

Data word Parameter DL DR

DW 0 -- Not relevant
DW 1 DPAD Address range of IM308C, here: F800h
DW 2 IMST Number of IM308C PROFIBUS-DP address of the slave
Range 1 to 123
(is currently not checked)
DW 3 FCT Function of FB 27: here DR
DW 4 GCGR Not relevant
DW 5 TYPE Not relevant
DW 6 STAD Not relevant
DW 7 LENG Length of PLC memory area in bytes: here 19h
DW 8 ERR Error word of FB 27
DW 9 Slot number: here 04h Data record number: here 84h
DW 10 Not relevant
DW 11 Error code 1 Error code 2
DW 12

© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 4–71


SINUMERIK 840C (PJ)
4 Data Sheets for Sequencer Blocks 01.99
4.5 Function block FB 27 (SW 6.1 and higher)

FCT parameter=CR
This function shows the parameter echo, the version label and the acknowledgements of the
DP/AS interface following the function FCT=DR initiated previously. The acknowledgements
indicate how the function FCT=DR has terminated (DW 8: parameter ERR of FB 27; DW 11:
error codes 1 and 2).
The function FCT=CR can only be executed via indirect programming. The data block used
has the following structure:

Data word Parameter DL DR

DW 0 -- Not relevant
DW 1 DPAD Address range of IM308C, here: F800h
DW 2 IMST Number of IM308C PROFIBUS-DP address of the slave
Range 1 to 123
(is currently not checked)
An error message is sent for 00h or
123 however (see DW 8)
DW 3 FCT Function of FB 27: here CR
DW 4 GCGR Not relevant
DW 5 TYPE Type of PLC memory area
DW 6 STAD Start of PLC memory area
DW 7 LENG Length of PLC memory area in bvtes: here 19h
DW 8 ERR Acknowledgement: error word of FB 27
DW 9 Not relevant
DW 10 Not relevant
DW 11 Acknowledgement: error code 1 Acknowledgement: error code 2
DW 12 Reserved

END OF SECTION

4–72 © Siemens AG 1993 All Rights Reserved 6FC5197- AA30


SINUMERIK 840C (PJ)
01.99 5 Block Data

5 Block Data
Block data for FB Package 0

FB- Name Block Processing Nesting FBs Assigned variables


No. length Call time in ms depth called
in length in
words words

17 STATUS 68 2 FB54, Called in user program


FB55,
27 IM308C 965 FB56
30 MUL:16 50 7 0 - FW246, 248
32 DIV:16 73 10 0 - FW240,242
33 DIV:32 288 14 1 FB34 FW225, FY229, FW240-254
35 DIV/100 32 5 0 - FW240, FW24 2
36 ADD:32 95 10 0 - FW245-254
37 SUB:32 95 10 0 - FW245-254
39 DUAL/BCD 20 4 0 -
40 COD:16 35 6 0 - FW246, 248
41 COD:32 302 8 0 - FW220-224, FW230-238
42 COD:B4 26 5 0 -
43 COD:B8 55 7 0 -
45 GST-FMBM 280 2 1 FB51 Called in user program
47 PSP:FMBM 89 2 0 - Called by FB50
48 FMBM:HSG 275 2 0 - Called in user program
49 UP:FM/BM 236 14 1 - Called by FB57/FB58
50 UP2:FMBM 136 2 0 FB50 Called by FB49
51 UP:FB45 83 7 0 FB47 Called by FB45
54 FM-ANZ 18 2 1 - Called by FB17
55 BM-ANZ 18 2 1 FB46 Called by FB17
56 MG-ANZ 287 2 0 FB46 Called by FB17
57 FM-ABFR 30 2 2 - Called in user program
FB49,
58 BM-ABFR 31 2 2 FB50 Called in user program
FB49,
59 MG-ABFR 285 2 0 FB50 Called in user program
93 ALS:V/R 872 19 1 - FW230-254
FB11,60
94 ALS:AUT 597 9 1 FB89 FW230-254
FB11,60
110 SUCH 212 13 0 FB89 FW230-239, FW252, FY254
SB01) FB-TIPP 367 2 0 - FW230-254
46 ERWEIT - SW 3
48 FMBM:MMC FB11 SW 3

FX- Name Block Call Processing Nesting FBs Assigned variables


No. length time in ms depth called
length in
in words
words

31 GRAYDUAL 127 4 0 - FW 252, 254


32 DUALGRAY 118 4 0 - FW 254
38 PRO-KO1 112 4 2 FB89 Called in user program
FX39, FY 224 - 237, 250
FB62
39 PRO-KO2 452 3 1 FB62 Called by FX 38
FW 226 - 254
81 IKONEN 100 4 0.2 0 FW 250, 254
82 STERNDRE

_______
* Processing time of current sequence block or step
1) Load only for GRAPH 5 sequencer

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 5–1


SINUMERIK 840C (PJ)








6

6.1
03.95

a
aaa a
a a
a a
aa
a a
a a
aaaa
a a
a a
a a
aaaa
a a
aaaa
a a
a a
a a
aaaa
a a
a a
aa
a a
a a
a a
aaaa
a a
aaaa
aaaa
aaaaaa
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa a aa a a

Notes:
a
a
a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa
a a
a
aaa
aa
a a
a

PB
a
a
a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
aa
a a
a a
aa a aa
aaaa a

PB 19
PB 18
PB 16
PB 15
PB 14
PB 12
PB 11
PB 10
a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a

3 axes
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

1 spindle
basic program.
a
aa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
aa
a a
aa
aa
a

Number of axes: 3

SINUMERIK 840C (PJ)


2 NC channels
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
aa
a a
aa
aa
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

Number of spindles: 1
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

GRAPH5 programming.
Appendix 1

a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

Hardware configuration:
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

spindle override switch etc.

Assigned channels: 1 and 2


a a
Appendix

a
a
aa
a aaaaaa
aaaaaaaa
aaaaaaaaaa
aaaa
aaaaaaaaaa
aaaaaaaa
aaaaaaaaaa
aaaaaa
aaaa
aaaa
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
aa
a a
aa
aa
a
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

© Siemens AG 1993 All Rights Reserved


a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aa aaaa

Program selection by the PLC

PLC/NC, COM link


aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a a a a
a a a a aa a a aa a a a aa aa a a a aa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a aa a a a aa a aa aa aa aaaa a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a
a a
aa
a a
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa a aa a
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa a aa a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa a aa a
a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa a aa a

Reading actual values from the axes.


a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa a aa a

Function
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa a aa

Copy I/Q/F area to interface


Copy interface to I/Q/F area

Sequential control GRAPH5


a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa aaaa a
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
aa
a a
aa
aa
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

PB 15 can only be used for 840C Version T


a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

PB 14 can only be used for 840C Version M


a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

6FC5 197- AA30


a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

Transfer MCP* signals in interface


a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aa
a
aaaaaaaaaa
aaaaaaaa
aaaaaaaaaa
aaaa
aaaaaaaaaa
aaaaaaaa
aaaaaaaaaa
aaaaaa
aaaa
aa aa
aaa
a

Direction keys Interface axes 840C T


The example is intended to demonstrate the supply of

a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa

Direction keys Interface axes 840C M

Error messages, operational messages


a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
aa
a a
aa
aa
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
aa
a a
aa
aa
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa aaa
a a a aa a a aa a a a aa aa a a a aa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a aa a a a aa a aa aa aa
a
Moreover, examples of the NC PLC communication are included:

The transfer operations are initiated using extended M addresses.

aaaaaa
a aa aa a
a aa aa a
Transfer of R parameters from the NC to the PLC and vice versa

a
a aa aa a
a a
aa
a a
aa
a
a
a
a
a aa aa a
a aa aa a
aa aa a

-
a a a aa a a a a a a aa a a a aa a aa a a a a a aa aa a
a aaa a aa a a
aaa
a a a a
aaa
a aa a a a aa a a aa a a a
aaa
a a
aaa
a
aaa
a a
aaaaa a
a aa aa a
aaa a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
aa
a a
a a
a a
a a
aa
a a
a a
a a
aa
a a
a a
a a
a a
aa
a a
a a
aa
a a
aa
a a
a a
a
a
a
a aa aa
aaa
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa a aa a
aaaa
aaaa a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa a aa a aa aa a

FB 71
FB 94
FB 67
FB 79
FB 70
FB 78
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa a aa a aa aa a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa a aa a aa aa a

Example of
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa a aa a aa aa a
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa a aa a aa aa a

FB 61, 62
a a a a aa a a aa a a a aa aa a a a aa a a aa a a a aa a aa aa a aa a aa aa a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a
a aa aa a
aa a
aaaaaaa a
with the most important interface signals such as mode selection switch, direction keys,

94 (FB Package 0). The same sequence cascade is processed in STEP5 programming and
Appendix 1 contains examples of the use of the standard function block package 0 and of the

PB 17 and PB 18 show examples of application for the sequence control blocks FB 92 and FB
6.1 Appendix 1
6 Appendix

6–1
6 Appendix 03.95
6.1 Appendix 1

PB10 SPRM-A LENGTH=15 SYM SHEET 1

NETWORK 1 0000 TRANSFER MACHINE CONTROL PANEL SIGNALS


TO DB CHANNEL 1

- TRANSFER MACHINE CONTROL PANEL SIGNALS TO THE


CHANNEL-SPECIFIC
INTERFACE CHANNEL 1.

- TRANSFER SPINDLE OVERRIDE SWITCH FOR SPINDLE 1 TO THE


SPINDLE-
SPECIFIC INTERFACE DB 31, DW 1.

TRANSFERRED SIGNALS: OPERATING MODE SELECTOR KEYS, NC START, NC


STOP, FEEDRATE OVERRIDE SWITCH, SINGLE BLOCK,
KEYSWITCH, RESET, SPINDLE OVERRIDE SWITCH,
PROGRAM MODIFICATION E.G. DRY RUN FEEDRATE.

FB 78
----------------
! T:MS->KN !
-GRUNDBL --!I-BY !
+1 --!K-NR !
+1 --!SPIN !
----------------

GRUNDBL = IB 64 INPUT BYTE BASIC BLOCK

NETWORK 2 000A TRANSFER MACHINE CONTROL PANEL SIGNALS


TO DB CHANNEL 2

TRANSFER MACHINE CONTROL PANEL SIGNALS TO THE CHANNEL-SPECIFIC


INTERFACE CHANNEL 2.

TRANSFERRED SIGNALS: OPERATING MODE SELECTOR KEYS, NC START, NC


STOP, FEEDRATE OVERRIDE SWITCH, SINGLE BLOCK,
KEYSWITCH, RESET, PROGRAM MODIFICATION E.G. DRY
RUN FEEDRATE.

FB 78
----------------
! T:MS->KN !
-GRUNDBL --!I-BY ! :BE
+2 --!K-NR !
+0 --!SPIN !
----------------

GRUNDBL = IB 64 INPUT BYTE BASIC BLOCK

6–2 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.1 Appendix 1

PB11 SPRM-A LENGTH=39 SYM SHEET 1

NETWORK 1 0000 COPY SPINDLE-SPECIFIC SIGNALS IN FLAG AREA

COPY SPINDLE-SPECIFIC SIGNALS OF DB 31 (SPINDLE 1) IN FLAG AREA STARTING AT


FY 60. 4 WORDS ARE TRANSFERRED (DW 0-3 -> FY60-67).
PROCESSING OF FLAG AREA IN PB 17, PB 18.

FB 70
----------------
! T:NS>EAM !
S --!QUTY !
0,1 --!QUAD !
M --!ZITY !
4,60 --!AN/Z !
-NULL --!PASP !
-NULL --!ZASP !
----------------

NULL = F 0.0 ZERO FLAG

NETWORK 2 0012 COPY CHANNEL-SPECIFIC SIGNALS IN FLAG AREA

COPY CHANNEL-SPECIFIC SIGNALS OF DB 10 (CHANNEL 1) STARTING WITH DW 17 IN


FLAG AREA STARTING AT FY 25. 7 WORDS ARE TRANSFERRED (DW 17-23 --> FY25-
38).
PROCESSING OF FLAG AREA IN NETWORKS 3 AND 4 IN PB 17, PB 18.

FB 70
----------------
! T:NS>EAM !
D --!QUTY !
10,17 --!QUAD !
M --!ZITY !
7,25 --!AN/Z !
-NULL --!PASP !
-NULL --!ZASP !
----------------

NULL = F 0.0 ZERO FLAG

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–3


SINUMERIK 840C (PJ)
6 Appendix 03.95
6.1 Appendix 1

PB11 SPRM-A LENGTH=39 SYM SHEET 2

NETWORK 3 INTERPRETATION FY/M9: COOLANT SELECTION

0024 :A - M09-DYN. F 29.1 DYN.SIGNAL M09: ”OFF”


0026 :R - M08-STAT F 30.0 STAT. SIGNAL M08: ”ON”
0028 :***

M09-DYN. = F 29.1 DYNAMIC SIGNAL M09


M08-STAT = F 30.0 STATIC SIGNAL M08

NETWORK 4

002A :A - M08-STAT F 30.0


002C :R - M09-STAT F 30.1 STAT. SIGNAL M09
002E := - KUEHLMI Q 4.0 OUTPUT COOLANT
0030 :***

M08-STAT = F 30.0 STATIC SIGNAL M08


M09-STAT = F 30.1 STATIC SIGNAL M09
KUEHLMI = Q 4.0 COOLANT ”ON”

NETWORK 5 0032 TRANSFER INTERFACE -> FLAG AREA

COPY INTERFACE DATA TRANSFER PLC/NC (DB 36) STARTING WITH DW 0 IN THE
FLAG AREA STARTING WITH FY 50. 3 WORDS ARE TRANSFERRED (DW 0-2 -> FY50-
55).
PROCESSING OF FLAG AREA IN PB 12.

FB 70
----------------
! T:NS>EAM !
D --!QUTY ! :BE
36,0 --!QUAD !
M --!ZITY !
3,50 --!AN/Z !
-NULL --!PASP !
-NULL --!ZASP !
----------------
NULL = F 0.0 ZERO FLAG

6–4 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
03.95 6 Appendix
6.1 Appendix 1

PB12 SPRM-A LENGTH=115 SYM SHEET 1

NETWORK 1 TRANSFER DECODED M FUNCTIONS TO FLAG AREA

PB 12 SHOWS DIFFERENT METHODS OF NC/PLC LINKING WITH FY 61 AND FY 62 (NCD-


LESE, NCD-SCHR).

TRANSFER OPERATIONS CAN BE INITIATED BY AN NC PROGRAM OR BY MEANS OF


THE OVERSTORE FUNCTION. TO DO SO, INPUT THE REQUIRED EXTENDED M
ADDRESS AND THE M ADDRESS AND PRESS NC START.

TO ACTIVATE M DECODING WITH EXTENDED ADDRESSES, THE RELEVANT PLC


MACHINE DATA HAS TO BE SET:

M DECODING WITH EXTENDED ADDRESSES CHANNEL 1: PLC MD 6009 = 0000 0001

IN THE PROGRAMMABLE CONTROLLER, THE DATA BLOCK BELONGING TO CHANNEL 1


HAS TO BE SET UP WITH THE DECODING LISTS OF THE EXTENDED M WORDS.

DECODING LIST CHANNEL 1: DB 80


3 DATA WORDS PER M WORD ARE ASSIGNED FOR DECODING AS FOLLOWS:
1ST WORD: EXTENDED M ADDRESS
2ND WORD: M ADDRESS
3RD WORD: HIGH-ORDER BYTE: DW NO., LOW-ORDER BYTE: BIT NO. IN DB 30

TRANSFER OF DECODED M SIGNALS FROM DB 30 TO FW 105

0000 :C - DB-M-SIG DB30 DB M. DECOD. M SIGNALS


0002 :L DW1
0004 :T FW105 FY105: DYN., 106: STAT. SIG.
0006 :***

DB-M-SIG= DB 30 DATA BLOCKS DECODED M SIGNALS

DB80 -DB-DEC.1 SPRM-A LENGTH=14 SYM

0: KF= +00010; M10 = 10


1: KF= +00010;
2: KY= 001,000; DB 30 DR 1 Bit 0
3: KF= +00010; M10 = 12
4: KF= +00012;
5: KY= 001,001; DB 30 DR1 Bit 1
6: KF= +00010; M10 = 89
7: KF= +00089;
8: KY= 001,002; DB 30 DR2..Bit 2
9: KF = +0000
10: KF = +0000
11: KY = 000,000
12:

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–5


SINUMERIK 840C (PJ)
6 Appendix 03.95
6.1 Appendix 1

NETWORK 2 0008 TRANSFER R PARAMETERS TO FLAG AREA

EXAMPLE FB61, JOB 1: WITH M 10 = 10, TRANSFER OF R PARAMETERS R 90, R 91, R


92 (ANZ/NO. = 3) FROM CHANNEL 1 TO THE FLAG AREA
STARTING WITH FY 107. 2 FLAG WORDS ARE ASSIGNED PER R
PARAMETER WITH NUMBER FORMAT ZFPN = FO (R 90, R 91, R
92 --> FY 107-118).

FB 61
----------------
! NCD-LESE !
-M10=10 --!LESE !
DL 0 --!NSBY !
+3 --!ANZ !
RP --!DTY1 !
NC --!DTY2 !
--!DTY3 !
+1 --!WER1 !
+90 --!WER2 !
+0 --!WER3 !
F0 --!ZFPN !
0 --!DBZI !
107 --!DWZI !
MW --!TYZI !
----------------

M10=10 = F 106.0 STATIC SIGNAL M10=10

6–6 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.1 Appendix 1

PB12 SPRM-A LAE=115 SYM SHEET 2

NETWORK 3 0024 TRANSFER ENDED, JOB 1

STATIC M SIGNAL RESET BY THE "DATA TRANSFER ENDED" INTERFACE SIGNAL FOR
JOB 1 (NSBY: DL 0)

-M10=10
---------
-DUE-END1 --!R !
! !
--!S Q !--
---------

DUE-END1 = F 50.4 DATA TRANSFER ENDED NSBY 1


M10=10 = F 106.0 STATIC SIGNAL M 10 = 10

NETWORK 4 002E WRITE BIT PATTERN IN R PARAMETER

EXAMPLE FB62, JOB 2: WITH M 10 = 12, TRANSFER OF FW 120 AS A BIT


PATTERN
(ZFPN = BI) TO R PARAMETER R 89 FOR CHANNEL 1.

FB 62
----------------
! NCD-SCHR !
-M10=12 --!SCHR !
DR 0 --!NSBY !
+1 --!ANZ !
RP --!DTY1 !
NC --!DTY2 !
--!DTY3 !
+1 --!WER1 !
+89 --!WER2 !
+0 --!WER3 !
BI --!ZFPN !
0 --!DBQU !
120 --!DWQU !
MW --!TYQU !
----------------

M10=12 = F 106.1 STATIC SIGNAL M10=12

NETWORK 5 004A TRANSFER ENDED, JOB 2

STATIC M SIGNAL RESET BY THE "DATA TRANSFER ENDED" INTERFACE SIGNAL FOR
JOB 2 (NSBY: DR 0)

-M10=12
---------
-DUE-END2 --!R !
! !
--!S Q !--
---------

DUE-END2 = F 51.4 DATA TRANSFER ENDED NSBY 2


M10=12 = F 106.1 STATIC SIGNAL M 10 = 12

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–7


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.1 Appendix 1

PB12 SPRM-A LENGTH=115 SYM SHEET 3

NETWORK 6 0054 WRITE DB AREA IN R PARAMETERS

EXAMPLE FB62, JOB 3: WITH M 10 = 89, TRANSFER OF AN AREA OF DB 160 (20


WORDS STARTING WITH DW 10; (QUEL/SOURCE = 160,10,
ANZ/NO. = 10) TO THE R PARAMETERS FOR CHANNEL 1
FROM R 100 TO R 109. 2 WORDS ARE READ PER R
PARAMETER (ZFPN = FO).
DB 160 MUST BE =>30 DW LONG.

FB 62
----------------
! NCD-SCHR !
-M10=89 --!SCHR !
DL 1 --!NSBY !
+20 --!ANZ !
RP --!DTY1 !
NC --!DTY2 !
--!DTY3 !
+1 --!WER1 !
+100 --!WER2 !
+0 --!WER3 !
F0 --!ZFPN !
160 --!DBQU !
10 --!DWQU !
DB --!TYQU !
----------------

M10=89 = F 106.2 STATIC SIGNAL M10=89

NETWORK 7 0070 TRANSFER ENDED, JOB 3

STATIC M SIGNAL RESET BY THE "DATA TRANSFER ENDED" INTERFACE SIGNAL FOR
JOB 3 (NSBY: DL 1)

-M10=89
---------
-DUE-END3 --!R !
! !
--!S Q !--
---------

DUE-END3 = F 52.4 DATA TRANSFER ENDED NSBY 3


M10=89 = F 106.2 STATIC SIGNAL M10=89

6–8 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.1 Appendix 1

NETWORK 8 SELECT PROGRAM NO. FROM PLC

EXAMPLE FB62: SELECT A PROGRAM FROM THE PLC THE PROGRAM NUMBER IS
PRESELECTED WITH A DECADE SWITCH AND TRANSFERRED TO
NC CHANNEL 2 WITH THE TRANSFER KEYS (VALUE 1 = 2).
NUMBER FORMAT ZFPN = B0, I.E. 3 WORDS ARE READ (FW 180,
182, 184).

007A :L KB0
007C :T FW180 AUXILIARY FLAG
007E :T FW182 AUXILIARY FLAG
0080 :L - PRG-NR IW5 DECADE SWITCH, 4 DECADES
0082 :T FW184 AUXILIARY FLAG
0084 :***

PRG-NR = IW 5 PROGRAM NUMBER

NETWORK 9 0086 SELECT PROGRAM NO. FROM PLC

FB 62
----------------
! NCD-SCHR !
-UEBERN. --!SCHR !
DR 1 --!NSBY !
+1 --!ANZ !
IN --!DTY1 !
IT --!DTY2 !
SP --!DTY3 !
+1 --!WER1 !
+1 --!WER2 !
+1 --!WER3 !
B0 --!ZFPN !
0 --!DBQU !
180 --!DWQU !
MW --!TYQU !
----------------

UEBERN. = I 4.3 TRANSFER KEY

NETWORK 10 READ ACTUAL VALUE AXIS 2

EXAMPLE FB61: READ WORKPIECE-ORIENTED ACTUAL VALUE AXIS 2


READ THE WORKPIECE-ORIENTED ACTUAL VALUE FOR
AXIS 2 AND STORE IN DB 160 STARTING WITH DW 1 AS A
BCD VALUE WITH 3 DECIMAL DIGITS. 3 DATA WORDS
ARE ASSIGNED (ZFPN = B4).

00A2 :A - IST-LESE I 4.4 INITIATE: READ ACTUAL VALUE


00A4 :AN F 220.0 AUXILIARY FLAG EDGE
00A6 :S F 220.1 AUXILIARY FLAG
00A8 :S F 220.0
00AA :A F 220.1 AUXILIARY FLAG
00AC :***

IST-LESE = I 4.4 COMMAND READ ACTUAL VALUE

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–9


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.1 Appendix 1

NETWORK 11 00B0 TRANSFER ACTUAL VALUE TO DB 160

FB 61
----------------
! NCD-LESE !
-EINS --!LESE !
DL 2 --!NSBY !
+1 --!ANZ !
AC --!DTY1 !
PW --!DTY2 !
--!DTY3 !
+2 --!WER1 !
+0 --!WER2 !
+0 --!WER3 !
B4 --!ZFPN !
160 --!DBZI !
1 --!DWZI !
DB --!TYZI !
----------------

EINS = F 0.1 ONE FLAG

NETWORK 12 00CC DATA TRANSFER ENDED, JOB 5

00CA :A DUE-ENDS F54.4 DATA TRANSFER ENDED


00CC :R F 220.1 AUXILIARY FLAG EDGE
00CE :AN F IST-LESE I4.4
00D0 :R F 220.0
00D2 :***

DUE-ENDS = F 54.4 DATA TRANSFER ENDED NSBY 5


IST-LESE = I 4.4 COMMAND READ ACTUAL VALUE

NETWORK 13 ACKNOWLEDGE STATIC M SIGNALS

IN ORDER TO ACKNOWLEDGE THE STATIC M SIGNALS WITH WHICH THE


TRANSFER OPERATIONS ARE INITIATED AT THE INTERFACE AS WELL, THE
FLAG AREA IN WHICH THE SIGNALS WERE STORED FOR PROCESSING
MUST BE WRITTEN BACK IN DB 30 (DECODED M SIGNALS).

00D4 :C - DB-M-SIG DB30


00D6 :L FW105
00D8 :T DW1
00DA :BE

DB-M-SIG = DB 30 DATA BLOCK DECODED M SIGNALS

6–10 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.1 Appendix 1

PB14 SPRM-A LENGTH=12 SYM SHEET 1

NETWORK 1 0000 DIRECTION KEYS (840C M Version) -->DB32

TRANSFER DIRECTION KEY SIGNALS (840 M) TO THE AXIS-SPECIFIC INTERFACE (DB


32) DEPENDING ON THE POSITION OF THE AXIS SELECTOR SWITCH POSITION. THE
SIGNALS FOR 3 AXES ARE TRANSFERRED (NRAZ = 1,3).

FB 79
----------------
! T:MS>ACH !
EB 65 --!AWS1 F !-- -AWS-FEHL
EB 0 --!AWS2 ! :BE
1,3 --!NRAZ !
----------------

AWS-FEHL = Q 4.1 AXIS SELECTOR SWITCH FAULTY (840 M)

PB15 SPRM-A LENGTH=13 SYM SHEET 1

NETWORK 1 0000 DIRECTION KEYS (840C T Version) --> DB32

TRANSFER DIRECTION KEY SIGNALS TO THE AXIS-SPECIFIC INTERFACE (DB 32). THE
SIGNALS FOR 6 AXES ARE TRANSFERRED.

FB 67
----------------
! T:MS>ACH !
EB 65 --!GBL ! :BE
EB 0 --!DSBL !
1,4 --!XG/D !
2,5 --!ZG/D !
3,6 --!CG/D !
----------------

GRUNDBL = IB 64 INPUT BYTE BASIC KEY GROUP

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–11


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.1 Appendix 1

PB16 SPRM-A LENGTH=46 SYM SHEET 1

NETWORK 1 INTERFACE SIGNALS IN F AREA

TO DETERMINE THE ERROR AND OPERATIONAL MESSAGES FOR THE EXAMPLE


DESCRIBED BELOW, THE FOLLOWING PLC MACHINE DATA HAVE TO BE SET:

DB58, DL3, BIT 0-7 FOR ERROR MESSAGES: --> MD6036 = 0001 0001
MESSAGE NUMBERS: 9032 - 9039
DB58, DL6, BIT 0-7 FOR ERROR MESSAGES: --> MD6045 = 0000 0100
MESSAGE NUMBERS: 9080 - 9087
DB10, DR9, BIT 0-7 FOR ERROR MESSAGES: --> MD6032 = 1000 0000
MESSAGE NUMBERS: 6056 - 6063

EMERGENCY STOP MESSAGES ARE ACKNOWLEDGED WITH "RESET", PLC ERROR


MESSAGES WITH "ACKNOWLEDGE ALARM", IN BOTH CASES ON CONDITION THAT
THE CAUSE OF THE ERROR HAS BEEN RECTIFIED.

0000 :C DB-MELD DB58 INTERFACE --> FLAG AREA


0002 :L DW0 CONTROL SIGNALS/STATES
0004 :T - STEUERSI FW145
0006 :C - DB-BEDIE DB40
0008 :L DR1 STAT. SIGNALS KEYS GROUP B
000A :T FY144 -FREELY ASSIGNABLE
000C :L DL4 DYN. SIGNALS KEYS GROUP G
000E :T FY 147 -INDIVIDUAL FUNCTIONS
0010 :***

STEUERSI = FW145 CONTROL SIGNALS FOR DISPLAY MESSAGES

DB-MELD = DB 58 DATA BLOCK PLC MESSAGES


DB-BEDIE = DB 40 DATA BLOCK OPERATOR PANEL SIGNALS

NETWORK 2 0012 ACKNOWLEDGE NC EMERGENCY STOP

-----
-T-RESET---! & !-- -NC-QUIT
-----

T-RESET = I 67.7 RESET KEY


NC-QUIT = F 145.7 ACKNOWLEDGE NC EMERGENCY STOP

NETWORK 3 0018 ACKNOWLEDGE PLC ALARM


-----
-T-FMQUIT---! & !-- -FM-QUIT
-----

T-FMQUIT = F 147.2 ACKNOWLEDGE ERROR MESSAGE KEY


FM-QUIT = F 145.1 ACKNOWLEDGE PLC ERROR MESSAGES

6–12 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.1 Appendix 1

NETWORK 4 DISPLAYS IN MESSAGE LINE

001E :A - EINS F 0.1


0020 :S - ANZ-BM F 145.4 DISPLAY OPERATIONAL MESSAGES
0022 :S - ANZ-FM F 145.5 DISPLAY ERROR MESSAGES
0024 :***

EINS = F 0.1 ONE FLAG


ANZ-BM = F 145.4 DISPLAY OPERATIONAL MESSAGES IN MESSAGE LINE
ANZ-FM = F 145.5 DISPLAY ERROR MESSAGES IN MESSAGE LINE

NETWORK 5 SIMULATION MESSAGES

0026 :A - TASTE 1 F 144.7 SIMULATION EMERGENCY STOP


0028 := - MELD9004 F 148.4 AS MESSAGE 9004
002A :A - TASTE 2 F 144.6 SIMULATION PLC ERROR MESSAGE
002C := - MELD9032 F 149.0 AS MESSAGE 9032
002E :A - TASTE 3 F 144.5 SIMULATION PLC OPERAT. MESS.
0030 := - MELD9080 F 150.0 AS MESSAGE 9080
0032 :A - TASTE 4 F 144.4 SIMULATION READ-IN DISABLE
0034 := - MELD6056 F 151.0 AS MESSAGE 6056
0036 :***

TASTE 1 = F 144.7 KEY 1: SIMULATION EMERGENCY STOP


MELD9004 = F 148.4 MESSAGE 9004 EMERGENCY STOP
TASTE 2 = F 144.6 KEY 2: SIMULATION PLC ERROR MESSAGE
MELD9032 = F 149.0 MESSAGE 9032 PLC ERROR MESSAGE
TASTE 3 = F 144.5 KEY 3: SIMULATION PLC OPERATIONAL MESS.
MELD9080 = F 150.0 MESSAGE 9080 PLC OPERATIONAL MESSAGE
TASTE 4 = F 144.4 SIMULATION ERROR MESSAGE CHANNEL 1
MELD6056 = F 151.0 MESSAGE 6056 READ-IN DISABLE CHANNEL 1

NETWORK 6 TRANSFER F AREA -> DB MESSAGES

0038 :C - DB-MELD DB58 DB MESSAGES


003A :L - NOT-AUS FY148 EMERGENCY STOP MESSAGES TO NC
003C :T DL1
003E :L - FM-PLC FY149 ERROR MESSAGES
0040 :T DL3
0042 :L - BM-PLC FY150 OPERATIONAL MESSAGES
0044 :T DL6
0046 :L - STEUERSI FW145 CONTROL SIGNALS FOR DISPLAY
MESSAGES
0048 :T DW0
004A :C - DB-K 1 DB10 DB CHANNEL 1
004C :L - FM-KANAL FY151 ERROR MESSAGES CHANNEL 1
004E :T DR9
0050 :BE

STEUERSI = FW 145 CONTROL SIGNALS FOR DISPLAY MESSAGES


NOT-AUS = FY 148 EMERGENCY STOP MESSAGES
FM-PLC = FY 149 PLC ERROR MESSAGE
BM-PLC = FY 150 PLC OPERATIONAL MESSAGE
FM-KANAL = FY 151 ERROR MESSAGES CHANNEL 1

DB-MELD = DB 58 DATA BLOCK PLC MESSAGES


DB-K 1 = DB 10 DB CHANNEL 1

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–13


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.1 Appendix 1

PB18 SPRM-A LENGTH=52 SYM SHEET 1

NETWORK 1 0000 START SEQUENCE CASCADE AUTOMATIC


CAUTION: THE SIGNAL "-STARTAK" IS RESET EITHER IN THE LAST STEP OR BY
THE SIGNAL "-STO".

----- -STARTAK
-M41-DYN.---!>=1! -------
-M42-DYN.---! !----! !
----- !S !
! !
--!R Q!-
-------

M41-DYN. = F 37.1 DYNAMIC SIGNAL M 41


M42-DYN. = F 37.2 DYNAMIC SIGNAL M 42
STARTAK = F 125.1 START SEQUENCE CASCADE

NETWORK 2 000C RESET SEQUENCE CASCADE AUTOMATIC

-----
-STARTAK --0! & ! -----
-T-RESET ---! !-----!>=1!
----- ! !
-GRUNDST ---! !-- -RESETAK
-----

STARTAK = F 125.1 START SEQUENCE CASCADE


T-RESET = I 67.7 RESET KEY
GRUNDST = F 2.1 NC INITIAL STATE
RESETAK = F 124.7 RESET SEQUENCE CASCADE

NETWORK 3 0016 CALL SEQUENCE CASCADE AUTOMATIC

FB 94
----------------
! ALS:AUT !
+150 --!SB SANZ!-- -SANZ
-STARTAK --!STA S+AK!-- -S+AK
-RESETAK --!R STO !-- -STO
-EINS --!SAN SSTO!-- -SSTO
-NULL --!ANZ+ !
-EINS --!DIAG !
-QIT --!QIT !
-UQIT --!UQIT !
----------------

STARTAK = F 125.1 START SEQUENCE CASCADE


RESETAK = F 124.7 RESET SEQUENCE CASCADE
EINS = F 0.1 ONE FLAG
NULL = F 0.0 ZERO FLAG
QIT = I 7.4 ACKNOWLEDGE A FAULT (CONDITIONAL)
UQIT = I 7.5 ACKNOWLEDGE A FAULT (UNCONDITIONAL)
SANZ = QW 8 OUTPUT OF THE STEP NO.
S+AK = Q 6.0 SEVERAL STEPS ALTIVE SIMULTANEOUSLY
STO = Q 6.1 FAULT IN THE CASCADE
SSTO = Q 6.2 STEP WITH FAULT

6–14 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.1 Appendix 1

PB18 SPRM-A LENGTH=52 SYM

NETWORK 4 002A FEEDBACK GEAR CHANGED

-----
-BEF-UMR ---! & !
-ES-GETR.---! !-- -RM-UMR
-----

BEF-UMR = F 125.2 COMMAND FROM SEQUENCE CASCADE: CHANGE GEAR


ES-GETR. = I 4.7 LIMIT SWITCH GEAR CHANGED
RM-UMR = F 125.7 FEEDBACK GEAR CHANGED

NETWORK 5 0032 RESET STARTAK


-STARTAK
-------
-STO --!R !
! !
--!S Q!-
-------

STO = Q 6.1 FAULT IN THE CASCADE


STARTAK = F 125.1 START SEQUENCE CASCADE

NETWORK 6 003C OUTPUT ERROR RUNNING TIME


-----
-STO ---! & !-- -FLFZ-A
-----

STO = Q 6.1 FAULT IN THE CASCADE


FLFZ-A = Q 5.7 MESSAGE ERROR RUNNING TIME SEQUENCE CASCADE

NETWORK 7 TRANSFER SIGNALS TO INTERFACE


0042 :C - DB-K 1 DB10 DATA BLOCK FOR CHANNEL 1
004A :L DL6 GENERAL FEED DISABLE SIGNALS
004C :T FY224
004E :A - VORSPER F127.0 FEED DISABLE FROM SEQUENCE
CASCADE
0050 := F 224.0
0052 :L FY224
0054 :T DL6
0056 :L DL9 READ-IN DISABLE SIGNALS
0058 :T FY224
005A :A - EINLSPER F 126.0 READ-IN DISABLE FROM SEQUENCE
CASCADE
005C := F 224.0
005E :L FY224
0060 :T DL9
0062 :BE
VORSPER = F 127.0 FEED DISABLE
EINL.SPER = F 126.0 READ-IN DISABLE

DB-K 1 = DB 10 DATA BLOCK CHANNEL 1

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–15


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.1 Appendix 1

SB150 SPRM-A LIB=15050 LENGTH=162 SYM

SEQUENCE CONTROL - SEQUENCE IDENTIFICATION


--------------------------------------------------------------------------------

SEQUENCE BLOCK NO.: SB 150

DATA BLOCK NO. : DB 150

ASSIGNED FLAG AREA: F 230.0 - F 255.7

TIMER BASIS : T 4 - T-WARTE WAITING TIME

FIXED ALLOCATION : T 0 , Z 0

TIMER RANGE: T 4 - T 5

6–16 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.1 Appendix 1

SB150 SPRM-A LIB=15050 LENGTH=162 SYM

! !
! !
! !
! !!T6 :
! T6 !
!---+ !
S==!=== ! S1 : RESET OUTPUTS
!S 1 ! !
===!=== !
! !!T1 : ...
?+ T1 !
! !
S--+--+ ! S2 : BRAKE SPINDLE
!S 2 ! !
+--+--+ !
! !!T2 : SPINDLE STOPPED
+ T2 !
! !
! !
! !
! !
! !!T8 : GEAR NOT CHANGED
! T8 !
!---+ !
S--+--+ ! S3 : REV. DIRECT. OF ROTATION
!S 3 ! !
+--+--+ !
!---------+ !!T3 :
?+ T3 + T7 !!17 : GEAR CHANGED
S--+--+ V ! S4 : ORIG. DIRECT. OF ROTATION
!S 4 ! S 5 ! S5 : ACCELERATE SPINDLE
+--+--+ !
!---------+ !!T4 : GEAR CHANGED
+ T4 + T8 !!T8 : GEAR NOT CHANGED
! ! !
! V !
! S 3 ! S3 : REV. DIRECT. OF ROTATION
! !
! !!T7 : GEAR CHANGED
! T7 !
!---+ ! S5 : ACCELERATE SPINDLE

!S 5 ! !
+--+--+ !
! !!T5 : SPINDLE IN SET RANGE
+ 75 !
! !
S--+--+ ! S6 : END OF GEAR CHANGE
!S 6 ! !
+--+--+ !
! !!T6 :
?+ T6 !
! !
V ! S1 : RESET OUTPUTS
S 1 !

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–17


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.1 Appendix 1

SB150 SPRM-A LIB=15050 LENGTH=162 SYM

!!T1 : ...
!!T2 : SPINDLE STOPPED
!!T3 :
!!T4 : GEAR MESHED
!!T5 : SPINDLE IN SET RANGE
!!T6 :
!!T7 : GEAR MESHED
!!T8 : GEAR NOT MESHED

SB150 SPRM-A LIB=15050 LENGTH=162 SYM SHEET 4

! S1 : RESET OUTPUTS
! S2 : BRAKE SPINDLE TUE : KT 100.1 TWA :
! S3 : REVERSE DIRECTION OF ROTATION TUE : TWA : KT 100.0
! S4 : ORIGINAL DIRECTION OF ROTATION TUE : TWA : KT 100.0
! S5 : ACCELERATE SPINDLE TUE : KT 100.1 TWA : KT 20.0
! S6 : END OF GEAR CHANGE TUE : TWA :

SB150 SPRM-A LIB=15050 LENGTH=162 SYM SHEET 5

TRANSITION 1/1 ...

0000 : BE

==============================================================

TRANSITION 2/1 SPINDLE STOPPED

0000 : A - S=0 F 60.3 SPINDLE STOPPED


0002 : BE

S=0 = F 60.3 SIGNAL SPINDLE STOPPED

==============================================================

TRANSITION 3/1

0000 : BE

==============================================================

6–18 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.1 Appendix 1

TRANSITION 4/1 GEAR CHANGED

0000 : A - RM-UMR F 125.7 FEEDBACK GEAR MESHED


0002 : BE

RM-UMR = F 125.7 FEEDBACK GEAR MESHED

==============================================================

TRANSITION 5/1 SPINDLE IN SET RANGE

0000 : A - S=SOLL F 60.5 SPINDLE IN SET RANGE


0002 : BE

S=SOLL = F 60.5 SPINDLE IN SET RANGE

==============================================================

TRANSITION 6/1

0000 : BE

==============================================================

TRANSITION 7/1 GEAR MESHED

0000 : A - RM-UMR F 125.7


0002 : BE

RM-UMR = F 125.7 FEEDBACK GEAR MESHED

==============================================================

TRANSITION 8/1 GEAR NOT MESHED

0000 : AN - RM-UMR F 125.7 FEEDBACK GEAR MESHED


0002 : BE

RM-UMR = F 125.7 FEEDBACK GEAR MESHED

==============================================================

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–19


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.1 Appendix 1

SB150 SPRM-A LIB=15050 LENGTH=162 SYM

STEP 1/1 RESET OUTPUTS

0000 :A F 233.0
0004 :R - GETR-UM F 61.7 CHANGE GEAR
0006 :R - PLC-SPIN F 65.0 PLC SPINDLE CONTROL
0008 :R - PENDEL F 65.6 OSCILLATION SPEED
000A :R - SOLL-RE F 65.7 SET DIRECTION OF ROTATION CW
000C :R - SPINSPER F 66.0 SPINDLE DISABLE
000E :R - BEF-UMR F 125.2 CHANGE GEAR COMMAND
0010 :R - EINLSPER F 126.0 READ-IN DISABLE
0012 :R - VORSPER F 127.0 FEED DISABLE
0014 :BE

GETR-UM = F 61.7 CHANGE GEAR SIGNAL FROM NC


PLC-SPIN = F 65.0 PLC SPINDLE CONTROL
PENDEL = F 65.6 OSCILLATION SPEED
SOLL-RE = F 65.7 SET DIRECTION OF ROTATION CW
SPINSPER = F 66.0 SPINDLE DISABLE
BEF-UMR = F 125.2 COMMAND FROM SEQUENCE CASCADE: MESH
GEAR
EINLSPER = F 126.0 READ-IN DISABLE
VORSPER = F 127.0 FEED DISABLE

==============================================================

STEP 2/1 BRAKE SPINDLE

0000 :A F 233.0
0002 :S - PLC-SPIN F 65.0 PLC SPINDLE CONTROL
0004 :S - SPINSPER F 66.0 SPINDLE DISABLE
0006 :S - EINLSPER F 126.0 READ-IN DISABLE
0008 :S - VORSPER F 127.0 FEED DISABLE
000A :BE

PLC-SPIN = F 65.0 PLC SPINDLE CONTROL


SPINSPER = F 66.0 SPINDLE DISABLE
EINLSPER = F 126.0 READ-IN DISABLE
VORSPER = F 127.0 FEED DISABLE

TUE : KT 100.1 TWA:

==============================================================

6–20 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.1 Appendix 1

STEP 3/1 REVERSE DIRECTION OF ROTATION

0000 :A F 233.0
0002 :R - SPINSPER F 66.0 SPINDLE DISABLE
0004 :S - SOLL-RE F 65.7 SET DIRECTION OF ROTATION CW
0006 :S - PENDEL F 65.6 SELECT OSCILLATION SPEED
0008 :S - BEF-UMR F 125. MESH GEAR COMMAND
000A :BE

SPINSPER = F 66.0 SPINDLE DISABLE


SOLL-RE = F 65.7 SET DIRECTION OF ROTATION CW
PENDEL = F 65.6 OSCILLATION SPEED
BEF-UMR = F 125.2 COMMAND FROM SEQUENCE CASCADE:
MESH GEAR

TUE : TWA : KT 100.0

==============================================================

STEP 4/1 ORIGINAL DIRECTION OF ROTATION

0000 :A F 233.0
0002 :R - SOLL-RE F 65.7 SET DIRECTION OF ROTATION CW
0004 :DO

SOLL-RE = F 65.7 SET DIRECTION OF ROTATION CW

TUE : TWA : KT 100.0

==============================================================

STEP 5/1 ACCELERATE SPINDLE

0000 :A F 233.0
0002 :R - PENDEL F 65.6 OSCILLATION SPEED
0004 :R - GETR-UM F 61.7 MESH GEAR
0006 :R - PLC-SPIN F 65.0 PLC SPINDLE CONTROL
0008 :S - SOLL-RE F 65.7 SET DIRECTION OF ROTATION CW
000A :R - BEF-UMR F 125.2 MESH GEAR COMMAND
000C :BE

PENDEL = F 65.6 OSCILLATION SPEED


GETR-UM = F 61.7 MESH GEAR SIGNAL FROM NC
PLC-SPIN = F 65.0 PLC SPINDLE CONTROL
SOLL-RE = F 65.7 SET DIRECTION OF ROTATION CW
BEF-UMR = F 125.2 COMMAND FROM SEQUENCE CASCADE:
MESH GEAR

TUE : KT 100.1 TWA : KT 20.0

==============================================================

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–21


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.1 Appendix 1

STEP 6/1 END OF GEAR CHANGE

0000 :A F 233.0
0002 :R - EINLSPER F 126.0 READ-IN DISABLE
0004 :R - VORSPER F 127.0 FEED DISABLE
0006 :R - BEF-UMR F 125.2 MESH GEAR COMMAND
0008 :R - PLC-SPIN F 65.0 PLC SPINDLE CONTROL
000A :R - PENDEL F 65.6 OSCILLATION SPEED
000C :R - SPINSPER F 66.0 SPINDLE DISABLE
000E :R - STARTAK F 125.1 START SEQUENCE CASCADE
0010 :BE RESET

EINLSPER = F 126.0 READ-IN DISABLE


VORSPER = F 127.0 FEED DISABLE
BEF-UMR = F 125.2 MESH GEAR COMMAND
PLC-SPIN = F 65.0 PLC SPINDLE CONTROL
PENDEL = F 65.6 OSCILLATION SPEED
SPINSPER = F 66.0 SPINDLE DISABLE
STARTAK = F 125.1 START SEQUENCE CASCADE

TUE : TWA :

==============================================================

PB19 SPRM-A LENGTH=19 ABS

NETWORK 1 COPY FLAG AREA -> DB CHANNEL 1

WRITE BACK THE FLAG AREA STARTING WITH FY 25 IN THE CHANNEL-SPECIFIC


INTERFACE DB 10 STARTING WITH DW 17. 7 WORDS ARE TRANSFERRED.
(FY 25-38 --> DW 17-23).

FB 71
--------------
! T:EAM>NS !
F --!QUTY !
7,25 --!AN/Q !
D --!ZITY !
10,17 --!ZIAD !
--------------

NETWORK 2 COPY FLAG AREA -> DB SPINDLE

WRITE BACK THE FLAG AREA STARTING WITH FY 60 IN THE SPINDLE-SPECIFIC


INTERFACE DB 31. 4 WORDS ARE TRANSFERRED (SPINDLE 1).
(FY 60-67 --> DW 0-3).

FB 71
--------------
! T:EAM>NS !
F --!QUTY ! :BE
4,60 --!AN/Q !
S --!ZITY !
0,1 --!ZIAD !
--------------

6–22 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.2 Appendix 2

6.2 Appendix 2
PB 21 A:P00855ST.S5D LEN=36
SHEET 1
NETWORK 1 0000 START SEQUENCE CASCADE V/R GRAPH 5

PROGRAM PB21 PROCESSES SEQUENCE CASCADE ”DEPOSIT TOOL” WITH FB 93 (ALS: V/R).
PB21 MUST BE CALLED IN OB1. THE OTHER PROGRAM BLOCKS IN OB1 ARE NOT
ABSOLUTELY NECESSARY TO RUN THE EXAMPLE.
CAUTION: THE START SIGNAL ”-WZA” IS RESET EITHER IN THE LAST STEP OR BY THE
SIGNAL ”-R”.

0000 : A I 6.0 -ST-ABLK START OF THE SEQUENCE CASCADE


0001 : S F 130.0 -WZA DEPOSIT TOOL
0002 : JU FB 93
0003 NAME : ALS: V/R
0004 SB : KF +170
0005 H/A : I 6.7 -HAND/AUT MANUAL/AUTOMATIC
0006 STA : F 130.0 -WZA DEPOSIT TOOL
0007 R : I 6.6 -R RESET
0008 SAN : I 7.1 -SAN SEQUENCE DISPLAY
0009 ANZ+ : I 7.2 -ANZ+ STEP ON SEQUENCE DISPLAY
000A DIAG : I 7.3 -DIAG DIAGNOSTIC FUNCTION
000B QIT : I 7.4 -QIT ACKNOWLEDGE A FAULT (COND.)
000C UQIT : I 7.5 -UQIT ACKNOWLEDGE A FAULT (UNCOND.)
000D S-NR : IW 11 -S-NR STEP NUMBER
000E S-AZ : I 7.6 -S-AZ STEP SELECTION
000F SST+ : I 6.2 -SST+ CONTROL FORWARDS
0010 SST- : I 6.3 -SST- CONTROL BACKWARDS
0011 TIP+ : I 6.4 -TIP+ JOG FORWARDS
0012 TIP- : I 6.5 -TIP- JOG BACKWARDS
0013 SANZ : QW 8 -SANZ OUTPUT OF THE STEP NUMBER
0014 S+AK : Q 6.0 -S+AK SEVERAL STEPS ACTIVE SIMULT.
0015 STO : Q 6.1 -STO FAULT IN THE CASCADE
0016 SSTO : Q 6.2 -SSTO STEP WITH FAULT
0017 VKE : Q 7.0 -VKE-AUSG RLO OF THE CURRENT TRANSITION
0018 STR : Q 7.1 -STR CONTROL BACKWARDS
0019 TIPB : Q 7.2 -TIPB JOG MODE
001A TIP : Q 7.3 -TIP JOG SIGNAL
001B :
001C : A I 6.6 -R RESET THE START SIGNAL
001D : R F 130.0 -WZA
001E : BE

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–23


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 2

I 6.0 = ST-ABLK START OF SEQUENCE CASCADE


F 130.0 = WZA DEPOSIT TOOL
I 6.7 = HAND/AUT MANUAL/AUTOMATIC
I 6.6 = R RESET
I 7.1 = SAN SEQUENCE DISPLAY
I 7.2 = ANZ+ STEP ON SEQUENCE DISPLAY
I 7.3 = DIAG DIAGNOSTIC FUNCTION
I 7.4 = QIT ACKNOWLEDGE A FAULT (COND.)
I 7.5 = UQIT ACKNOWLEDGE A FAULT (UNCOND.)
IW 11 = S-NR STEP NUMBER
I 7.6 = S-AZ STEP SELECTION
I 6.2 = SST+ CONTROL FORWARDS
I 6.3 = SST- CONTROL BACKWARDS
I 6.4 = TIP+ JOG FORWARDS
I 6.5 = TIP- JOG BACKWARDS
QW 8 = SANZ OUTPUT OF THE STEP NUMBER
Q 6.0 = S+AK SEVERAL STEPS ACTIVE SIMULTANEOUSLY
Q 6.1 = STO FAULT IN THE CASCADE
Q 6.2 = SSTO STEP WITH FAULT
Q 7.0 = VKE-AUSG RLO OUTPUT
Q 7.1 = STR CONTROL BACKWARDS
Q 7.2 = TIPB JOG MODE
Q 7.3 = TIP JOG

6–24 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 2
SEQUENCE CONTROL - SEQUENCE IDENTIFICATION

FB SELECTION : FB 70/71 FOR LINEAR/SIMULTANEOUS SEQUENCE: COMFORT VERSION

SEQUENCE BLOCK NO. : SB 170

ASSIGNED DATA BLOCK : DB 170

TIMER BASIS : T1 ASS. TIMER RANGE : T1 - T2

ASS. FLAG AREA : F 200.0 - F 255.7

ASS. TIMER, COUNTER : T 0, Z 0

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–25


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 3

! !!T8 : CONTROL & FEEDBACK VERTICAL


! T8 !
!---+ !
! !!T7 : CONTROL FORWARDS
! T7 !
!---+ !
S=!=== ! S1 : INIT-STEP
?!S 1 ! !
==!=== !
! !!T1 : START CONDITION
+ T1 !
! !
! !
! !
! !
! !!T9 : CONTROL & FEEDBACK FORWARDS
! T9 !
!---+ !
S--+--+ ! S2 : GRIPPER 90° CLOCKWISE
!S 2 ! !
+--+--+ !
!---------+ !!T2 : CONTROL FORWARDS
+ T2 + T8 !!T8 : CONTROL & FEEDBACK VERTICAL
! ! !
! V !
! S 1 ! S1 : INIT-STEP
! !
! !!T10 : CONTROL
! T10 !
!---+ !
S--+--+ ! S3 : GRIPPER BACK
!S 3 ! !
+--+--+ !
!---------+ !!T3 : CONTROL FORWARDS
+ T3 + T9 !!T9 : CONTROL & FEEDBACK FORWARDS
! ! !
! V !!T15 : BACKWARD JUMP TO STEP 4
! T15 S 2 ! S2 : GRIPPER 90° CLOCKWISE
!---+ !
! !!T11 : CONTROL
! T11 !
!---+ !
S--+--+ ! S4 : CLAMP SPINDLE
!S 4 ! !
+--+--+ !
!---------+---------+ !!T4 : CONTROL FORWARDS
+ T4 + T10 +T14 !!T10 : CONTROL
! ! ! !!T14 : FORWARD JUMP TO STEP 6
! V V !
! S 3 S 6 ! S3 : GRIPPER BACK
! ! S6 : RELEASE GRIPPER
! !!T12 : CONTROL
! T12 !
!---+ !
S--+--+ ! S5 : RESTORE MAGAZINE DATA
!S 5 ! !
+--+--+ !
!---------+ !!T5 : CONTROL FORWARDS
+ T5 + T11 !!T11 : CONTROL
! ! !
! V !!T14 : FORWARD JUMP TO STEP 6
! T14 S 4 ! S4 : CLAMP SPINDLE

6–26 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 4

! !!T13 : CONTROL BACKWARDS


! T13 !
!---+ !
S--+--+ ! S6 : RELEASE GRIPPER
!S 6 ! !
+--+--+ !
!---------+---------+ !!T6 : CONTROL FORWARDS
+ T6 + T12 +T15 !!T12 : CONTROL
! ! ! !!T15 : BACKWARD JUMP TO STEP 4
S--+--+ V V ! S7 : GRIPPER 90° COUNTERCLOCKWISE
!S 7 ! S 5 S 4 ! S5 : RESTORE MAGAZINE DATA
+--+--+ ! S4 : CLAMP SPINDLE
!---------+ !!T7 : CONTROL FORWARDS
+ T7 + T13 !!T13 : CONTROL BACKWARDS
! ! !
V V ! S1 : INIT-STEP
S 1 S 6 ! S6 : RELEASE GRIPPER

SB 170 A:P00855ST.S5D LEN=257


SHEET 5

!!T1 : START CONDITION


!!T2 : CONTROL FORWARDS
!!T3 : CONTROL FORWARDS
!!T4 : CONTROL FORWARDS
!!T5 : CONTROL FORWARDS
!!T6 : CONTROL FORWARDS
!!T7 : CONTROL FORWARDS
!!T8 : CONTROL AND FEEDBACK VERTICAL
!!T9 : CONTROL AND FEEDBACK FORWARD
!!T10 : CONTROL
!!T11 : CONTROL
!!T12 : CONTROL
!!T13 : CONTROL BACKWARDS
!!T14 : FORWARD JUMP TO STEP 6
!!T15 : BACKWARD JUMP TO STEP 4

SB 170 A:P00855ST.S5D LEN=257


SHEET 6

! S1 : INIT-STEP
! S2 : GRIPPER 90° CLOCKWISE TUE : TWA : KT 100.0
! S3 : GRIPPER BACK TUE : TWA : KT 100.0
! S4 : CLAMP SPINDLE TUE : TWA : KT 100.0
! S5 : RESTORE MAGAZINE DATA TUE : TWA : KT 100.0
! S6 : RELEASE GRIPPER TUE : TWA : KT 100.0
! S7 : GRIPPER 90° COUNTERCLOCKWISE TUE : TWA : KT 100.0

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–27


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 7
TRANSITION 1/1 0034 START CONDITION
0034 : A I 7.0 -STARTBED START CONDITIONS FULFILLED?
0035 : AN Q 7.1 -STR CONTROL FORWARDS?
0036 : BE

I 7.0 = STARTBED START CONDITIONS


Q 7.1 = STR CONTROL BACKWARDS

===========================================================================

TRANSITION 2/1 0041 CONTROL FORWARDS


0041 : AN Q 7.1 -STR CONTROL FORWARDS?
0042 : A I 8.0 -RM-WAAGR FEEDBACK GRIPPER HORIZONTAL?
0043 : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.0 = RM-WAAGR FEEDBACK GRIPPER HORIZONTAL

===========================================================================

TRANSITION 3/1 004E CONTROL FORWARDS


004E : AN Q 7.1 -STR CONTROL FORWARDS?
004F : A I 8.2 -RM-HINT FEÈDBACK GRIPPER BEHIND?
0050 : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.2 = RM-HINT FEÈDBACK GRIPPER BEHIND

===========================================================================

TRANSITION 4/1 005B CONTROL FORWARDS


005B : AN Q 7.1 -STR CONTROL FORWARDS?
005C : A I 8.4 -SP-DRUCK CLAMPING PRESSURE?
005D : A I 8.5 -WZM-GESP TOOL CLAMPED IN MAGAZINE?
005E : AN F 133.0 -SP-LEER SPINDLE NOT EMPTY?
005F : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.4 = SP-DRUCK CLAMPING PRESSURE
I 8.5 = WZM-GESP TOOL CLAMPED IN MAGAZINE
F 133.0 = SP-LEER SPINDLE EMPTY

===========================================================================

6–28 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 8

TRANSITION 5/1 006A CONTROL FORWARDS


006A : AN Q 7.1 -STR CONTROL FORWARDS?
006B : BE

Q 7.1 = STR CONTROL BACKWARDS

===========================================================================

TRANSITION 6/1 0076 CONTROL FORWARDS


0076 : AN Q 7.1 -STR CONTROL FORWARDS?
0077 : A I 8.6 -GR-GELOE GRIPPER RELEASED?
0078 : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.6 = GR-GELOE GRIPPER RELEASED

===========================================================================

TRANSITION 7/1 0083 CONTROL FORWARDS


0083 : AN Q 7.1 -STR CONTROL FORWARDS?
0084 : A I 8.1 -RM-SENKR FEEDBACK GRIPPER VERTICAL?
0085 : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.1 = RM-SENKR FEEDBACK GRIPPER VERTICAL

===========================================================================

TRANSITION 8/1 008E CONTROL AND FEEDBACK VERTICAL


008E : A Q 7.1 -STR CONTROL FORWARDS?
008F : A I 8.1 -RM-SENKR FEEDBACK GRIPPER VERTICAL?
0090 : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.1 = RM-SENKR FEEDBACK GRIPPER VERTICAL

===========================================================================

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–29


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 9

TRANSITION 9/1 0099 CONTROL AND FEEDBACK FRONT


0099 : A Q 7.1 -STR CONTROL BACKWARDS?
009A : A I 8.3 -RM-VORN FEEDBACK GRIPPER FRONT?
009B : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.3 = RM-VORN FEEDBACK GRIPPER IN FRONT

===========================================================================

TRANSITION 10/1 00A7 STR


00A7 : A Q 7.1 -STR CONTROL BACKWARDS?
00A8 : AN I 8.4 -SP-DRUCK CLAMPING PRESSURE NOT FULFILLED?
00A9 : AN I 8.5 -WZM-GESP TOOL CLAMPED IN MAGAZINE?
00AA : A F 133.0 -SP-LEER SPINDLE EMPTY?
00AB : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.4 = SP-DRUCK CLAMPING PRESSURE
I 8.5 = WZM-GESP TOOL CLAMPED IN MAGAZINE
F 133.0 = SP-LEER SPINDLE EMPTY

===========================================================================

TRANSITION 11/1 00B7 STR


00B7 : A Q 7.1 -STR CONTROL BACKWARDS?
0078 : BE

Q 7.1 = STR CONTROL BACKWARDS

===========================================================================

TRANSITION 12/1 00C4 STR


00C4 : A Q 7.1 -STR CONTROL BACKWARDS?
00C5 : A I 8.7 -GR-GESPA GRIPPER CLAMPED?
00C6 : AN F 133.0 -SP-LEER SPINDLE NOT EMPTY?
00C7 : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.7 = GR-GESPA GRIPPER CLAMPED
F 133.0 = SP-LEER SPINDLE EMPTY

===========================================================================

6–30 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 10

TRANSITION 13/1 00D3 CONTROL BACKWARDS


00D3 : A Q 7.1 -STR CONTROL BACKWARDS?
00D4 : A I 8.0 -RM-WAAGR FEEDBACK GRIPPER HORIZONTAL?
00D5 : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.0 = RM-WAAGR FEEDBACK GRIPPER HORIZONTAL

===========================================================================

TRANSITION 14/1 00E1 FORWARD JUMP TO STEP 6


00E1 : AN Q 7.1 -STR CONTROL FORWARDS?
00E2 : A I 8.4 -SP-DRUCK CLAMPING PRESSURE?
00E3 : A I 8.5 -WZM-GESP TOOL CLAMPED IN MAGAZINE?
00E4 : A F 133.0 -SP-LEER SPINDLE EMPTY
00E5 : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.4 = SP-DRUCK CLAMPING PRESSURE
I 8.5 = WZM-GESP TOOL CLAMPED IN MAGAZINE
F 133.0 = SP-LEER SPINDLE EMPTY

===========================================================================

TRANSITION 15/1 00F1 BACKWARD JUMP TO STEP 4


00F1 : A Q 7.1 -STR CONTROL BACKWARDS?
00F2 : A I 8.7 -GR-GESPA GRIPPER CLAMPED?
00F3 : A F 133.0 -SP-LEER SPINDLE EMPTY
00F4 : BE

Q 7.1 = STR CONTROL BACKWARDS


I 8.7 = GR-GESPA GRIPPER CLAMPED
F 133.0 = SP-LEER SPINDLE EMPTY

===========================================================================

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–31


SINUMERIK 840C (PJ)
6 Appendix 06.93
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 11

STEP 1/1 000C INIT-STEP


000C : A F 233.0
000D : BE

===========================================================================

STEP 2/1 0010 GRIPPER 90° CLOCKWISE


0010 : A F 233.0
0011 : = F 131.2 -GR-RL GRIPPER 90° CLOCKWISE
0012 : R F 131.7 -MAG-POS RESET MAGAZINE POSITIONING
0013 : BE

F 131.2 = GR-RL GRIPPER CLOCKWISE


F 131.7 = MAG-POS MAGAZINE POSITIONING

TUE: TWA: KT 100.0

===========================================================================

STEP 3/1 0016 GRIPPER BACK


0016 : A F 233.0
0017 : = F 131.1 -GR-ZUR GRIPPER BACK
0018 : BE

F 131.1 = GR-ZUR GRIPPER BACK

TUE: TWA: KT 100.0

===========================================================================

STEP 4/1 001B CLAMP SPINDLE


001B : A F 233.0
001C : = F 132.1 -SP-SPANN CLAMP SPINDLE
001D : = F 134.2 -WZM-SPA CLAMP TOOL IN MAGAZINE
001E : BE

F 132.1 = SP-SPANN CLAMP SPINDLE


F 134.2 = WZM-SPA CLAMP TOOL IN MAGAZINE

TUE: TWA: KT 100.0

===========================================================================

6–32 © Siemens AG 1993 All Rights Reserved 6FC5 197- AA30


SINUMERIK 840C (PJ)
06.93 6 Appendix
6.2 Appendix 2

SB 170 A:P00855ST.S5D LEN=257


SHEET 12

STEP 5/1 0021 RESTORE MAGAZINE DATA


0021 : A F 233.0
0022 : = F 130.7 -UMSP RESTORE MAGAZINE DATA
0023 : BE

F 130.7 = UMSP RESTORE MAGAZINE DATA

TUE: TWA: KT 100.0

===========================================================================

STEP 6/1 0026 RELEASE GRIPPER


0026 : A F 233.0
0027 : = F 131.4 -GR-LOES RELEASE GRIPPER
0028 : BE

F 131.4 = GR-LOES RELEASE GRIPPER

TUE: TWA: KT 100.0

===========================================================================

STEP 7/1 002B GRIPPER 90° COUNTERCLOCKWISE


002B : A F 233.0
002C : = F 131.3 -GR-LL GRIPPER 90° COUNTERCLOCKWISE
002D : R F 130.0 -WZA RESET STORE TOOL
002E : BE

F 131.3 = GR-LL GRIPPER COUNTERCLOCKWISE


F 130.0 = WZA STORE TOOL

TUE: TWA: KT 100.0

===========================================================================

END OF SECTION

© Siemens AG 1993 All Rights Reserved 6FC5 197- AA30 6–33


SINUMERIK 840C (PJ)
Siemens AG Suggestions

Corrections
A&D MC IS
P.O. Box 31 80 For Publication/Manual:
SINUMERIK 840C
D-91050 Erlangen Software Versions 1, 2, 3, 4, 5 and 6
Federal Republic of Germany 135 WB2/WD PLC Function Blocks
Package 0: Basic Functions

Planning Guide
Order No.: 6FC5 197-6AA30-0BP1
Edition: 01.99

From:
Should you come across any printing errors
Name when reading this publication, we would ask
Company/Dept. you to inform us accordingly, using this
form. We would also welcome any sugges-
Address
tions you may have in the way of improve-
Telephone / ment.

Suggestions and/or corrections


Siemens AG
Automation & Drives
Motion Control Systems
P.O. Box 31 80, D-91050 Erlangen © Siemens AG 1992, 1993, 1994, 1995, 1996, 1997, 1998
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
aaaaaaaaaaa

All Rights Reserved


Progress
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a

Federal Republic of Germany


a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a

Subject to change without prior notice


a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a

in Automation.
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a

Siemens Aktiengesellschaft
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a

Order No. 6FC5197-6AA30-0BP1


Siemens
a
a
a
a
a
a
a
a
a
a
a
a
a
aa
a
a
a
a
a

Printed in the Federal Republic of Germany


a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a

You might also like