osai 10 CNC Application Manual

10 Series CNC
WinPLUS
Application Manual
Code: 45006862V Rev. 04
PUBLICATION ISSUED BY:
OSAI S.p.A. Via Torino, 14 - 10010 Barone Canavese (TO) – Italy
Tel. +39-0119899711
Web www.osai.it
e-mail sales@osai.it
service@osai.it
Copyright 2001-2005 by OSAI All rights reserved
Edition: October 2005
IMPORTANT USER INFORMATION
This document has been prepared in order to be used by OSAI. It describes the latest release of the product. OSAI reserves the right to modify and improve the product described by this document at any time and without prior notice. Actual application of this product is up to the user. In no event will OSAI be responsible or liable for indirect or consequential damages that may result from installation or use of the equipment described in this text.
abc

SUMMARY OF CHANGES

General
This issue completely replaces the previous ones.
PAGE UPDATE TYPE
UPDATE
10 Series CNC WinPLUS Application Manual
INDEX
Chapter 2
page 3 page 5 page 6 page 7 page 13
Chapter 4
page 2
Chapter 5
page 1 page 3 page 5 page 6 page 8 page 53 page 54 page 55
Chapter 8
page 1 page 2 page 9 page 11 page 12 page 13 page 15
Updated
Added a new paragraph “Routines activated by Fast Input Events” Changed picture (added Fast Input) Added “Attention” Changed picture (added Fast Input) Added description EventTaskFIN
Added description in the table
Changed picture Added description in the table Added “Attention” Changed picture Added “Attention” Added a new paragraph “MANAGEMENT of SHARED SPINDLE RACK (GTS)” Added a new paragraph “ Added a new paragraph “ MIGRATION OF AXES (GTA) MANAGEMENT RACK”
Changed description Changed table Changed table Added description in the table Changed table and description Added a new paragraph “Shutdown Warnings” Added a new paragraph “Mechatrolink Emergencies”
PROGRAM ACTIVATION (SPG) MANAGEMENT RACK”
Chapter 10
page 6
Chapter 12
page 7
APPENDIX B
10 Series CNC WINPLUS Application Manual (04)
Added new paragraphs “Coordinated Axes” Point-Point Axes” “Gantry Axis”
Added description in the table
Added a new appendix “ HILSCHER CANOPEN ERROR CODES”
abc

Preface

