Readme PDF
Readme PDF
Readme PDF
Important:
The sample programs are freeware. Any user can use, copy and forward this program free of charge. The
authors and owners of this program take no responsibility whatsoever for the functionality and compatibility
of this software. Use of the software is at the user's own risk.
Since this software is free of charge, there is no warranty and no entitlement to error correction and hotline
support.
1
SIEMENS AG
Use only PLC subroutines and data blocks from the same toolbox CD. Don’t replace or add single subroutines or
data blocks.
MCP 310 and MCP483 got different input / output images. Further is the arrangement of feed control different in
milling and turning.
The symbol table IS_MCP in examples MCP_xx is adapted to the arrangement for the respective technology.
Please begin your project with the selection of the MCP and add in this project other subroutines.
All SBRs for magazine or tool management relate to first magazine, first tool holder and first loading point.
The SWAP_DW SBR exchanges byte-order of a floating point number from big endian to little endian.
This example manages the interface between HMI and PLC to activate hand-wheel in WCS (DB3200.DBX100x.x)
or MCS (DB380x.DBB4) and jog keys on hand held unit (HHU).
The hand-wheel signals need to be taken to X143 of the PPU as first hand-wheel.
Keys for axis selection, jog, rapid movement and function keys needs to interfacing on X51, X52 and X55 on MCP
with standard addresses.
The emergency and enabling buttons should be used in safety/enabling circuit of the machine.
Call SBR HW_HHU_Mill always after MCP and JOG_MCP SBR.
Function description:
Position 0 on axis selection key set HHU inactive. Hand-wheel functions may be selected on HMI.
Switch on axis Z…5 activates HHU. The selected axis can be displayed with PLC alarm (in example alarm 700236).
Machine function 1 INC is selected.
Rapid traverse button switch to machine function 100 INC. Other INC functions are not realized.
2
SIEMENS AG
This Subroutine manages cancel instruction to tool management and reset acknowledgment errors. SBR
TMM_Cancel_Job is part of example TMM_Mill. If you use this SBR in other projects make sure that DB9902
TM_ACK has acknowledgment step 2 with status 3 or change the acknowledgment bits inside the SBR.
This subroutine needs data block EMG_STOP (DB9052). Data block DB9052 is contained in this project.
Please copy this data block into your project.
CAUTION
Please check whether this subroutine complies with all the relevant safety requirements.
This subroutine handles the emergency stop sequence, as well as the power on and off sequence of the drive
SINAMICS S120.
For detailed information about drive SINAMICS S120, please refer to SINAMICS S120 documents.
Signals:
Input E_KEY: PLC Input from emergency stop key
Input T_RDY_LM: PLC Input from line module X21 Pin 1
Input HWL_ON: any hardware limit is active
Input Axis_stopped: all axis stand still, can be used to make sure that spindle standstill before disable the drive
system
Output OFF1: Output to set OFF1 and give pulse enable
Output OFF3: Output to set OFF3
Outputs E_Key_pressed, Drive_not_ready and HW_Limit_active: Outputs for set alarms.
3
SIEMENS AG
This subroutine needs data block EMG_STOP (DB9052). Data block DB9052 is contained in this project.
Please copy this data block into your project.
CAUTION
Please check whether this subroutine complies with all the relevant safety requirements.
This subroutine handles the emergency stop sequence by using a safety relay combination with undelayed and
delayed relay contacts (hardware solution).
Only one emergency stop subroutine may be active in the OB1, either Emergency_stop or SR_EMG_STOP.
The spindle stop signal is not monitoring. The delayed time from the safety relay contact must have a value > drive
stop time from the most powerful drive (e.g. time spindle stop time).
The SINAMICS controlled the line contactor via the Active Line Module.
By using a Smart Line Module without DRIVE CLIQ the line contactor is controlled by the safety relay.
Signals:
Input LM_RDY: Line module with DRIVE CLiQ 828D X132.8 ready to power up; by using line module without
DRIVE CLiQ must be ONE
Input OFF3_K1_Cont: OFF3 quick stop from 828D X122.2
Input OFF1_K2_Cont: OFF1 from 828D X122.1
Input HWL_active: any of hardware limit switches is active (NO)
Input ON_Key_cust: Customer Key for flag ON safety relay
Input LM_Infop: infeed operation line module with (without line module must be one)
Input E_Key_cust: Emergency Stop key (NO)
Input LC_Replay_Cont: Replay from Line contactor
Output SR_ON: On flag for safety relay
Output OFF1_T: Terminal output to subroutine Axis_enable
Output OFF3_T: Terminal output
Output Drive_Power_Alarm: Alarm from Drive power up
Output EMG_button_pushed: Emergency stop button is pushed
Output LC_signal_error: No checkback signal from line contactor
4
SIEMENS AG
SBR 233Axis_enable
SBR manages ax enabling, feed stop /spindle stop for all axes and first spindle.
If more spindles exist please manage in a separate SBR.
Signals:
Program test
Dry run
Programmed stop
Handweel Offset
Skip Block
This example manages on base Manual PPU, chapter 7.1, signals NC-->PLC and PLC -->NC.
Signals:
Operating Mode (Jog, Jog-Ref, MDA, Auto) and machine functions (Inc, Repos, Teach In)
Program control (NC Start, NC Stop, NC Reset, Single Block)
5
SIEMENS AG
Key-operated switch
WCS/MCS
This subroutine needs data block DB_Common (DB9053). Data block DB9053 is contained in this project.
Please begin a new project with one MCP example. Symbol Table IS_MCP matches only for this example.
This example manages on base Manual PPU, chapter 7.1, signals NC-->PLC and PLC -->NC.
Signals:
Feed start/stop (send to DB9053, interface is managed in SBR Axis_enable)
Feed control with override switch
Spindle start/stop (send to DB9053, interface is managed in SBR Axis_enable)
Spindle control with override switch
Direction keys with rapid traverse override
SBR input Spindle1_Axis: enter here the machine axis number of the first spindle (to manage the spindle
override).
This subroutine needs data block DB_Common (DB9053). Data block DB9053 is contained in this project.
Please begin a new project with one MCP example. Symbol Table IS_MCP matches only for this example.
This example manages on base Manual PPU, chapter 7.1, signals NC-->PLC and PLC -->NC.
Signals:
Feed start/stop (send to DB9053, interface is managed in SBR Axis_enable)
Feed control with combined ax and direction key and override feed/rapid traverse
6
SIEMENS AG
SBR input Spindle1_Axis: enter here the machine axis number of the first spindle
(to manage the spindle override).
This subroutine needs data block DB_Common (DB9053). Data block DB9053 is contained in this project.
Please begin a new project with one MCP example. Symbol Table IS_MCP matches only for this example.
This example manages on base Manual PPU, chapter 7.1, signals NC-->PLC and PLC -->NC.
Signals:
Feed start/stop (send to DB9053, interface is managed in SBR Axis_enable)
Feed control with combined ax and direction key and override feed/rapid traverse
Spindle start/stop (send to DB9053, interface is managed in SBR Axis_enable)
Spindle control with override switch
rapid traverse key
SBR input Spindle1_Axis: enter here the machine axis number of the first spindle
(to manage the spindle override).
This example manages on base Manual PPU, chapter 7.1, signals NC-->PLC and PLC -->NC.
7
SIEMENS AG
Signals:
Operating Mode (Jog, Jog-Ref, MDA, Auto) and machine functions (Inc, Repos, Teach In)
Program control (NC Start, NC Stop, NC Reset, Single Block)
Key-operated switch
WCS/MCS
This subroutine needs data block DB_Common (DB9053). Data block DB9053 is contained in this project.
Please begin a new project with one MCP example. Symbol Table IS_MCP matches only for this example.
This example manages on base Manual PPU, chapter 7.2, signals NC-->PLC and PLC -->NC.
Signals:
Feed start/stop (send to DB9053, interface is managed in SBR Axis_enable)
Feed control with override switch
Spindle start/stop (send to DB380x.DBB5006 and DB9053, interface is managed in SBR Axis_enable)
Spindle control with toggle keys
Direction keys with rapid traverse override
SBR input Spindle1_Axis: enter here the machine axis number of the first spindle
(to manage the spindle override).
This subroutine needs data block DB_Common (DB9053). Data block DB9053 is contained in this project.
Please begin a new project with one MCP example. Symbol Table IS_MCP matches only for this example.
This example manages on base Manual PPU, chapter 7.2, signals NC-->PLC and PLC -->NC.
8
SIEMENS AG
Signals:
Feed start/stop (send to DB9053, interface is managed in SBR Axis_enable)
Feed control with combined ax and direction key and override feed/rapid traverse
Spindle start/stop (send to DB380x.DBB5006 and DB9053, interface is managed in SBR Axis_enable)
Spindle control with toggle keys
rapid traverse key
SBR input Spindle1_Axis: enter here the machine axis number of the first spindle
(to manage the spindle override).
This subroutine needs data block DB_Common (DB9053). Data block DB9053 is contained in this project.
Please begin a new project with one MCP example. Symbol Table IS_MCP matches only for this example.
This example manages on base Manual PPU, chapter 7.2, signals NC-->PLC and PLC -->NC.
Signals:
Feed start/stop (send to DB9053, interface is managed in SBR Axis_enable)
Feed control with combined ax and direction key and override feed/rapid traverse
Spindle start/stop (send to DB380x.DBB5006 and DB9053, interface is managed in SBR Axis_enable)
Spindle control with toggle keys
rapid traverse key
SBR input Spindle1_Axis: enter here the machine axis number of the first spindle
(to manage the spindle override).
9
SIEMENS AG
This SBR match to flow chart and description of the procedure in commissioning manual chapter 9.8 Application
example for milling machine…
The program steps in flow chart correspond to the labels in SBR Tool_Change_mill. The subroutine will set all
necessary acknowledgments.
Please insert on inputs Stepx_done the signals, which reports the mechanical movements.
The acknowledgments will set with a positive transition on SBR input. SBR output Stepx_prepared means: start
respective step.
In this example are the outputs Stepx_prepared direct wired to the inputs. This circuit makes a short run through the
sequence.
Signals:
Input Step2_done till Step14_done: wait for report step is done
Output Step: actual step number
Output Error_status: Feedback from DB4100.DBW104. see commissioning manual chapter 9.2.2
Output Ack_error: Signal from TMM to PLC acknowledgment error
Output Change_in_run: Tool change is running, on DB4300.DBX0.0 is a job pending
Output Step4_prepared till Step14_prepared: start respective step
SBR Tool_relocate manages the acknowledgement to tool management for load, unload, relocate and position
magazine.
In DB9902 (TM_ACK) is as second acknowledgment step needed:
Transfer step number of the new tool = 0
Transfer step number of the old tool = 0
Status at NCK = 3
Please see second transfer step in this example.
Signals:
Input Job: job on interface from first loading point
10
SIEMENS AG
SBR Mag_Dir calculates when a positioning of a new magazin place is required the pre-index
position and the direction for short way for a turret or chain magazin.
Signals:
Input Num_place: number of magazine locations
Input Required_Place: target position in positioning job from TMM, you can use here DB9058.DBW4 from SBR
Turret if this SBR is also used
Input current_Place: here is the actual location number as integer needed.
Input Calc_new: starts a new calculation
Output P_INDXo: location number one place before the target position is reached, can be used to start indexing
process
Output DIR: direction for the short way to target position, = 1: for CW; 0: for CCW
Output Calc_is_done: signal to start magazine movement, if SBR Turret is used: connect to Rev_can_Start Input
11
SIEMENS AG
SBR Turret controls by plc output controlled turret drive. In case the turret gets a request to turn from a tool
management job and the enabling signal to start movement (Rev_can_Start) is true the output signal Turn_cw or
Turn_ccw is true till target position is reached. The output signal In_Pos can be used to set the acknowledgement to
tool management. With input Dir_short_way may be the direction get selected. Dir_short_way = 1 turns CW,
Dir_short_way = 0 turns CCW. You can use to decide the direction the SBR MAG_DIR. The output DIR can
provide input Dir_short_way from SBR Turret. Output Calc_is_done from MAG_DIR can provide the
Rev_can_Start input from SBR Turret.
Input Jog_Rev_CW or Jog_Rev_CCW start manually revolver movement in case no request from TMM is pending.
Signals:
Input Rev_can_Start: magazine is ready to start positioning, direction was judged
Input Jog_Rev_CW and Jog_Rev_CCW are PLC Inputs for manually movement
Input Dir_short_way: = 1: for CW; = 0: for CCW, can get calculated from SBR MAG_DIR
Input Curr_Place: the SBR needs here the information about the actual location number as integer
Output TMM_new_pos_req: there is an new job from TMM with positioning request, signal to start in SBR
MAG_DIR a new calculation
Output Turn_cw: output to plc, turn magazine clockwise
Ouput Turn_ccw: output to PLC, turn magazine counterclockwise
Output In_Pos: End position out TMM job is reached, with this signal you can set acknowledgement to TMM
This example manages the interface between HMI and PLC to activate hand-wheel in WCS (DB3200.DBX100x.x)
or MCS (DB380x.DBB4).
SBR Handweel doesn’t support hand-wheel activation from HHU.
SBR248 Star_Delta
This subroutine needs data block Val_Star_Delta (DB9059).
Please copy this data block into your project.
The building block serves to case shift of the Contactor for Star"Y" - Delta motors and the DDS.
Signals:
Spindel_No: Here will the ax number for the spindle entered.
12
SIEMENS AG
This example manages the user interface between NC and PLC for initialization and starting the PLCASUP1_SPF
and PLCASUP2_SPF.
The interface and handshaking requirements are described in:
Function Manual Basic Functions Sinumerik 840Dsl/ 828D , chapter
14.6.2 Program instance services and
14.6.5 Starting ASUBs.
The example call from SBR ASUP occupied Alarm 243 till Alarm 246 (DB1600.DBX30.2 - DB1600.DBX30.5)
program flow:
The SBR ASUP contains for each PLC ASUP two input signals and five output signals.
ASUP1_initialize: starts the initialization via PI service. In the example call the initialization is started after the
first PLC cycle.
13
SIEMENS AG
ASUP1_Start: starts PLCASUP1_SPF, please note the necessary conditions for start
(see Function Manual chapter 14.6.5), example call encloses no interlock conditions!
ASUP1_Run_out: signal is 1 during PLCASUP1_SPF is running
ASUP1_Error_out: signal is 1 if ASUP cannot be executed or the ASUP is not initialized.
ASUP1_done_out: PLCASUP1 is finished without error, ASUP completed
This example manages the user interface between HMI and PLC for service planner.
The interface and handshaking requirements are described in:
Commissioning Manual Sinumerik 828D Turning and Milling, chapter 8.1 Service Planner.
SBR Service_Planner occupied Alarm 100 till Alarm 163 (DB1600.DBX12.3 - DB1600.DBX20.2)
14
SIEMENS AG
This example manages the communication between HMI and PLC for easy extend script. The SBR supports the
password tag.
The example matches to easy extend configuration as:
<AGM>
<!-- Option MD -->
<OPTION_MD name = "plc/db9061.dbw0" index="0" />
<OPTION_MD name = "plc/db9061.dbw2" index="1" />
<OPTION_MD name = "plc/db9061.dbw4" index="2" />
<OPTION_MD name = "plc/db9061.dbw6" index="3" />
....
....
<DEVICE>
<list_id>1</list_id>
.....
<!-- Password input required to protect Option -->
<password refvar="plc/db9062.dbd0" />
....
....
<DEVICE>
<list_id>2</list_id>
....
<!-- Password input required to protect Option -->
<password refvar="plc/db9062.dbd8" />
....
....
<SET_INACTIVE>
....
<!-- Delete saved Password -->
<DATA name = "plc/db9061.dbx8.0"> 1 </DATA>
....
....
15
SIEMENS AG
If you want to define a numerical password, change in first row the default password 123456.
The network compares on HMI supplied password with the value in first row and set in case of correct input
the option bit in DB9061.
The dialog between HMI and PLC for set active and set inactive is without any condition realised. PLC gives
the data handshaking requirements only back to HMI.
You can add there your own logic if necessary.
With DB9061.DBX8.0 and up you can delete the saved password if you set the associated bits from easy
extend script.
The PLC user program can read or write a maximum of eight variables from the NCK area
via the PLC/NCK interface "Read/write NC variable".
You find a description in: Function Manual Basic Functions / 14.6.1 Read/write NC variables
The PLC user program can read or write a maximum of eight variables from the NCK area via the PLC/NCK
interface "Read/write NC variable".
You find a description in: Function Manual Basic Functions / 14.6.1 Read/write NC variables
Signals:
16
SIEMENS AG
Description from PLC axis control in: Function Manual Base Functions, chapter 14.6.4 PLC axis control
Description from PLC axis control in: Function Manual Base Functions, chapter 14.6.4 PLC axis control
17
SIEMENS AG
247 Hand-wheel
246 Turret 9058
245 Mag_Dir 9057
244 Tool_relocate 9902 242
243 TMM_Mill 9056 241
9900
9901
9902
242 Jog_MCP_310_T_b 9053
241 Jog_MCP_310_T_f 9053
240 Jog_MCP_310_M 9053
239 MCP_310 9053
238 Jog_MCP_483_T_b 9053
237 Jog_MCP_483_T_f 9053
236 Jog_MCP_483_M 9053
235 MCP_483 9053
234 Prog_control 9051
233 Axis_Enable 9053 125
9052
232 SR_EMG_STOP 9052 126 239
238
237
231 Emergency_stop 9052 240
239
238
230 TMM_Cancel_Job 9902
229 Hand-wheel_HHU_Mill 9053 124 237
228 SWAP_DW
18