siemens 840C User Manual

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
For more information, refer to the Internet: http://www.a&d.siemens.de/sinumerik
The publication was produced on the Siemens 5800 0ffice System. The reproduction, transmission or use of this document or its
contents is not permitted without express written authority. Offenders will be liable for damages. All rights, including created by patent grant or registration of a utility model or design, are reserved,
© Siemens AG 1993, 1994, 1995, 1996, 1997, 1998, 1999 All Rights Reserved
Order No. 6FC5197-6AA30-0BP1 Printed in the Federal Republic of Germany
Other functions not described in this documentation might be executable in the control. This does not, however, represent an obligation to supply such functions with a new control or when servicing.
We have checked that the contents of this publication agree with the hardware and software described herein. The information given in this publication is reviewed at regular intervals and any corrections that might be necessary are made in the subsequent printings. Suggestions for improvement are welcome at all times.
Subject to change without prior notice.
Siemens-Aktiengesellschaft
Definitions 1
Data Sheets for Digital Functions
Data Sheets for Scanning/Displaying Messages
Data Sheets for Sequencer Blocks 4
Block Data
Appendix 6
2
3
5
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
aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa
aaa aaa aaa aaa aaa aaa aaa aaa aaa
aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa
aaa aaa aaa aaa aaa aaa aaa aaa aaa
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
This documentation is valid for software versions 1, 2, 3, 4, 5 and 6.
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
I Input Q Output
BO Block
T Timer C Counter D Data
I,..
I,BI - Q
I,BI - I
D,..
BO
T
C
$F...
$DW...
*F...
*DW.. .
FB name
Q,...
Q - Q,BI
I - Q,BI
$F...
$DW...
*F...
*DW...
- % 1
- %v1
Type of parameter
IB Operand with
bit address
BY Operand with
byte address
W Operand with
word address
Not applicable
Not applicable Not applicable KM Binary pattern, 16 positions
KY Two absolute values from 0 to 255 KH Hexadecimal number, max. of 4 positions KS Two alphanumeric characters KT Time (1.0 to 999.3) KC Count (0 to 999) KF Fixed-point number (-32768 to +32767)
Allowed actual operand
I n.m Input Q n.m Output F n.m Flag
IB n Input byte QB n Output byte FB n Flag byte DL n Data byte left DR n Data byte right PB n I/O byte
IW n Input word QW n Output word FW n Flag word DW n Data word PW n I/O word
DB n Data block FB n Function block PB n Program block SB n Sequence block
T n No. of timer C n No. of counter
I,BI I,BI -Q I,BI - /
I,.. $...
*...
Q,BI
Q- Q,BI
I- Q,BI
$...
*... % 1
%v1
© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 1–1 SINUMERIK 840C (PJ)
Input signal, statically effective Input signal which is acknowledged by the FB Input signal whose leading edge is evaluated
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
Output signal, statically effective Output signal which must be acknowledged by the user 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 Error number ACCU2 for system stop (STS); ACCU1 FB number Additional specification of interface byte number in high byte ACCU2
1 Definitions 06.93
1.2 Overview of PLC interface
1.2 Overview of PLC interface
1.2.1 Inputs
Inputs
Byte
No.
7 6 5 4 3 2 1 0
0
127
128
255
1.2.2 Outputs
Byte
No.
7 6 5 4 3 2 1 0
0
127
Bit No.
Physical interface with process image
(Input modules, DMP submodules, machine control panel)
Physical interface without process image
(Input modules, DMP submodules)
Outputs
Bit No.
Physical interface with process image
(Output modules, DMP submodules, machine control panel)
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
24 25
99
100
199 200
224
255
Basic signals
.
e.g. auxiliary flags or . . .
dynamically assignable by interface signals
e.g. interface Channel 1 . .
User assignable . . . . .
Reserved for function .
. .
blocks (see note)
Area saved on change of level and warm restart
.
Channel 2 etc.
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-255are available to the user.
DB No.
DB desig. DB name Pack.
1
2 3
4 10 * 11 * 12 * 13 *
14 *
15 *
16-17 28
29 30 * 31 * 32 * 33 34 35 36 * 37 * 38 40 * 41 * 48 * 50 51 52 53 54 55 56 57 58 * 59 60 * 61 * 62 * 63 * 64 * 65 * 66 67 68 * 71 *
DIAG-DB STATUS-DB
DATKAN-DB FM/BM-DB
NS KN 1 NS KN 2 NS KN 3
NS KN 4 NS KN 5 NS KN 6
SI
NS ELG
DEC MFU
SPI SIG
ACHS SIG
E-PU
A-PU
DUE NC
SER SCH.
RK : ZW-DB
NS BEDT.
NS KK
NS COM
E : PLC 1
A : PLC1
E : PLC 2
A : PLC2
E : PLC 3
A : PLC3
E : PLC 4
A : PLC4
MELD DB-ZENTRAL MDG WO MDF WO MDA WO MDG BI MDF BI MDA BI IKO-DB INT-MSTT SEA WO SEA BI
Diagnostic DB PLC status channel (up to SW2, not used in SW3), from SW4 used for ”Rapid data channel” function PLC data channel (up to SW2, not used in SW3), from SW4 used for ”Rapid data channel” function Error and operational messages Interface NC channel 1 Interface NC channel 2 Interface NC channel 3
Interface NC channel 4 Interface NC channel 5 Interface NC channel 6
Reserved
Interface Signals for Safety Integrated
GI signals and 611D signals (GI=gearbox interpolation)
Decoded M functions (list)
Interface for spindle-specific signals
Interface for axis-specific signals
Reserved
Input buffer, computer link
Output buffer, computer link
Interface for data transfer NC
<-> PLC
Data transfer control
Status DB computer link
Interface for operator panel
Interface for command channel
Interface for NC/PLC communication
Input signals from PLC 1 880/880 GAZ only
Output signals to PLC 1 880/880 GAZ only
Input signals from PLC 2 880/880 GAZ only
Output signals to PLC 2 880/880 GAZ only
Input signals from PLC 3 880/880 GAZ only
Output signals to PLC 3 880/880 GAZ only
Input signals from PLC 4 880/880 GAZ only
Output signals to PLC 4 880/880 GAZ only
Interface for general messages
Central DB in link RAM 880/880 GAZ only
MD words operating system
MD words function blocks
MD words user
MD bits operating system
MD bits function blocks
MD bits user
Icon control in MMC
Internal machine control panel
SE user words
SE user bits
OS OS
OS OS
OS OS OS OS OS OS
FB OS OS OS OS CL CL OS OS CL OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS
Abbreviations:
OS PLC operating system CL Computer link SE setting data
FB Description of Functions Safety Integrated
1–4
Note:
Data blocks marked * are generated and initialized by the PLC operating system on each cold restart, after a general reset. These blocks are always reinitialized with every automatic cold restart.
© Siemens AG 1993 All Rights Reserved 6FC5197- AA30
SINUMERIK 840C (PJ)
12.93 1 Definitions
1.3 Data blocks
DB No.
76 77 78 79 80 81 82 83
99 100 101 102 103 104 105
122 125
126 127 128 129 130
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
DB design. DB name Pack.
Quit FM/BM DB FM/BM Quit FM/BM QUITFMBM LMDKN 1 LMDKN 2 LMDKN 3 LMDKN 4
Log-Part
NCDAT-T
EIN ASS
AUS ASS
ZWSP-WZD
WZ-V-BO
EM/OM acknowledgement signals (up to SW2) DB status words for EMs/OMs (up to SW2) EM/OM acknowledgement signals (up to SW2) EM/OM acknowledgement signals (up to SW2) List for M decoding, NC Channel 1 List for M decoding, NC Channel 2 List for M decoding, NC Channel 3 List for M decoding, NC Channel 4
Assignment user-interface/logical peer destination Texts for file transfer display (operator request) Input user interface Output user interface Buffer for tool data Tool management, operator interface
Reserved . . .
. . .
Reserved
S-SIGNALE FORM-DB ZUST-DB E-PUFFER A-PUFFER
Standard signals
Format list
Status DB
Input useful data DB
Output useful data DB
Reserved
ZW-STAZ ZW DYNPUFF 1 DYNPUFF 2 DYNPUFF 3 DYNPUFF 4 DYNPUFF 5 DYNPUFF 6 DYNPUFF 7 DYNPUFF 8 ZW-DATVT ZW-BT ZW-ANZBT ZW-MESS TO-DATVT TO-DATLS ZW-WZV
Status DB for tool life, quantity
Status word DB for punched tape input
Dynamic buffer
Dynamic buffer
Dynamic buffer
Dynamic buffer
Dynamic buffer
Dynamic buffer
Dynamic buffer
Dynamic buffer
Status word DB data distributor
Status word DB operator panel
1)
1)
Display parameters, operator panel
Interface, measurement
TO memory distributor
Buffer for read/write TO data (FB 61/FB 62)
Status words, tool management
0 0 0 0 UR UR UR UR
CL CL, 4 CL CL CL, 4
CL CL CL CL CL CL
CL 6 6 6 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Abbreviations:
OS PLC operating
system 0 FB Package 0 CL Computer link UR User 1 FB Package 1
Note:
Data blocks marked * are generated and initialized by the PLC operating system on each cold restart, after a general reset. These blocks are always reinitialized with every automatic cold restart.
1)
Data blocks marked
are created contiguously according to the
tool management configuration.
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.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
DB desig. DB name Pack.
KENN 1 KENN 2 KENN 3 IDENT 1 IDENT 2 DUPLO ANWEND 1 ANWEND 2 ANWEND 3 ANWEND 4 ANWEND 5 ANWEND 6 ANWEND 7 D-NR. 1 D-NR. 2 D-NR. 3 D-NR. 4 D-NR. 5 D-NR. 6 D-NR. 7 D-NR. 8 D-NR. 9 ERSATZPL WZAUF1 L1 WZAUF2 L1 WZAUF1 L2 WZAUF2 L2 ADAGE1 L1 ADAGE2 L1 ADAGE1 L2 ADAGE1 L2 ADALAGE
Identifiers Identifiers Identifiers Ident. number Ident. number Duplo number User data User data User data User data User data User data User data Reference list Reference list Reference list Reference list Reference list Reference list Reference list Reference list Reference list Replacement location number Tool holder L1 Tool holder L1 Tool holder L2 Tool holder L2 Adapter geometry L1 Adapter geometry L1 Adapter geometry L2 Adapter geometry L2 Adapter position
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Abbreviations:
OS PLC operating
system 0 FB Package 0 CL Computer link UR User 1 FB Package 1
Note:
Data blocks marked * are generated and initialized by the PLC operating system on each cold restart, after a general reset. These blocks are always reinitialized with every automatic cold restart.
1)
Data blocks marked
are created contiguously according to the
tool management configuration.
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.
11 * 12 * 17 27 30
32 33
35 36 37
39 40 41
42 43
45 45
47 48 48 49 50 51 52 *
FB desig. FB name Pack.
EINR-DB WDTGR STATUS IM308C MUL:16
DIV:16 DIV:32
DIV/100 ADD:32 SUB:32
DUAL/BCD COD:16 COD:32
Create data blocks Retriggering cycle monitoring PLC status channel (840C SW 1 and 2) Profibus interface for 840C (SW 6.1 and higher) Multiplication of two 16-bit binary numbers
Division of two 16-bit binary numbers Division of two 32-bit binary numbers
Division by 100 Addition of two binary numbers Subtraction of two binary numbers
Convert binary to BCD, 4 decades Convert fixed-point binary number (16 bits) to BCD number
OS OS 0 0 0
0 0
0 0 0
0 0
Convert fixed-point binary number (32 bits) to BCD
COD:B4
number (flags used: FW 220, 238)
0
Convert BCD number (4 decades) to fixed-point binary
COD:B8
number
0
Convert BCD number (8 decades) to fixed-point binary
0 0 0
0 0 0 0 0 0 OS
GST-FMBM ANLAUF
PSP:FMBM
FMBM:HSG FMBM:MMC
UP:57/58 UP:FB49 UP:FB45 BTR 8-16
number Initial settings for error messages/operational messages
Initial settings for error messages/operational messages (840C SW 3) Buffer, error/operational messages Auxiliary signals for EMs/OMs Auxiliary signals for EMs/OMs (840C SW 3) Subroutine FB57, FB58 Subroutine FB49 Subroutine FB45 Block transfer between 8 bit and 16 bit memory
54 55 56 57 58 59 60 * 61 * 62 * 63 * 64 *
FM-ANZ BM-ANZ MG-ANZ FM-ABFR BM-ABFR MG-ABFR BLOCK-TR NCD-LESE NCD-SCHR PCD-LESE PCDSCHR
Abbreviations:
OS PLC operating system 0 FB Package 0
Display error messages (840C SW 1 and 2) Display operational messages (840C SW 1 and 2) Display message groups (840C SW 1 and 2) Scan error messages Scan operational messages Scan message groups (840C SW 1 and 2) Block transfer Read NC data Write NC data Read PLC data from PLC 1/2/3/4
(applies to 880 only)
Write PLC data to PLC 1/2/3/4 (applies to 880 only)
Note:
Blocks marked * are function macros which are integrated in the PLC operating system.
0 0 0 0 0 0 OS OS OS OS OS
(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.
65 * 66 * 67 * 68 * 69 * 70 * 71 * 72 * 73 * 74 * 75 * 76 * 77 * 78 * 79 *
88 * 89 *
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113* 114 115 116 117 118 119 120
FB desig. FB name Pack.
M-STACK STACK-M
>ACH
T:RI-
RUF
AP G-DECOD
>EAM
T:NS­T:EAM­T:NCK­T:DB­T:SPI­T:DB­T:ACH­T:DB­T:MS­T:MS-
>NS >DB
>NCK
>DB
>SPI
>DB
>ACH
>KN >ACH
BA-LAMPE BAA-LESE
AK2:V/R AK3:AUT ALS:V/R ALS:AUT RK:S880 RK:TWZD
RK:GLOBA RK:MELDG RK:NCDAT
UP:FB101 UP:RK880
SUCH SUCHROUT LEERPL1 SUCH-SYM SUCH-VOR SUCH-RWS WZV-INIT EINR-MAG WZ-GR:ST
Transfer flags -­Flag stack -­Transfer direction keys (840C T version) to axes Aperiodic program call G functions decoding Transfer interface DB to I/Q/F Transfer I/Q/F to interface DB Transfer NC channel -­Transfer DB channel -­Transfer spindle -­Transfer DB spindle -­Transfer axis -­Transfer DB axis -­Transfer machine control panel -­Transfer machine control panel --
Mode LED driver Read block start address
Sequencer forwards/reverse Sequencer reverse Sequencer forwards/reverse Graph 5 Sequencer automatic Graph 5 Computer link FB Reserved, transfer tool data Reserved Reserved Reserved Global functions Messages File transfer (operator request) Reserved Reserved Reserved Reserved Subroutine for FB 101 Subroutine Reserved Search for word Search routine Search for empty location without default Direction of search, symmetrical Forward search Backward search Initialize tool management Create magazine table Standard tool size Reserved Reserved
> flag stack > transfer flags
> DB channel
> NC channel
> DB spindle
> spindle
> DB axis
> axis
> NC channel > DB axis (840C
M
version)
OS OS OS OS OS OS OS OS OS OS OS OS OS OS OS
OS OS
0 0 0 0 CL, 4 CL, 5 CL CL CL CL, 4 CL, 4 CL, 4 CL CL CL CL CL, 4 CL, 4 CL 0 1 1 OS 1 1
1 1 1 1
Abbreviations:
OS PLC operating system 0 FB Package 0 1 FB Package 1 4 FB Package 4 of
computer link
CL Computer link
1–8
Note:
Blocks marked * are function macros which are integrated in the PLC operating system (see description of FUNCTION MACROS).
© Siemens AG 1993 All Rights Reserved 6FC5197- AA30
SINUMERIK 840C (PJ)
06.93 1 Definitions
1.4.1 Class FB function blocks
FB No.
121 122 123 124 125
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
FB desig. FB name Pack.
Reserved LEERPL2 WZ-BS UP: T=ID UP: T=PL
Search for empty location with default
Prepare tool
Subroutine tool search T = ident
Subroutine tool search T = location UP:ZW-SP
TRANSFER
Transfer tool data
Reserved TOS-VER UP: MD-B UP: MD-W RI-AUSW TODAT-W D-NR:WZW WZDAT-LS
Subroutine
Subroutine MD bits
Subroutine MD words
Direction selection
Reserved
Prepare D number after tool change
Read tool data
Subroutine DYN-PUFF DAT-VERT UP: FB139 UP: KC-0 UP: KC1-4 UP: KC5-7 UP:KC8+9 BEL-CDTR ENT-CDTR CT-FORMAT
Management of data I/O buffers
Processing of data I/O buffers
Subroutines of FB 139
Subroutines of FB 139
Subroutines of FB 139
Subroutines of FB 139
Subroutines of FB 139
Load tool with code carrier
Unload tool with code carrier
Formatting
Reserved
Reserved
Reserved
Reserved NP-SIF AD-AD RK: AW-SS LOCHSTEG STAZ/VWG STUE/VWG WZ-SPER BCD-DUAL
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
Subroutine
Subroutine
User interface for CL (processing)
Punched tape input
Tool life monitor (prewarning limit)
Monitor for no. of pieces (prewarning limit)
Tool lockout
BCD/binary conversion
Central calling block
Subroutine check
Spare
Spare
Transfer tool selection
Reserved
Signal: load spindle
Signal: unload spindle
Acknowledge spindle
Spare
Assignments, buffer
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6 6 6 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Abbreviations:
1 FB Package 1 6 FB Package 6
© Siemens AG 1993 All Rights Reserved 6FC5197- AA30 1–9 SINUMERIK 840C (PJ)
Note:
Blocks marked management.
1)
are part of the user interface example of tool
1 Definitions 06.93
1.4.1 Class FB function blocks
FB No.
171 172 173 174 175 176 177 178 179
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
FB desig. FB name Pack.
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
1)
Magazine assignments Selection tool according to T number Load/unload magazine from preselect/spindle Spare Display tool data from buffer assignments Change tool data from buffer assignments Display tool data from magazine assignments Change tool data from magazine assignments Selection tool according to cursor position from magazine assignments Additional cutter from buffer and magazine Additional cuffer from loading Load Unload Spare Manual acknowledgement Abort manual magazine/spindle Display next cutter Reactivate tool Delete last cutter Select loading display, punched tape Acknowledge punched tape positive/negative Abort punched tape Spare Spare
Reserved WZ-LISTE TAUSCHL FIFO
Reserved
Open tool list
Open swap list
Buffer processing
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Abbreviations:
1 FB Package 1
Note:
Blocks marked management.
1)
are part of the user interface example of tool
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
10 11 12 13 14 15 16 17
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
54
2 3 4 5 6 7 8 9
:
:
SI
SIMULAT WZ-GRIEP
BEL-CDTR ENT-CDTR UP-CDTR
DAT-EIN DAT-AUS DAT-UHR
GRAYDUAL DUALGRAY RECHNEN MESSEN RESREQ
PRO-KO1 PRO-KO2 RK:WZABF RK: WZM RK: WZBEL RK: WZENT RK:WZBGB RK:KASSE
UPWZKASS EA-TRAN UPWZDIAL
Self-start-up Reserved Reserved Reserved Reserved Reserved Simulation of a part program Presetting tool size via EPROM Reserved Reserved Reserved Reserved Reserved Load code carrier Unload code carrier Subroutine code carrier Reserved Reserved Reserved Reserved Reserved Reserved Reserved PLC-controlled data input PLC-controlled data output Date/time Reserved Reserved Gray code/binary converter Binary/gray code converter Contour and technology calculation Measuring in JOG mode Triggering link bus reset Reserved Reserved Program coordination (840C SW 2 and higher) Subroutine FX 38 Computer link, interrogate tool Computer link, report tool Computer link, load tool Computer link, unload tool Computer link, load magazine assignment data Tool cassette processing Reserved Reserved Subroutine tool cassette processing Data transfer I/O buffer Tool management Subroutine tool dialog Reserved Reserved Reserved
OS
1 1 1 1 1 1
7 7 7 CL CL CL
8 8 8 CL CL 0 0 CP CP 0 CL CL 0 0 5 5 5 5 5 5
5 5 5
© 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 56 57 58 59 60
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
99
:
DIAGNOSE ALLFUNK 1 ALLFUNK 2 SINFUNKT PLCFUNKT
PRO-MESS TP-UEB TP-BEARB DRU-AUSG PRO-UP1 OEM-SEND OEM-EMPF AX-G-FKT
IKONEN STERNDRE
Diagnostics main module General functions 1 General functions 2 SINUMERIK-dependent functions PLC-dependent functions Reserved
Reserved Logging measuring data Transfer part program Process part program Printer output Subroutine Send data to MMC (reserved for OEM customers) Receive data from MMC (reserved for OEM customers) Decode axis-specific G functions (840C SW 3 and higher) Reserved Reserved address calculation flag area Reserved Reserved Reserved Icon display Star-delta switchover (840C SW 3) Reserved PG functions Reserved PG functions Reserved PG functions Reserved PG functions Reserved PG functions Reserved PG functions Reserved
Reserved
8 8 8 8 8 OS OS OS
0 0
Abbreviations:
0 FB Package 0 1 FB Package 1 5 FB Package 5 7 FB Package 7
8 FB Package 8 OS PLC Operating System CP Cycles Package 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 = A x B
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)
Loading...
+ 151 hidden pages