10 Series CNC WinPLUS Application Manual
PREFACE
The 10 Series numerical control introduces many new Technical concepts. One of the most important of these concepts is the concept of information exchange between the CNC and the integrated PLC (Programmable Logic Controller).
Conventional controls use a window with a large amount of fixed flags, which are continuously scanned and updated by both CNC and programmable logic control.
The concept of 10 Series by-passes this general conception with a simple but unique solution: both CNC and PLC use function calls to alert each other, to pass information or to request a certain action. These function calls need only be executed on event, thus freeing up CPU capacity and increasing the general system performance.
This manual explains the new concept and shows how applications can use its power.
ABOUT THIS MANUAL
This manual is intended to be used by the OEM personnel in charge of the programming of the machine tool interface. It gives an overview of the software architecture to be used to develop the programmable logic.
it does NOT explain the WinPLUS programming language and the use of any of its language elements.
10 Series CNC WinPLUS Application Manual (04) 1
Preface
10 Series CNC WinPLUS Application Manual
This manual is structured as follows:
Chapter 1 explains the concepts of communication between the logic and the system.
Chapter 2 gives a detailed view of the structure of the routines running on the PLC
module: it shows the timing and the execution priorities of the different routines on the I/O processor and it makes you familiar with the special execution mode of the background logic programs. Finally, it gives a list of declarations needed to define the different routines.
Chapter 3 deals with the data areas in the PLC module's memory and in its dual port.
Chapter 4 explains the configuration of the interface between part program and logic.
Chapter 5 explains the functions of the interface between the part program and the logic.
Chapter 6 explains the configuration and the use of filters of executive commands.
Chapter 7 explains the configuration of the emergency routines and of OEM softkeys.
Chapter 8 describes management of emergencies.
Chapter 9 describes OEM softkey management.
Chapter 10 this is the practical part of the manual which explains how to use the
communication concepts of the controls to create efficient applications.
Chapter 11 this chapter describes how to use the INTERBUS feature on 10 Series systems.
Chapter 12 this chapter describes how to use the CANOPEN feature on 10 Series systems.
Chapter 13 this chapter describes how to use the OSWIRE feature on 10 Series systems.
Chapter 14 Describes how to use the PROFIBUS function in Series 10 systems
Appendix A contains a glossary of verbs and expressions used in this manual.
Appendix B contains HILSCHER CANOPEN ERROR CODES
OTHER MANUALS ABOUT WINPLUS
Beside this manual there are 2 other specific manuals on WinPLUS:
10 Series CNC WinPLUS LIBRARY code : 45006867F
This manual covers the library function calls and the function blocks available in the WinPLUS
programming language:
System function calls
function calls
10 Series CNC WinPLUS development tool code 4500 6672 P
This manual describes the WinPLUS development tool, the editors and the utilities to generate
an executable logic program:
ladder diagram / function block diagram editor (FBD/LD)
sequential function chart editor (SFC)
2 10 Series CNC WinPLUS Application Manual (04)
Preface
10 Series CNC WinPLUS Application Manual
Other manuals may be of interest when programming a machine tool interface:
1. 10 Series CNC AMP - Software Characterisation Manual Code : 4500 6667 V
describes the system/process software configuration utility and its parameters
2. 10 Series CNC Programming Manual Code: 4500 4457 K
describes the 10 Series CNC part program language
3. 10 Series CNC User Manual Code: 4500 4452 H
describes the use of the human interface, the CNC manual functions and the utilities available
to the operator
4. 10 Series Family Installation Guide Code 4500 6657 R
contains all the information needed to realise a correct installation of the 10 Series CNC
system.
5. 10 Series CNC Software Installation Manual Code 4500 6687 N
contains all the information needed to install the software release.
WARNINGS
For correct control operation, it is important to follow the information given in this manual. Take particular care with topics bearing one of the signs: WARNING, CAUTION or IMPORTANT, which indicate the following types of information:
Draws attention to facts or circumstances that may cause damage to the control, to the machine or to operators.
WARNING
Indicates information to be followed in order to avoid damage to equipment in
CAUTION
general.
IMPORTANT
Indicates information that must be followed carefully in order to ensure full success of the application.
10 Series CNC PLUS Application Manual (04) 3
Preface
10 Series CNC WinPLUS Application Manual
END OF PREFACE
4 10 Series CNC WinPLUS Application Manual (04)
10 Series CNC WinPLUS – Application Manual

INDEX

SYSTEM - APPLICATION LOGIC HANDSHAKE
THE LOGIC INTERFACE BUFFER – THE M RACK ..................................................... 1-1
SYSTEM FUNCTION CALLS ......................................................................................... 1-2
COMMON DATA AREAS ............................................................................................... 1-2
Indice
ORGANIZATION OF THE MACHINE LOGIC PROGRAM
AVAILABLE ROUTINES................................................................................................. 2-1
Routines activated on time (foreground) ............................................................... 2-1
Continuously executed routines (background routines) ........................................ 2-1
Routine activated in an emergency ....................................................................... 2-2
Routine activated by pressing a softkey (OEM softkey routine)............................ 2-2
Routines activated by part program events (part program interface).................... 2-2
Routines activated from the console (request for enable signal) .......................... 2-2
Routines activated when requested by the logic ................................................... 2-2
Routines activated by Fast Input Events ............................................................... 2-3
ANALYSIS OF RACK M ................................................................................................. 2-3
TASK SYNCRONISATION ............................................................................................. 2-3
BACKGROUND EXECUTION ........................................................................................ 2-10
WINPLUS TASK DECLARATION .................................................................................. 2-13
I/O PROCESSOR /SYSTEM DATA AREAS
SYSTEM STATUS FLAGS.............................................................................................. 3-2
PROCESS STATUS FLAGS........................................................................................... 3-6
USER DEFINED / GLOBAL VARIABLES (G VARIABLES).......................................... 3-15
M VARIABLES ................................................................................................................ 3-16
A VARIABLES................................................................................................................. 3-18
TABLES........................................................................................................................... 3-19
Axes Table............................................................................................................. 3-19
Tool table ............................................................................................................... 3-23
Tool offset table ..................................................................................................... 3-25
User table .............................................................................................................. 3-29
WINPLUS VARIABLES SUMMARY TABLE.................................................................. 3-30
CONFIGURATION OF FUNCTIONS
10 Series CNC WinPLUS – Application Manual (04) i
Indice
10 Series CNC WinPLUS – Application Manual
Configuration.......................................................................................................... 4-1
LOGIC / SYSTEM COMMUNICATION
STRUCTURE OF THE PART PROGRAM RACK........................................................... 5-1
THE PART PROGRAM INTERFACE RACKS................................................................ 5-3
COORDINATED AXES.................................................................................................... 5-8
Consent to move Rack........................................................................................... 5-8
Motion blocks ......................................................................................................... 5-10
Consent to move management.............................................................................. 5-11
End of motion Rack................................................................................................ 5-12
End of motion management................................................................................... 5-13
M FUNCTIONS ................................................................................................................5-14
M function rack....................................................................................................... 5-15
M code management (EXPEDITE) ........................................................................5-17
AMP set up for M functions.................................................................................... 5-18
PSEUDO AXES ............................................................................................................... 5-26
Pseudo axes rack................................................................................................... 5-26
S FUNCTION ................................................................................................................... 5-29
Rack of S functions ................................................................................................ 5-29
T FUNCTION.................................................................................................................... 5-33
T function Rack ...................................................................................................... 5-35
END OF BLOCK RACK................................................................................................... 5-40
TOOL OFFSET PRESETTING RACK (RQP) .................................................................5-42
TOOL OFFSET REQUALIFICATION (RQT)................................................................... 5-45
DECLARE TOOL LIFE EXPIRED (TOU) ........................................................................ 5-48
PROBING CYCLE COMPLETED (QUTAST) ................................................................. 5-50
MANAGEMENT OF SHARED SPINDLE RACK (GTS).................................................. 5-53
MIGRATION OF AXES (GTA) MANAGEMENT RACK .................................................. 5-55
SYSTEM/ LOGIC COMMUNICATION
CONSOLE RACK FROM LOGIC ....................................................................................6-2
Configuration.......................................................................................................... 6-2
Control of commands sent by the console............................................................. 6-4
STRUCTURE OF THE RACK ......................................................................................... 6-6
Parameters associated with Manual Feed Override.............................................. 6-8
Parameters associated with Feed rate Override ...................................................6-8
Parameters associated with Speed Override ........................................................6-9
Parameters associated with Mode change............................................................ 6-9
Parameters associated with Rapid Override .........................................................6-10
Parameters associated with Axes Selection.......................................................... 6-10
Originating command environment........................................................................ 6-11
END OF COMMAND ACKNOWLEDGE FUNCTIONS ...................................................6-12
RACK CONFIGURATION OF EMERGENCIES AND OEM SOFTKEYS
ANSWER FUNCTIONS FOR COMMAND END.............................................................. 7-2
EMERGENCY MANAGEMENT
ii 10 Series CNC WinPLUS – Application Manual (04)
10 Series CNC WinPLUS – Application Manual
SYSTEM EMERGENCIES............................................................................................... 8-1
UNRECOVERABLE EMERGENCIES ............................................................................ 8-2
Digital Servo Interface (D.S.I.) EMERGENCIES ................................................... 8-4
EMERGENCIES FROM WINPLUS INTERPRETER ............................................ 8-5
OSWIRE EMERGENCIES .................................................................................... 8-6
RECOVERABLE EMERGENCIES.................................................................................. 8-9
D.S.I. Emergencies (Digital Servo Interface)......................................................... 8-11
SHUTDOWN WARNINGS (CLASS 2 DIAGNOSTIC)........................................... 8-13
OSWIRE EMERGENCIES .................................................................................... 8-15
MECHATROLINK EMERGENCIES ...................................................................... 8-15
OEM SOFTKEYS
ON/OFF Softkeys .................................................................................................. 9-3
MAINTAINED Softkey............................................................................................ 9-3
DATA ENTRY Softkeys ......................................................................................... 9-4
NORMAL Softkeys................................................................................................. 9-5
OPLink Function Keys ........................................................................................... 9-5
Indice
STANDARD APPLICATION NOTES
WINPLUS INITIALIZATION ............................................................................................ 10-1
MACHINE TOOL POWER UP AND RE-POWER UP AFTER E-STOP......................... 10-2
Coordinated axes................................................................................................... 10-6
Point-Point Axes .................................................................................................... 10-6
Gantry Axis ............................................................................................................ 10-6
HOLD MANAGEMENT.................................................................................................... 10-10
RESET MANAGEMENT.................................................................................................. 10-13
SPINDLE MANAGEMENT .............................................................................................. 10-15
CO-ORDINATED AXES MOVES (MAS) FROM WINPLUS ........................................... 10-17
HARDWARE OVERTRAVEL LIMIT SWITCHES ........................................................... 10-22
AXES HOMING ............................................................................................................... 10-25
FEED HOLD .................................................................................................................... 10-28
ACTIVE RESET............................................................................................................... 10-30
MANUAL JOG BY THE LOGIC ...................................................................................... 10-35
FEED RATE OVERRIDE CONTROL.............................................................................. 10-36
FEED RATE BYPASS..................................................................................................... 10-37
SERIAL LINE MANAGEMENT (RS-232)........................................................................ 10-39
AXIS POSITIONING VIA RS-232 SERIAL LINE ............................................................ 10-41
Configuration ......................................................................................................... 10-41
Programming ......................................................................................................... 10-42
Installation Specifications ...................................................................................... 10-45
INTERBUS® FEATURES ON 10 SERIES SYSTEMS
CONFIGURATION APPLICATION IBS CMD................................................................. 11-3
On-line Operations................................................................................................. 11-5
Off-line Operations................................................................................................. 11-13
TRANSFERRING THE CONFIGURATION FILE TO THE 10 SERIES CNC ................. 11-15
INTERBUS ERRORS ...................................................................................................... 11-16
CANOPEN® FUNCTIONS ON SERIES 10
10 Series CNC WinPLUS – Application Manual (04) iii
Indice
10 Series CNC WinPLUS – Application Manual
CANOPEN BUS CONFIGURATION ............................................................................... 12-2
CONFIGURATION EXAMPLE ........................................................................................ 12-4
DESCRIPTION OF ERROR CODES RETURNED DURING OPERATION
OF CANOPEN BUS......................................................................................................... 12-5
Errors from RIO EC modules .................................................................................12-5
Errors from CWIO modules.................................................................................... 12-7
ERRORS RETURNED DURING CNC POWER UP ........................................................ 12-7
SD180 CAN: Not all modules have been found on net .......................... 12-9
SD185 CAN: 24V failure on at least one I/O module ..................................................12-9
OSWIRE FUNCTIONS ON SERIES 10 SYSTEMS
OSWIRE BUS CONFIGURATION................................................................................... 13-2
CONFIGURATION EXAMPLE ........................................................................................ 13-4
DESCRIPTION OF ERROR CODES RETURNED DURING OPERATION
OF OSWIRE BUS ............................................................................................................ 13-5
Errors returned during CNC power up ...................................................................13-7
SLAVE PROFIBUS® FUNCTIONALITIES ON 10 SERIES SYSTEMS
SLAVE PROFIBUS CONFIGURATION .......................................................................... 14-2
DESCRIPTION OF ERROR CODES RETURNED DURING THE
FUNCTIONING OF THE SLAVE PROFIBUS. ................................................................14-4
ERRORS RETURNED DURING CNC START-UP .........................................................14-6
GLOSSARY
GLOSSARY .....................................................................................................................A-1
HILSCHER CANOPEN ERROR CODES
ERROR CODES............................................................................................................... B-1
END INDEX
iv 10 Series CNC WinPLUS – Application Manual (04)
SYSTEM - APPLICATION LOGIC HANDSHAKE
Logic Buffer Interface
Chapter 1
Fig. 1-1 System - Application Logic Handshake
THE LOGIC INTERFACE BUFFER – THE M RACK
The system communicates with the logic through a logic interface. This interface is a data buffer in which the system writes the data to send to the machine logic program.
The data buffer is divided according to its functions in different parts called RACKS.
They are always active.
M Rack
10 Series CNC WinPLUS Application Manual (00) 1-1
Chapter 1
System - Application Logic Handshake

SYSTEM FUNCTION CALLS

The logic from its part communicates with the system through a set of function calls which can include a parameter exchange between the two parties. There are two types of function calls:
NO WAIT functions pass a command (with parameters) to the system without waiting for an answer (the application program execution is not suspended).
WAIT functions pass a command to the system and wait for a response ( the logic execution is suspended until the response arrives)

COMMON DATA AREAS

The third communication channel between the logic and the system are the common data areas in the battery buffered dual ported memory of the I/O processor board. These areas can be divided in:
System area. This is a group of 500 variables of the type short (16 bit integer word) containing the status of the system and/or the processes.
Global variables. These variables are referred to as "G" variables. They have two formats; short and double (precision floating point). They can be read and written by both part program and logic program. The G variables are retentive, i.e. they are not cleared after powering up the system.
Tables. Tables are retentive memory areas in the dual port of the I/O processor module. They can be commonly accessed by the system and by the logic programs. The data contained in tables includes:
tool data
tool offset data
axes origin data
axes offsets
END OF CHAPTER
1-2 10 Series CNC WinPLUS Application Manual (00)
Chapter 2
ORGANIZATION OF THE MACHINE LOGIC PROGRAM
The logic program is organised in independent routines. All these routines run on the I/O processor module and have different priorities depending on their use.
The various routines are activated by the operating system of the PLC following specific events, or at given times, or may also be run continuously (in loops).
AVAILABLE ROUTINES
Routines activated on time (foreground)
This routine (only one can be present) will be executed on each clock tick of the I/O processor module. This clock tick is currently set at 10 ms. If the foreground routine execution time exceeds the available time (max. 10 ms), the system will generate an "overrun error" and go into emergency status. The routine must have the shortest execution time possible (<5 ms) because the remaining TICK time is used by routines with a lower priority. The primary use of the foreground routine is to "latch" events to be executed with fast, precise timing such as read/write physical I/O device status or handling of security/emergency devices. Requested name for the routine :fore.
Continuously executed routines (background routines)
A background routine executes continuously in a loop like a program in a standard PLC. The I/O processor can run up to 12 background routines in parallel.
Each background routine can execute functions of the WAIT type, which will suspend the execution of that background routine until arrival of the response. In the meantime the other background routines will continue executing. In reality, when one routine is suspended, control passes to the next one.
The logic programmer has to optimise the performance of the I/O processor by distributing the logic in the available background routines. Requested name for the routine : back1 …back12.
10 Series CNC WinPLUS Application Manual (04) 2-1
Chapter 2
Organisation of the Machine Logic Program
Routine activated in an emergency
This routine can be recalled whenever an emergency condition occurs. It can be activated only if it has been loaded. In an emergency, the logic application may have to execute logic sequences in parallel with the actions performed by the system. Mandatory name for the routine:
EventTaskEmg.
Routine activated by pressing a softkey (OEM softkey routine)
This routine is called whenever an OEM softkey is pressed (or released).It can be activated only if it has been loaded.
The OEM softkeys are defined in AMP, enabling the OEM to provide its application with the same appearance and operability as are typical of the standard system (AMP configuration manual). The management routine of an OEM softkey works at a very low priority level. Mandatory name for this routine: EventTaskHum.
Routines activated by part program events (part program interface)
Specific routines (one for each process configured) are called whenever a part program block contains functions relating to the logic (e.g., M codes, S and T functions, and all the other functions that can be grouped under the heading of ancillary logic functions). These routines can be activated only if they have been loaded. Mandatory name for these routines: EventTaskPPX, where X stands for the name of the associated process.
Routines activated from the console (request for enable signal)
Specific routines (one for each process configured) are called whenever a command is imparted to the system (e.g., cycle start, reset, etc.), enabling the logic to read and/or suspend the commands imparted to the system by the operator. These routines can be activated only if they have been loaded.
These routines are provided for most of the commands that can be entered via softkeys and/or from the MTB panel. Mandatory name for these routines: EventTaskConX, where X stands for the name of the associated process.
Routines activated when requested by the logic
Specific routines (from 1 to 39) will be called whenever the logic notifies an event through the SetEventTask function. Once activated, these tasks will be completed through the end.
Mandatory name for these routines: EventTaskLogX, where X stands for the task number.
2-2 10 Series CNC WinPLUS - Application Manual (04)
Chapter 2
Organisation of the Machine Logic Program
Routines activated by Fast Input Events
A routine that is available following activation of a fast input.
This routine will be activated only if it has been loaded. The application logic understands what Fast Input has been executed. To understand which input has been executed refer to the following table.
MW9990
Bit Event
0 Fast Input#1
1 Fast Input#2
2 Fast Input#3
3 Fast Input#4
4-15 Reserved
If two Fast Input events occur at the same time, the routine will be called twice.
Mandatory name for the routine: EventTaskFIN.

ANALYSIS OF RACK M

The data supplied from CNC to the logic is written in RACK M every time that the data is memorised in the interface buffer interrupting the execution of the Background routine for the necessary time that it takes to be written.

TASK SYNCRONISATION

The background routines can be synchronised with a set of semaphores (32) with the WAIT and SEND instructions. With the WAIT instruction and a semaphore number (from 0 to 31) it is possible to suspend the execution of a routine (task) until one of the other routines executes the SEND instruction with the same semaphore number . In this way it is possible to synchronise the execution of a task with another event in another task.
10 Series CNC WinPLUS - Application Manual (04) 2-3
Chapter 2
Organisation of the Machine Logic Program
Fig. 2-1 Task synchronisation
The instruction WAIT (3) suspends the execution of the BackProgram1 task until the command SEND (3) in the BackProgram2 task executes. Naturally the exact point (in time) of task resume depends on its priority.
2-4 10 Series CNC WinPLUS - Application Manual (04)
Chapter 2
Organisation of the Machine Logic Program
SYSTEM CPU
PART PROG. PACK INTERFACE
INTERFACCIA DELLA LOGICA
ROUTINE BACKGROUND # 1
SYSTEM
PACK EMERGENCY
PACK OEM SOFTKEY
EVENT TASK OF EMERGENCY
ROUTINE FOREGROUND
EVENT TASK PART PROG.
INFORM ATION SEND TO LOGIC
PACK OF REQUEST CONSENS
EVENT OF EMERGENCY
INTERRUPT TEMPORIZ. 10 MS
EVENT P. P.
ROUTINE BACKGROUND # 2
ROUTINE BACKGROUND # 3
EVENT TASK CONSOLE
EVENT TASK SOFTKEY OEM
EVENT TASK LOGIC
EVENT TASK FAST INPUT
Fig. 2-2 Routine scheduling
EVENT CONSOLE
EVENT SOFTKEY OEM
EVENT LOGIC
FAST INPUT
10 Series CNC WinPLUS - Application Manual (04) 2-5
Chapter 2
Organisation of the Machine Logic Program
NOTE:
If a SEND on a semaphore is issued without a task waiting for this semaphore. The SEND instruction will be ignored. Any routine in WAIT status can only be released by the equivalent SEND instruction. The routine containing the SEND instruction must be synchronised with the routine containing the WAIT status request.
IMPORTANT
You are not allowed to use the WAIT/DLY instructions in foreground, fast input and emergency routines
The use of the SEND and WAIT functions for synchronisation can produce some inhibits to the system if used during the management of the Part Program functions:
RQP RQT TOU GTA GTS
The problem can happen if the task that performs the SEND to the routines managing the functions in the list above also performs process applications (for example NC functions for position or status acquisition).
If they are wanted to use criterions of synchronism founded on WAIT and SEND it it is necessary to make sure that the task that sends the SEND doesn't perform any application toward the NC process. It is suggested that an ad hoc task is created that verifies the conditions of acceptance of the applications (e.g. possibility to use the in demand axes through GTA) and you effect the SEND to unhook the task applicant.
2-6 10 Series CNC WinPLUS - Application Manual (04)
High Priority
Emergency EventTask
Event Task Console # 1
I/O update
Event Task FAST INPUT
Foreground routine
Event Task Console
Chapter 2
Organisation of the Machine Logic Program
# 2
Event Task Console # 3
Event Task Console
Event Task Console # 7
Event Task Console # 9
Event Task Part Program # 1
Event Task Part Program # 3
Event Task Part Program
Event Task Part Program # 7
Event Task Part Program
Routine background # 1 Routine background # 2
# 5
# 5
# 9
OEM softkey eventTask
Event Task Console # 4
Event Task Console # 6
Event Task Console # 8
Event Task Console
Event Task Part Program # 2
Event Task Part Program
Event Task Part Program
Event Task Part Program # 8
Event Task Part Program
# 10
# 4
# 6
# 10
Low Priority
Routine background # 3 Routine background # 4
Logic event Task
Task n°39
Task n°1
10 Series CNC WinPLUS - Application Manual (04) 2-7
Chapter 2
Organisation of the Machine Logic Program
t
10 ms
I/O update
1 ms
10 ms
1 ms
= 1 ms.
Foreground routine
Background routine
Fig. 2-3 Steady Operation
Every 10 ms the system updates the I/O, executes all the foreground routine and executes a background in 1 ms. Every 10 ms one of the background routines will be executed in sequence. If a background routine lasts for less than 1 ms, it will be executed again from the start, until the time runs out. No routine will be interrupted.
Part Program interface
1 ms
10 ms
I/O update
routine foreground
High priority routine
Fig. 2-4 High Priority Interrupt Operation
1 ms
10 ms
routine background
t
= 1
2-8 10 Series CNC WinPLUS - Application Manual (04)
Chapter 2
Organisation of the Machine Logic Program
When emergencies occur, the continuous operation of the I/O processor will be interrupted and the high priority routines required will be executed immediately. Note that the continuous execution may be interrupted anywhere during the execution of the I/O ring update, of the foreground logic or of the background logic.
Consense request
Part Programm interface
10 ms
1 ms
request
Consense request
10 ms
1 ms
t
I/O update
1 ms
=
Foreground routine
.
Lower routine priority
Background routine
Fig. 2-5 Low Priority Interrupt Operation
When low priority events occur, like consent request calls, part program Interface calls or even OEM softkey calls, the foreground routine and all other higher priority tasks will not be interrupted. These low priority routines will only run during the time available for background logic execution.
10 Series CNC WinPLUS - Application Manual (04) 2-9
Chapter 2
Organisation of the Machine Logic Program

BACKGROUND EXECUTION

There can be up to 12 background routines. The background routines are those with the lowest priorities among the routines making up the application logic and are executed in turn every 10 ms (WinPlus Tick) for 1 ms. At each WinPlus Tick the integrated PLC updates the I/O's and the foreground routines. Consent routines, part program interfaces and OEM softkeys are enabled at system request and interrupt background execution.
After enabling all high priority routines at each WinPlus Tick, the system enables one of the background routines and lets it run for 1 ms. At each WinPlus Tick the system enables a different background routine. The sequence of activation is determined by the number associated with the routine name. At the first WinPlus Tick the background routine 1 (BACK1) is enabled, at the second the background routine 2 (BACK2) and so on. Once the last background routine has been enabled, the system starts again with the first.
Therefore, an individual background routine is executed over several WinPlus Ticks, alternating part of its code with that of other background routines in time slicing. If a background routine suspends its execution voluntarily by calling a function such as WAIT or DELAY or indirectly by calling system functions of the WAIT type, the remaining time up to the end of the millisecond is available for other system operations (processing a part program, displaying, etc).
If a background routine is shorter than 1 ms, it will execute several times during the WinPlus Tick. If the background task to be enabled is suspended at a new WinPlus Tick, no other background routine is executed and the millisecond reserved for it is used by the system.
Fig. 2-6 Background logic execution
Fig. 2.6 shows 3 background loops with total execution times of 3, of 0.5 and 2 ms respectively.
2-10 10 Series CNC WinPLUS - Application Manual (04)
Chapter 2
Organisation of the Machine Logic Program
1.1
2.1 2.1
0.5 | 0.5 ms
3.1
1.2
2.1 2.1
0.5 | 0.5 ms
3.2
1.3
1° TICK
2° TICK
3° TICK
4° TICK
5° TICK
6° TICK
7° TICK
2.1 2.1
0.5 | 0.5 ms
3.1
1 ms
8° TICK
9° TICK
012345678910 ms
Task Foreground
Task Background
Fig. 2-7 Background logic execution
Supposing after foreground execution + I/O ring management the remaining time for each sampling is constant at 5 mSec, the above routine are executed in the following sequence:
10 Series CNC WinPLUS - Application Manual (04) 2-11
Chapter 2
Organisation of the Machine Logic Program
As can be seen, at each cycle a different background routine is started, which means that a short background routine is executed more often than a long one.
Referring to the example, the repeat frequency of the 3 loops will be:
$BACK 1 90 ms $BACK 2 30 ms $BACK 3 60 ms
The formula for calculating the frequency of a background routine is:
duration of the background routine x number of background routines x 10
IMPORTANT
In this example it is assumed, that there are no interrupts (fast inputs, OEM softkey, requests form a part program or from the operator)
2-12 10 Series CNC WinPLUS - Application Manual (04)
Chapter 2
Organisation of the Machine Logic Program

WINPLUS TASK DECLARATION

To make sure that the various tasks are called correctly, the following names must be assigned:
Fore: Foreground task;
Back1 … Back12: Background task;
EventTaskCon1…EventTaskCon20: Tasks activated by enable signal requested events;
Numbers 1…20 denote the process associated with the task;
EventTaskPP1…EventTaskPP20: Tasks activated by Part Program interface events; Numbers 1…20 denote the process associated with the task;
EventTaskEmg: Tasks activated by emergency events;
EventTaskHum: Tasks activated by pressing an OEM softkey;
EventTaskLog1…EventTaskLog39: Tasks activated by logic events. The numbers denote the
task number and serve as input parameters for the SetEventTask function for triggering the associated task.
EventTaskFIN: Task activated by a fast input.
NOTE: The max. number of tasks that can be loaded simultaneously is 40.
10 Series CNC WinPLUS - Application Manual (04) 2-13
Chapter 2
Organisation of the Machine Logic Program
END OF CHAPTER
2-14 10 Series CNC WinPLUS - Application Manual (04)
Chapter 3
A
A
I/O PROCESSOR /SYSTEM DATA AREAS
The I/O processor and the system share a data area in the dual port memory of the I/O processor module. This data area contains an I/O image, global retentive variables (G), system status variables and 4 retentive tables with machine tool related data. Fig. 3-1 gives a detailed overview of all data areas on the I/O processor, which are available to the application logic.
Non retentive variables
Non retentive variables
Status of the system
(s variables)
Status of the proces
(s variables)
Global
M variables
Global
(M variables)
USER area
Physical inputs
(I variable)
SYSTEM
PPLICATION
LOGIC
Defined by the user
(G variables)
XES Table
TOOL Table
OFFSET Table
USER Table
global
(variables G)
retentive variables
retentive variables
Physical outputs
(0 variable)
Fig. 3-1 Memory areas available to WinPLUS
10 Series CNC WinPLUS Application Manual (03) 3-1
Chapter 3
I/O Processor /System Data Areas

SYSTEM STATUS FLAGS

There are 500 system variables. They all have the short format. The first 20 variables (SW 00­SW 19) are used to exchange some general system information between the logic program and the system. Since the purpose of these variables is predefined, they have predefined symbolic names. Most of the variables are read only by the logic (R/O). Only SW 03, SW4 , SW7 and SW12 can be written and read by the logic (R/W). SW Variables can be managed as words (I) or as single bits (B) or both (B/I).:
WORD MNEMONIC TITLE ACCESS PROT
SW 00 S_CTRL Activation status B R/W
SW 01 S_SECURLEV Active security level I R/O
SW 02 S_CNINFO NC state information B R/O
SW 03 S_HLS1 Home Limit Switches 1 B/I R/W
SW 04 S_HLS2 Home Limit Switches 2 B/I R/W
SW 05 S_WINNBI Activation WinNBI screens I R/W
SW 06 E_STOP E_STOP status B R/O
SW 07 S_DELAY_BOOT WINPLUS logic activation delay I R/W
SW 08 reserved for future use
SW 09 S_PROCSEL Selected process I R/O
SW 10 S_SCRNSEL selected screen I R/O
SW 11 S_UNITS configured units B R/O
SW 12 reserved for future use
SW 13 reserved for future use
SW 14 reserved for future use
SW 15 reserved for future use
SW 16 S_NOWAIT NO WAIT call counter I R/O
SW 17 S_CNCTYPE Control type B/I R/O
SW 18 reserved for future use
SW 19 reserved for future use
Hereafter, all variables and their functions will be discussed in more detail.
R/W SYSTEM VARIABLE SW0 S_CTRL
BIT
S00_00
S00_14
S 00_15
R/W SYSTEM VARIABLE SW1 S_SECURLEV
WORD
Title: ACTIVATION STATUS
S_DONE Signal on 1 when all SW loading operations have been completed
satisfactorily.
S_RESET MW and MD variables reset request after logic Warm Start
S_REBOOT Signal on 1 when a logic Warm Start has been performed, the
application can reset this bit once the required operations have been carried out.
Title: Home Limit switches
3-2 10 Series CNC WinPLUS Application Manual (03)
Loading...
+ 220 hidden pages