10 series cnc winplus library

414
PUBLICATION ISSUED BY: OSAI S.p.A. Via Torino, 14 - 10010 Barone Canavese (TO) – Italy Phone: +39-0119899711 Web: www.osai.it e-mail: [email protected] [email protected] 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. 10 Series CNC WinPLUS LIBRARY User Manual Code: 45006867F Rev. 04

Upload: others

Post on 23-Dec-2021

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 10 Series CNC WinPLUS LIBRARY

PUBLICATION ISSUED BY:

OSAI S.p.A.Via Torino, 14 - 10010 Barone Canavese (TO) – Italy

Phone: +39-0119899711

Web: www.osai.it

e-mail: [email protected]@osai.it

Copyright 2001-2005 by OSAIAll 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 ofthe product.OSAI reserves the right to modify and improve the product described by this document at any timeand without prior notice.Actual application of this product is up to the user. In no event will OSAI be responsible or liable forindirect or consequential damages that may result from installation or use of the equipmentdescribed in this text.

10 Series CNC WinPLUS LIBRARY User Manual

Code: 45006867FRev. 04

Page 2: 10 Series CNC WinPLUS LIBRARY

ABCABC

Page 3: 10 Series CNC WinPLUS LIBRARY

Update10 Series CNC WINPLUS Library- User Manual

10 Series CNC WINPLUS Library- User Manual (04)

UPDATES TO THE PRESENT EDITION

General

This issue completely replaces the previous ones.

PAGES UPDATES

PrefacePage 2

UpdatedChanged description

INDEX Updated

CHAP. 2Page 20Page 21Page 22

Changed LIMITSW functionChanged description of A_TO_ID functionChanged description of ID_TO_A function

CHAP. 3Page 15Page 47

Changed description of ANAIN functionChanged description of ENCODER function

CHAP. 4Page 30Page 31

Changed description of PARK_SP functionChanged description of GET_SP function

CHAP. 6Page 15Page 16Page 17Page 18

Changed GETUSED functionAdded new function PUTUSEDAdded new function GETUSECAdded new function PUTUSEC

CHAP. 8Page 14Page 39Page 45Page 46Page 60Page 62Page 63Page 76Page 88Page 90Page 91Page 92

Changed description of AX_SETZ functionChanged description and NOTE of AX_GET8 functionAdded NOTEAdded NOTEChanged description and NOTES of TC_CONF functionChanged description of TC_READ1 functionChanged description and NOTES of TC_WRIT functionChanged AXD_CMD functionAdded new function AX_MECSAdded new function AX_MECRAdded new function AX_MECWAdded new function AX_RTFBCK

CHAP. 10 Added new charter “CANOPEN-HILSCHER MANAGEMENT FUNCTIONS”

APPENDIX H Added new appendix “TABLE OF MAIN RESOURCES OF AXIS BOARDS”

Page 4: 10 Series CNC WinPLUS LIBRARY
Page 5: 10 Series CNC WinPLUS LIBRARY

Preface10 Series CNC WinPLUS Library - User Manual

10 Series CNC WinPLUS Library - User Manual (04) 1

PREFACE

This manual contains the description of all block functions (FB) needed for the logic applicationprojects of the 10 Series CNC.

It contains the corresponding Structured Text (ST) code for each FB and a description of the inputand output variables.

This manual deals specifically with functions and function blocks. For further information onWinPLUS, its language and its applications in the 10 Series CNC environment consult the followingmanuals:

10 Series CNC WinPLUS APPLICATION MANUAL Code 45006926D

10 Series CNC WinPLUS development tool Code 45006877B

You can find an FB or a function more easily if you look up the Function Reference List below inthis preface.

In this list the functions are ordered alphabetically and for each of them there is a short descriptionplus the page number.

In this manual the various function blocks have been subdivided into groups depending on the typeof operation they fulfil or the environment to which they belong. So if you do not know the exactname of an FB, but know the environment to which it refers, you can easily find the FB in themanual by consulting the index.

COMMON FEATURES OF FUNCTION BLOCKS:

All function blocks can be used in the Ladder Diagram / Function Block Diagram (LD/FBD) editorsand the Structured Text (ST). All the other function blocks are extensions which internally use afunction call. These functions can also be used in the ST editor. For each FB there is an examplefor the calls and the necessary parameters in ST.

stat_wrd output (function status output word)

The function status output is available on all system function blocks. After the relevant function hasbeen completed, this word contain a value indicating that all went well or that there was some kindof problem. When everything was ok, the status word will be zero. In case of problems the value ofthe status word is different from zero. Please refer to the specific function block for the meaning ofthe values returned in the status word.

Page 6: 10 Series CNC WinPLUS LIBRARY

Preface10 Series CNC WinPLUS Library - User Manual

2 10 Series CNC WinPLUS Library - User Manual (04)

Often you're not interested in knowing the status of the functions because your program has beentested and always works well. You can then hook up only one single short variable, e.g. MW 999,to the status output of many functions.

ax_id input (physical axis identifier)

The axis identifier is used for many system functions. It is a number identifying the internalresources for one axis on an axes module. For non OS-Wire systems , each axes module supports8 axes, 6 resources are reserved for physical axes (which read encoders and/or write to D/Aconverters) and 2 for virtual axes. A machine axis (e.g. "X") may be related to any of the availablephysical axis resources on any of the axes modules.

There can be up to 4 axes modules in the 10 Series CNC chassis, allowing for up to 32 axes(theoretically). The axis identifier now, is a number in the range of 1 through 32. It must beassigned during the axes configuration in AMP and will also serve to define the page number of theaxes table on which this axis will be managed.

OS-Wire systems are not subjected to any hardware limitation and therefore the number ofphysical axes may range from 1 to 32, and the same applies to the total number of transducers andconverters.

Even when you move the physical connections (encoder, D/A) of an axis to another axes module,its ax_id will remain unchanged and the axis data will remain available on the same page of theaxes table.

The function A_TO_ID converts an ASCII axis address to its physical axis identifier number.

tc_id input (transducer/converter physical identifier)

For non OS-Wire systems , the identifiers of the tansducer inputs are numbers in the range of100Hex up to 1nnHex. On the first servo module you will find (top to bottom) the transducers100Hex through 105Hex, on the second 106Hex through 10BHex, on the third module 10CHexthrough 111, and so on. The D/A converters have a similar numbering system. On the first moduleyou will find the converters 200Hex through 205Hex, on the second module 206Hex through20BHex, and so on.

In OS-Wire systems, the identifiers mapped on the bus use code 1nntHex, where ‘nn’ is theaddress (from 0 to 3DHex) of the device and ‘t’ is the transducer number from 1 to 3. On the OS3drive you can fit (as an option) only one incremental transducer, on the Bridge you can have up to3 transducers. D/A converters use a similar system of codes (this applies only to Bridge devices):2nncHex, where ‘nn’ is the address of the device (from 0 to 3DHex) and ‘c’ is the converter numberfrom 1 to 3.In OS-Wire systems fitted with local transducers and converters (i.e., not mapped on a digital busbut present on the board connector), the identifier codes are the same as are used in non OS-Wiresystems.

Page 7: 10 Series CNC WinPLUS LIBRARY

Preface10 Series CNCWinPLUS Library - User Manual

10 Series CNC WinPLUS Library - User Manual (04) 3

TYPES OF SYSTEM FUNCTION CALLS

There can be 3 different types of system function calls (system function blocks):

WAITA WAIT function call suspends the execution of the task that called it. This task will resume itsactivity after the function has been completely executed.

The suspension of a task implies the suspension of all routines that make up this task. The WAITfunction is normally executed by an environment other than the I/O processor module (the system).

For this reason a WAIT function is a synchronous call: when the logic scan exits from a WAITfunction block, this block has been completely executed.

NOWAITA NOWAIT function call does not suspend the execution of the logic task that called it. Immediatelyafter the call has been issued, the logic task resumes execution. The function call will be executedby an environment other than the I/O processor module (system).

For this reason a NOWAIT function is an asynchronous call: when the logic scan exits from aNOWAIT function block, the function is still being executed by another environment.

The execution of many NOWAIT function calls from a logic task may cause a system overloadingsince the simultaneous execution of many functions is required.

When 15 NOWAIT functions are in parallel execution, the function that has generated the last callis in any case executed and it returns to the word status a warning code (1000 hexadecimal).

If you continue to call NOWAIT functions after the warning message, that is when 25 functions arein parallel execution, an unrecoverable emergency is generated ("too many requests").

INTERNALAn INTERNAL function is similar to a WAIT function call but its execution is much faster becauseit's done by the same environment that calls the function (WinPLUS). An INTERNAL function call isin all aspects like a subroutine available to the WinPLUS environment. For this reason anINTERNAL function is a synchronous call: when the logic scan exits from an INTERNAL functionblock, this block has been completely executed.

Page 8: 10 Series CNC WinPLUS LIBRARY

Preface10 Series CNC WinPLUS Library - User Manual

4 10 Series CNC WinPLUS Library - User Manual (04)

LIST OF THE BASE ELEMENTS OF THE LANGUAGE

AABORT: Abort a point-to-point-interpolator................................................................ 4-5ACK_STRB: Send acknowlegde signal ............................................................................3-37ACLOSE: Close channel for point-to-point-interpolator ............................................... 4-6ACTOFFS: Request activation of a tool offset................................................................ 5-5ACTRES: Active reset request ..................................................................................... 9-2ANAIN: Read analog input........................................................................................ 3-15AOPEN: Open channel for point-to-point-interpolator................................................ 4-7ARESET: Request to reset a point-to-point-interpolator .............................................. 4-8AUX_STAT: Read point-to-point axis or spindle status ................................................... 4-20AX_CHAS: Change the servo mode of an axis.............................................................. 8-4AX_DISA: Disable servo loop of an axis or disable its D/A converter. ......................... 2-3AX_ENAB: Enable servo loop of an axis or enable its D/A converter............................ 2-2AX_FWR: Read OS3 axes drive parameter ……………………………………………….8-86AX_FWW: Write OS3 axes drive parameter………………………………………………..8_85AX_GET1: Get axis (spindle) servo parameters............................................................ 8-15AX_GET2: Get axis (spindle) servo parameters............................................................ 8-17AX_GET2B: Get axis (spindle) servo parameters……………………………………………8-20AX_GET3: Get axis (spindle) servo parameters............................................................ 8-23AX_GET4: Get axis (spindle) servo parameters............................................................ 8-25AX_GET5: Get axis (spindle) servo parameters............................................................ 8-27AX_GET6: Get axis (spindle) servo parameters............................................................ 8-29AX_GET7: Get axis (spindle) servo parameters............................................................ 8-34AX_GET8: Get axis (spindle) servo parameters............................................................ 8-39AX_GETS: Get axis status ............................................................................................. 8-58AX_MECR: Read the parameters of a Mechatrolink drive ............................................. 8-90AX_MECS: Read the status of a Mechatrolink drive ...................................................... 8-88AX_MECW: Write the parameters of a Mechatrolink drive.............................................. 8-91AX_PROB: Enable probing signal for one or more axis ................................................. 8-5AX_PUT1: Set axis servo parameter............................................................................. 8-41AX_PUT2: Set axis servo parameter............................................................................. 8-48AX_PUT2B: Set axis servo parameter………………………………………………………..8-50AX_PUT3: Set axis servo parameter............................................................................. 8-52AX_PUT4: Set axis servo parameter............................................................................. 8-54AX_RESE: Abort the actual operation of the addressed axis ........................................ 8-8AX_RPAR: Read AMP parameter from axis…………………………………………………8-84AX_RTFBCK: Read OS-WIRE variables in real time ......................................................... 8-92AX_RPOS: Resets the axis' position .............................................................................. 8-13AX_SELE: Activate axis monitor functions / gear range................................................ 8-11AX_SETZ: Allows the activation of different functions for the specified axis................. 8-14AX_ZSH1: Write zero shift offset #1 .............................................................................. 8-9AX_ZSH2: Write zero shift offset #2 .............................................................................. 8-10AXD_CMD: Send a command to a digital drive .............................................................. 8-76AX_WPAR: Write AMP axis parameter ……………………………………………………. 8-78AXD_PUT: Set the enable/disable bits for a digital drive ............................................... 8-75AXD_RDD: Read a numerical parameter from a digital drive ........................................ 8-70AXD_RDS: Read a string parameter from a digital drive ............................................... 8-73AXD_WRD: Write a numerical parameter to a digital drive ............................................. 8-72AXD_WRS: Write a string parameter to a digital drive.................................................... 8-74AXMANFED: Set feedrate override of axes in manual movement.................................... 1-44AXSELEC: Select one or more axes for manual movement.......................................... 1-18AXSELFED: Selects axes allowing to change feedrate override ..................................... 1-42AXTAN_D: Disables tangent axis algorithm...................................................................2-14AXTAN_E: Enable tangent axis algorithm .....................................................................2-12

Page 9: 10 Series CNC WinPLUS LIBRARY

Preface10 Series CNCWinPLUS Library - User Manual

10 Series CNC WinPLUS Library - User Manual (04) 5

CAN_BOARD_CMD:Send commands to Hilscher master board................................................. 10-15CAN_INIT: CANopen parameters initialisation.............................................................. 10-2COMPOFF: Compute new axes offset............................................................................ 5-7CON_LED: Manage leds on the OPLink operator panel ............................................... 7-10CONN_AX: Connect an axis to the interpolator of the logic ........................................... 4-26CONN_SP: Connect a spindle to an interpolator ........................................................... 4-32CYCLE: Request cycle for a selected process ......................................................... 1-4CYSTART: Request cycle start for a selected process ................................................. 1-3CYSTOP: Request cycle stop for the selected process .............................................. 1-5DE_ETH: Enable/disable communication via Ethernet ............................................... 9-10DECODE: Decodify a word with some data ................................................................. 3-46DELAY: Delay function.............................................................................................. 3-39ENCODER: Decodify a bit on a word.............................................................................. 3-47ENDRESE: Notify end of reset from WinPLUS .............................................................. 1-21FAST_RD: Fast data reading from DP .......................................................................... 9-8FAST_WR: Fast data writing on DP ............................................................................... 9-6FAX_GET: Read in real time a number of axis parameters .......................................... 8-68FAX_PUT: Real time updating of an axis' zero shift value............................................ 8-67FAX_RCON: Configures the driver for real time data communication ............................. 8-66FAX_WCON: Configures driver for real time data communication ................................... 8-65FEED_GO: Request the interpolator to exit the feedhold status.................................... 1-7FEEDBYOF: Restore programmed feedrate after feedrate bypass ................................. 1-35FEEDBYON: Activate feedrate bypass ............................................................................. 1-33FEEDHLD: Request the interpolator to enter the feedhold status ................................. 1-6FEEDHEM: Tells the interpolator to change to feedhold mode at end of movement……1-8FOUT: Force a fast output ...................................................................................... 3-17FRORIDE: Set feedrate override................................................................................... 1-13GBPROVAR: Get Boolean process variable ..................................................................... 6-3GET_AX: Plus gets a parked axis ............................................................................... 4-24GET_EMCY_INFORead node information and diagnostic data ............................................... 10-8GET_INTP: Reads in real time a number of interpolator data........................................ 1-38GET_POSD: Read position and feed rate of an axis controlled via serial line RS-232.... 4-23GET_SP: Process gets a spindle already parked ....................................................... 4-31GETAXINT: Get real axis position................................................................................... 8-3GETEPAR: Get part program E-parameter.................................................................... 6-5GETHFL: Get part program H parameter flag (HF)..................................................... 6-9GETHPAR: Get part program H-parameter.................................................................... 6-7GETPNTR: Request information about part program execution.................................... 1-24GETPPNAM: Get information from selected part program ............................................... 1-22GETSC: Get ASCII global part program variable ...................................................... 6-11GETSN: Get lreal global part program variable......................................................... 6-13GETDATE: Read system data…………………………………………………………………3-65GETTIME: Read system time…………………………………………………………………3-67GETUSEC: Read the user variables of a char type process.......................................... 6-17GETUSED: Read the user variables of a double type process...................................... 6-15GJOG: Get Jog increment.............................................................................................. 1-16HISPROC: Select a process to control .......................................................................... 7-2HOLDOFF: Exit from hold............................................................................................... 1-10HOLDON: Enter in hold ................................................................................................ 1-9HPG_OFF: Disables hand pulse generator (HPG) ........................................................ 2-11HPG_ON: Enable hand pulse generator (HPG)........................................................... 2-9HUM_ABI: Enable specified softkeys............................................................................ 7-11HUM_DIS: It disables specified softkeys....................................................................... 7-13IBS_INP: Transfer of INTERBUS inputs to the MW variables .................................... 3-35IBS_OUT: Transfer MW variables to INTERBUS outputs ............................................ 3-36

Page 10: 10 Series CNC WinPLUS LIBRARY

Preface10 Series CNC WinPLUS Library - User Manual

6 10 Series CNC WinPLUS Library - User Manual (04)

ID_TO_A: Request for conversion from axis identifier into axis name (ASCII) ............ 2-22IFWAIT: Semaphore status........................................................................................ 3-40INDEX: Copy a range of M variables........................................................................6-19INDEXA: Copy a range of ASCII variabiles.................................................................6-20INTP_ABI: Enable driver for real time reading of interpolator parameters. ................... 1-36INTP_CMD: Send a command to the interpolator ........................................................... 1-46INTP_DIS: Disable driver for real time reading of the interp. parameters. .................... 1-37INWORD: Read input word........................................................................................... 3-18IO_FILE: Read/write formatted file…………………………………………………………3-69XDA-COMD: Master/slave axis management…………………………………………………1-53LIMITSW: Manage hardware overtravel limits.............................................................. 2-20LOCKTAB: Set table interlock status.............................................................................. 9-3MANFEED: Set manual feedrate override ......................................................................1-11MDI_CMD: Execute a block in MDI ................................................................................ 1-27MESSROT: Display rotating messages...........................................................................3-48MTB_OFF: Disconnect a Pilot panel from a process ..................................................... 7-9MTB_ON: Assign a Pilot panel to a process ................................................................ 7-7NAXOFF: Activate new axes offset .............................................................................. 5-8NMT_CMD: Send CANopen network or remote node management commands............. 10-5OUTWORD: Write output word......................................................................................... 3-19PALMOVE: Move a point-to-point-axis ........................................................................... 4-9PARK_AX: Park an axis belonging to the logic.............................................................. 4-29PARK_SP: Park a spindle .............................................................................................. 4-30PP_BSRC: Position the active Part Program on the selected block .............................. 1-40PP_EXEC: Select a block from part program for execution........................................... 1-26PP_SELE: Select a part program for execution ............................................................ 1-25PP_TSRC: Finds a string inside the active part program............................................... 1-39PPRESUME: Resume part program execution after M06................................................. 1-30PPRUNINFO: Part Program execution monitoring management…………………………….1-47PREC_OFF: Disable part program block precalculation .................................................. 1-31PREC_ON: Enable part program block precalculation ................................................... 1-32PUTUSEC: Write the user variables of a type char process .......................................... 6-18PUTUSED: Write the user variables of a double type process ...................................... 6-16R232_INI: Set termination character for the serial line ................................................. 3-4R232_RES: Reset RS 232 interface................................................................................ 3-12R232_RXD: Receive lreal data buffer via the RS-232 interface...................................... 3-9R232_RXS: Receive an ASCII string via the RS 232 interface....................................... 3-11R232_RXW: Receive int data buffer via the RS 232 interface ......................................... 3-10R232_STS: Read RS-232 status .................................................................................... 3-13R232_TRM: Set termination characters used in message handling................................ 3-5R232_TXD: Transmit lreal data buffer via the RS 232 interface ..................................... 3-6R232_TXS: Transmit an ASCII string via the RS 232 interface...................................... 3-8R232_TXW: Trasmit int data buffer via RS 232 interface ................................................ 3-7RCM_MOD: Define the mode for the search in memory. ................................................ 1-41RD_ADA: Read an ADARING device A/D channel...................................................... 3-24READ_SDO_CMD Send read objects through SDO commands............................................... 10-11RESRIF: Reset axis homed flag ................................................................................. 2-6RIO_INP: Read remote I/O inputs................................................................................ 3-33RIO_OUT: Write the remote I/O outputs........................................................................3-34RQESTOP: Request process E-STOP ........................................................................... 3-20RQRESET: Request reset of NC ....................................................................................1-19RTIRES: Read RTI axes monitor table ....................................................................... 4-19SBPROVAR: Set Boolean process variable...................................................................... 6-4SCLOSE: Close RTI channel for spindle ..................................................................... 4-11SCONN_AX: Disconnect an axis from the interpolator of the logic................................... 4-28

Page 11: 10 Series CNC WinPLUS LIBRARY

Preface10 Series CNCWinPLUS Library - User Manual

10 Series CNC WinPLUS Library - User Manual (04) 7

SCONN_SP: Disconnect a spindle from the associated interpolator ............................... 4-33SEL_SCR: Display a screen.......................................................................................... 3-27SEND: Send to semaphore ..................................................................................... 3-43SEND_MSG: Trasmit message to a queue....................................................................... 3-44SETCUSK: Set OEM softkey status; ON/OFF type ....................................................... 7-3SETCUSL: Set OEM softkey status; Maintained, Data Entry and Normal .................... 7-4SETDATE: Set system data……………………………………………………………………3-66SETEPAR: Set part program E parameter..................................................................... 6-6SETHFL: Set part program H parameter flag ............................................................. 6-10SETHINT: Set human interface protection bits............................................................. 7-5SETHPAR: Set part program H-parameter .................................................................... 6-8SETMODE: Request mode of operation for a selected process .................................... 1-15SETRANG: Select spindle gear range............................................................................ 4-12SETRIF: Set axis homed flag..................................................................................... 2-5SETSC: Set ASCII global part program variable....................................................... 6-12SETSN: Set lreal global part program parameter ..................................................... 6-14SETTEST: Set axes to test mode.................................................................................. 2-8SETTIME: Write system time…………………………………………………………………3-68SG96RPM: Request G96 constant surface speed spindle control ................................ 4-13SG97RPM: Set spindle speed in RPM........................................................................... 4-15SJOG: Set jog incremen ......................................................................................... 1-17SL_CLOSE: Release posses of the serial line COM1 or COM2 ..................................... 3-52SL_OPEN: Obtain exclusive possession of serial line COM1 or COM2 ....................... 3-51SL_RESET: Reset the transmission status on COM1 or COM2..................................... 3-54SL_RXD: Receive lreal buffer data from COM1 or COM2.......................................... 3-61SL_RXS: Receive string buffer data from COM1 or COM2........................................ 3-62SL_RXW: Receive short data buffer from COM1 or COM2......................................... 3-59SL_SETUP: Set parameters for serial lines COM1 or COM2 ......................................... 3-49SL_STAT: Status of the serial line COM1 or COM2..................................................... 3-53SL_TXD: Transmit lreal data buffer on COM1 or COM2 ............................................ 3-57SL_TXS: Transmit string data buffer on COM1 or COM2 .......................................... 3-58SL_TXW: Transmit short data buffer on COM1 or COM2........................................... 3-56SOFTOTL: Enable /disable software overtravel limits ................................................... 2-4SOPEN: Open a channel for spindle management ................................................... 4-16SORIENT: Request spindle orientation......................................................................... 4-17SPEPN: Request to energize the E-STOP relay(s)................................................... 3-21SPORIDE: Set speed override ...................................................................................... 1-14SRESET: Request to reset a spindle........................................................................... 4-18STTRAVEL: Set H/W overtravel status............................................................................ 2-7SYNC_CMD: Send SYNC command to all the nodes....................................................... 10-7TBLGETD: Read lreal value from a table ...................................................................... 5-10TBLGETW: Read int value from a table ......................................................................... 5-9TBLPUTD: Write lreal value to a table.......................................................................... 5-12TBLPUTW: Write int value to a table.............................................................................. 5-11TBLSRCD: Table lreal search........................................................................................ 5-13TBLSRCW: Table int search........................................................................................... 5-15TC_CONF: Set the transducer ERDC............................................................................ 8-60TC_READ1: Read the physical position of the transducer .............................................. 8-62TC_WRIT: Set D/A Converter output ............................................................................ 8-63TCPACT: Enable/disable the Tool Center Point feature ............................................. 2-15TCPREAD: Read associated variables to Tool Center Point......................................... 2-18TCPWRT: Write associated variables to Tool Center Point ......................................... 2-16TOOL_RD: Get tool slave identifier................................................................................ 5-17TOOLACT: Update axis table with new tool offset......................................................... 5-2UNLKTAB: Cancel table interlock status ....................................................................... 9-5

Page 12: 10 Series CNC WinPLUS LIBRARY

Preface10 Series CNC WinPLUS Library - User Manual

8 10 Series CNC WinPLUS Library - User Manual (04)

URLFEED: Set rapid feedrate override ..........................................................................1-12WAIT: Wait on semaphore...................................................................................... 3-41WAIT_MSG: Wait a message in a queue .........................................................................3-42WARN_HIS: Display a message and store it in system history. ...................................... 3-26WARNING: Display error message................................................................................. 3-3WR_ADA: Write an ADARING device D/A channel...................................................... 3-22WRI_SCR: Display a user message ..............................................................................3-30WRITE_SDO_CMD: Scrive parametri tramite SDO...................................................................... 10-13

END OF PREFACE

Page 13: 10 Series CNC WinPLUS LIBRARY

Index10 Series CNC WinPLUS Library - User Manual

10 Series CNC WinPLUS Library - User Manual (04) i

INDEX

NC RELATED FUNCTIONSCYSTART: Request cycle start for a selected process......................................... 1-3CYCLE: Request cycle for a selected process...................................................... 1-4CYSTOP: Request cycle stop for the selected process........................................ 1-5FEEDHLD: Request the interpolator to enter the feedhold status ........................ 1-6FEED_GO: Request the interpolator to exit the feedhold status........................... 1-7FEEDHEM: request to interpolator to enter in feedhold at end of movement....... 1-8HOLDON: Enter in hold ......................................................................................... 1-9HOLDOFF: Exit from hold ..................................................................................... 1-10MANFEED: Set manual feedrate override ............................................................ 1-11URLFEED: Set rapid feedrate override ................................................................. 1-12FRORIDE: Set feedrate override........................................................................... 1-13SPORIDE: Set speed override .............................................................................. 1-14SETMODE: Request mode of operation for a selected process........................... 1-15GJOG: Get jog increment ...................................................................................... 1-16SJOG: Set jog incremen........................................................................................ 1-17AXSELEC: Select one or more axes for manual movement................................. 1-18RQRESET: Request reset of NC........................................................................... 1-19ENDRESE: Notify end of reset from WinPLUS ..................................................... 1-21GETPPNAM: Get information from selected part program ................................... 1-22GETPNTR: Request information about part program execution........................... 1-24PP_SELE: Select a part program for execution .................................................... 1-25PP_EXEC: Select a block from part program for execution.................................. 1-26MDI_CMD: Execute a block in MDI ....................................................................... 1-27MDI_EXEC: Executes program blocks from WinPLUS in MDI mode ................... 1-29PPRESUME: Resume part program execution after M06 .................................... 1-30PREC_OFF: Disable part program block precalculation....................................... 1-31PREC_ON: Enable part program block precalculation ......................................... 1-32FEEDBYON: Activate feedrate bypass ................................................................. 1-33FEEDBYOF: Restore programmed feedrate after feedrate bypass...................... 1-35INTP_ABI: Enable driver for real time reading of interpolator parameters............ 1-36INTP_DIS: Disable driver for real time reading of the interpolatorparameters............................................................................................................. 1-37GET_INTP: Reads in real time a number of interpolator data .............................. 1-38PP_TSRC: Finds a string inside the active part program...................................... 1-39PP_BSRC: Position the active Part Program on the selected block ..................... 1-40RCM_MOD: Define the mode for the search in memory. ..................................... 1-41AXSELFED: Selects axes allowing to change feedrate override .......................... 1-42AXMANFED: Set feedrate override of axes in manual movement........................ 1-44

Page 14: 10 Series CNC WinPLUS LIBRARY

Index10 Series CNC WinPLUS Library - User Manual

ii 10 Series CNC WinPLUS Library - User Manual (04)

INTP_CMD: Send a command to the interpolator ................................................. 1-46PPRUNINFO: Part Program execution monitoring management.......................... 1-47XDA_COMD: Master/Slave axes management..................................................... 1-53Master/Slave association ....................................................................................... 1-54Mode 0 ................................................................................................................... 1-55Mode 1 ................................................................................................................... 1-55Mode 2 ................................................................................................................... 1-57Mode 3 ................................................................................................................... 1-58Deactivating the Master/Slave Association............................................................ 1-59Definition/Variation of Following Ratio ................................................................... 1-59Activating the Following function............................................................................ 1-59Deactivating the following function.........................................................................1-60Monitoring the following function............................................................................ 1-60

AXIS MOTION FUNCTIONSAX_ENAB: Enable servo loop of an axis or enable its D/A converter. .................. 2-2AX_DISA: Disable servo loop of an axis or disable its D/A converter. .................. 2-3SOFTOTL: Enable /disable software overtravel limits ........................................... 2-4SETRIF: Set axis homed flag................................................................................. 2-5RESRIF: Reset axis homed flag ............................................................................ 2-6STTRAVEL: Set H/W overtravel status.................................................................. 2-7SETTEST: Set axes to test mode .......................................................................... 2-8HPG_ON: Enable hand pulse generator (HPG) .................................................... 2-9HPG_OFF: Disables hand pulse generator (HPG)................................................ 2-11AXTAN_E: Enable tangent axis algorithm ............................................................. 2-12AXTAN_D: Disables tangent axis algorithm .......................................................... 2-14TCPACT: Enable/disable the Tool Center Point feature ....................................... 2-15TCPWRT: Write associated variables to Tool Center Point .................................. 2-16TCPREAD: Read associated variables to Tool Center Point ................................ 2-18LIMITSW: Manage hardware overtravel limits....................................................... 2-20A_TO_ID: Request for conversion from axis name into axis identifier .................. 2-21ID_TO_A: Request for conversion from axis identifier into axis name (ASCII) ..... 2-22

GENERAL PURPOSE FUNCTIONSWARNING: Display error message ....................................................................... 3-3R232_INI: Set termination character for the serial line.......................................... 3-4R232_TRM: Set termination characters used in message handling ..................... 3-5R232_TXD: Transmit lreal data buffer via the RS 232 interface ........................... 3-6R232_TXW: Trasmit int data buffer via RS 232 interface...................................... 3-7R232_TXS: Transmit an ASCII string via the RS 232 interface ............................ 3-8R232_RXD: Receive lreal data buffer via the RS-232 interface............................ 3-9R232_RXW: Receive int data buffer via the RS 232 interface .............................. 3-10R232_RXS: Receive an ASCII string via the RS 232 interface ............................. 3-11R232_RES: Reset RS 232 interface...................................................................... 3-12R232_STS: Read RS-232 status ........................................................................... 3-13ANAIN: Read analog input..................................................................................... 3-15FOUT: Force a fast output ..................................................................................... 3-17INWORD: Read input word.................................................................................... 3-18OUTWORD: Write output word..............................................................................3-19RQESTOP: Request process E-STOP.................................................................. 3-20SPEPN: Request to energize the E-STOP relay(s) ............................................... 3-21WR_ADA: Write an ADARING device D/A channel............................................... 3-22

Page 15: 10 Series CNC WinPLUS LIBRARY

Index10 Series CNC WinPLUS Library - User Manual

10 Series CNC WinPLUS Library - User Manual (04) iii

RD_ADA: Read an ADARING device A/D channel............................................... 3-24WARN_HIS: Display a message and store it in system history. ........................... 3-26SEL_SCR: Display a screen.................................................................................. 3-27WRI_SCR: Display a user message ..................................................................... 3-30RIO_INP: Read remote I/O inputs ......................................................................... 3-33RIO_OUT: Write the remote I/O outputs ............................................................... 3-34$IBS_INP: Transfer of physical inputs from the INTERBUS orCANOPEN, OSWIRE, PROFIBUS modules to the MW variables ........................ 3-35$IBS_OUT: Transfer of the MW variables to the physical outputs ofthe INTERBUS, CANOPEN, OSWIRE or PROFIBUS modules ........................... 3-36ACK_STRB: Send acknowlegde signal................................................................. 3-37DELAY: Delay function .......................................................................................... 3-39IFWAIT: Semaphore status ................................................................................... 3-40WAIT: Wait on semaphore .................................................................................... 3-41WAIT_MSG: Wait a message in a queue.............................................................. 3-42SEND: Send to semaphore ................................................................................... 3-43SEND_MSG: Trasmit message to a queue........................................................... 3-44DECODE: Decodify a word with some data .......................................................... 3-46ENCODER: Decodify a bit on a word.................................................................... 3-47MESSROT: Display rotating messages ................................................................ 3-48SL_SETUP: Set parameters for serial lines COM1 or COM2............................... 3-49SL_OPEN: Obtain exclusive possession of serial line COM1 or COM2............... 3-51SL_CLOSE: Release posses of the serial line COM1 or COM2........................... 3-52SL_STAT: Status of the serial line COM1 or COM2 ............................................. 3-53SL_RESET: Reset the transmission status on COM1 or COM2........................... 3-54SL_TXB: Transmits byte data buffer on COM1 or COM2 ..................................... 3-55SL_TXW: Transmit short data buffer on COM1 or COM2..................................... 3-56SL_TXD: Transmit lreal data buffer on COM1 or COM2....................................... 3-57SL_TXS: Transmit string data buffer on COM1 or COM2..................................... 3-58SL_RXW: Receive short data buffer from COM1 or COM2 .................................. 3-59SL_RXB: Receives byte data buffer from COM1 or COM2 .................................. 3-60SL_RXD: Receive lreal buffer data from COM1 or COM2 .................................... 3-61SL_RXS: Receive string buffer data from COM1 or COM2 .................................. 3-62MOVEDATA: Copies/transfers variables in indexed mode ................................... 3-63TCPSYS_I: Enables Teach Pendant on serial line (CPU board) .......................... 3-64GETDATE: read system date ................................................................................ 3-65SETDATE: Write system date ............................................................................... 3-66GETTIME: Read system time................................................................................ 3-67SETTIME: writes system time ............................................................................... 3-68IO_FILE : Reading / writing formatted files............................................................ 3-69

POINT-TO-POINT-AXES / SPINDLE LIBRARYAX_SHARE: Shares/releases axes between a process and the logic.................. 4-3AABORT: Abort a point-to-point-interpolator......................................................... 4-5ACLOSE: Close channel for point-to-point-interpolator ........................................ 4-6AOPEN: Open channel for point-to-point-interpolator........................................... 4-7ARESET: Request to reset a point-to-point-interpolator ....................................... 4-8PALMOVE: Move a point-to-point-axis.................................................................. 4-9SCLOSE: Close RTI channel for spindle............................................................... 4-11SETRANG: Select spindle gear range .................................................................. 4-12SG96RPM: Request G96 constant surface speed spindle control ....................... 4-13SG97RPM: Set spindle speed in RPM.................................................................. 4-15SOPEN: Open a channel for spindle management............................................... 4-16SORIENT: Request spindle orientation................................................................. 4-17

Page 16: 10 Series CNC WinPLUS LIBRARY

Index10 Series CNC WinPLUS Library - User Manual

iv 10 Series CNC WinPLUS Library - User Manual (04)

SRESET: Request to reset a spindle..................................................................... 4-18RTIRES: Read RTI axes monitor table .................................................................. 4-19AUX_STAT: Read point-to-point axis or spindle status......................................... 4-20GET_POSD: Read position and feed rate of an axis controlled viaserial line RS-232................................................................................................... 4-23GET_AX: Plus gets a parked axis.......................................................................... 4-24CONN_AX: Connect an axis to the interpolator of the logic .................................. 4-26SCONN_AX: Disconnect an axis from the interpolator of the logic ....................... 4-28PARK_AX: Park an axis belonging to the logic ..................................................... 4-29PARK_SP: Park a spindle...................................................................................... 4-30GET_SP: Process gets a spindle already parked.................................................. 4-31CONN_SP: Connect a spindle to an interpolator................................................... 4-32SCONN_SP: Disconnect a spindle from the associated interpolator .................... 4-33

OFFSET AND TOOLS HANDLINGTOOLACT: Update axis table with new tool offset ................................................ 5-2ACTOFFS: Request activation of a tool offset....................................................... 5-5COMPOFF: Compute new axes offset .................................................................. 5-7NAXOFF: Activate new axes offset........................................................................ 5-8TBLGETW: Read int value from a table................................................................. 5-9TBLGETD: Read lreal value from a table .............................................................. 5-10TBLPUTW: Write int value to a table ..................................................................... 5-11TBLPUTD: Write lreal value to a table .................................................................. 5-12TBLSRCD: Table lreal search................................................................................5-13TBLSRCW: Table int search.................................................................................. 5-15TOOL_RD: Get tool slave identifier ....................................................................... 5-17

PROCESS/SYSTEM VARIABLES HANDLINGGBPROVAR: Get Boolean process variable ......................................................... 6-3SBPROVAR: Set Boolean process variable .......................................................... 6-4GETEPAR: Get part program E-parameter ........................................................... 6-5SETEPAR: Set part program E parameter ............................................................ 6-6GETHPAR: Get part program H-parameter........................................................... 6-7SETHPAR: Set part program H-parameter............................................................ 6-8GETHFL: Get part program H parameter flag (HF) ............................................... 6-9SETHFL: Set part program H parameter flag ........................................................ 6-10GETSC: Get ASCII global part program variable .................................................. 6-11SETSC: Set ASCII global part program variable ................................................... 6-12GETSN: Get lreal global part program variable ..................................................... 6-13SETSN: Set lreal global part program parameter .................................................. 6-14GETUSED: Read the user variables of a double type process ............................. 6-15PUTUSED: Write the user variables of a double type process ............................. 6-16GETUSEC: Read the user variables of a char type process................................. 6-17PUTUSEC: Write the user variables of a type char process ................................. 6-18INDEX: Copy a range of M variables .....................................................................6-19INDEXA: Copy a range of ASCII variabiles ........................................................... 6-20

HUMAN INTERFACEHISPROC: Select a process to control .................................................................. 7-2SETCUSK: Set OEM softkey status; ON/OFF type............................................... 7-3

Page 17: 10 Series CNC WinPLUS LIBRARY

Index10 Series CNC WinPLUS Library - User Manual

10 Series CNC WinPLUS Library - User Manual (04) v

SETCUSL: Set OEM softkey status; Maintained, Data Entry and Normal............ 7-4SETHINT: Set human interface protection bits ..................................................... 7-5MTB_ON: Assign a Pilot panel to a process ......................................................... 7-7MTB_OFF: Disconnect a Pilot panel from a process ............................................ 7-9CONS_LED: Manage leds on the OPLink operator panel .................................... 7-10HUM_ABI: Enable specified softkeys.................................................................... 7-11HUM_DIS: It disables specified softkeys............................................................... 7-13CONS_ON: Connects a WinMedia Operator Console to a process ..................... 7-15CONS_OFF: Disconnects a WinMedia Operator Console from a process .......... 7-17CONS_PUT: Sets the parameters of a WinMedia Operator Console................... 7-18

AXES RELATED FUNCTIONSGETAXINT: Get real axis position ......................................................................... 8-3AX_CHAS: Change the servo mode of an axis..................................................... 8-4AX_PROB: Enable probing signal for one or more axis........................................ 8-5AX_RDPB: Read the probed positions of one or more axes ................................ 8-6AX_RESE: Abort the actual operation of the addressed axis ............................... 8-8AX_ZSH1: Write zero shift offset #1...................................................................... 8-9AX_ZSH2: Write zero shift offset #2...................................................................... 8-10AX_SELE: Activate axis monitor functions / gear range ....................................... 8-11AX_RPOS: Resets the axis' position..................................................................... 8-13AX_SETZ: Allows the activation of different functions for the specified axis ........ 8-14AX_GET1: Get axis (spindle) servo parameters ................................................... 8-15AX_GET2: Get axis (spindle) servo parameters ................................................... 8-17AX_GET2B: Get axis (spindle) servo parameters................................................. 8-20AX_GET3: Get axis (spindle) servo parameters ................................................... 8-23AX_GET4: Get axis (spindle) servo parameters ................................................... 8-25AX_GET5: Get axis (spindle) servo parameters ................................................... 8-27AX_GET6: Get axis (spindle) servo parameters ................................................... 8-29AX_GET7: Get axis (spindle) servo parameters ................................................... 8-34AX_GET8: Get axis (spindle) servo parameters ................................................... 8-39AX_PUT1: Set axis servo parameter..................................................................... 8-41Notes to the parameter “CHANGECONV” ............................................................ 8-44Notes to the parameter “CHANGETRAS” ............................................................. 8-45Notes concerning the “STANDSTILL-GAIN” parameter........................................ 8-46Notes on the parameter “BACKLASH_TIME” ....................................................... 8-47AX_PUT2: Set axis servo parameter..................................................................... 8-48AX_PUT2B: Sets axis interlocking parameter....................................................... 8-50AX_PUT3: Set axis servo parameter..................................................................... 8-52AX_PUT4: Set axis servo parameter..................................................................... 8-54AX_PUTS: Writes axis status ................................................................................ 8-57AX_GETS: Get axis status .................................................................................... 8-59TC_CONF: Set the transducer ERDC................................................................... 8-61TC_READ1: Read the physical position of the transducer ................................... 8-63TC_WRIT: Set D/A Converter output .................................................................... 8-64FAX_WCON: Configures driver for real time data communication ....................... 8-66FAX_RCON: Configures the driver for real time data communication.................. 8-67FAX_PUT: Real time updating of an axis' zero shift value.................................... 8-68FAX_GET: Read in real time a number of axis parameters.................................. 8-69AXD_RDD: Read a numerical parameter from a digital drive ............................... 8-71AXD_WRD: Write a numerical parameter to a digital drive................................... 8-73AXD_RDS: Read a string parameter from a digital drive ...................................... 8-74AXD_WRS: Write a string parameter to a digital drive.......................................... 8-75AXD_PUT: Set the enable/disable bits for a digital drive ...................................... 8-76

Page 18: 10 Series CNC WinPLUS LIBRARY

Index10 Series CNC WinPLUS Library - User Manual

vi 10 Series CNC WinPLUS Library - User Manual (04)

AXD_CMD: Send a command to a digital drive..................................................... 8-77AX_WPAR: Writes the AMP parameters of an axis............................................... 8-79AX_RPAR: Reads the AMP parameters of an axis ............................................... 8-85AX_FWW: Writes the parameters of an OS3 drive associated with an axis ......... 8-86AX_FWR: Reads the parameters of an OS3 drive associated with an axis.......... 8-87AX_MECS: Read the status of a Mechatrolink drive ............................................. 8-90AX_MECR: Read the parameters of a Mechatrolink drive .................................... 8-91AX_MECW: Write the parameters of a Mechatrolink drive.................................... 8-92AX_RTFBCK: Read OS-WIRE variables in real time ............................................ 8-93

SPECIAL FUNCTIONSACTRES: Active reset request............................................................................... 9-2LOCKTAB: Set table interlock status ..................................................................... 9-3UNLKTAB: Cancel table interlock status ............................................................... 9-5FAST_WR: Fast data writing on DP ...................................................................... 9-6FAST_RD: Fast data reading from DP .................................................................. 9-8DE_ETH: Enable/disable communication via Ethernet ......................................... 9-10

CANOPEN® HILSCHER MANAGEMENT FUNCTIONSCAN_INIT: CANopen parameters initialisation ...................................................... 10-2NMT_CMD: Send CANopen network or remote node management commands ... 10-5SYNC_CMD: Send SYNC command to all the nodes........................................... 10-7GET_EMCY_INFO: Read node information and diagnostic data.......................... 10-8READ_SDO_CMD: Send read objects through SDO commands......................... 10-11WRITE_SDO_CMD: Send write objects through SDO commands....................... 10-13CAN_BOARD_CMD: Send commands to Hilscher mster board........................... 10-15

ERROR MESSAGES FOR SERIAL LINES COM1 OR COM2General errors ........................................................................................................A-1Transmit errors.......................................................................................................A-1Receive errors........................................................................................................A-1Line errors ..............................................................................................................A-2System errors.........................................................................................................A-2

NC MESSAGESERROR CODES DISPLAYED IN THE NC ENVIRONMENT..........................................B-1

POINT-TO-POINT AXES / SPINDLE MESSAGESPOINT-TO-POINT AXES / SPINDLE MESSAGES.........................................................C-1

AVAILABLE TABLESAVAILABLE TABLES .....................................................................................................D-1

Axes table ..............................................................................................................D-1Tool table ...............................................................................................................D-2Tool offset table......................................................................................................D-2

Page 19: 10 Series CNC WinPLUS LIBRARY

Index10 Series CNC WinPLUS Library - User Manual

10 Series CNC WinPLUS Library - User Manual (04) vii

User table .............................................................................................................. D-2

HUMAN INTERFACE AND PLUS RELATED MESSAGESHuman Interface Related Messages .................................................................... E-1PLUS Related Messages ...................................................................................... E-1

ERROR MESSAGES FOR THE D.S.I. INTERFACEERROR LIST ................................................................................................................... F-1

MESSAGES FOR POINT TO POINT AXIS CONTROLLED VIA RS-232 SERIAL LINE

Serial Driver ........................................................................................................... G-1DAC/DSC Osai Drive............................................................................................. G-2

APPENDIX HTABLE OF MAIN RESOURCES OF AXIS BOARDS:........................................... H-1

Page 20: 10 Series CNC WinPLUS LIBRARY

Index10 Series CNC WinPLUS Library - User Manual

viii 10 Series CNC WinPLUS Library - User Manual (04)

END OF INDEX

Page 21: 10 Series CNC WinPLUS LIBRARY

Chapter 1

10 Series CNC WinPLUS Library - User Manual (03) 1-1

NC RELATED FUNCTIONS

The NC system function calls allow the WinPLUS logic program to communicate with the systemand to request the execution of typical CNC related functions (operator functions, part programrelated functions). All functions can be used as a function block or can be called as a function inthe Structured Text. This chapter gives the type and sequence of parameters for the StructuredText call. Where necessary, the function and its conditions are explained.Each function has a return value (parameter 'stat_wrd') which can be found in Appendix B("Messages relative to NC) or a zero value if the execution was completed without errors.

REQUEST CYCLE START FOR A SELECTED PROCESS.......................................CYSTARTREQUEST CYCLE FOR A SELECTED PROCESS....................................................CYCLEREQUEST CYCLE STOP FOR THE SELECTED PROCESS ....................................CYSTOPREQUEST THE INTERPOLATOR TO ENTER IN FEEDHOLD STATUS ..................FEEDHLDREQUEST THE INTERPOLATOR TO EXIT FROM FEEDHOLD...............................FEED_GOENTER IN HOLD .........................................................................................................HOLDONEXIT FROM HOLD.......................................................................................................HOLDOFFSET MANUAL FEEDRATE OVERRIDE......................................................................MANFEEDSET RAPID FEEDRATE OVERRIDE..........................................................................URLFEEDSET FEEDRATE OVERRIDE ......................................................................................FRORIDESET SPEED OVERRIDE .............................................................................................SPORIDEREQUEST MODE OF OPERATION FOR A SELECTED PROCESS.........................SETMODEGET JOG INCREMENT...............................................................................................GJOGSET JOG INCREMENT ...............................................................................................SJOGSELECT ONE OR MORE AXES FOR MANUAL MOVEMENT...................................AXSELECREQUEST RESET OF NC ..........................................................................................RQRESETNOTIFY END OF RESET FROM WINPLUS ...............................................................ENDRESEGET INFORMATION FROM SELECTED PART PROGRAM .....................................GETPPNAMREQUEST INFORMATION ABOUT PP EXECUTION................................................GETPNTRSELECT A PART PROGRAM FOR EXECUTION.......................................................PP_SELESELECT A BLOCK FROM PART PROGRAM FOR EXECUTION..............................PP_EXECEXECUTE A BLOCK IN MDI .......................................................................................MDI_CMDEXECUTES PROGRAM BLOCKS FROM WINPLUS IN MDI MODE.........................MDI_EXECRESUME PART PROGRAM EXECUTION AFTER M06 ............................................PPRESUMEDISABLE PART PROGRAM BLOCK PRECALCULATION ........................................PREC_OFFENABLE PART PROGRAM BLOCK PRECALCULATION .........................................PREC_ONACTIVATE FEEDRATE BYPASS................................................................................FEEDBYONRESTORE PROGRAMMED FEEDRATE AFTER FEEDRATE BYPASS...................FEEDBYOFENABLE DRIVER FOR R.T. READING OF INTERP. PARAMETERS.......................INTP_ABIDISABLE DRIVER FOR R.T. READING OF THE INTERP. PARAM..........................INTP_DISREADS IN R.T. A NUMBER OF INTERP. DATA ........................................................GET_INTPFIND A STRING INSIDE THE ACTIVE PART PROGRAM.........................................PP_TRSCPOSITION THE ACTIVE PART PROGRAM ON THE SELECTED BLOCK ...............PP_BRSCDEFINE THE MODE FOR THE SEARCH IN MEMORY.............................................RCM_MODSELECT AXES ALLOWING TO CHANGE FEEDRATE OVERRIDE..........................AXSELFEDSET FEED RATE OVERRIDE OF AXES FOR MANUAL MOVEMENT......................AXMANFEDSEND A COMMAND TO THE INTERPOLATOR ........................................................INTP_CMD

Page 22: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-2 10 Series CNC WinPLUS Library - User Manual (03)

REQUEST THE INTERPOLATOR TO ENTER IN FEEDHOLD STATUS AT ENDOF MOVEMENT..........................................................................................................FEEDHEMPART PROGRAM EXECUTION MONITORING MANAGEMENT…………………….PPRUNINFOMASTER/SLAVE AXES MANAGEMENT……………………………………………….. XDA_COMD

Page 23: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-3

CYSTART: Request cycle start for a selected process

Type: No Wait

LD/FBD:

ST:stat_wrd := CYSTART(proc_num) ;

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLE: status word (int)

Description:

This function is used to simulate the front panel's cycle start button in WinPLUS

NOTE:The CYCLE has the same functionalities as CYSTART but it is a WAIT function.

stat_wrd

Page 24: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-4 10 Series CNC WinPLUS Library - User Manual (03)

CYCLE: Request cycle for a selected process

Type: Wait

LD/FBD:

ST:stat_wrd := CYCLE(proc_num);

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLE: status word (int)

Description:

This function is utilized to simulate pressing of the command module's cycle start button fromWinPLUSThe WAIT CYCLE function allows synchronization with the NC module and always receives anacknowledge from the process.On exit from the CYCLE call two situations can take place, according to the process' status:

• Process in "IDLE" status: The command that has been sent in execution following theCYCLE call is being executed; you must wait for the processto enter "IDLE" status so that the command can be executed

• Process in "RUN" status: The command sent in execution following the CYCLE callhas already been executed.

NOTE:This function can be used, when the logic sends the blocks MDI (MDI_CMD) to execution.In presence of a CYCLE command, the logic can synchronise with the NC environment as follows:

• execution of a block in MDI with actual axes movements using the routines CONMOV andENDMOV

• execution of a block in MDI without moving the axes by testing the process signal status IDLEand RUN.

The function CYSTART has the same features as the function CYCLE, but as it is a NOWAIT, itdoes not allow a proper synchronisation between the logic and the NC environment, if the blocksent to execution does not contain an actual axis move.

stat_wrd

Page 25: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-5

CYSTOP: Request cycle stop for the selected process

Type: No Wait

LD/FBD:

ST:stat_wrd := CYSTOP(proc_num,ax_id);

INPUT VARIABLES: process number (1..20) (int)axes identifier of axis to be stopped (int)

OUTPUT VARIABLE: status word (int)

Description:

This function stops the axis' motion (ax_id) relative to the process specified by the user("proc_num").

The "ax_id" parameter is insignificant, in fact the axis in motion can be stopped without the "ax_id"axis identify;

Despite this we advise to give the identifier of the axis to be stopped to the "ax_id" parameter forreasons of future developments compatibility.

stat_wrd

Page 26: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-6 10 Series CNC WinPLUS Library - User Manual (03)

FEEDHLD: Request the interpolator to enter the feedhold status

Type: No Wait

LD/FBD:

ST:stat_wrd := FEEDHLD(proc_num);

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLE: status word (int)

Description:

This function simply sets the feedrate to a zero value. Any on-going interpolating axes motion inthe selected process is suspended. The motion can be resumed with FEED_GO.

NOTES:• This function is not executed when the control is working in G33 (thread cutting) or G84

(tapping). The stat_wrd variable contains a corresponding error code.

• The feedhold state is not cancelled by a RESET.

• Flag S_nFEEDH (S 20_15) informs the logic about the actual state of the control.

stat_wrd

Page 27: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-7

FEED_GO: Request the interpolator to exit the feedhold status

Type: No Wait

LD/FBD:

ST:stat_wrd := FEED_GO(proc_num);

INPUT VARIABLE: process number 1-20 (int)OUTPUT VARIABLE: status word (int)

Description:

This function makes the interpolator exit the feedhold state requested by the function FEEDHLD.The feedrate with the value previous to the entry in feedhold state is restored. The motion of theaxes resumes.

If you call this function when the interpolator is not in feedhold state, nothing happens.

See also:

FEEDHLD request feedhold system function call

System flags:

S_nFEEDH (S 20_15) process in feedhold status.

stat_wrd

Page 28: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-8 10 Series CNC WinPLUS Library - User Manual (03)

FEEDHEM: request to interpolator to enter in feedhold at end of movement

Type: No Wait

LD/FBD:

ST:stat_wrd := FEEDHEM(proc_num);

INPUT VARIABLE : number of process 1-20 (int)OUTPUT VARIABILE : status word (int)

Description:

With this function the final point of the movement (program block) currently executed is reached atzero speed. At this point feedrate is set on zero as is done with the FEEDHLD function. Themovement can be resumed with FEED_GO.

NOTES:• This function applies continuous motions, as reaching the final point at zero speed is an intrinsiccharacteristic in all other types of movement and hence the function in question is an integral partof the movement. However, at the end of all types of movement, feedrate is set on zero.

• Stopping at the final point of a movement is not ensured if the stop request is executed at adistance from the final point of the movement which is not sufficient to stop the movement(compatibly with the acceleration values configured on the axes); in this case, the stop will occuron the subsequent movement(s), as in a regular feedHold.

• If the stop at final point has been correctly requested, stop coordinates may differ from the finalpoint of the movement by a distance of the order of 0.01 mm.

• This function is not performed when the control is working in G33 mode (threading) or G84(tapping). The stat_wrd variable contains the corresponding error code.

• Feedhold status is not deleted by a RESET.

• The S_nFEEDH (S 20_15) flag informs the logic as to the current control status.

stat_wrd

Page 29: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-9

HOLDON: Enter in hold

Type: No Wait

LD/FBD:

ST:stat_wrd := HOLDON(proc_num);

INPUT VARIABLE: process number 1-20 (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function stops the interpolator of the requested process. In this status of the NC, it is possibleto execute manual motion, to execute MDI motion and to invoke multi-block-retrace.

See also:

HOLDOFF Exit from HOLD status function call.

System flags:

S_nHOLDA (S 20_02) process in HOLD status.

stat_wrd

Page 30: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-10 10 Series CNC WinPLUS Library - User Manual (03)

HOLDOFF: Exit from hold

Type: No Wait

LD/FBD:

ST:stat_wrd := HOLDOFF(proc_num);

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function makes the interpolator exit from HOLD status function call.

See also:

HOLDON request to enter in HOLD status.

System flag:

S_nHOLDA (S 20_2) process in HOLD status.

stat_wrd

Page 31: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-11

MANFEED: Set manual feedrate override

Type: Wait

LD/FBD:

ST:stat_wrd := MANFED(proc_num, mfo_percent, mfo_direction);

INPUT VARIABLES: process number (1-20) (int)manual feed percentage ( x 100) (int)manual feed direction (int)

OUTPUT VARIABLE: status word (int)

Description:

Forces the feedrate with the value equal to the percentage (mfo-percent) of the maximumconfigured manual feedrate.

The mfo_percent variable can have values between 0 and 10000, where:

00000 = manual feedhold10000 = 100% manual feedrate

The direction of the manual motion depends on the variable mfo_direction:

0 = positive manual jog1 = negative manual jog

You cannot override the manual feedrate to a value higher than the configured manual feedrate(100 %).

See also:

S_nMFO (SW 035) actual manual feedrate override percentage.

$n_PUTFMA manual feedrate override change requested

stat_wrd

Page 32: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-12 10 Series CNC WinPLUS Library - User Manual (03)

URLFEED: Set rapid feedrate override

Type: Wait

LD/FBD:

ST:stat_wrd := URLFEED(proc_num, url_percent);

INPUT VARIABLES: process number (1-20) (int)rapid feed percentage ( x 100) (int)

OUTPUT VARIABLE: status word (int)

Description:

Forces the rapid feedrate with a value equal to the percentage of the configured maximal rapidfeedrate. This function only effects the rapid feedrate when the override rapid is enabled (Booleanprocess variable URL=1. This variable can be set by the operator in the part program set up menuor by WinPLUS ).

The url_percent variable can have values between 0 and 10000, where:

00000 = rapid at 0% (feed hold)

10000 = 100% rapid feedrate

You cannot override the rapid feedrate to a value higher than the configured rapid feedrate (100 %).

See also:

SBPROVAR Set Boolean process variable (URL)

GBPROVAR Get Boolean process variable (URL)

stat_wrd

Page 33: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-13

FRORIDE: Set feedrate override

Type: Wait

LD/FBD:

ST:stat_wrd := FRORIDE(proc_num, fro_percent);

INPUT VARIABLES: process number (1-20) (int)FRO % value (expressed in % * 100) (int)

OUTPUT VARIABLE: status word (int)

Description:

This function used to control the feedrate of the axes when not in G00. The feedrate is limited bythe system to the configured rapid feedrate for every axis. The true feedrate percentage must bemultiplied with 100 to obtain the controls internal resolution:

0 = 0 % feedhold100 = 1 %1000 = 10 %10000 = 100 %20000 = 200 %32767 = 327.67 % max. FRO percentage

See also:

S_nFRO (SW 36) actual feedrate override percentage.

stat_wrd

Page 34: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-14 10 Series CNC WinPLUS Library - User Manual (03)

SPORIDE: Set speed override

Type: Wait

LD/FBD:

ST:stat_wrd := SPORIDE(proc_num, sso_percent);

INPUT VARIABLES: process number 1-20 (int)SSO % value (expressed in % * 100) (int)

OUTPUT VARIABLE: status word (int)

Description:

Value of sso_percent % Comment

0 0 % of the programmed spindle speed

100 1 %

1000 10 %

10000 100 %

20000 200 %

ecc.

This function is used to force the spindle speed override value in the systems process display.WinPLUS uses the SSO value to control the spindle RPM in G97 or the tool cutting speed in G96.The theoretical maximum limit of the spindle speed override is 327.67 %.

See also:

S_nSSO (SW 37) actual spindle speed override percentage value.

stat_wrd

Page 35: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-15

SETMODE: Request mode of operation for a selected process

Type: Wait

LD/FBD:

ST:stat_wrd := SETMODE(proc_num, mode);

INPUT VARIABLES: process number 1-20 (int)mode select (int)

OUTPUT VARIABLE: function status output word (int)

Description:

The mode select parameter can have following values:

00001 = MDI00002 = auto00003 = semi auto00004 = continuous JOG00005 = incremental JOG00006 = return to contour00007 = home00008 = hand pulse generator

See also:

S_nPROMOD (SW 31) active process mode of operation.

stat_wrd

Page 36: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-16 10 Series CNC WinPLUS Library - User Manual (03)

GJOG: Get jog increment

Type: Wait

LD/FBD:

ST:stat_wrd := GJOG (proc_num, jog_val);

INPUT VARIABLE: process number 1-20 (int)OUTPUT VARIABLES: jog value (lreal)

status word (int)

Description:

This function returns the current of the incremental JOG (manual axis movements).The value is written in the jog_val variable in a lreal format.

stat_wrd

Page 37: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-17

SJOG: Set jog incremen

Type: Wait

LD/FBD:

ST:stat_wrd := SJOG(proc_num, jog_val);

INPUT VARIABLES : process number 1-20 (int)increment for manual jog (lreal)

OUTPUT VARIABLE : function status output word (int)

Description:

This function allows to force the incremental manual jog value on the declared process.

stat_wrd

Page 38: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-18 10 Series CNC WinPLUS Library - User Manual (03)

AXSELEC: Select one or more axes for manual movement

Type: Wait

LD/FBD:

* L'ingresso “ax_id” puo' essere duplicato.

ST:stat_wrd := AXSELEC(proc_num, ax_id, …);

INPUT VARIABLES: process number (1..20) (int)first axis physical identifier (int)…..last axis physical identifier (int)

OUTPUT VARIABLE: function output status word (int)

Description:

This function is used to select one or more axes for manual operations. The axes managed by WinPLUS (motion control by logic) cannot be selected (the status word will contain a non-zero value).The contemporary selection of different axes is useful only for the homing cycle execution.Up to 9 axes can be selected. The input variable ax_id must be duplicated for each one of theaxes to be selected. Using the function block you must duplicate the ax_id.

Parameter ax_id must be 1 since it is currently only possible to manually move one axis at a time.

See also:

S_nAXSEL (SW 29) ID of axis actually selected. If more than one axis are selected,SW29 contains the ax_id of the first axis.

stat_wrd

Page 39: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-19

RQRESET: Request reset of NC

Type: No Wait

LD/FBD:

ST:stat_wrd := RQRESET(proc_num);

INPUT VARIABLE: process number 1-20 (int)OUTPUT VARIABLE: status word (int)

Description:

A system reset causes:

• all axes motion (except point to point) to stop

• the part program buffer to be cleared

• the part program pointer to be set to the first block of the active program

• the G92 work register presets to be cancelled

• all origin shifts to be cleared

• the cycle stop button to be released

• the power turn on G-codes to be activated

• certain three-letter codes to be reset

All other actions required for a reset must be started in the WinPLUS program. These actions canbe different according to the type of applications. Some examples of what may be necessary toexecute from WinPLUS:

• stop the spindle and the coolant

• abort all point-to-point-axis motion

• reset specific M codes to their default state

• activate a default screen display

• initialize certain machine related conditions and variables

stat_wrd

Page 40: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-20 10 Series CNC WinPLUS Library - User Manual (03)

The sequence of RQRESET usage in a WinPLUS routine should be:

• call RQRESET

• check S_nRESE (S 20_07) to go true

• execute the action required for RESET (in P.L.U.S)

• call ENDRESE

See also:

S_nRESE (S 20_07) process is being reset.

ENDRESE Logic has finished reset actions

Manual 10 Series CNC WinPLUS Application Manual - chapter 8

Page 41: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-21

ENDRESE: Notify end of reset from WinPLUS

Type: Wait

LD/FBD:

ST:stat_wrd := ENDRESE(proc_num);

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLE: status word (int)

Description:

This system function call must be used to tell the system that WinPLUS has finished all the actionrequired for a RESET.The system will not go into IDLE state before it receives this call from the logic. If you omit to callthis function after reset, the system will "hang".

See also:

S_nRESE (S 20_07) system reset on-going

Manual 10 Series CNC WinPLUS Application Manual - chapter 8

stat_wrd

Page 42: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-22 10 Series CNC WinPLUS Library - User Manual (03)

GETPPNAM: Get information from selected part program

Type: Wait

LD/FBD:

ST:stat_wrd := GETPPNAM(proc_num, name_main, name_sub, pp_num);

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLES: name of the active main program (string)

name of the active subroutine (string)level of the active part program (int)status word (int)

Description:

The GETPPNAM function returns the name of the active main part program, subroutine name inexecution, if any and if present, and nesting level of the active part program.The "pp_num" parameter shows if a part program is active and at what nesting level the subroutinein execution is.

NOTE:The parameters "name_sub" and "name_main" act on the first 4000 characters of the ASCII array.

stat_wrd

Page 43: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-23

The "pp_num" parameter can have the following values:

Value Meaning

0 no active part program is present

1 main part program is active

2 subroutine at level 2 is in execution

3 subroutine at level 3 is in execution

4 subroutine at level 4 is in execution

5 subroutine at level 5 is in execution

If no part program is active (pp_num =0), the output parameters "name_main" and "name_sub"become insignificant.If the main part program (pp_num=1) is in execution, its name is shown in the output parameter"name_main" while the "name_sub" parameter is insignificant.If a subroutine (2<pp_num<=5) is in execution, the "name_main" parameter will contain the nameof the main part program while the "name_sub" parameter will contain the name of the subroutinein execution.Part program names can be long up to 48 characters.

See also:

S_nGMACRO (SW 21) active parameter G Code

Page 44: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-24 10 Series CNC WinPLUS Library - User Manual (03)

GETPNTR: Request information about part program execution

Type: Wait

LD/FBD:

ST:stat_wrd := GETPNTR(proc_num, main, level1, level2, level3, level4);

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLES: block number main (lreal)

block number nesting level1 (lreal)block number nesting level2 (lreal)block number nesting level3 (lreal)block number nesting level4 (lreal)function status output (int)

Description:

This function returns the active part program block sequence numbers of the main program andnested subroutines. Block sequence numbers are integer numbers and can have up to sixsignificant digits. This WinPLUS library routine presents the sequence numbers in a lreal format.

If no block numbers are used in the active part program or in any of the subroutines, a 0 will bereturned.

stat_wrd

Page 45: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-25

PP_SELE: Select a part program for execution

Type:Wait

LD/FBD:

ST:stat_wrd := PP_SELE(proc_num, mode, pp_name);

INPUT VARIABLES: process number (1..20) (int)mode of activation, with or w/o analysis (int)name of the part program to be activated (string)

OUTPUT VARIABLE: status word (int)

Description:

This function is used to select a part program for execution. The activation can be done incombination with a part program pre-analysis (mode=0) or without pre-analysis (mode=1).

When you enter an empty string (0 characters) as the part program name, the current active partprogram will be de-selected (in this case, the function is equivalent to the "deactivate" softkey).

NOTE:The parameter "pp_name" acts on the first 4000 characters of the ASCII array.

stat_wrd

Page 46: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-26 10 Series CNC WinPLUS Library - User Manual (03)

PP_EXEC: Select a block from part program for execution

Type: Wait

LD/FBD:

ST:stat_wrd := PP_EXEC(proc_num, block_num);

INPUT VARIABLES: process number (1..20) (int)number of last block to be executed (lreal)

OUTPUT VARIABLE: status word (int)

Description:

The block number is entered for the active program. The program must be started with the cyclestart push button or with the equivalent WinPLUS function.

If the block number specified in "block_num" is not present in the active program, the functionreturns 0 in the "stat_wrd" (function executed correctly) and the part program will be entirelyexecuted.

The PP_EXEC command is cancelled in the following cases:

• when the part program positions itself on the indicated block

• when the system is reset

stat_wrd

Page 47: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-27

MDI_CMD: Execute a block in MDI

Type: Wait

LD/FBD:

ST:stat_wrd := MDI_CMD(proc_num, cmd_string);

INPUT VARIABLES: process number 1-20 (int)block to be executed (ASCII string) (string)

OUTPUT VARIABLE: status word (int)

Description:

Its string handling capabilities allow WinPLUS to transfer part program blocks from its ASCIImemory area to the NC ambient. This function will just copy a string from the I/O processor's ASCIIbuffer (or a string constant) to the MDI buffer in the addressed process. These part program blockscan then be executed with a cycle start (system function call CYSTART or CYCLE).

Part program blocks from WinPLUS can only be executed under following conditions:

• the process mode must be MDI

• the process status must be IDLE or MAS

• the string you copy to the MDI buffer must be a legal part program block

stat_wrd

Page 48: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-28 10 Series CNC WinPLUS Library - User Manual (03)

NOTES:• We recommend disabling the MDI softkey (SETHINT) during the execution of part program

blocks by WinPLUS.

• A MDI_CMD block cannot be executed using the front panel's cycle start push button. YouMUST use the system function call CYSTART

See also:

S_nMAS (S 20_13) Process in calculation stop (transfer inhibit)

S_nIDLE (S 20_00) Process status is idle

S_nMDI (S 31_00) Manual Data Input mode active

CYSTART System function call cycle start from WinPLUS NO WAIT Type

CYCLE System function call cycle start from WinPLUS WAIT Type

Page 49: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-29

MDI_EXEC: Executes program blocks from WinPLUS in MDI mode

Type: Wait

LD/FBD:

ST:stat_wrd := MDI_EXEC(proc_num, cmd_string);

INPUT VARIABLES: process number 1-20 (int)block to be executed (ASCII string) (string)

OUTPUT VARIABLE: status word (int)

Description:

This function makes it possible to execute a Part Program block in MDI mode.

The block to be executed must be entered in string form in variable “cmd_string” and the relativeprocess in variable “proc_num”.

This function causes the immediate execution of the block without having to force a cycle start,since this is already executed by the function itself.

The function can be activated only if:

• The process is in MDI;

• The process is in IDLE or MAS status

• The string that is copied onto the MDI buffer must be a valid part program block.

The block specified as input in “cmd_string” must be a valid Part Program block.

NOTE:• We recommend disabling the MDI softkey (SETHINT) during the execution of Part Program

blocks from WinPLUS.

See also:

S_nMAS (S 20_13) Process in calculation stop

S_nIDLE (S 20_00) Process status is IDLE

S_nMDI (S 31_00) Manual Data Input mode active

stat_wrd

Page 50: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-30 10 Series CNC WinPLUS Library - User Manual (03)

PPRESUME: Resume part program execution after M06

Type: Wait

LD/FBD:

ST:stat_wrd := PPRESUME(proc_num);

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLE: status word (int)

Description:

This function is used to exit the hold state of the NC which was forced by a M function (M06 toolchange for example).

stat_wrd

Page 51: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-31

PREC_OFF: Disable part program block precalculation

Type: Wait

LD/FBD:

ST:stat_wrd := PREC_OFF(proc_num);

INPUT VARIABLE: process number 1-20 (int)OUTPUT VARIABLE: status word (int)

Description:

This function disables the part program block precalculation. Before analysing another block, thesystem asks for consent with the EOB" part program interface task. A "NACK" programmed in thetask forces the system to "MAS + IDLE" status.

If the nEOB routine is enabled with PREC_OFF it will also be activated when you put the "#"synchronization character in front of a part program block.

See also:

PREC_ON

stat_wrd

Page 52: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-32 10 Series CNC WinPLUS Library - User Manual (03)

PREC_ON: Enable part program block precalculation

Type: Wait

LD/FBD:

ST:stat_wrd := PREC_ON(proc_num);

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLE: status word (int)

Description:

This function restores the system's normal functioning. Consensus to analyse the following blockwill not be requested to the interface at the end-of-block (part program block precalculationenabled).

See also:

PREC_OFF

stat_wrd

Page 53: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-33

FEEDBYON: Activate feedrate bypass

Type: No Wait

LD/FBD:

ST:stat_wrd := FEEDBYON(proc_num, velocity);

INPUT VARIABLE: process number 1-20 (int)velocity expressed in configured units (lreal)

OUTPUT VARIABLE: function status output word (int)

Description:

Feedrate bypass is a feature which allows you to instantaneously change the feedrate to anydesired value within the limits of the axes. This function can be used for fast approach to the workpiece ("gap elimination").

You must express the desired feedrate in configured units, i.e. if your machine was configured ininches, the velocity parameter has to be a feedrate expressed in inches per minute. If the feedratevelocity is higher than the configured rapid feedrate of the axes involved, the system will limit theresulting feedrate to the rapid of the slowest axis involved.

This function can be activated during the linear point-to-point interpolation (G01 with G29) with G94or G95 feedrate coding. In all other interpolation modes the active feedrate bypass mode will beaborted or the request with FEEDBYON will be ignored. An ignored request will not be memorised.

Changing the process status will also lead to the cancellation of feedrate bypass; i.e. when theprocess goes IDLE, the feed bypass will be switched off automatically.

The process flag S_nFRB will always reflect the active state of the feedrate bypass.

During feedrate bypass, you can still use the feedrate override selector to fine tune the bypassspeed. You must use the FEEDBYOF system function call to restore the original feedrate asprogrammed in the part program.

stat_wrd

Page 54: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-34 10 Series CNC WinPLUS Library - User Manual (03)

NOTE:The effect of the feedrate bypass call is instantaneous. There is no synchronization with the partprogram blocks or the motion.

See also:

FEEDBYOF restore programmed feedrate

S_nFRB (S 30_15) feedrate bypass active flag

Page 55: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-35

FEEDBYOF: Restore programmed feedrate after feedrate bypass

Type: No Wait

LD/FBD:

ST:stat_wrd := FEEDBYOF(proc_num);

INPUT VARIABLE: process number 1-20 (int)OUTPUT VARIABLE: status word (int)

Description:

This function will instantaneously restore the programmed feedrate when feedrate bypass is ineffect. You normally use this system function call to finish the quick approach to the workpiece.

Calling this function when feedrate bypass is not active has no other effect than a waste of time inexecuting the call.

See also:

FEEDBYON activate feedrate bypass

S_nFRB (S 30_15) feedrate bypass is active

stat_wrd

Page 56: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-36 10 Series CNC WinPLUS Library - User Manual (03)

INTP_ABI: Enable driver for real time reading of interpolator parameters.

Type: Internal

LD/FBD:

ST:stat_wrd := INTP_ABI(proc_num);

INPUT VARIABLE : process number (1..4) (int)OUTPUT VARIABLE: status word (int)

Description:

The function activates the driver utilized for real time reading of a number of data relative toprocess axes interpolator.

The driver can be enabled at any moment but if this is done during the execution of a movementblock (one or more part program blocks), data relative to the interpolator will be available onlystarting from the beginning of following block.

The output STAT_WRD can have the following values:

Value Meaning

0 OK

402 Process number out of range

404 Driver Already Active

See also:

GET_INTP

INTP_DIS

stat_wrd

Page 57: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-37

INTP_DIS: Disable driver for real time reading of the interpolator parameters.

Type: Internal

LD/FBD:

ST:stat_wrd := INTP_DIS(proc_num);

INPUT VARIABLE: process number (1..4) (int)OUTPUT VARIABLE: status word (int)

Description:

The function disables the driver for real time reading of data relative to the process axesinterpolator.

The driver can be enabled at any moment but if this is done during the execution of a movementblock (one or more part program blocks), the driver will be actually stopped only at the end of theblock.

The output STAT_WRD can have the following values:

Value Meaning

0 OK

402 Process number out of range

405 Driver already disabled

See also:

INTP_ABI

GET_INTP

stat_wrd

Page 58: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-38 10 Series CNC WinPLUS Library - User Manual (03)

GET_INTP: Reads in real time a number of interpolator data

. Type: Internal

LD/FBD:

ST:stat_wrd := GET_INTP(proc_num, para_num, value);

INPUT VARIABLES : process number (1..4) (int)parameter number (int)

OUTPUT VARIABLES : requested parameter value (lreal)status word (int)

Description:

The function reads in real time a number of values relative to the specified process interpolator: itcan be called only after enabling the driver for real time communication between WinPLUS andinterpolator (via INTP_ABI).The parameter to be read is selected through the para_num variable, which can have the followingvalues:

1 for current feed on profile.2 distance to go, on the profile, in order to finish the movement

The parameter specified by para_num will be written in the "value" variable and will be expressedin accordance with the configured measurement unit.

The output STAT_WRD can have the following values:

Value Meaning0 OK

403 para_num out of range402 process number out of range405 driver disabled

See also:

NTP_ABI

INTP_DIS

stat_wrd

Page 59: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-39

PP_TSRC: Finds a string inside the active part program

Type: Wait

LD/FBD:

ST:stat_wrd := PP_TSRC(proc_num, aString, direction);

INPUT VARIABLES : process number (1..20) (int)string to find (string)search direction (0 onwards, 1 backwards) (int)

OUTPUT VARIABLES: status word (int)

Description:

This function searches for the string specified as an input in the "aString" parameter inside theselected part program and in the direction specified in the "direction" parameter.

At the next Part Program block to be executed, the pointer will be positioned on the block wherethe string has been found.

If the string is not found, the function returns to the output variable "stat_wrd" the beginning or endof file, according to the selected search direction.

The function returns an error if no Part Program is selected.

NOTE:The parameter "string" acts on the first 4000 characters of the ASCII array.

stat_wrd

Page 60: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-40 10 Series CNC WinPLUS Library - User Manual (03)

PP_BSRC: Position the active Part Program on the selected block

Type: Wait

LD/FBD:

ST:stat_wrd := PP_BSRC(proc_num, block_number, direction);

INPUT VARIABLES : process number (1..20) (int)block number (int)search direction (0 onward, 1 backwards) (int)

OUTPUT VARIABLES: status word (int)

Direction:

This function positions the pointer on the next PP block to be executed, "block number" blocksonwards or backwards with respect to the current position.

If a number of blocks higher than those left at the end or at the beginning of the Part Program arerequested to be moved, the function returns to the output variable "stat_wrd" the beginning or endof file warning, according to the selected search direction.

The function returns an error if a Part Program has not been selected.

stat_wrd

Page 61: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-41

RCM_MOD: Define the mode for the search in memory.

Type: Wait

LD/FBD:

ST:stat_wrd := RCM_MOD(proc_num, mode);

INPUT VARIABLES: process number 1-4 (int)mode (int)

OUTPUT VARIABLE: status word (int)

Description:

If the search in memory is active, this function allows to define how the auxiliary functions have tobe managed; that is if they have to be memorized and sent to the Plus logic only once at the end ofthe search or whenever they are found in the part program.

The modality to be used can be selected through the "mode" parameter that can have the followingvalues:

bit meaning

0 M function passed to WinPlus during the search

1 T function passed to WinPlus during the search

2 S function passed to WinPlus during the search

3 axes function passed to WinPlus during the search

If the "mod" parameter is equal to 0 the auxiliary functions are memorized and sent to the logiconly at the end of the search.

stat_wrd

Page 62: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-42 10 Series CNC WinPLUS Library - User Manual (03)

AXSELFED: Selects axes allowing to change feedrate override

Type: Wait

LD/FBD:

ST:stat_wrd := AXSELFED(proc_num, ax_feed, …);

* The parameter ax_feed can be copied.

INPUT VARIABLES: process number (1...20) (int)first “ax_feed” structure (Ax_feed)...last “ax_feed” structure (Ax_feed)

OUTPUT VARIABLE: status word (int)

“Ax_feed” is a data structure composed of:

ax_id: (int) physical axis identifier (1…32)feed: (int) feed percentage of the axis (0……10000)

Description:

This function is used to select one or more axes to be moved manually and to define for each ofthem the feedrate override percentage. The axes handled by WinPLUS (movements controlled bythe logic) cannot be selected. You can select up to 9 axes. The value of feed is expressed inpercent * 100 i.e. to have 10% you have to input 1000.

The axis speed will result according to the following formula:

Va = Vc ∗ Sf ∗ Sa

Where:

Va = speed axis;

Vc = configured speed in AMP in the field “manual feed”;

Sf = percentage value of the selector of either feed manual or softkey set value or forded by PLUS;

Sa = set value in the feed field of the function AXSELFED or AXMANFED.

stat_wrd

Page 63: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-43

NOTE:Execution of the function with wrong values can cause errors.The selection of a new axis through the buttons “↓” or “↑” cancels the set speed variation.

ESEMPIO:

Page 64: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-44 10 Series CNC WinPLUS Library - User Manual (03)

AXMANFED: Set feedrate override of axes in manual movement

Type: Wait

LD/FBD:

ST:stat_wrd := AXMANFED(proc_num, ax_feed);

* The parameter ax_feed can be copied.

INPUT VARIABLES: process number (1...20) (int)First “ax_feed” structure (Ax_feed)...Last “ax_feed” structure (Ax_feed)

OUTPUT VARIABLE: status word (int)

Description:

This function is used to set the feedrate override for the axes moved manually. The axes handledby WinPLUS (movements controlled by the logic) cannot be selected. You can select up to 9 axes.The value of feed is expressed in percent * 100 i.e. to have 10% you have to input 1000.

The axis speed will result according to the following formula:

Va = Vc ∗ Sf ∗ Sa

Where:

Va = speed axis;

Vc = configured speed in AMP in the field “manual feed”;

Sf = percentage value of the selector of either feed manual or softkey set value or forded by PLUS;

Sa = set value in the feed field of the function AXSELFED or AXMANFED.

stat_wrd

Page 65: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-45

NOTE:Execution of the function with wrong values can cause errors.The selection of a new axis through the buttons “↓” or “↑” cancels the set speed variation.

ESEMPIO:

Page 66: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-46 10 Series CNC WinPLUS Library - User Manual (03)

INTP_CMD: Send a command to the interpolator

Type: No Wait

LD/FBD:

ST:stat_wrd := INTP_CMD(proc_num, code_cmd);

INPUT VARIABLES: process number (int) code of the command to be enabled (int) OUTPUT VARIABLES: status word (int)

Description:

With this call you can send asynchronous commands to the interpolator.

At the moment only the function for aborting the tapping cycle is available which sets the inputvariable ”code_cmd” to 1 (other values cause the error 160). The command is only accepted duringthe actual tapping cycle (and ignored during the rapid approach to the drill point and during therapid return).

The output variable STAT_WRD can have the following values:

Value Meaning

0 OK

160 Invalid command (the CODE value is invalid)

stat_wrd

Page 67: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-47

PPRUNINFO: Part Program execution monitoring management

Type: Internal

LD/FBD:

ST:stat_wrd := PPRUNINFO (func_num, proc_num, MD_index, MW_index);

INPUT VARIABLES : function requested (int)Number of process to be monitored (int)Index of MD area to contain the information (int)Index of MW area to contain the information (int)

OUTPUT VARIABLES : status word (int)

Description:

The PPRUNINFO function makes it possible to monitor the execution of a part program, byproviding the machine logic with information on the movements performed at that moment, whethermovements contained in a part program or movements executed in a different mode (manual,MDI,...). During movements in Manual mode or in non continuous Run mode, this function onlysupplies the information regarding the movement underway; in the case of continuous run mode,the function supplies information on the movement underway (or the first movement to beperformed) and the next movement.

The system will make available the information from the time the movement enable function isactivated to the end of movement function. The information will be notified within the MW and MDvariables starting with the index notified by the function itself; 400 MW and 320 MD variables willbe used. The data will be supplied within the MW and the MD variables only upon an explicit readrequest by the logic, and hence the read request will have to be entered whenever it provesnecessary to process information of this type.

The system will start the collection of monitoring data only upon an explicit request from the logicand, similarly, will stop it based on an explicit request. The request has to be entered beforestarting a movement (Cycle); activation requests entered when the movement has started will notbe managed. Requests entered when a movement has already started (i.e., after the cycle) will beactivated at the next start.

stat_wrd

Page 68: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-48 10 Series CNC WinPLUS Library - User Manual (03)

MW mapping

The information stored in the Mw variables regards the axes moved (5 MW’s per axis) and themovements executed in each process (10 MW’s per process). The information regarding the axesis organised and accessed on the basis of the axis ID; process-related information is organised byprocess number. The following scheme applies:

initial MW MW for axis with ID 1

initial MW + 5 MW for axis with ID 2

………………

initial MW + 155 MW for axis with ID 32

initial MW + 160 MW for movement on process 1

initial MW + 170 MW for movement on process 2

……………….

initial MW + 390 MW for movement on process 24

The information notified for each axis will include the following elements:

Status Word Variable containing the following elements (as bits):bit 0 : Axis moved explicitly in the current movement. The

coordinates are given in the axis MD’sbit 1 : Axis moved in an indirect manner, i.e., moved by

virtualisations or TCP without its having been explicitlyprogrammed

bit 4 : Axis moved explicitly in the next movement. The coordinatesare given in the axis MD’s

bit 5 : Axis moved in an indirect manner, i.e., moved byvirtualisations or TCP without its having been explicitlyprogrammed in the next movement

AxID and Process Contains the axis ID and the number of the process controlling themotion of the axis. The information breaks down intoHigh byte: axis IDLow byte: controlling process

Free 3 free MW’s for future implementation

Page 69: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-49

The information notified for each process contains the following elements

Status Word Variables containing the following elements (as bits):bit 0 : Data present, regarding the current movement (this applies

to the process MD’s too)bit 4 : Data present, regarding the next movement (this applies to

the process MD’s too)bit 13 : Information that has not changed since the earlier reading; in

actual practice, the data have not been alteredbit 14 : Monitoring activity startedbit 15 : Current process

BlkNbr 1 Block number (N), if any, programmed in the current block

BlkNbr 2 Block number (N), if any, programmed in the next block

Type 1 Contains the current type of movement, and can be:1 - Linear movement2 - Circular movement3 - Threading4 - Tapping without transducer5 - Tapping with transducer6 - Probing7 - Boring9 - Probing (approaching)15 - HSM21 - Manual movement22 - Zero micro

Type 2 Contains the next type of movement, and can be:1 - Linear movement2 - Circular movement3 - Threading4 - Tapping without transducer5 - Tapping with transducer6 - Probing7 - Boring9 - Probing (approaching)

Free 5 free MW’s for future implementation

Page 70: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-50 10 Series CNC WinPLUS Library - User Manual (03)

MD mapping

The information stored in the MD variables regards the axes moved (4 MD’s per axis) and themovements executed in each process (8 MD’s per process). The information regarding the axes isorganised and accessed on the basis of the axis ID; process-related information is organised byprocess number. The following scheme applies:

initial MD MD for axis with ID 1

initial MD + 4 MD for axis with ID 2

………………

initial MW + 124 MD for axis with ID 32

initial MW + 128 MD for movement on process 1

initial MW + 136 MD for movement on process 2

……………….

initial MW + 312 MD for movement on process 24

The following elements are notified for each axis:

Final point 1 Final (absolute) position to be assumed by the axis at the end of thecurrent movement

Final point 2 Final (absolute) position to be assumed by the axis at the end of thenext movement

Free 2 free MD’s for future implementation

The following elements are notified for each process:

Feedrate 1 Feedrate programmed on the current block in unit/min

Feedrate 2 Feedrate programmed on the next block in unit/min

Radius 1 Radius of the circumference being executed on the current block. Itsdirection is defined by the sign: clockwise (G2) if the sign isnegative, counterclockwise (G3) if the sign is positive.

Radius 2 Radius of the circumference being executed on the next block. Itsdirection is defined by the sign: clockwise (G2) if the sign isnegative, counterclockwise (G3) if the sign is positive.

Free 4 free MD’s for future implementation.

Page 71: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-51

Activating the monitoring stage

To start the monitoring stage, call the PPRUNINFO function with the func_num = 1 parameter.The proc_num parameter will indicate the process to be monitored; if this parameter is set on 0, themonitoring request will apply to all the current processes. The other two parameters aremeaningless.

The STAT_WRD output variable may assume the following values:

Value Meaning

0 OK

2 Process number wrong

3 Process not present

Deactivating the monitoring stage

To end the monitoring stage, call the PPRUNINFO function with the func_num = 2 parameter. Theproc_num parameter will indicate the process to be monitored; if this parameter is set on 0, thedeactivation request will apply to all the current processes. The other two parameters aremeaningless.

The STAT_WRD output variable may assume the following values:

Value Meaning

0 OK

2 Process number wrong

3 Process not present

Data reading

To read the monitoring data (i.e., to load the MW and MD variables) call the PPRUNINFO functionwith the func_num = 3 parameter. The proc_num parameter will indicate the process whose datahave to be read; if this parameter is set on 0 the read request will be about the data of all thecurrent processes. The MW_index and MD_index parameters specify the MW and MD into whichthe data must be downloaded.

The STAT_WRD output variables may assume the following values:

Value Meaning

0 OK

2 Process number wrong

3 Process not present

4 Monitoring function not activated

6 MD index wrong, or does not make it possible to save the 320 variablesneeded for monitoring

7 MW index wrong, or does not make it possible to save the 400 variablesneeded for monitoring

Page 72: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-52 10 Series CNC WinPLUS Library - User Manual (03)

Checking monitoring activities

To determine whether or not the monitoring activity is on, call the PPRUNINFO function with thefunc_num = 4 parameter. The proc_num parameter will indicate the process whose monitoringstatus has to be checked. The other two parameters are meaningless.

The STAT_WRD output variable may assume the following values:

Value Meaning

0 Monitoring NOT activated

1 Monitoring ON

2 Process number wrong

Other functions

All the calls made to the PPRUNINFO function with a func_num parameter other than specifiedabove will generate an error message.

The STAT_WRD output variable may assume the following values:

Value Meaning

5 Function not envisaged

Page 73: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-53

XDA_COMD: Master/Slave axes management

Type: Wait

LD/FBD:

ST:stat_wrd := XDA_COMD(FuncNum, ProcNum, Mode, FollRate, Spazio, MD_index,

MW_index, MastNam, SlavNam );

INPUT VARIABLES: function 0-5 (int)Process number 1-20 (int)Following mode (int)Folowing ratio (lreal)synchronisation distance (lreal)MD index for monitoring values (int)MW index for monitoring values (int)name of master axis (int)name of slave axis (int)…..

OUTPUT VARIABLE: status word (int)

Description:

Through a series of functions associated with Function XDA_COMD it is possible to interact withthe programming of Master/Slave axes from a process (see part program command XDA).

This function has a set of parameters whose meaning and use depends on the specific functionrequested.

Page 74: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-54 10 Series CNC WinPLUS Library - User Manual (03)

Master/Slave association

This function requests the association between a master axis and (up to 8) slave axes. Thisinstruction DOES NOT activate the following function, which is activated by a specificcommand. This means that after this instruction a movement of the master does not bring about amovement of the slave(s). The command is accepted only if the process is in Idle.

Parameters needed

FuncNum 1

ProcNum Number of process for which the association is requested

Mode Defines the following method of the master by the slave and can be

0 The slave follows the master point by point

1 The slave follows the master in terms of speed

2 The slave follows the master in terms of position

3 The slave follows the master in terms of position, and thesynchronisation distance is taken up

FollRate This is the master following ratio specified for the slave(s). It must be viewed as amultiplication factor for the feedrate of the master or the distance covered by it. Ifthe value of this ratio is 1.0, the motion of the master is reproduced exactly by theslave; if it is smaller than 1.0, feedrate/distance are reduced, if it is greater than 1.0they are increased. This value can be preceded by a sign

Space This is the distance to be covered by the slave to synchronise with the motion ofthe master.

MastNam This is the name of the master axis and it is denoted with a single ASCII character

SlavNam These are the names of the slave axes (each denoted with a single ASCIIcharacter). You can program up to 8 slaves.

The master axis can identify either an axis present in the process in which the command isactivated or an axis which is not present; in the latter case, a “virtual” axis, having the namespecified, will be created; this axis will have the dynamic characteristics inherited from the slaveaxes (the lowest values of feedrate, accelerations and jerk). This axis may be part of avirtualisation (UPR, UDA,…) and also of a TCP. The master axis Homing operation cannot beperformed.

At least one slave axis must be present in the process in which the command is activated; it can bea SHARED axis, i.e. an axis shared with the machine logic environment. In this connection, theaxis may continue to be moved by the machine logic even after the association with the master,however it cannot be moved while it is following the master. It cannot be part of any virtualisation orTCP.

Page 75: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-55

Mode 0

In this mode, the slave axis follows the master proportionately to the value of the ratio (if the ratio =1, the slave reproduces the movement of the master axis exactly), synchronisation isinstantaneous and the variation in the feedrate of the slave is “in steps”. Slave position andfeedrate values are calculated, instant by instant, according to the following formulas:

Vslave = Vmaster * FollowRatePosSlave = PosSlavet0 + (PosMaster – PosMaster t0) * FollowRate

If the speed specified for the slave axis exceeds the maximum admissible value for this axis, thesystem will reduce the feedrate requested accordingly and will give out an emergency (servo error)message, in that the slave is unable to follow the required position.

Mode 1

In this mode, the slave follows the feedrate of the master proportionately to the value of the ratio (ifthe ratio = 1, the slave copies the movement of the master axis exactly); the synchronisationdepends on the dynamic characteristics of the slave axis and/or the Space parameter whichdefines the synchronisation distance.

If the distance = 0, the slave will synchronise with the master based on its maximum accelerationand using linear ramps only.

V masterV

t

V slave

Activation =Synchronisation

t 0

V masterV

t

V slave

Activation

t 0

Synchronisation

t 1

Page 76: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-56 10 Series CNC WinPLUS Library - User Manual (03)

If the value is not 0, the slave will synchronise with the master based on an acceleration calculatedas a function of the synchronisation distance and using linear ramps only. The acceleration will becalculated again with each sampling process based on the following formula :

Aslave = ((Vmaster * FollowRate)2 + Vslave 2 ) / 2 * Space

where the value of the distance is gradually reduced based on the distance covered during thesynchronisation stage. No check is made on the ensuing acceleration value, and therefore servoerrors may arise if the acceleration exceeds the maximum value that can be withstood by the axis.

Once the synchronisation with the master has taken place, the slave will move according to thisformula:

Vslave = Vmaster * FollowRate

The feedrate (Vslave) determined in this manner is “theoretical”, since it is necessary to determinewhether this request is compatible with the dynamic characteristics of the axis (maximum feedrateand maximum acceleration). The moment the feedrate of the master varies, the slave will followthis variation based on its own acceleration value. If the feedrate requested of the slave exceeds itsmaximum admissible feedrate, the system will reduce the feedrate requested accordingly. Hence,the feedrate and acceleration values with which the slave has to be moved, Vslave i and Aslave i,will be determined instant by instant. The position of the slave will therefore be calculated on thebasis of these values:

PosSlave tn+1 = PosSlave tn + Vslave i + Aslave i

V master

t

V slave

Activation

t 0

Space

Synchronisation

t 1

Page 77: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-57

Mode 2

In this mode, the slave follows the position of the master proportionately to the value of the ratio (ifthe ratio = 1 the slave reproduces exactly the movement of the master); synchronisation dependson the dynamic characteristics of the slave axis and/or the Space parameter which defines thesynchronisation distance.

If the distance is 0, the slave will synchronise with the master based on its maximum accelerationand using linear ramps only.

If the distance is not 0, the slave axis will synchronise with the master axis based on anacceleration calculated as a function of the synchronisation distance and using linear ramps only.The acceleration value will be calculated again with each sampling step according to this formula

Aslave = ((Vmaster * FollowRate)2 + Vslave 2 ) / 2 * Space

where the value of the distance is gradually reduced based on the distance covered during thesynchronisation stage. No check is made on the ensuing acceleration value and therefore servoerror messages may be generated the moment the acceleration exceeds the maximum value thatthe axis can withstand.

V masterV

t

V slave

Activation

t 0

Synchronisation

t 1

V master

t

V slave

Activation

t 0

Space

Synchronisation

t 1

Page 78: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-58 10 Series CNC WinPLUS Library - User Manual (03)

Once the synchronisation with the master axis has occurred, the slave will move according to thefollowing formulas:

PosSlave = PosSlavet1 + (PosMaster – PosMaster t1) * FollowRateVslave = Vmaster * FollowRate

The position, PosSlave, and the feedrate, Vslave, determined in this manner should be rated as“theoretical” values, since it is necessary to determine whether the values requested arecompatible with the dynamic characteristics of the axis (Maximum feedrate and maximumacceleration). The moment the feedrate of the master varies, the slave will follow this variationaccording to its own acceleration value. If the feedrate requested for the slave exceeds themaximum value admissible for this axis, the system will reduce the feedrate accordingly. To thisend, the two values with which to move the slave, Vslave i and Aslave i will be calculated instantby instant. The actual position of the slave axis will therefore be calculated on the basis of thesevalues:

PosSlave tn+1 = PosSlave tn + Vslave i + Aslave i

The difference between the actual and the theoretical position of the axis is taken up by the slaveduring its motion (even when the master has stopped moving) by moving, to the extent feasible, ata rate higher than the theoretical Vslave.

Mode 3

In this mode, the slave follows the position and feedrate of the master proportionately to the valueof the ratio (if the ratio = 1, the slave reproduces exactly the movement of the master);synchronisation depends on the dynamic characteristics of the slave.

During the entire movement of the slave (i.e. both during and after the synchronisation stage), themotion of the axis is according to the following formulas (always using linear ramps):

PosSlave = PosSlaveto + (PosMaster – PosMaster t0) * FollowRateVslave = Vmaster * FollowRate

The position (PosSlave) and the feedrate (Vslave) determined in this manner should be rated as“theoretical” values, in that it is necessary to determine whether these requests are compatible withthe dynamic characteristics of the axis (max admissible feedrate and max admissible acceleration).The moment the feedrate of the master varies, the slave follows the variation according to its own

V master

t

V slave

Activation =Synchronisation

t 0

Space lost duringacceleration stage

Space recovered aftersynchronisation withMaster

Page 79: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-59

acceleration value. If the feedrate requested of the slave is higher than its maximum admissiblefeedrate, the system reduces the feedrate requested accordingly. To this end, the two values withwhich the axis is to be moved (Vslave i and Aslave i) will be calculated instant by instant. Theactual position of the slave will therefore be calculated on the basis of these values:

PosSlave tn+1 = PosSlave tn + Vslave i + Aslave i

The difference between the actual and the theoretical position of the axis is taken up by the slaveduring its motion (even when the master has stopped moving) by moving, to the extent feasible, ata rate higher than the theoretical Vslave.

Deactivating the Master/Slave Association

This instruction removes the master/slave association. This command can be accepted only if theprocess is in Idle.

Parameters needed

FuncNum 0

Definition/Variation of Following Ratio

This instruction defines/varies the parameter determining the master axis following ratio by theslave(s) specified.

Parameters needed

FuncNum 2

FollRate This is the master following ratio specified for the slave(s). It must be viewed as amultiplication factor for the feedrate of the master or the distance covered by it. Ifthe value of this ratio is 1.0, the motion of the master is reproduced exactly by theslave; if the ratio is smaller than 1.0, it is reduced, if the ratio is greater than 1.0 it isincreased. This value can be preceded by a sign.

SlavNam These are the names of the slaves (each of them denoted with a single ASCIIcharacter). You can program up to 8 slaves.

This command can be entered either when a slave is already following the master (in this case, theslave is released from the master and a new synchronisation stage gets underway based on thenew following parameter) or when a slave is not in the following stage (then the following value tobe adopted in the next movement is activated).

Activating the Following function

The following of the master by the slave is immediately activated. The following mode is defined bymeans of the “mode” parameter contained in the master/slave association command.

Page 80: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-60 10 Series CNC WinPLUS Library - User Manual (03)

Parameters needed

FuncNum 3

SlavNam These are the names of the slave axes (each of them denoted with a single ASCIIcharacter). You can program up to 8 slaves.

This command can be entered at any time (provided that the master/slave association has alreadybeen activated). The outcome of the command will tell whether the following command has beenentered correctly and the request has been received by the axis movement function; the actualactivation of the command must be monitored by the appropriate monitoring function.

Deactivating the following function

The following of the master by the slave is deactivated immediately. The release mode is definedby means of the “mode” parameter defined in the master/slave association command.

Parameters needed

FuncNum 4

SlavNam These are the names of the slave axes (each of them denoted with a single ASCIIcharacter). You can program up to 8 slaves.

The slave remains associated with the master, but does not follow it any more. Depending on the“mode” parameter defined in the master/slave association command we will get:

0 The slave switches immediately from the current feedrate to nil feedrate.

others The slave comes to a halt according to its deceleration ramp.

The command can be entered at any time (provided that the master/slave association has alreadybeen activated). The outcome of the command will tell whether the following deactivation commandhas been entered correctly and the request has been received by the axis movement function; theactual activation of the command will have to be monitored by means of the appropriatemonitoring function.

Monitoring the following function

The MD and MW variables now contain some data needed for monitoring the axis following status.More precisely, the MD’s supply the discrepancy between the position of the slave and the positionfollowed by the master (which takes into account the following ratio); the MW’s define the status ofthe slave.

Page 81: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

10 Series CNC WinPLUS Library - User Manual (03) 1-61

Parameters needed

FuncNum 5

MD_Index MD to contain the error in the master following function by the slaves specified.

MW_Index MW to contain the status of the slaves specified.

SlavNam These are the names of the slave axes (each of them denoted with a single ASCIIcharacter). It is possible to program up to 8 slaves.

The status of the slave axes is defined in a Word consisting of bits whose meanings are:

bit 0 The slave in the master following stage; in this case the following bits are meaningfuland, if they are all 0, they indicated that the slave is stationary.

bit 1 The slave is moving in synchronisation with the master phase.

bit 2 The slave is moving in synchro with the master.

bit 3 The slave is moving but is ending the master following stage.

The STAT_WRD output variable may assume the following values:

Value Meaning

1 Function not envisaged

2 Slave number wrong

3 Mode parameter wrong

4 MD index wrong

5 MW index wrong

Others Process errors

Page 82: 10 Series CNC WinPLUS LIBRARY

Chapter 1NC Related Functions

1-62 10 Series CNC WinPLUS Library - User Manual (03)

END OF CHAPTER

Page 83: 10 Series CNC WinPLUS LIBRARY

Chapter 2

10 Series CNC WinPLUS Library - User Manual (04) 2-1

AXIS MOTION FUNCTIONS

The system function calls in this chapter communicate with the servo processor(s). The chaptercontains a set of basic function calls intended for use with all standard applications. Chapter 8contains other (more specialized) axes related functions.

ENABLE SERVOLOOP OF AN AXIS OR ENABLE ITS D/A CONVERTER...............AX_ENABDISABLE SERVOLOOP OF AN AXIS OR DISABLE ITS D/A CONVERTER.............AX_DISAENABLE/DISABLE SOFTWARE OVERTRAVEL LIMITS ...........................................SOFTOTLSET AXIS HOMED FLAG............................................................................................SETRIFRESET AXIS HOMED FLAG.......................................................................................RESRIFSET H/W OVERTRAVEL STATUS .............................................................................STTRAVELSET AXES TO TEST MODE .......................................................................................SETTESTENABLE HAND PULSE GENERATOR.......................................................................HPG_ONDISABLE HAND PULSE GENERATOR......................................................................HPG_OFFENABLE TANGENT AXIS ALGORITHM.....................................................................AXTAN_EDISABLE TANGENT AXIS ALGORITHM....................................................................AXTAN_DENABLE/DISABLE TOOL CENTER POINT FEATURE..............................................TCPACTWRITE ASSOCIATED VARIABLE TO TOOL CENTER POINT.................................TCPWRTREAD ASSOCIATED VARIABLE TO TOOL CENTER POINT ...................................TCPREADMANAGE HARDWARE OVERTRAVEL LIMITS .........................................................LIMITSWREQUEST FOR CONVERSION FROM AXIS NAME INTO AXIS IDENTIFIER .........A_TO_IDREQUEST FOR CONVERSION FROM AXIS IDENTIFIER INTO AXIS NAME .........ID_TO_A

Page 84: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-2 10 Series CNC WinPLUS Library - User Manual (04)

AX_ENAB: Enable servo loop of an axis or enable its D/A converter.

Type: No Wait

LD/FBD:

ST :stat_wrd := AX_ENAB(ax_id, res) ;

INPUT VARIABLES: axis identifier (int)resource to be enabled (int)

OUTPUT VARIABLE: function status output word (int)

Description:

Type of resource can have 3 values:

0 = Axis with feedback but without output on D/A converter (not to be used for D.S.I.)1 = Axis with feedback and output on D/A Converter2 = D.S.I. driver movement enabled (driver ON + ENABLE).

For axis connected to drive OS3: transmits drive enable command (DRIVE ON).3 = Axis with feedback and output on D\A converter maintaining the theoretical point

(work position) on the enabled command.

If the resource 0 (axis) is selected the axis position will be monitored and compared with thecommanded position only. There will be no output to the D/A converter. If the axis position exceedsthe tolerance of the stand-still following error, the control will go in an emergency state.

If resource 1 or 3 is selected, the axis will be in complete closed loop. Possible deviations from thecommanded position will be corrected by putting out an analog voltage to the axis drive.

If the resource 2 is selected, the functions becomes a WAIT.

Resource 3 can be used when the axis is disabled and enabled again with TCP active.

NOTE:It is possible to configure a delay for reading the "broken wire" (AX_PUT1 parameter 1.5).

stat_wrd

Page 85: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-3

AX_DISA: Disable servo loop of an axis or disable its D/A converter.

Type: No Wait

LD/FBD:

ST:stat_wrd := AX_DISA(ax_id, res);

Type: No Wait

INPUT VARIABLES: axis identifier (int)type of resource to be disabled (int)

OUTPUT VARIABLE: function status output word (int)

Description:

Type of resource can have 3 values:

0 = Disable complete axis1 = Disable D/A converter only (not to be used for D.S.I.)2 = For D.S.I. axis: driver disabled (driver OFF + DISABLE). For axis connected to driveOS3: transmits drive disable command (DRIVE OFF).

If 0 (axis) is selected as a resource, there will be no servo loop action at all. The axis position willnot be monitored, and there will be no output to the D/A converter.

If 1 (D/A converter) is selected, the position monitor of the servo loop will stay active and only theoutput to the D/A converter will be disabled. The servo error will be checked against the activeerror tolerance.

If the resource 2 is selected, the functions becomes a “WAIT”.

stat_wrd

Page 86: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-4 10 Series CNC WinPLUS Library - User Manual (04)

SOFTOTL: Enable /disable software overtravel limits

Type: Wait

LD/FBD:

ST:stat_wrd := SOFTOTL(ax_id, otl_state);

INPUT VARIABLES: axes identifier (int)overtravel limit status (0 = active) (int)

OUTPUT VARIABLE: function status word (int)

Description:

The variable otl_state must be specified with a short. The meaning of this variable is:

otl_state = 0 Positive and negative software overtravel limit switches active

otl_state = 1 Positive software overtravel limit switch active; negative overtravel limitswitch not active

otl_state = 2 Positive software overtravel limit switch not active; negative softwareovertravel limit switch active

otl_state = 3 Positive and negative software overtravel limit switches not active

The ax_id parameter is a short variable which contains the physical axis identifier.

NOTE:This system function call can only be used when the process is idle

stat_wrd

Page 87: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-5

SETRIF: Set axis homed flag

Type: Wait

LD/FBD:

ST:stat_wrd := SETRIF(ax_id);

INPUT VARIABLE: physical axis identifier (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function can override the need to home an axis before you can execute automatic motion withit. The axes indicated with the ax_id input variable will be treated as if it was homed normally.

See also:

RESRIF

stat_wrd

Page 88: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-6 10 Series CNC WinPLUS Library - User Manual (04)

RESRIF: Reset axis homed flag

Type: Wait

LD/FBD:

ST:stat_wrd := RESRIF(ax_id);

INPUT VARIABLE: physical axes identifier (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function forces an axes to be homed before you can execute automatic motion with it. Theaxis indicated in the ax_id variable will be treated as if it was never homed before.

stat_wrd

Page 89: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-7

STTRAVEL: Set H/W overtravel status

Type: No Wait

LD/FBD:

ST:stat_wrd := STTRAVEL(ax_id, direction, otl_state) ;

INPUT VARIABLES: physical axis identifier (int)overtravel limit direction 1=positive, 0=negative (int)state of the limit switch 0 = activated, 1 = free (int)

OUTPUT VARIABLE: function status output word (int)

Description:

Any coordinated axis can be equipped with two hardware overtravel limit switches to signal the endof stroke conditions in both directions. When an axis hits the switch, you use this function to advisethe system of this error status. The system will execute following action:

• stop the interpolation of the all axes of the process (ramped stop)

• send a message "AXIS HW OVERTRAVEL LIMIT REACHED" to the screen

The process is now in stand-by an will only allow the axis on the overtravel limit switch to bemoved in manual mode and in the opposite direction (away from the overtravel limit switch).

To enable normal operation of the axis, you have to use the same function with a 1 state in theparameter otl_state. From this moment, it will possible to execute motions again and in alloperating modes and in both directions.

Refer to Chapter 8 in the 10 Series CNC WinPLUS Application Manual.

stat_wrd

Page 90: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-8 10 Series CNC WinPLUS Library - User Manual (04)

SETTEST: Set axes to test mode

Type: Wait

LD/FBD:

* ax_id può essere duplicato

ST:stat_wrd := SETTEST(state, ax_id, …) ;

INPUT VARIABLES: Axis status (0-1) (int)identifier of 1st axis (int)....identifier of the axes (int)

OUTPUT VARIABLE: status word (int)

Description:

When an axis is put in test mode, it will not physically move. The axis is kept in closed loop at theposition it was in when the test mode was activated. In the display, the axis positions are updatedas if the axis was moving. All CNC functionality can be applied to an axis in test mode. After returnfrom test mode, all registers and flags concerning that axes are restored to the state they were inbefore the axis was put into test mode.

State = 1 activeState = 0 non-active

This function can only be activated/de-activated when the process is IDLE (S 20_00).

stat_wrd

Page 91: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-9

HPG_ON: Enable hand pulse generator (HPG)

Type: Wait

LD/FBD:

ST:stat_wrd := HPG_ON(ax_id, transducer, scale, pitch) ;

INPUT VARIABLES: identifier of axis to be driven by HPG (int)identifier of transducer channel used by HPG (int)scale factor expressed as mm or inches/revolution (lreal)pitch = number of pulses for 1 HPG revolution (lreal)

OUTPUT VARIABLE: function status output word (int)

Description:

With this function the hand pulse generator is activated and you can select the axis associated withit. The parameter axis_id must contain the physical axis identifier of the axis to be driven. Theparameter transducer is the physical identifier of the encoder input used by the hand pulsegenerator. It is a number in the range as shown in the table below.This function can only be called when the process is IDLE (S 20_00).If an axis has been homed previous to its assignment to the hand pulse generator, the softwareovertravel limits of that axis will also be valid when moving it with a hand pulse generator.The STAT_WRD variable can have the following values:

Value Meaning0 OK-1 wrong or not configured ax_id1 the handwheel's transducer and the associated axis are not on the

same board2 virtual axis or the handwheel is already active on an axis different from

the input one (axis_id)3 the handwheel transducer is already engaged by another axis4 Out of range software overtravel limits5 Maximum number of transducers6 Invalid id of OSWire transducer7 OSWire transducers exhausted (max. number exceeded)8 OSWire transducer resource could not be allocated for timeout.

stat_wrd

Page 92: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-10 10 Series CNC WinPLUS Library - User Manual (04)

NOTE FOR NON OSWIRE SYSTEMS:The axis' converter and transducer and the hand pulse generator's transducer must all reside onthe same axes board.

The transducers' identifiers are as follows:

1° board from 0x100 to 0x105

2° board from 0x106 to 0x10B

3° board from 0x10C to 0x111

4° board from 0x112 to 0x117

If the board is not a 6-axis or various different boards are present (i.e. 5.3 and 6 axes), the abovetable is valid only for present transducers.

NOTE FOR NON OSWIRE SYSTEMS:

Version 10/510 systems when integrated with OS 8510/3 board only have available transducers0x104 and 0x105.

Example:3 boards of 5.3 and 6 axis with 5.3 and 6 linked transducers respectively, are present.

The identifiers are as follows:

Transd.1 Transd.2 Trasnd.3 Transd.4 Transd.5 Transd.6

1° Board 0x100 0x101 0x102 0x103 0x104

2° Board 0x106 0x107 0x108

3° Board 0x10C 0x10D 0x10E 0x10F 0x110 0x111

NOTE FOR OSWIRE SYSTEMS:

For OSWire systems transducer identifiers are coded as 1nntHex, where ‘nn’ is the address (from0 to 3Dhex) of the device and ‘t’ is the transducer number, from 1 to 3. On drive OS3 we may have(as an option) a single incremental transducer, and on the Bridge up to 3 transducers.

Example:To identify the second transducer of a Bridge device with 1b (hexadecimal) address, write 11b2(hexadecimal).

To identify the only external transducer of a drive OS3 address 2 (hexadecimal), write 1021(hexadecimal).

Page 93: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-11

HPG_OFF: Disables hand pulse generator (HPG)

Type: Wait

LD/FBD:

ST:stat_wrd := HPG_OFF(ax_id, transducer);

INPUT VARIABLES: identifier of axis to be driven by HPG (int)identifier of transducer channel used by HPG (int)

OUTPUT VARIABLE: function status output word (int)

Description:

With this system function call you can de-activate the hand pulse generator.

The parameter axis_id is the physical axis identifier of the axis currently driven by the hand pulsegenerator HPG. The parameter transducer is the physical identifier of the encoder input used bythe Hand Pulse Generator (see HPG_ON function).

The STAT_WRD variable can have the following values:

Value Meaning

0 OK

-1 wrong or not configured ax_id

1 the handwheel's transducer and the associated axis are not on thesame board

2 virtual axis or the handwheel is already active on an axis different fromthe input one (ax_id)

6 Invalid id of OSWire transducer

8 OSWire transducer resource could not be allocated for timeout.

stat_wrd

Page 94: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-12 10 Series CNC WinPLUS Library - User Manual (04)

AXTAN_E: Enable tangent axis algorithm

Type: Wait

LD/FBD:

ST:stat_wrd := AXTAN_E(proc_num, ax_num, ax_id1, ax_id2, ax_id3, offset, sign);

INPUT VARIABLES: process number (1...20) (int)process axes number (int)logic id abscissa axis (int)logic id ordinate axis (int)logic id rollover tangent axis (int)offset with respect to trigonometric zero (lreal)trigonometric sign convention (lreal)

OUTPUT VARIABLE: status word (int)

Description:

The AXTAN_E parameter allows to keep the axis (rollover tangent axis configured as a rotaryrollover) tangent to the profile being machined. It can be enabled on one process at a time.If you request from Part Program the movement of the tangent axis while virtualization in process,the command is ignored (from part program).

stat_wrd

Page 95: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-13

To move the axis from Part Program it is necessary to deactivate virtualization (AXTAN_D).

The conditions necessary for activations are the following:

• the system must be in IDLE status

• the axes involved must be enabled

The "ax_num" parameter shows the number of axes present in the process specified in the"proc_num" parameter.

The "sign" parameter is the trigonometric sign convention: values allowed are 1 (positive sign:value included between 0° and 360° ) and -1 (negative sign: values included between 360° and 0°).

NOTE:The same feature is available from Part Program by programming the block (TCP,4).

See also:

AXTAN_D

Page 96: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-14 10 Series CNC WinPLUS Library - User Manual (04)

AXTAN_D: Disables tangent axis algorithm

Type: Wait

LD/FBD:

ST:stat_wrd := AXTAN_D(proc_num);

INPUT VARIABLE: process number (1...20) (int)OUTPUT VARIABLE: status word (int)

Description:

The AXTAN_D function disables the algorithm for the tangent axis management enabled throughthe AXTAN_E function.

See also:

AXTAN_E

stat_wrd

Page 97: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-15

TCPACT: Enable/disable the Tool Center Point feature

Type: Wait

LD/FBD:

ST:stat_wrd := TCPACT(proc_num, atype) ;

INPUT VARIABLES: process number (int)type of Tool Center Point function (int)

OUTPUT VARIABLE: status word (int)

Description:

TCPACT permits to enable/disable the Tool Center Point function. The meaning of the "type"parameter may be as follows:

type meaning

0 disables TCP

1 enables TCP in mode 1

2 enables TCP in mode 2

3 enables TCP in mode 3

4 enables TCP in mode 4

5 enables TCP in mode 5

The "proc_num" parameter must be 1. If it has any other value the status word will be 404 (illegalprocess number).

If the function is performed correctly, the "stat_wrd" variable returns to 0. If not, it will have a valueother than 0 (refer to appendix B).

stat_wrd

Page 98: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-16 10 Series CNC WinPLUS Library - User Manual (04)

TCPWRT: Write associated variables to Tool Center Point

Type: internal

LD/FBD:

ST:stat_wrd := TCPWRT(proc_num, mask, reserved, lenght, hor_pos, ver_pos, radius,

angle, edge_rad, edge_angle);

INPUT VARIABLES: process number (int)mask (int)(reserved) (lreal)tool length variation (lreal)horizontal rotary axis position (lreal)vertical rotary axis position (lreal)tool radius variation (lreal)part contact point angle variation (lreal)edge radius (lreal)edge angle variation (lreal)

OUTPUT VARIABLE: status word (int)

Description:

The TCPWRT function puts the interpolator into communication with WinPLUS: this allows to alterin real time some of the Tool Center Point variables.

This FB permits to alter the tool length, the tool radius and the angle, which are available onrecords 386, 399 and 400 of the User Table (refer to the Programming Manual). If the TCP mode isactive, the system will automatically assume as new tool length, tool radius and angle the valuesread from the User Table plus the specified alteration. If the TCP mode is not active yet, thesystem will assume the new values once TCP is enabled.

In addition, TCPWRT permits to alter the rotary axes positions used for identifying the tool directionwhen TCP is enabled in mode 5 (refer to the Programming Manual. These positions will be takeninto consideration by the system when (TCP,5) is enabled but only if the rotary axes are nothomed. You must make sure that no alterations are accepted if they are given when TCP is activeor the rotary axes are still homed.

stat_wrd

Page 99: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-17

The "proc_num" parameter must be 1: If you accept other values the function will not be executedare will return the 402 value in the "stat_wrd" output variable. If the relevant bit from the "mask"parameter is to 1, the TCPWRT writes the value associated to the input parameter. Thebit/parameter relationship is shown in the table below:

bit associated variable

0 reserved

1 length - tool length variation

2 hor_pos - horizontal rotary axis position

3 ver_ pos - vertical rotary axis position

4 radius - tool radius variation

5 angle - part contact point angle variation

6 edge radius

7 edge angle variation (α)

See also:

TCPACTTCPREAD

Page 100: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-18 10 Series CNC WinPLUS Library - User Manual (04)

TCPREAD: Read associated variables to Tool Center Point

Type: internal

LD/FBD:

ST:stat_wrd := TCPREAD(proc_num, status, lenght, hor_pos, ver_pos, radius, angle,

edge_rad, edge_angle);

INPUT VARIABLES: process number (int)OUTPUT VARIABLE: Tool Center Point status (int)

tool length variation (lreal)horizontal rotary axis position (lreal)vertical rotary axis position (lreal)tool radius variation (lreal)part contact point angle variation (lreal)edge radius (lreal)edge angle variation (lreal)status word (int)

stat_wrd

Page 101: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-19

Description:

TCPREAD puts the interpolator in communication with WinPLUS, thus allowing to read in real timecertain variables associated to the Tool Center Points.

This FB permits to read tool length, tool radius and angle variations that have been specified withthe TCPWRT function.

In addition, TCPREAD permits to read the rotary axes positions used for motion along the tooldirection (TCP with mode 5). These positions may have been automatically acquired by the system(refer to the Programming Manual and the User Manual) or input either with the TCPWRT functionor with a MANUAL SET-UP data entry.

The "proc_num" parameter must be 1. If it has any other value the function will not be executedand the 402 value will return to the "stat_word" output variable.

The "status" parameter indicates the Tool Center Point mode. Allowed values are as follows:

status TCP mode

0 not enabled

1 TCP enabled in mode 1

2 TCP enabled in mode 2

3 TCP enabled in mode 3

4 TCP enabled in mode 4

5 TCP enabled in mode 5

Page 102: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-20 10 Series CNC WinPLUS Library - User Manual (04)

LIMITSW: Manage hardware overtravel limits

Type: No wait

LD/FBD:

ST:stat_wrd := LIMITSW(ax_id, micro_pos, micro_neg, ramp_mode);

INPUT VARIABLES: Axis identifier (int)Positive Physical Input of microswitch (boolean)Negative physical input of the microswitch (boolean)Deceleration modality (boolean)

OUTPUT VARIABLES: status word (int)

Description:

The function manages the hardware limit switches of an axis.

The ramp_mode parameter value is FALSE if you want to apply the deceleration ramp when theaxis reaches the limit switch; it is TRUE if you want the axis to stop without a ramp when it reachesa limit switch (i.e., the reference value is set on zero).

The stat_wrd variable may assume the following values:

Value Meaning

0 OK

400 Axis ID out of range

402 Process number out of range

stat_wrd

Page 103: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

10 Series CNC WinPLUS Library - User Manual (04) 2-21

A_TO_ID: Request for conversion from axis name into axis identifier

Type: internal

LD/FBD:

ST:stat_wrd := A_TO_ID(proc_num, ax_name, ax_id);

INPUT VARIABLE: process number (int)axis name (nome ASCII) (int)

OUTPUT VARIABLE: axis identifier (int)

Description:

This function converts the axis name (in ASCII) belonging to a specified process into a physicalidentifier of an axis, this is necessary for the main part of the function calls.The axis name and the physical identifier are associated through the characterisation program“AMP”.In the case of a spindle axis, the association can be by means of the GTS triliteral.

If the process number is out of range (0÷20) and/or the axis name doesn’t exist, the parameter“ax_id” reaches value zero.

stat_wrd

Page 104: 10 Series CNC WinPLUS LIBRARY

Chapter 2Axis Motion Functions

2-22 10 Series CNC WinPLUS Library - User Manual (04)

ID_TO_A: Request for conversion from axis identifier into axis name (ASCII)

Type: internal

LD/FBD:

ST:

stat_wrd := ID_TO_A(ax_id, proc_num, ax_name);

INPUT VARIABLES: axis identifier (int)process number (int)

VARIABILE DI USCITA: axis name (ASCII name) (int)

Description:

This function converts the axis identifier in the axis name (ASCII) and returns the belongingprocess number. If the process number is 0 it means that the axis is under control of the machinelogic, if it -1 it means that the axis is parked.The axis name and the physical identifier are associated through the characterisation program“AMP”.

If the axis identifier is out of range (1÷32), the function will not be executed (the output parameters“proc_num” and “ax_name” will remain the same).

If ax_id is the identifier of a spindle, the proc_num parameter will always return the configurationprocess in AMP.

END OF CHAPTER

stat_wrd

Page 105: 10 Series CNC WinPLUS LIBRARY

Chapter 3

10 Series CNC WinPLUS Library - User Manual (04) 3-1

GENERAL PURPOSE FUNCTIONS

The system function calls in this chapter address the I/O processor board's hardware resources,like fast inputs and fast outputs, analog I/O, etc. Some others address the system (humaninterface) to read the system time or to display a message.

DISPLAY ERROR MESSAGE.....................................................................................WARNINGINITIALISE THE RS 232 INTERFACE ........................................................................R232_INISET TERMINATION CHARACTER FOR THE SERIAL LINE.....................................R232_TRMTRANSMIT LREAL DATA BUFFER VIA RS 232 INTERFACE...................................R232_TXDTRANSMIT INT DATA BUFFER VIA RS 232 INTERFACE……………………………R232_TXWTRANSMIT STRING VIA THE RS 232 INTERFACE ..................................................R232_TXSRECEIVE LREAL DATA BUFFER VIA THE RS 232 INTERFACE.............................R232_RXDRECEIVE INT DATA BUFFER VIA THE RS 232 INTERFACE………………….…… R232_RXWRECEIVE A STRING VIA THE RS 232 INTERFACE .................................................R232_RXSRESET RS 232 INTERFACE.......................................................................................R232_RESREAD RS 232 STATUS...............................................................................................R232_STSREAD ANALOG INPUT ...............................................................................................ANAINFORCE A FAST OUTPUT...........................................................................................FOUTREAD INPUT WORD...................................................................................................INWORDWRITE OUTPUT WORD .............................................................................................OUTWORDREQUEST PROCESS E_STOP..................................................................................RQESTOPREQUEST TO ENERGIZE THE E-STOP RELAY(S)..................................................SPEPNWRITE AN ADARING DEVICE D/A CHANNEL ..........................................................WR_ADAREADS AN ADARING DEVICE A/D CHANNEL .........................................................RD_ADADISPLAY A MESSAGE AND STORE IT IN SYSTEM HISTORY................................WARN_HISDISPLAY A SCREEN ..................................................................................................SEL_SCRDISPLAY AN USER MESSAGE..................................................................................WRI_SCRREAD THE REMOTE I/O INPUTS ..............................................................................RIO_INPWRITE THE REMOTE I/O OUTPUTS.........................................................................RIO_OUTTRANSFER OF INTERBUS INPUTS TO THE MW VARIABLES ...............................IBS_INPTRANSFER OF MW VARIABLES TO THE INTERBUS OUTPUTS…………………. IBS_OUTSEND ACKNOWLEDGE SIGNAL …………..…………………………………………... ACK_STRBDELAY FUNCTION......................................................................................................DELAYSEMAPHORE STATUS…………………………………………………………………... IFWAITWAIT ON SEMAPHORE..............................................................................................WAITWAIT A MESSAGE IN A QUEUE…………………………………………………………WAIT_MSG

Page 106: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-2 10 Series CNC WinPLUS Library - User Manual (04)

SEND TO SEMAPHORE ......................................................................................... SENDTRANSMIT MESSAGE TO A QUEUE..................................................................... SEND_MSGDECODIFY A WORD WITH SOME DATA .............................................................. DECODEDECODIFY A BIT ON A WORD .............................................................................. ENCODERDISPLAY ROTATING MESSAGES ......................................................................... MESSROTSET PARAMETERS FOR SERIAL LINES COM1 AND COM2............................... SL_SETUPOBTAIN EXCLUSIVE POSSES OF COM1 OR COM2 ........................................... SL_OPENRELEASE POSSES OF COM1 OR COM2.............................................................. SL_CLOSESTATUS OF SERIAL LINE COM1 OR COM2......................................................... SL_STATRESET TRANSMISSION STATE ON COM1 OR COM2 ........................................ SL_RESETTRANSMIT INT DATA BUFFER ON COM1 OR COM2 .......................................... SL_TXWTRANSMIT LREAL DATA BUFFER ON COM1 OR COM2..................................... SL_TXDRECEIVES STRING DATA BUFFER FROM COM1 OR COM2 ............................. SL_RXBTRANSMIT STRING DATA BUFFER ON COM1 OR COM2 .................................. SL_TXSTRANSMITS BYTE DATA BUFFER ON COM1 OR COM2 .................................... SL_TXBRECEIVE INT DATA BUFFER FROM COM1 OR COM2........................................ SL_RXWRECEIVE LREAL DATA BUFFER FROM COM1 OR COM2.................................. SL_RXDRECEIVE STRING DATA BUFFER FROM COM1 OR COM2................................ SL_RXSENABLES TEACH PENDANT ON SERIAL LINE (CPU BOARD)........................... TCPSYS_ICOPIES/TRANSFERS VARIABLES IN ADDRESS MODE..................................... MOVEDATAREAD SYSTEM DATE……………………………………………………………………..GETDATEWRITE SYSTEM DATE…………………………………………………………………… SETDATEREAD SYSTEM TIME .............................................................................................. GETTIMEWRITE SYSTEM TIME……………………………………………………………………. SETTIMEREAD/WRITE FORMATTED FILE………………………………………………………..IO_FILE

Page 107: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-3

WARNING: Display error message

Type: Wait

LD/FB:

ST:stat_wrd := WARNING(index);

INPUT VARIABLE: index in ASCII Buffer (int)OUTPUT VARIABLE: function status output word (int)

Description:

The WinPLUS error message is displayed on all the system's display pages, in the second half ofthe second CRT line (max. 40 characters) and is NOT stored in system history.

The WinPLUS message can be removed as follows:

• Manually, with the CLR MSG key;

• With the function WARN_HIS or with the function WARNING using an empty string.

System error messages are displayed in the first half of the second row.

The parameter “index” must be a value between 0 and 1499.

NOTE:The WARN_HIS has the same functionality as WARNING; furthermore, it stores the message insystem history

stat_wrd

Page 108: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-4 10 Series CNC WinPLUS Library - User Manual (04)

R232_INI: Set termination character for the serial line

Type: Internal

LD/FBD:

ST:stat_wrd := R232_INI(baud_rate, parity, stop_bit, word_len);

INPUT VARIABLES: Baud rate (50 .. 19200) (int)parity (0=none, 1=odd, 2=even) (int)stop bit (1=1 stop bit, 2=2 stop bits) (int)word length (7=7 bits, 8=8 bits) (int)

OUTPUT VARIABLE: function status output word (int)

Description:

The values returned STAT_WRD by this function can assume following values:

Value Meaning

0 Initialization, OK

10 Illegal character length

11 Illegal stop bits number

12 Illegal Parity parameter

13 Illegal baud rate

stat_wrd

Page 109: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-5

R232_TRM: Set termination characters used in message handling

Type: Internal

LD/FBD:

* L'ingresso term può essere duplicato fino a 7 volte.

ST:stat_wrd := R232_TRM(term, …);

INPUT VARIABLES: 1st terminator character (int).....last terminator character (int)

OUTPUT VARIABLE: status word (int)

Description:

If you try to duplicate the Terminator parameter more than 7 times, the system will not display anerror. Internally only 8 terminator parameters will be translated.

The values returned STAT_WRD by this function can assume following values:

Value Meaning

0 OK

5 Too many terminators (>8)

When during reception of a string a termination character is encountered, the reception is stopped(terminated). Often used termination characters are for example NULL, CR (carriage eturn), LF(line feed), EOT or ETX.

∗ Any terminator characters that were set by this function call will be cancelled by the 232_INITfunction.

stat_wrd

Page 110: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-6 10 Series CNC WinPLUS Library - User Manual (04)

R232_TXD: Transmit lreal data buffer via the RS 232 interface

Type: Internal

LD/FBD:

ST:stat_wrd := R232_TXD(len, data);

INPUT VARIABLES: data buffer length (in byte) (int)data buffer to be transmitted (lreal)

OUTPUT VARIABLE: status word (int)

Description:

The data buffer must not exceed 256 characters. A data buffer can be a PLUS memory area of theM or G type. The area is defined with the address of the first variable in the buffer, e.g. MD 100,GD 20. Remember that a lreal variable contains 8 bytes. Defining a data buffer which begins withMD 100 and a length of 40 bytes, the words in the range of MW 100 up to and including MW 104will be occupied by this buffer. Defining a data buffer which begins at GD20 with a length of 16 byteswill occupy the variables GD 20 and GD 21 only.The values returned STAT_WRD by this function can assume following values:

Value Meaning Requested action

0 OK -

2 channel occupied retry

4 communication channel not initialized initialize 232 (R232_IN)

8 buffer too long (>256) reduce len_in

If stat_wrd is not 0, the function call has not been executed. In this case you must fix the problem(see "required action" in the table) and call R232_TXD again.

NOTE:The output “data” doesn’t have to be connected to any variable.

IMPORTANT Do not use "char" type variables as the transmit data buffer.

stat_wrd

Page 111: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-7

R232_TXW: Trasmit int data buffer via RS 232 interface

Type: Internal

LD/FBD:

ST:stat_wrd := R232_TXW(len, data);

INPUT VARIABLES: lenght of the data buffer (in bytes) (int)data buffer to transmit (int)

OUTPUT VARIABLES: status word (int)

Description:

The data buffer must not excide 256 characters. The data buffer can be a memory area ofWinPLUS, either type M or G. The area is defined with the adress of the first variables of the bufferex: MW 100 GW 20. Remember that an int variable contains 2 bytes. Defining a data buffer thatstarts with MW100 and is long 50 bytes, the words from MW 100 up to MW 124 included will bepart of this buffer. The definition of a data buffer that starts at GW20 with a lenght of 16 bytes willinclude only variables GW20 and GW27.The values returned STAT_WRD by this function can assume following values:

Value Meaning Requested action

0 OK -

2 channel occupied retry

4 communication channel not initialized initialise 232 (R232_INI)

8 buffer too long (>256) reduce len_in

If stat_wrd is not 0, the function call has not been executed. In this case you must fix the problem(see "required action" in the table) and call R232_TXW again.

NOTA:

The output “data” doesn’t have to be connected to any variable.

IMPORTANT Do not use "char" type variables as the transmit data buffer.

stat_wrd

Page 112: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-8 10 Series CNC WinPLUS Library - User Manual (04)

R232_TXS: Transmit an ASCII string via the RS 232 interface

Type: Internal

LD/FBD:

ST:stat_wrd := R232_TXS(len_inp, aString, len_out);

INPUT VARIABLE: data buffer length (int)OUTPUT VARIABLE string to be transmitted (string)

length of string effectively transmitted (int)function status output word (int)

Description:

This function can be used to transmit strings from the ASCII buffer via the serial line. It is alsopossible to transmit string constants (#"). The string length must not exceed 256 characters.The string's terminator used is always the "NULL" end of string character (\0), as it is normally usedfor all WinPLUS string handling functions. If the string length is = len_inp, the string will be entirelytransmitted (len_out = string length); if the string length is > len_inp, only len_inp bytes will betransmitted (len_out = len_inp).The values returned in STAT_WRD by this function can assume following values:

Value Meaning Requested Action

0 OK -

2 channel occupied retry

4 communication channel not initialised initialise 232 (232_INT)

8 string too long (>256) reduce string length and/or len_inp

If stat_wrd is not 0, the function call has not been executed: in this case you must follow "requiredaction" and call the function 232_TXS again.

NOTE:The output “aString” must not be connected to any variable.

stat_wrd

Page 113: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-9

R232_RXD: Receive lreal data buffer via the RS-232 interface

Type: Internal

LD/FBD:

ST:stat_wrd := R232_RXD(len_inp, data, len_out) ;

INPUT VARIABLES: length of data to be received (bytes) (int)OUTPUT VARIABLES: data received (lreal)

length of the data received (bytes) (int)function status output word (int)

Description:

The length of the data buffer must not exceed 256 characters. A data buffer can be a PLUSmemory area of the M or G type. The area is defined with the address of the first variable in thebuffer, e.g. MW 100, GD 20. Remember that a lreal variable contains 8 bytes. Defining a databuffer which begins with MD100 and a length of 40 bytes, the words in the range of MD 100 up toand including MD 104 will be occupied by this buffer. Defining a data buffer which begins at GD20with a length of 16 bytes will occupy the variables GD20 and GD21 only.Characters are not written inside the data buffer until "len_inp" characters are received.

The values returned by this function in the variable STAT_WRD can assume following values:

Value Meaning Requested action

0 OK -

1 buffer empty retry

4 communication channel not initialized initialize 232 (R232_INT)

8 string too long (>256) reduce len_inp

If stat_wrd is not 0, the function has not been executed: in this case you must follow "requiredaction" and then call the function 232_RXD again.

IMPORTANT Do not use "char" type variables as the receive data buffer.

stat_wrd

Page 114: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-10 10 Series CNC WinPLUS Library - User Manual (04)

R232_RXW: Receive int data buffer via the RS 232 interface

Type: Internal

LD/FBD:

ST:stat_wrd := R232_RXW(len_inp, data, len_out) ;

INPUT VARIABLES: length of data to be received (bytes) (int)OUTPUT VARIABLES: data received (int)

length of the data received (bytes) (int)status word (int)

Description:

The length of the data buffer must not excide 256 characters. A data buffer can be a WinPLUSmemory area of the M or G type. The area is defined with the address of the first variable in thebuffer, e.g. MW 100, GD 20. Remember that a int variable contains 2 bytes. Defining a data bufferwhich begins at MW100 with a length of 50, the words from MW100 to MW124 included are part ofthis buffer.The characters are not written in the data buffer until you receive “len_inp” characters.

The values returned by this function in the variable STAT_WRD can assume following values:

Value Meaning Requested action

0 OK -

1 buffer empty retry

4 communication channel not initialized initialize 232 (R232_INI)

8 string too long (>256) reduce len_inpIf stat_wrd is not 0, the function has not been executed: in this case you must follow "requiredaction" and then call the function 232_RXW again.

IMPORTANT Do not use "char" type variables as the receive data buffer.

stat_wrd

Page 115: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-11

R232_RXS: Receive an ASCII string via the RS 232 interface

Type: Internal

LD/FBD:

ST:stat_wrd := R232_RXS(len_inp, aString, len_out) ;

INPUT VARIABLE: length of string to be received (int)OUTPUT VARIABLES: string received (string)

real length of the string received (int)function status output word (int)

Description:

Before using this function, be sure to have defined the required string terminators (232_TRM). Thelength of the string to be received must not exceed 256 characters.The values returned in STAT_WRD by this function can assume following values:

Value Meaning Requested action

0 OK -

1 buffer empty retry

4 communication channel not initialized RS232 (R232_INI)

6 terminators not defined set terminators (R232_TRM)

7 terminator not found and len_out <=len_inp retry

8 string too long ( > 256) reduce len_inp

9 terminator not found and len_out > len_inp set len_inp > len_out

If stat_wrd is not 0, the function call has not been executed. In this case you must fix the problem(see "Required action" in above table) and call R232_RXS again.

stat_wrd

Page 116: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-12 10 Series CNC WinPLUS Library - User Manual (04)

R232_RES: Reset RS 232 interface

Type: Internal

LD/FBD:

IL:stat_wrd := R232_RES(buffer);

INPUT VARIABLE: buffer with reset mask (int)OUTPUT VARIABLE: function status output word (int)

Description:

The single bits in the word parameter buffer have the following meaning:

bit 0 = 1reset TX (transmit) bufferbit 1 = 1reset RX (receive) buffer

To reset the serial interface both in reception and transmission you must set both bit 0 and bit 1 toa 1 state. After a reset, the serial interface does need to not be initialized again.

stat_wrd

Page 117: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-13

R232_STS: Read RS-232 status

Type: Internal

LD/FBD:

ST:stat_wrd := R232_STS(line_status, driver_status);

INPUT VARIABLE: noneOUTPUT VARIABLES: line status (see table below) (int)

driver status (see table below) (int)function status output word (int)

Description:

This function reads the status of the serial interface of the I/O processor board. The "Line status"parameter provides the status of the hardware component that manages the serial line givinginformation on the line's status, parity error, etc.The "Driver status" parameter provides serial line driver status; should errors occur in this word(i.e. "transmission buffer full") we suggest to check the hardware component status ("line status"parameter"). If the value of stat_wrd is equal to 0 the bits in the line status word have followingmeaning:

stat_wrd

Page 118: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-14 10 Series CNC WinPLUS Library - User Manual (04)

HARDWARE COMPONENT STATUS

Bit Meaning

0 reserved

1 reserved

2 reserved

3 0 OFF, 1 ON; Data Carrier Detect

4 reserved

5 link status "clear to send" (CTS)

6 reserved

7 reserved

8 reserved

9 reserved

10 reserved

11 reserved

12 Parity error of sent characters

13 unable to read a character from the data register beforeanother character arrives (transmission too speedycompared to reading)

14 stop bit not found (check baud rate value)

15 reserved

The driver status word bits have the following meaning when their value is 1:

SERIAL DRIVER STATUS LINE

BIT Meaning

0 transmission buffer full

1 transmission is active

2 reception buffer is empty

3 driver is initialized

The value returned in STAT_WRD by this function can always be zero.

Page 119: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-15

ANAIN: Read analog input

Type: Internal

LD/FBD:

ST:stat_wrd := ANAIN(channel, value);

INPUT VARIABLE: channel number (1..3) (int)OUTPUT VARIABLE: A/D converter output value (int)

Description:

This function reads the value of the A/D channel specified (channel parameter). A system can beequipped with up to two A/D converters, whose characteristics vary as detailed in the tables below.When a voltage input is used, the output value of the function (value parameter) ranges from -2048to +2048 and unit increment or decrement of this value is a variation reflecting the resolution of theconverter being used.When a current input is used, the output value of the function varies from 0 to 4095 with aresolution of 0.00488 mA.

If the number of the analog converter is out of range (1 - 3), the function is not executed.

Voltage inputs reference table

A/D Type A/D bit number Resolution Input voltage

1st A/D OS 8012/X

2nd A/D OS 8012/X

(rack system)

12 4.88 mV -10V to +10V

1st A/D OS 8201

(10/310 system) 8 78.12 mV -10V to +10V

2nd A/D 0S 8201

(10/310 optional

system)

12

4.88 mV

------------------------------

2.44 mV

-10V to +10V

-------------------------------

-5V to +5V

stat_wrd

Page 120: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-16 10 Series CNC WinPLUS Library - User Manual (04)

2nd A/D

3 rd A/D

(10/110 system)

124.88 mV

-----------------------------

2.44 mV

-10V to +10V

-5V to +10V

1st A/D

2nd A/D

(10/565 – 10/585systems)

124.88 mV 2.44mV

4.88 mV

-10V to +10V -5V to +5V

-10V to +10V

1 st A/D OS 8510

2nd A/D OS 8520

3rd A/D OS 8520/3

2nd A/D OS 8515

3rd A/D OS 8515

2nd A/D OS 8512

3rd A/D OS 8512

2nd A/D OS 8516

3rd A/D OS 8516

2nd A/D OS 8532

3rd A/D OS 8532

(system 10/510)

8

12

12

12

12

12

12

12

12

12

12

78.12 mV

4.88 mV 2.44 mV

4.88 mV 2.44mV

4.88 mV 2.44mV

4.88 mV 2.44mV

4.88 mV

4.88 mV

4.88 mV

4.88 mV

4.88 mV

4.88 mV

-10V to +10V

-10V to +10V -5V to +5V

-10V to +10V -5V to +5V

-10V to +10V -5V to +5V

-10V to +10V -5V to +5V

-10V to +10V

-10V to +10V

-10V to +10V

-10V to +10V

-10V to +10V

-10V to +10V

Current inputs reference table

A/D type A/D bit no. Resolution Input current

2nd A/D OS 8515

2nd A/D OS 8512

2nd A/D OS 8516

2nd A/D OS 8532

(system 10/510)

12

12

12

12

0.00488 mA 0 to +20 mA

2nd A/D OS 8365

(system 10/110)

12 0.00488 mA 0 to +20 mA

Page 121: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-17

FOUT: Force a fast output

Type: Internal

LD/FBD:

ST:stat_wrd := FOUT(out_num, out_stat);

INPUT VARIABLES: number of fast output (1..4) (int)logic state of output (0 or 1) (int)

OUTPUT VARIABLE: none

Description:

This function allows to control the 4 fast outputs on the I/O processor module. These I/O are NOTsynchronized with the I/O ring and will be immediately set or reset when this function is called.Refer to the interface design manual for the pin-out of these 4 outputs.

You can also use fast outputs in a task synchronized by fast inputs for very high speed control ofspecial machine tool equipment.

If the input parameters are out of range (fast output number 1 ÷ 4, status 0 ÷ 1), the function willnot be executed.

stat_wrd

Page 122: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-18 10 Series CNC WinPLUS Library - User Manual (04)

INWORD: Read input word

Type: Internal

LD/FBD:

ST:stat_wrd := INWORD(index, bit, num_bit, dest_var);

INPUT VARIABLES: word to start reading (int)bit to start reading (int)number of bits to read in sequence (int)

OUTPUT VARIABLE: destination variable (int)

Description: The function makes it possible to read a set of input bits from the I/O devices. Itworks in different modes depending on the value of the index parameter (read start word).

Index between 0 and 84 (reads the bits for the I/O Ring devices)

Since the map of the I/O ring input bits is non consecutive, this function has been developed whichreads a number of bits in a sequence and thereby eliminates all the holes in the bits map, goingbeyond the limits of the input word (it also reads the bits of the next word).

Applications are in the areas of reading BCD or binary numerical values from 1 to 16 bit lengthfrom the inputs (rotary switches /BCD thumb-wheel switches or digital I/O interfaces to othercontrol systems). The specified number num_bit of inputs (1-16) are read, starting with theindicated bit (bit=0 through 10) and stored in the destination word dest_var from the first bitupwards. The destination variable can be any of MW, GW, SW, TW, CW or XW.

Index between 85 and 511 (reads the bits for all the other types of I/O bus)

Reads the input bits for all the other I/O devices. In this case, the input bits map for the various I/Odevices is consecutive.

See also:OUTWORD writes a word consisting of n bits of the I/O devices

NOTE:When using digital I/O (E150....E154), you have to consider that there are only 20 inputs instead of22. The input addresses with bit number 10 do not exist, i.e. do not contain useful information.Crossing word boundaries with digital I/O will therefore cause problems. There are no problemswith High Density I/O and OSARING I/O.

stat_wrd

Page 123: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-19

OUTWORD: Write output word

Type: Internal

LD/FBD:

ST:stat_wrd := OUTWORD(index, bit, num_bit, src);

INPUT VARIABLES: word to start writing (int)bit to start writing (int)number of bits to write in sequence (int)source variable (int)

OUTPUT VARIABLE: none

Description:

This function makes it possible to write a set of output bits in the I/O devices. It works in differentmodes depending on the value of the index parameter (write start word).

Index between 0 and 84 (writes the bits for the I/O Ring devices)

Since the map of the I/O ring output bits is non consecutive, this function has been developedwhich writes a number of bits in a sequence and thereby eliminates all the holes in the bits map,going beyond the limits of the output word (it also writes the bits of the next word).

Applications are in the areas of writing BCD or binary numerical values from 1 to 16 bit length tothe outputs. The outputs are written, starting with the first bit of the source word for the specifiednumber of bits (1-16).

Index between 85 and 511 (reads the bits for all the other types of I/O bus)

Writes the output bits for all the other I/O devices. In this case, the output bits map for the variousI/O devices is consecutive.

stat_wrd

Page 124: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-20 10 Series CNC WinPLUS Library - User Manual (04)

RQESTOP: Request process E-STOP

Type: No Wait

LD/FBD:

ST:stat_wrd := RQESTOP(proc_num);

INPUT VARIABLE: process number (1..4) (int)OUTPUT VARIABLE: none

Description:

When 0 is entered for the process number, the E-stop state will be requested for all processes.This means that all local E-stop circuits and their related relays will be de-energized.

Requesting an E-stop for a process means that only the E-stop relay for that specific process willbe de-energized.

When you call this function, you will activate an internal E-stop cycle at the end of which the logictask EMERGR will be activated (task for recoverable emergencies). See chapter 6 of the WinPLUSApplication Manual for more detail.

If the "proc_num" value is out of range (0 ÷ 4), the function will not be executed.

Related functions: SPEPN request to energize E-Stop relay

stat_wrd

Page 125: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-21

SPEPN: Request to energize the E-STOP relay(s)

Type: Internal

LD/FBD:

ST:stat_wrd := SPEPN(e_stp_val);

INPUT VARIABLE: Bit pattern of E-STOP relays to energize (int)OUTPUT VARIABLE: none

Description:

Bit pattern:Bit 0 = local E-stop relay process #1Bit 1 = local E-stop relay process #2 *Bit 2 = local E-stop relay process #3 *Bit 3 = local E-stop relay process #4 *

* only in 'Multiprocess' systems

When a local E-stop relay is energized, the corresponding E-stop contact on the relay modulecloses. This contact closure is normally used to power up the drives and/or the machinemagnetics.There is one global E-stop relay, which will be energized by the system when the control is ready.In the same moment the WinPLUS logic tasks start running.The other E-stop relays which are process related can now be energized by WinPLUSWith SPEPN, WinPLUS can only energize local E_STOP relays. Calling the function with a zero bitpattern does not de-energize any relay. This functionality is similar to a Boolean S (set) instruction.The GENERAL E-Stop relay will only be de-energized by the system in case of a non recoverableerror or emergency or in case of an hardware error.

The 4 local E-Stop relays are completely under control of the WinPLUS logic and can be de-energized using the function RQESTOP.

stat_wrd

Page 126: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-22 10 Series CNC WinPLUS Library - User Manual (04)

WR_ADA: Write an ADARING device D/A channel

Type: Internal

LD/FBD:

ST:stat_wrd := WR_ADA(device, channel, value);

INPUT VARIABLES: device num (int)channel (int)value (int)

OUTPUT VARIABLE: function status output word (int)

Description:

The function allows to write a D/A channel of the ADARING device.

The device num parameter must be the same number configured through the dip_switches of anADARING device present on the I/O ring.

The channel parameter selects a D/A channel of the device and the range is 0 - 1.

The value parameter is a number that defines the D/A output voltage.

Both the D/A converters are 12 bit channels and it is possible to configure them (on board) asunipolar or bipolar: the accuracy is 2.44 mV if unipolar and 4.88 mV if bipolar.

stat_wrd

Page 127: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-23

The number-to-voltage conversion table is the following:

UNIPOLAR BIPOLAR

FFF +10V 7FF +10V

800 + 5V 0 0V

0 + 0V 800 -10V

For the bipolar output the value is in the 0 - 7FF range for positive voltage and in the 0 - 7FF rangefor negative voltage.

Operating the sign extension (bit 11), the numbers are in the normal positive and negative rangefor a SHORT.

The STAT_WRD output values can be as follows:

Value Meaning

0 command executed

11 the specified device doesn't exist

12 the specifie channel doesn't existd

Page 128: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-24 10 Series CNC WinPLUS Library - User Manual (04)

RD_ADA: Read an ADARING device A/D channel

Type: Internal

LD/FBD:

ST:stat_wrd := RD_ADA(device, channel, value);

INPUT VARIABLES: device num (int)channel (int)

OUTPUT VARIABLES: value (int)function status output word (int)

Description:

The function allows to read an A/D channel of the ADARING device.

The device-number parameter must be the same number configured through the dip-switches ofan ADARING device present on the I/O ring.

The channel parameter selects an A/D channel of the device and the range is 0 - 3.

The value parameter is a number that represents the A/D input voltage.Channel numbers 0 and 2 are connected to 10 bits A/D converters while channel numbers 1 and 3are connected to 12 bits A/D converters.

All converters are configurable (on board) as unipolar or bipolar. The accuracy is the following:

CHANNEL 12 bit 10 bit

unipolar 2.44 mV 9.76 mV

bipolar 4.88 mV 19.52 mV

stat_wrd

Page 129: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-25

A value taken indifferently from a 10 or 12 A/D channel is always in the same range. The differencebetween a channel type and the other one is given by the min. possible increment of the valueread

minimum STEP for a 12 bit channel: 1minimum STEP for a 10 bit channel: 4

The value-to-voltage conversion tables for the unipolar and bipolar channels are the following:

UNIPOLAR BIPOLAR

FFF +10V 7FF +10V

800 + 5V 0 0V

0 + 0V 800 -10V

For the bipolar inputs, the value is in the range 0 - 7FF for positive voltage and in the range FFF -800 for negative voltage.

Operating the sign-extension (bit 11), the numbers are in the normal positive and negative rangeon SHORT.

The STAT_WRD output values can be as follows:

Value Meaning

0 command executed

11 the specified device doesn't exist

12 the specifie channel doesn't existd

Page 130: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-26 10 Series CNC WinPLUS Library - User Manual (04)

WARN_HIS: Display a message and store it in system history.

Type: Wait

LD/FBD:

ST:stat_wrd := WARN_HIS(index);

INPUT VARIABLE: index in ASCII buffer (int)OUTPUT VARIABLE: status word (int)

Description:

The WinPLUS error message is displayed on all the system's display pages in the second half ofthe second display string (max. 40 characters) and it is stored in system history.

The WinPLUS message can be deleted as follows:

• Manually, with the CLRMSG key

• with the WARN_HIS function or the WARNING function using an empty string.

System error messages are displayed in the first half of the second row.

The parameter “index” must always have a value between 0 and 1499.

NOTE:The WARNING has the same functionality as WARN_HIS but it does not store the message insystem history.

stat_wrd

Page 131: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-27

SEL_SCR: Display a screen

Type: Wait

LD/FBD:

ST:stat_wrd := SEL_SCR(screen);

INPUT VARIABLE: screen n° (int)OUTPUT VARIABLE: status word (int)

Description:

Four screens are available:

1. Main screen

2. Axes position screen with big values

3. Logic screens

4. Additional screens (4 quadrants)

1. Main screen

The "main screen" is associated to the process; a main screen is available for each configuredprocess.

2. Axes position screen with big values

The axes position screen with big values is associated to a process; a screen of this type isavailable for each configured process.

stat_wrd

Page 132: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-28 10 Series CNC WinPLUS Library - User Manual (04)

3. Logic screens

Up to 9 "logic screens" are available; these screens are controlled by WinPLUS and are notassociated to the process. The 9 logic screens are divided in two groups:

• Video screens:

− Logic main screen− Logic screen 1 (complete screen)− Logic screen 2 (complete screen)− Logic screen 3 (complete screen)− Logic screen 4 (complete screen)

• Quadrant screens:

− Logic screen logquad1 (quadrant)− Logic screen logquad2 (quadrant)− Logic screen logquad3 (quadrant)− Logic screen logquad4 (quadrant)

Quadrant screens are used to create additional screens, made up of 4 quadrants (see point 4).

4. Additional 4-quadrant screens

Up to five additional screens are available. Additional screens are made up of 4 elementary screens (or quadrants) and they are defined by

the user in the AMP utility. Each elementary screen can be chosen among the following:

− system status (SYS_STAT)− axes position (AXES_POS)− part program display (PRG_DISP)− process status display (PROC_STA)− auxiliary/preparatory codes display (CODE_STA)− axes offset data (AXIS_OFF)− logic quadrant screen 1 (LOGQUAD1)− logic quadrant screen 2 (LOGQUAD2)− logic quadrant screen 3 (LOGQUAD3)− logic quadrant screen 4 (LOGQUAD4)

Page 133: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-29

The SEL_SCR function selects the requested screen ONLY if it has been inserted in the "screensequence" of the selected process that is active in that moment; the "Scr" parameter, screennumber can have the following values:

Screen Name Screen CodeProcess main screen 1Logic main screen 2Large axes position 3Logic screen 1 (full) 4Logic screen 2 (full) 5Logic screen 3 (full) 6Logic screen 4 (full) 7Additional screen 1 8Additional screen 2 9Additional screen 3 10Additional screen 4 11Additional screen 5 12

Elementary screens can be selected by using the additional screen code that contains them(8/9/10/11/12).

It is possible to associate a synoptic, generated with the appropriate editor, to each of the 9screens.

Page 134: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-30 10 Series CNC WinPLUS Library - User Manual (04)

WRI_SCR: Display a user message

Type: Wait

LD/FBD:

ST:stat_wrd := WRI_SCR(index, screen, row, col, attr, mode);

INPUT VARIABLES: string index in the ASCII buffer (0..3999) (int)addressed WinPLUS screen no. (see box) (int)window line (0..12 / 0..20 / 0..10) (int)window column (0..79 / 0..38) (int)screen attribute (see below) (int)mode (always 0) (int)

OUTPUT VARIABLE: status word (int)

Description:

This function writes a string that must be contained in the ASCII buffer, in one of the logic screenspreviously configured in AMP.The parameter index must have a value between 0 and 1499.There are 9 screens that can be configured and inside which the logic can write. It is possible tocreate a file for each of the screens, containing the screen's basic structure (semi-graphiccharacters-text). See Chapter 24, of the PLUS Language and PLUSEDIT Manual for informationon how to define the above file.

stat_wrd

Page 135: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-31

If a logic screen is present in more than one "screen sequence", that is in various processes, theWRI_SCR function will write in all configured screens associated to the "screen" parameter,independently from the active process.

The following screens are available:

Screen nameScreenCode

window sizex line col line values column values

LOGIC MAIN SCREEN 2 13 x 80 0 <= row <=12 0<= col <= 79

LOGIC SCREEN 1 (complete screen) 4 21 x 80 0 <= row <= 20 0<= col <= 79

LOGIC SCREEN 2 (complete screen) 5 21 x 80 0 <= row <= 20 0<= col <= 79

LOGIC SCREEN 3 (complete screen) 6 21 x 80 0 <= row <= 20 0<= col <= 79

LOGIC SCREEN 4 (complete screen) 7 21 x 80 0 <= row <= 20 0<= col <= 79

LOG QUAD1 (quadrant) 25 10 x 39 0 <= row <= 9 0<= col <= 38

LOG QUAD2 (quadrant) 26 10 x 39 0 <= row <= 9 0<= col <= 38

LOG QUAD3 (quadrant) 27 10 x 39 0 <= row <= 9 0<= col <= 38

LOG QUAD4 (quadrant) 28 10 x 39 0 <= row <= 9 0<= col <= 38

One of the above screen numbers must be used in the screen input parameter.The screen attribute “attr”, defines foreground and background colors and it is similar colordefinition in MS-DOS environment.

Bit scheme

background foreground

7 6 5 4 3 2 1 0↑ ↑ unused

flashing foreground

Bits 0-2 define the foreground color, that is the color of the characters the user is writing; bit 3 is notused . Bit 7 is unused to activate the foreground flashing attribute; possible foreground colors arealways high density colors.Bits 4-6 define background colors: no high density colors are available for the background.

Page 136: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-32 10 Series CNC WinPLUS Library - User Manual (04)

It is possible to choose screen colors from the following table:

Foreground and background:

Foregr. color Backgr. color Hexadecimal Bit pattern

black black 0 000

dark blue dark blue 1 001

green green 2 010

blue blue 3 011

red red 4 100

magenta magenta 5 101

yellow brown 6 110

white light grey 7 111

Example:To obtain white text on blue background, you must use 0001 0111 = KH0017 / KW 023. In order tomake the white foreground color wink, use bit scheme 1001 0111 = KH 0097 / KW 151 for thecolor.

NOTE:• You can write in a screen despite the fact it is not active/selected. In AMP it is possible to merge

elementary logic screens with elementary system screens in order to create new screen pagesthat can be activated via "NEXT DISPLAY" softkey.

• The maximum string length to be sent to a screen is 80 characters: if you reach the last columnof a window, the remaining part of the string will be truncated.

Page 137: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-33

RIO_INP: Read remote I/O inputs

Type: Internal

LD/FBD:

ST:stat_wrd := RIO_INP(start_idx);

INPUT VARIABLES: MW variables start address (int)OUTPUT VARIABLE: status word (int)

Description:

The function reads the 8 bits supplied by the Remote I/O and stores them in the MW variables inup to 8 words, starting from the "start_idx" index.The current Remote I/O version supports only the "DISCRETE I/O" communication mode. The"BLOCK TRANSFER" mode is not available.To maintain compatibility with the latter, do not use the first 8 input bits (although the system is in"DISCRETE I/O" mode).

The STAT_WRD output parameter may have the following values:

Value Meaning

0 OK

407 index out of range

stat_wrd

Page 138: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-34 10 Series CNC WinPLUS Library - User Manual (04)

RIO_OUT: Write the remote I/O outputs

Type: Internal

LD/FBD:

ST:stat_wrd := RIO_OUT(start_idx);

INPUT VARIABLE: MW variables start address (int)OUTPUT VARIABLE: status word (int)

Description:

The function writes in the Remote I/O the 8 shorts stored in the MW variables from the "start_idx"index.The current Remote I/O version supports only the "DISCRETE I/O" communication mode. The"BLOCK TRANSFER" mode is not available.To maintain compatibility with the latter, do not use the first 8 output bits (although the system is in"DISCRETE I/O" mode).

The STAT_WRD output parameter may have the following values:

Value Meaning

0 OK

407 index out of range

stat_wrd

Page 139: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-35

$IBS_INP: Transfer of physical inputs from the INTERBUS or CANOPEN,OSWIRE, PROFIBUS modules to the MW variables

Type: Internal

LD/FBD:

ST:

stat_wrd := IBS_INP(start_idx);

INPUT VARIABLES: MW variable start index (int)OUTPUT VARIABLES: status word (int)

Description:

The function copies the inputs available on the INTERBUS, CANOPEN, OSWIRE or PROFIBUSmodules into the MW variables for a fixed length of 128 words starting at the index start_idx.

The correct use of the function with the PROFIBUS, CANOPEN, OSWIRE modules depends onthe fact that the inputs are mapped in memory with an offset of 170 byte. So in the configuration filethere must be

INP_OFFS =170

(See “PLUS Application Manual)

The output parameter STAT_WRD can assume the following values:

Value Meaning

0 OK

1 index out of range

stat_wrd

Page 140: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-36 10 Series CNC WinPLUS Library - User Manual (04)

$IBS_OUT: Transfer of the MW variables to the physical outputs of the INTERBUS, CANOPEN, OSWIRE or PROFIBUS modules

Type: Internal

LD/FBD:

ST:

stat_wrd := IBS_OUT(start_idx);

INPUT VARIABLES: MW variable start index (int)OUTPUT VARIABLES: status word (int)

Description:

The function copies the MW variables for a fixed length of 128 words starting at the index start_idxonto the available outputs of the INTERBUS, CANOPEN, OSWIRE or PROFIBUS modules.

The correct use of the function with the CANOPEN, OSWIRE, PROFIBUS modules depends onthe fact that the inputs are mapped in memory with an offset of 170 bytes. So in the configurationfile there must be

OUT_OFFS =170

(See “PLUS Application Manual)

The output parameter STAT_WRD can assume the following values:

Value Meaning

0 OK

407 index out of range

stat_wrd

Page 141: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-37

ACK_STRB: Send acknowlegde signal

Type:No wait

LD/FBD:

ST:

stat_wrd := ACK_STRB(proc_num, func_num);

INPUT VARIABLES: Number of process (int)Number of function (int)

OUTPUT VARIABLES: status word (int)

Description:

The function sends an acknowledge signal to the Part Program requests either by Console or bySystem. The associated values to these requests are indicated in the following charts.

Part Program requests:

func_num Descrption

1 Consent to move

2 End of movement

3 M functions

4 Pseudo axes

5 S functions

6 T functions

7 End of Block

8 RQP

9 RQT

10 TOU

11 End probing cycle

stat_wrd

Page 142: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-38 10 Series CNC WinPLUS Library - User Manual (04)

Console requests:

func_num Description

100 Cycle start

101 Cycle stop

102 Reset

103 Hold on

104 Hold off

105 Feed Manual Override

106 Feedrate override

107 Speedrate override

108 Setmode

109 Rapid override

110 Select axes

System requests:

func_num Description

200 Emergencies

201 Softkey OEM

Page 143: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-39

DELAY: Delay function

Type: Internal

LD/FBD:

ST:stat_wrd := DELAY(deltime);

INPUT VARIABLES: delay (int)OUTPUT VARIABLES: status word (int)

Description:

This function suspends the execution of a WinPLUS routine for a certain amount of time.Once this time has passed, the execution will continue. The time must be introduced in the input“deltime” and is expressed in .01 s. It is possible to use either a whole constant or a int variable tointroduce the time in the range 1-65535.

stat_wrd

Page 144: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-40 10 Series CNC WinPLUS Library - User Manual (04)

IFWAIT: Semaphore status

Type: Internal

LD/FBD:

ST:stat_wrd := IFWAIT(id_sem);

INPUT VARIABLES: semaphore identifier (int)OUTPUT VARIABLES: status word (int)

Description:

This function is used to see if the Tasks are suspended on a semaphore. It is generally used as anintegration to the functions SEND and WAIT to resolve special synchronisation problems.

For example during the elaboration of the M functions, the background execution of a logic part canbe influenced by the fact that the preparing phase of the task is finishes and the task has beensuspended.

The input value of this FB is the semaphore identifier (id_sem) and it can have values from 0 to 31.The output variable indicates the status of the semaphore.

stat_wrd

Page 145: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-41

WAIT: Wait on semaphore

Type: Internal

LD/FBD:

ST:stat_wrd := WAIT(id_sem);

INPUT VARIABLES: semaphore identifier (int)OUTPUT VARIABLES: status word (int)

Description:

This function suspends the execution of a WinPLUS routine until an other routine starts thefunction SEND (or the instruction SEND) on the same number of semaphore. The number ofsemaphore at the input “id _sem” can be a constant in the range 0-31 or a int variable in the samerange.

A routine that is suspended using WAIT will not be executed until the command SEND will not bereceived. Once SEND is received, the execution of the routine will start again with the block thatfollows the function WAIT.

stat_wrd

Page 146: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-42 10 Series CNC WinPLUS Library - User Manual (04)

WAIT_MSG: Wait a message in a queue

Type: Internal

LD/FBD:

ST:stat_wrd := WAIT_MSG(tout_hi, tout_lo, mw_idx, md_idx, ascii_idx,

source, mw_num, md_num, ascii_num);

INPUT VARIABLES: timeout high part (int)timeout low part (int)MW variable index (int)MD index variable (int)ASCII variable index (int)

OUTPUT VARIABLES: source (int)MW variable number (int)MD variable number (int)ASCII variable number (int)status word (int)

Description:

The background task waits for a message on the queue.

Timeouts (multiples of 0.10 ms) and indexes of the variables in which the messages must bememorised must be specified in input.

The output “source” indicates which task has sent the message, whereas the outputs “mw_num”,“md_num” and “ascii_num” indicate the number of the received variables.

stat_wrd

Page 147: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-43

SEND: Send to semaphore

Type: Internal

LD/FBD:

ST:stat_wrd := SEND(id_sem);

INPUT VARIABLES: timeout high part (int)

OUTPUT VARIABLE: status word (int)

Description:

This function allows a WinPLUS routine that is waiting on the same semaphore to restart. Thenumber of the semaphore at the “id_sem” input can be a constant in the range 0-31 or a intvariable in the same range.

When you use SEND on a non-used semaphore (no task is suspended in WAIT on thissemaphore), the function SEND will be ignored.

stat_wrd

Page 148: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-44 10 Series CNC WinPLUS Library - User Manual (04)

SEND_MSG: Trasmit message to a queue

Type: Internal

LD/FBD:

ST:stat_wrd := SEND_MSG(dest_que, mw_idx, mw_num, md_idx, md_num, ascii_idx,

ascii_num);

INPUT VARIABLES: destination queue (int)MW variable index (int)MW variable number (int)MD index variable (int)MD variable numbers (int)ASCII variable index (int)ASCII variable number (int)

OUTPUT VARIABLES: status word (int)

Description:

Through this function the task transmits a message on a queue of an other task specified in“dest_que”. This input can have the following values:

dest_que Task

0x5027 Background 1

0x5029 Background 2

0x502B Background 3

0x502D Background 4

0x502F Background 5

0x5031 Background 6

0x5033 Background 7

0x5035 Background 8

stat_wrd

Page 149: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-45

0x5037 Background 9

0x5039 Background 10

0x503B Background 11

0x503D Background 12

The indexes of the variables that you want to transmit to the message must be assigned to theinputs “xxx_idx”, whereas to the inputs “xxx_num” you have to assign the number of variables thatyou want to transmit.

Page 150: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-46 10 Series CNC WinPLUS Library - User Manual (04)

DECODE: Decodify a word with some data

Type: Internal

LD/FBD:

* var_par can be copied up to 16

ST:stat_wrd := DECODE(word_dec, out_dec, val_par, …);

INPUT VARIABLES: word to decode (word)word to compare (word)

OUTPUT VARIABLES: decoded output (word)status word (int)

Description:

When the value inside the parameter val_par is the same as the value of the parameter word_dec,in the variable out_dec the relatif bit is set at one at val_par input.

The parameters word_dec and val_par are not the same, the parameter status is set at one.

stat_wrd

Page 151: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-47

ENCODER: Decodify a bit on a word

Type: Internal

LD/FBD:

* bool_in can be copied up to 16

ST:stat_wrd := ENCODER(word_out, bool_in, …);

INPUT VARIABLES: boolean input (bool)

OUTPUT VARIABLES: codified word (word)status word (int)

Description:

This function codifies in a positional way 16 input bit on a word; hence the word_out parameter willbe composed as follows:

word_out bit value0 Bool_in1… …15 Bool_in16

If the input bits are more than 16, the value of the parameter word_out will always be zero.

stat_wrd

Page 152: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-48 10 Series CNC WinPLUS Library - User Manual (04)

MESSROT: Display rotating messages

Type: Wait

LD/FBD:

ST:stat_wrd := MESSROT(tim_vis, num_msg, mw_msg, mw_onoff, idx_msg);

INPUT VARIABLES: display time (int)number of messages to dispaly (int)MW start index (int)MW start/stop msg (int)

OUTPUT VARIABLES: message index display (int)status word (int)

Description:

This function allows to display a message defined by the user. In case there should be moremessages simultaneously, they will be displayed in sequence according to the time.

The message will be displayed on the monitor of the system in the second half of the second lineon the right of the video (maximum 40 characters) and it will not be stored in the system hystory.

stat_wrd

Page 153: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-49

SL_SETUP: Set parameters for serial lines COM1 or COM2

Type: Internal

LD/FBD:

* term can be copied

ST:stat_wrd := SL_SETUP(device, baud_rate, parity, num_bit, bit_stop, protocol, modem,

timeout_tx, retry_tx, timeout_rx, retry_rx, num_term, term, …);

INPUT VARIABLES: Device (int)Baud rate (int)Parity (int)Numer of bits for each data (int)Stop bit (int)Protocol (int)Modem commands (int)Timeout on transmission (in ms) (int)Transmission retries (int)Data receive timeouts (in ms) (int)Data receive retries (int)Number of terminating characters (max 32) (int)Terminating characters (int)

OUTPUT VARIABLE: Status word (int)

Description:

In order to use the functions concerning the serial line you must install the driver through theproper configuration in AMP. This serial line IS NOT only used for the logic, but can also be usedby ASSET or Realtime DOS. It is therefore advisable to use the serial line just for the necessarytime during transmission and receive.

stat_wrd

Page 154: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-50 10 Series CNC WinPLUS Library - User Manual (04)

This function has to be executed before any other operation on the serial line.If the function is not executed correctly an error will be generated.

Device It defines the device on which you want to transmit, its value can be 1(using port COM) or 2 (port COM2)

Baud Rate It defines the data transfer rate; the accepted values are the following:

50, 75, 110, 134, 150, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800,9600, 19200, 38400, 56000.

Parity It defines the kind of parity control. The accepted values are the following :

0 (No parity), 1 (Odd parity), 2 (Even parity)

Bit number It defines the number of transmitted bits for each character and its possiblevalues are :

5, 6, 7, 8.

Protocol It enables the use of the logic transfer protocol XON/XOFF. If at 1, theprotocol is activated, if at 0 it is disabled.

Modem commands It specifies which “physical” transfer signals must be managed during thedata transfer. At each signal a value is associated, as described:

1 DTR Data Terminal Ready2 RTS Request to Send4 DSR Data Set Ready8 CTS Clear to Send

To use multiple signals it is important to write the sum of the valuesassociated to the signals in the proper field. Ex. To use CTS and RTS write10 (that is 8+2).

Transmission timeout Timeout during the data transfer; it is expressed in ms. This transfermodality is used only for the WAIT kind of receive, and it is activated if itdoesn’t manage to receive a message within the selected time. The value0 disables the timeout management.

Transmission retries Maximum number of transmission retries that will be carried out; after, atransmission error will be signalled (if there is an error during thetransmission)

Data receive timeout Timeout during the data receive; it is expressed in ms. This transfermodality is used only for the WAIT kind of receive and it is activated if itdoesn’t receive any message during the established time. The value 0disables the timeout management.

Data receive retries Maximum number of data receive retries: after, a receive error will besignalled (if there is an error during the data receive)

Number of terminatingcharacters It indicates how many terminating characters should be used during the

data receive; The value ranges from 0 to 32.

Terminating characters It indicates the characters to use as “end message” during the datareceive.If a terminating character is received, it concludes the receive of amessage and an other one can follow.

For the values of the variable “stat_wrd” see Appendix A.

Page 155: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-51

SL_OPEN: Obtain exclusive possession of serial line COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_OPEN(device);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)

OUTPUT VARIABLES: Status word (int)

Description:

With this function it is possible to obtain the exclusive possession of the specified device and so itis possible to access the different services of the driver that manages the serial line. It must beexecuted after the function SL_SETUP and before any other operation on the serial line

For the value of the variable “stat_wrd” see Appendix A.

stat_wrd

Page 156: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-52 10 Series CNC WinPLUS Library - User Manual (04)

SL_CLOSE: Release posses of the serial line COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_CLOSE(device);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)

OUTPUT VARIABLES: Status word (int)

Description:

This function releases the exclusive possession of the specified device, so other programs can useits devices.

For the value of the variable “stat_wrd” see Appendix A.

stat_wrd

Page 157: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-53

SL_STAT: Status of the serial line COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_STAT(device, trx_msg, trx_sts, trx_err, rcx_msg, rcx_sts, rcx_err);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)

OUTPUT VARIABLES: Number of messages in transmission (int)Status of transmission (int)Transmission error (int)Number of OK received messages in queue (int)Status of the receive (int)Receive error (int)Status word (int)

Description:

With this function it is possible to control the status of the serial line and the NOWAIT pendingoperations.

For the transmission/receive status the following table is valid:

0 TRX or RCX inactive1 RCX ready to receive2 TCX or RCX working3 TRX or RCX in error status (a reset is

necessary)4 TRX or RCX in hold status (XON_XOFF)

For the value of the “stat_wrd” see Appendix H.

stat_wrd

Page 158: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-54 10 Series CNC WinPLUS Library - User Manual (04)

SL_RESET: Reset the transmission status on COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_RESET(device);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)

OUTPUT VARIABLES: Status word (int)

Description:

With this function it is possible to reset the transmission and receive status. All the received andpending messages are cancelled; if a task is suspended waiting in receive or transmit status, it willbe unlocked and a signal is sent; the serial line will be reset without changing the configurationparameters.

For the value of the variable “stat_wrd” see Appendix A.

stat_wrd

Page 159: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-55

SL_TXB: Transmits byte data buffer on COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_TXB(device, mode, len, data);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)Mode (0=NOWAIT, 1=WAIT) (int)Number of bytes to be transmitted (int)Area containing bytes to be transmitted (byte, int or word)

OUTPUT VARIABLE: Status word (int)

Description:

This function is used to transmit a message containing “byte” type data via a serial line. Parameter“mode” can take two values:

• If mode = 0 (NOWAIT), the request is transmitted to the driver, which immediately returnscontrol to the logic; the latter can monitor progress status by means of function SL_STAT. Inthis mode it is possible to request different transmissions, one after the other, without having towait for the end of the previous one; the limit is the number of transmission requests pendingadmitted by the driver.

• If mode = 1 (WAIT) control is returned to the logic only when the required message has beentransmitted; transmissions pending, if any, are completed before the current request can befulfilled. In this mode, a transmission timeout may be triggered (transmission not completedwithin the time limit set at the configuration stage).

The area containing the bytes to be transmitted should be conceived as a consecutive memoryarea (array) where the bytes are loaded one after the other. Since the data transmitted are binarytype, the use of terminator characters is not advisable.

If RTS management is requested, this signal is activated during the entire transmission stage(notifies a transmission request), at the end of the transmission the signal is lowered. Beforetransmitting every single character, the system makes sure that DSR and CTS signals are present.

For the values taken on by variable “stat_wrd” see Appendix A.

stat_wrd

Page 160: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-56 10 Series CNC WinPLUS Library - User Manual (04)

SL_TXW: Transmit short data buffer on COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_TXW(device, mode, len, data);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)Mode (0=NOWAIT, 1=WAIT) (int)Number of int or word to be transmitted (int)Area containing the ints or words to be transmitted (int or word)

OUTPUT VARIABLES: Status word (int)

Description:

With this function a message containing “int” or "word" data is transmitted on the serial line.The parameter “mode” can assume two values:

• If mode = 0 (NOWAIT), the request is sent to the software driver that manages the serial line,which immediately returns back the control to the WinPLUS that can check the work inprogress of the transmission using the SL_STAT function. In this way it is possible to requestmultiple transmissions, one after the other, without waiting for the end of the previous one: thelimit is represented by the number of pending transmission request allowed by the driver.

• If mode = 1(WAIT) control is returned to the logic only after having transmitted the requestedmessage; if there are any pending transmissions, they will be executed before the currentrequest. In this transmission modality the timeouts could expire (transmission not carried outwithin the terms set during the configuration).

The area containing the ints or words data is an area of consecutive memory (array) in which intvalues are loaded one after the other. The use of terminating characters is not advised as binarydata are transmitted.

In case the management of RTS is requested, this signal will remain active during the data transfer(it signals the transmission request), and at the end of the transmission it is deactivated. Beforetransmitting every single character it will verify the presence of DTS and CTS signals.For the value of the variable “stat_wrd” see Appendix A.

stat_wrd

Page 161: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-57

SL_TXD: Transmit lreal data buffer on COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_TXD(device, mode, len, data);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)Mode (0=NOWAIT, 1=WAIT) (int)Number of “lreal” data to be transmitted (int)Area containing the “lreal” data to be transmitted (int)

OUTPUT VARIABLES: Status word (int)

Description:

With this function it is possible to transmit a message that contains “lreal” data on the serial line.The “mode” parameter can assume two values:

• If mode = 0 (NOWAIT), the request is sent to the software driver that manages the serial line,which immediately returns back the control to the WinPLUS that can check the work inprogress of the transmission using the SL_STAT function. In this way it is possible to requestmultiple transmissions, one after the other, without waiting for the end of the previous one; thelimit is represented by the number of pending transmission requests allowed by the driver.

• If mode = 1 (WAIT) control is returned to the logic only after having transmitted the requestedmessage; if there are any pending transmissions, they will be executed before the currentrequest. In this transmission modality the timeouts could expire (transmission not carried outwithin the terms set during the configuration).

The area containing the “lreal” data is an area of consecutive memory (array) in which doublevalues are loaded one after the other. The use of terminating characters is not advised as binarydata are transmitted.

In case the management of RTS is requested, this signal will remain active during the data transfer(it signals the transmission request), and at the end of the transmission it is deactivated. Beforetransmitting every single character it will verify the presence of DTS and CTS signals.For the value of the variable “stat_wrd” see Appendix A.

stat_wrd

Page 162: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-58 10 Series CNC WinPLUS Library - User Manual (04)

SL_TXS: Transmit string data buffer on COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_TXS(device, mode, len, data);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)Mode (0=NOWAIT, 1=WAIT) (int)String length (int)String to be transmitted (string)

OUTPUT VARIABLES: Status word (int)

Description:

With this function it is possible to transmit a message containing a “string” on the serial line. The“mode” parameter can assume two values:

• If mode = 0 (NOWAIT), the request is sent to the software driver that manages the serial line,which immediately returns back the control to the WinPLUS that can check the work inprogress of the transmission using the SL_STAT function. In this way it is possible to requestmultiple transmissions, one after the other, without waiting for the end of the previous one; thelimit is represented by the number of pending transmission requests allowed by the driver.

• If mode = 1 (WAIT) control is returned to the logic only after having transmitted the requestmessage; if there are any pending transmissions, they will be executed before the currentrequest. In this transmission modality the timeouts could expire (transmission not carried outwithin the terms set during the configuration).

It is up to the logic to insert any possible terminating characters in the string.

In case the management of RTS is requested, this signal will remain active during the data transfer(it signals the transmission request), and at the end of the transmission it is deactivated. Beforetransmitting every single character it will verify the presence of DTS and CTS signals.

For the value of the variable “stat_wrd” see Appendix A.

stat_wrd

Page 163: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-59

SL_RXW: Receive short data buffer from COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_RXW(device, mode, len_inp, data, len_out);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)Mode (0=NOWAIT, 1 =WAIT) (int)Maximum number of “int” data to receive (int)

OUTPUT VARIABLES: Area where “int” data is received (int or word)Number of received short values (int)Status word (int)

Description:

With this function you receive a message from the serial line that contains “int” or "word" data.The parameter “mode” can have two value:

• If mode = 0 (NOWAIT) the request will be immediately executed returning to the user all thereceived characters up to that moment, limited to the length of the receive buffer.

• If mode != 0 (WAIT) control is returned to the logic only after having received a message. Inorder to make it possible that this kind of receive doesn’t suspend the task you must requestthe receive of a message only when you are sure that a buffered message exits in the driverbuffer (see SL_STAT); if you request a receive in this situation no suspension will occur.If no terminating characters have been defined, the receive will terminate immediately,returning the received characters, or, if no characters have been received, when they arrivefrom the serial line.

The area containing the ints or words data is an area of consecutive memory (array) in which shortvalues are loaded one after the other. The use of terminating characters is not advised as binarydata are transmitted.

In case the management of CTS is requested, the presence of this signal means that RTS signalwill be activated during all the receive phase (receive signal OK). At the end of the transmission,when the CTS is deactivated, the RTS will be too. Before receiving every single character thepresence of the DSR and the CTS signals will be verified.

For the value of the variable “stat_wrd” see Appendix A.

stat_wrd

Page 164: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-60 10 Series CNC WinPLUS Library - User Manual (04)

SL_RXB: Receives byte data buffer from COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_RXB(device, mode, len_inp, data, len_out);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)Mode (0=NOWAIT, 1 =WAIT) (int)Maximum number of bytes to be received (int)

OUTPUT VARIABLES: Area where to receive the bytes (byte, int or word)Number of bytes received (int)Status word (int)

Description:

This function is used to receive a message containing “Byte” type data via a serial line. The “mode”parameter can take on two values:

• If mode = 0 (NOWAIT) the request is immediately fulfilled by transmitting to the user all thecharacters received up to that time, with the sole limit of the side of the receiving buffer.

• If mode != 0 (WAIT), return to the user takes place only upon receipt of a message. It ispossible to ensure that this type of reception will not interrupt the task: request a messagereceipt only when you know for sure that there is at least one in the driver buffer (seeSL_STAT); if a reception is requested in these conditions, no break occurs. If no terminatorshave been defined, the reception ends immediately and only the characters received so far arepassed on, or, if no characters have been received, when the latter come from the serial line.

The area where the bytes are to be received should be conceived as a memory array that will beloaded with the bytes coming in, one after the other. Since binary type data are transmitted, theuse of terminator characters is not advisable.If the management of the CTS is requested, the presence of this signal entails an RTS activatedindication throughout the receiving stage (reception OK signal): at the end of the transmission, i.e.,when the CTS is lowered, the RTS will also be lowered. Before each single character is received,the presence of DSR and CTS signals will be checked.For the values taken on by variable “stat_wrd” see appendix A.

NOTE :If the area where the bytes are received (Data parameter) is of int or word type, it has to be resetbefore calling this function. This rules out the risk of reading wrong data from the destinationvariable.

stat_wrd

Page 165: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-61

SL_RXD: Receive lreal buffer data from COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_RXD(device, mode, len_inp, data, len_out);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)Mode (0=NOWAIT, 1WAIT) (int)Maximum number of “lreal” data to be received (int)

OUTPUT VARIABLES: Area where the “lreal” data are received (int)Number of received double variable (int)Status word (int)

Description:

With this function you will receive a message from the serial line that contains some “lreal” data.The parameter “mode” can have two values:

• If mode = 0 (NOWAIT) the request will be immediately executed returning to the user all thereceived characters up to that moment, limited to the length of the receive buffer..

• If mode != 0 (WAIT), control is returned to the logic only after having received a message. Inorder to make it possible that this kind of receive doesn’t suspend the task you must requestthe receive of a message only when you are sure that a buffered message exists in the driverbuffer (see SL_STAT); if you request a receive in this situation no suspend will occur.If no terminating characters have been defined, the receive will terminate immediately,returning the received characters, or, if no characters have been received, when they arrivefrom the serial line.

The area containing the “lreal” data is an area of consecutive memory (array) in which doublevalues are loaded one after the other. The use of terminating characters is not advised as binarydata are transmitted.

In case the management of CTS is requested, the presence of this signal means that RTS signalwill be activated during all the receive phase (receive signal OK). At the end of the transmission,when the CTS is deactivated, the RTS will be too. Before receiving every single character thepresence of the DSR and CTS signals will be verified.

For the value of the variable “stat_wrd” see Appendix A.

stat_wrd

Page 166: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-62 10 Series CNC WinPLUS Library - User Manual (04)

SL_RXS: Receive string buffer data from COM1 or COM2

Type: Internal

LD/FBD:

ST:stat_wrd := SL_RXS(device, mode, len_inp, data, len_out);

INPUT VARIABLES: Device (1=COM1, 2=COM2) (int)Mode (0=NOWAIT, 1WAIT) (int)Maximum length of the string to be received (int)

OUTPUT VARIABLES Area where the string is received (string)Length of the received string (int)Status word (int)

Description:

With this function you will receive a message from the serial line that contains some “String” data.The parameter “mode” can have two values:

• If mode = 0 (NOWAIT) the request will be immediately executed returning to the user all thereceived characters up to that moment, limited to the length of the receive buffer.

• If mode != 0 (WAIT), control is returned to the logic only after having received a message. Inorder to make it possible that this kind of receive doesn’t suspend the task you must requestthe receive of a message only when you are sure that a buffered message exits in the driverbuffer (see SL_STAT); if you request a receive in this situation no suspension will occur.If no terminating characters have been defined, the receive will terminate immediately,returning the received characters, or , if no characters have been received, when they arrivefrom the serial line.

The area receiving the string data is an area of consecutive memory (array) in which stringcharacters are loaded one after the other. It is up to the logic to exclude from the message anyreceived terminating characters.

In case the management of CTS is requested, the presence of this signal means that RTS signalwill be activated during all the receive phase (receive signal OK). At the end of the transmission,when CTS is deactivated, the RTS will be too, Before receiving every single character thepresence of the DSR and CTS signals will be verified.For the value of the variable “stat_wrd” see Appendix A.

stat_wrd

Page 167: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-63

MOVEDATA: Copies/transfers variables in indexed mode

Type: WAIT

LD/FBD:

ST:stat_wrd := MOVEDATA(IndexIn, NumVar, IndexOut, DataIn, DataOut);

INPUT VARIABLE: Index to read variables from (int)Number of variables to be transferred (int)Index to which the variables have to be transferred (int)Area/Variable to be read from (byte,word,int,lreal,string)Area/Variable to be written in (byte,word,int,lreal,string)

OUTPUT VARIABLES: status word (int)

Description:

This function transfers a number of variables in indexed mode from one memory area to another.For example, to transfer 100 MW variables, from MW44 through GW10, the following call must beprogrammed:

MOVEDATA (44,100,10,MW0,GW0);

As for the Area/Variable to be read and Area/Variable to be written, it is necessary to specify thefirst variable contained in the memory area in question (MW0 for MW variables, GW0 for GWvariables, MD0 for MD variables, GD0 for GD variables, SW0 for SW variables, A0 for Avariables,…..). It is also possible to use the local/global variables of WinPlus.

WARNING

This function does not perform any check on the validity of the variablesused, and therefore there is a risk of writing outside the memory area.

stat_wrd

Page 168: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-64 10 Series CNC WinPLUS Library - User Manual (04)

TCPSYS_I: Enables Teach Pendant on serial line (CPU board)

Type: Wait

LD/FBD:

ST:stat_wrd := TCPSYS_I(proc_num, mode);

INPUT VARIABLES: Process number (1..20) (int)Mode (int)

OUTPUT VARIABLE: Status word (int)

Description:

The TCPSYS_I function makes it possible to enable the teach pendant connected to a serial linefor the process specified in the required mode.The "mode" variable is managed by bits:

Bit Mode

0 manual

1 automatic

If the bit is at logic level "1", the associated mode is enabled. If the bit is at "0", the mode isdisabled. In the same call, it is possible to enable a function by disabling another.

Example: mode=3 enables manual (bit 0=1) and automatic (bit 1=1)mode=1 disables automatic (bit 1=0)

mode=0 disables the TCP

Output parameter STAT_WRD can take on the following values:

Value Meaning

0 OK

402 Invalid process number

420 TCP not available

stat_wrd

Page 169: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-65

GETDATE: read system date

Type: WAIT

LD/FBD:

ST:stat_wrd := GETDATE (day, month, year, century );

OUTPUT VARIABLES : day (int)month (int)year (int)century (int)

Description:

This function is used to get the system date. The date is that of the internal system clock (CMOS).

Return value: 0 Function performed correctly

-1 Error

See also:

SETDATE writes the system date

stat_wrd

Page 170: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-66 10 Series CNC WinPLUS Library - User Manual (04)

SETDATE: Write system date

Type: WAIT

LD/FBD:

ST:stat_wrd := SETDATE (day, month, year, century );

INPUT VARIABLES: day (int)month (int)year (int)century (int)

Description:

This function is used to set the system date. The date is that of the internal system clock (CMOS).

Return value: 0 Function performed correctly

-1 Error

See also:

GETDATE reads the system date

stat_wrd

Page 171: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-67

GETTIME: Read system time

Type: WAIT

LD/FBD:

ST:stat_wrd := GETTIME (hour, minutes, seconds);

INPUT VARIABLES: hour (int)minutes (int)seconds (int)

Description:

This function is used to get the system time. The time is that of the internal system clock (CMOS).

Return value: 0 Function performed correctly

-1 Error

See also:

SETTIME writes the system time

stat_wrd

Page 172: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-68 10 Series CNC WinPLUS Library - User Manual (04)

SETTIME: writes system time

Type: WAIT

LD/FBD:

ST:stat_wrd := SETTIME (hour, minutes, seconds);

INPUT VARIABLES: hour (int)minutes (int)seconds (int)

Description:

This function is used to set the system time. The time is that of the internal system clock (CMOS).

Return value: 0 Function performed correctly

-1 Error

See also:

GETTIME reads the system time

stat_wrd

Page 173: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-69

IO_FILE : Reading / writing formatted files

Type: Wait

LD/FBD:

ST :stat_wrd := IO_FILE(OpType, VarIndex, NumVar, FileName, VarType, Text, Offset);

INPUT VARIABLES Type of operation (int)Variable index or offset (int)Number of variables to be written (int)File name (string)Variable type (int)Text to be written (string)Offset in bytes defined in file to be read (dint)

OUTPUT VARIABILES: File name (string)Variable type (int)Text written or read (string)Offset after reading file (dint)status word (int)

Description:

This function manages the read/write on file activities of "Predefined" WinPLUS variables(predefined variables include the GW, GD, MW, MD and A variables) and the writing of sequentialASCII files.

The file containing the predefined files is ASCII type, and therefore can be accessed by any editor.It has a header specifying type of variable (MW VARIABLES, MD VARIABLES, GW VARIABLES,GD VARIABLES, ASCII VARIABLES, MESSAGES), followed by a list of variables with the indexformat, value. Each line contains the data relating to a single variable. Comments can be added tothe file, according to the WinPLUS syntax (for example: "(* This is a comment! *)" ).

On files of this type, you can perform several operations: save, restore, request info, delete file.

The file extension must always consist of 3 characters (e.g., myfile.var).

stat_wrd

Page 174: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-70 10 Series CNC WinPLUS Library - User Manual (04)

IMPORTANT This function cannot be called from a Foreground task.

OpType parameter

This parameter specifies the type of operation that you want to perform. It may assume one of thevalues listed in the table below:

TYPE VALUE

Write 1

Read 2

Append 3

Info 4

Delete 5

VarType parameter

This parameter specifies the type of variable that you want to read/write from/in the file. It mayassume one of the values listed in the table below:

TYPE VALUE

MW 1

MD 2

GW 3

GD 4

A 5

TEXT 6

Write operation (OpType = 1)

This operation makes it possible to write variables or text in the file defined with the "FileName"parameter. The path can also be defined in the file name. For example: "E:\DIRLOG\file.txt". If nopath is specified, the system will use the default path, which is E:\LOG\WIN. If the file does notexist, it is created, otherwise, before writing, the system renames the existing file and appends the.bak extension to it.

Page 175: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

10 Series CNC WinPLUS Library - User Manual (04) 3-71

When dealing with predefined WinPLUS variables, the parameters used by the function are:

1. VarIndex (Index of the first variable to be written);

2. NumVar (Number of variables to be written, starting from VarIndex);

3. FileName (File name or complete path name);

4. VarType (Type of variable to be written).

A header is written in the first line of the file created, indices and the relative values of the variablesare written from the second line on. The format is as follows:

Index Value or string Hexadecimal value (an option, only for MW and GW)

For instance, if the writing of 4 variables (NumVar = 4) MW (VarType = 1) starting from index 10(VarIndex = 10) is requested, the file (FileName = MyFile.txt) will contain the following data:

MW VARIABLES

10 233 E9

11 10 A

12 255 FF

13 25374 631E

If you want to write text in a file, the parameters to be supplied as inputs to the function will be:

1. FileName (File name or complete path name);

2. VarType (= 6);

3. Text (Text to be written).

A header is written in the first line of the file created, the text supplied to the function through theText parameter is written in the second line. To be able to write more lines in the same file, see theAppend operation.

Read or restore operation (OpType = 2)

This operation makes it possible to restore the predefined WinPLUS variables with the valuessaved in the file, or to read text lines. The file must exist, otherwise the function returns an error.

Through the VarIndex parameter it is possible to define the variable index in which the values areto be restored:

VarIndex Restore index

0 The same as specified in the file

Page 176: 10 Series CNC WinPLUS LIBRARY

Chapter 3General Purpose Functions

3-72 10 Series CNC WinPLUS Library - User Manual (04)

>0 Determined as: (file index) + (VarIndex). The newindex must be in the correct range depending on thetype of variable to be restored.

Example:

Let us consider the example made for the MW variables in the write operation.

If VarType = 0, the values will be restored in the MW10, MW11, MW12 and MW13 variables.

If VarType = 5, the values will be restored in the MW15, MW16, MW17 and MW18 variables.

This operation makes it possible to read text files too (VarType = 6). In this case, the file is readone line at a time. The line read (max 128 byte) is supplied as an input to the function with the"Text" parameter. The offset (expressed in bytes) of the following line in the file is also provided asan output from the function, this value is supplied as input to the next function call to be able toread the next text line.

Append operation (OpType = 3)

This operation makes it possible to write a predefined variable or a text at the end of the file. Thefile must exist and be consistent with the type of variable to be written.

Info operation (OpType = 4)

This operation makes it possible to determine the types of variable contained in the file. Theinformation is as supplied as an output in the VarType parameter.

Delete operation (OpType = 5)

This operation makes it possible to delete an existing file.

stat_wrd parameter

The stat_wrd parameter may assume the following values:

Value Meaning0 OK

100 Error while opening file101 Variable type other than the one contained in the file102 Non recoverable file type103 File does not contain a valid header104 The function cannot be called from Foreground105 Incorrect type variable106 Incorrect type operation

20000+ line no. Variable index out of range (the number of the line inwhich the error occurred must be extrapolated fromthe value)

END OF CHAPTER

Page 177: 10 Series CNC WinPLUS LIBRARY

Chapter 4

10 Series CNC WinPLUS Library - User Manual (04) 4-1

POINT-TO-POINT-AXES / SPINDLE LIBRARY

The functions explained in this chapter are related to the point-to-point-interpolator which is locatedin the system but completely available to the WinPLUS logic programs This software module canhandle as many as 32 simultaneous point-to-point-interpolators. To inform the PLUS logic programabout the status of each of the interpolators, there is a table with 32 entries in the dual port memoryof the I/O processor module. Whenever you open a 'channel' to control a point-to-point axis or aspindle the corresponding function returns a so-called RTI-number. The RTI number (Real TimeInterpolator) indicates which interpolator will be used for that axis or spindle and at the same timein what entry of the table the status of the interpolator can be found. In addition, we haveintroduced the possibility to control a point-to-point axes via an RS-232 serial line. In this case theWinPLUS logic program is informed about the interpolator status by reading the status word of theSerial Auxiliary Axis.

AXIS IDENTIFIERS

Wherever the functions in this chapter require an axis identifier, you must indicate the physicalidentifier. This is the same number used in AMP for configuring this axis or is a number between101 and 132, when the axis is managed via serial line.The axes table gives a cross reference between physical identifier, owner (process) and the axisASCII name (i.e. "X"). You can use the function A_TO_ID to obtain the physical axis identifier for agiven axis name and process.Point-to-point-axes are managed in this table using the (virtual) process number 0. Also if you arerequesting or changing information regarding the point-to-point-axes, use process #0 as areference.

SHARES/RELEASES AXES BETWEEN A PROCESS AND THE LOGIC .................AXSHAREABORT A POINT-TO-POINT-INTERPOLATOR .........................................................AABORTCLOSE CHANNEL FOR POINT-TO-POINT-INTERPOLATOR..................................ACLOSEOPEN CHANNEL FOR POINT-TO-POINT-INTERPOLATOR....................................AOPENREQUEST TO RESET A POINT-TO-POINT-INTERPOLATOR .................................ARESETMOVE A POINT-TO-POINT-AXIS ...............................................................................PALMOVECLOSE RTI CHANNEL FOR SPINDLE.......................................................................SCLOSESELECT SPINDLE GEAR RANGE..............................................................................SETRANGSET G96 CONSTANT SURFACE SPEED SPINDLE CONTROL...............................SG96RPMSET SPINDLE SPEED IN RPM...................................................................................SG97RPMOPEN A CHANNEL FOR SPINDLE MANAGEMENT .................................................SOPENREQUEST SPINDLE ORIENTATION..........................................................................SORIENTREQUEST TO RESET A SPINDLE.............................................................................SRESETREAD RTI AXES MONITOR TABLE ...........................................................................RTIRES READ POINT-TO-POINT AXIS OR SPINDEL STATUS............................................. AUX_STAT READ POSITION AND FEED RATE OF AN AXIS CONTROLLED VIA SERIAL LINE . GET_POSD

Page 178: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-2 10 Series CNC PLUS Library - User Manual (04)

PLUS GETS S PARKED AXIS....................................................................................GET_AXCONNECT AN AXIS TO THE INTERPOLATOR OF THE LOGIC .............................CONN_AXDISCONNECTS AN AXIS FROM THE INTERPOLATOR OF THE LOGIC ..............SCONN_AXPARK AN AXIS BELONGING TO THE LOGIC ..........................................................PARK_AXPARK A SPINDLE .......................................................................................................PARK_SPPROCESS GETS A SPINDLE ALREADY PARKED ..................................................GET_SPCONNECT A SPINDLE TO AN INTERPOLATOR......................................................CONN_SPDISCONNECT A SPINDLE FROM THE ASSOCIATED INTERPOLATOR ...............SCONN_SP

All above functions are of the WAIT type. For some of the functions the explanation as given inpreface is not valid though. More specifically, the functions:

SG96RPM, SG97RPM, SORIENT, PALMOV, SRESET and ARESET

are WAIT functions in the sense that the interpolator returns an answer to notify the logic that thecommand was (or was not) accepted. The response does not imply that the function was reallyexecuted. To know whether or not the command was executed, you have to use the function callRTIRES on the specified interpolator channel.

The other functions:

• select gear range (SETRANG)

• open and close RTI-channels (SOPEN, AOPEN, ACLOSE, SCLOSE)

• abort a point-to-point-interpolator (AABORT)

• read axis or spindle status (AUX_STAT)

• read position and feedrate of an axis controlled via serial line (GET_POSD)

Are WAIT functions in the sense that their response in the parameter 'stat_wrd' implies that thefunction has been executed, with or without errors.

Function return value :All functions return the 0 value in the variable stat_wrd when no problems are encountered. Anyother value than 0 means that some problem arose during the function's execution. TheAppendixes C and G contain lists of the possible error codes and their messages.

Page 179: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-3

AX_SHARE: Shares/releases axes between a process and the logic

Type: WAIT

LD/FBD:

* The ax_id input can be doubled

ST:stat_wrd := AX_SHARE(proc_num, type_op, ax_id,…);

INPUT VARIABLE: Process number (1…20) (int)Type of command to be executed (int)ID of first axis (int)…ID of last axis (int)

OUTPUT VARIABLES: status word (int)

Description:

This function is used to share/release axis between a process and the machine logic, dependingon the value of the "type_op" parameter:

type_op COMMAND0 Release axes1 Share axes

Only AX_ID’s other than zero are considered: they need not be contiguous and those = 0 areignored.

Variable stat_wrd can take on the following values:

Value Meaning404 Process number out-of-range410 Invalid "type_op" parameter769 Process is non existent

other See appendix B

stat_wrd

Page 180: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-4 10 Series CNC PLUS Library - User Manual (04)

N.B.

This function can be called by the logic only when process status is IDLE.

Before releasing the axes (calling the AX_SHARE function with type_op = 0), the logic must haveconcluded the movement of the axes associated with the function ID’s.

The AX_SHARE function is not compatible with instructions/operations affecting shared axes,such as:

• Virtualisation

• Axis release through a GTA command

• UDA

• Part program execution in HSM mode (High Speed Machining)

See also:

AX_GETS Reads axis status.

Page 181: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-5

AABORT: Abort a point-to-point-interpolator

Type: Wait

LD/FBD:

ST:stat_wrd := AABORT(rti_num);

INPUT VARIABLE: RTI number (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function will abort the point-to-point axes motion linked to the indicated RTI number. Themotion, as in ARESET, is stopped in a monitored way, decelerating with the configureddeceleration rate.

stat_wrd

Page 182: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-6 10 Series CNC PLUS Library - User Manual (04)

ACLOSE: Close channel for point-to-point-interpolator

Type: Wait

LD/FBD:

ST:stat_wrd := ACLOSE(rti_num);

INPUT VARIABLE: RTI number (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function "closes" an RTI channel by disabling the axis with resource = 0. After freeing up achannel you can open it again with another axis identifier.

It is impossible to close a channel with axis in movement: first of all you must stop the movementvia ARESET function.

stat_wrd

Page 183: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-7

AOPEN: Open channel for point-to-point-interpolator

Type :Wait

LD/FBD:

ST:stat_wrd := AOPEN(ax_id);

INPUT VARIABLE: physical axis identifier (int)OUTPUT VARIABLES: RTI number of interpolator (int)

function status output word (int)

Description:

It is impossible to move a point-to-point axis if the channel has not been previously opened with theAOPEN function. The function returns the number of the interpolator assigned to that axis (RTInumber).

IMPORTANTA request for opening the point-to-point interpolator of an axis, which can alsobe that of a process, enables the axis in question (AX_ENAB enable withresource = 1).

stat_wrd

Page 184: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-8 10 Series CNC PLUS Library - User Manual (04)

ARESET: Request to reset a point-to-point-interpolator

Type: Wait

LD/FBD:

ST:stat_wrd := ARESET(rti_num);

INPUT VARIABLE: RTI number (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function, like AABORT, terminates the motion of the point-to-point-axis linked to the indicatedRTI number. The motion will be stopped in a monitored way. The axis will decelerate with theconfigured deceleration rate.

stat_wrd

Page 185: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-9

PALMOVE: Move a point-to-point-axis

Type: Wait

LD/FBD:

ST:stat_wrd := PALMOVE(mov_type, position, feed_rate, rti_num);

INPUT VARIABLES: Movement type (int)Axis position or increment value in mm (lreal)Feedrate in mm/min (lreal)RTI number (int)

OUTPUT VARIABLE: function status output word (int)

Description:

The mov_type parameter can have the following values:

1. Absolute position movement with already executed micro; it verifies micro execution otherwise itgenerates an error)

2. Incremental movement with executed MICRO (it verifies micro execution otherwise it generatesan error))

3. Finds zero micro

4. Optimised absolute position movement for Rollover axes with executed MICRO (it verifies microexecution otherwise it generates an error)

5. Absolute position movement, independent from micro (it does not verify micro execution)

stat_wrd

Page 186: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-10 10 Series CNC PLUS Library - User Manual (04)

6. Incremental movement independent from MICRO (it does not verify micro execution)

7. Absolute position movement, optimised for Rollover axes, independently from MICRO (it doesnot verify the micro execution)

8. Feed movement % variation

The feed status of a point-to-point axis can be controlled via the function AUX_STAT.

The feed_rate value input to the FB is controlled with the following values configured in AMP:

• Manual rate if mov_type = 3 (homing cycle)

• Rapid rate for all other movements

If the input value is > the AMP value, the AMP value is forced and the status bit "reached upperfeedrate limit" is set (see function RTIRES)

If the interpolator is managed via serial line, the maximum feedrate value in input to the functionblock is determined by the value set in the parameter P262 of the Serial Auxiliary Axis. In this waythe latter value is forced, if the input value of the function block is greater than the one specified inparameter P262.

NOTE:All commands are accepted with the axis both in stand-by and in motion.

IMPORTANTIf the point to be reached is altered with the axis in motion, it must beremembered that this variation must not involve any inversion of movement; ifit does, an error will be signalled.

For the axis controlled via RS-232 serial line this variation is permitted.

Page 187: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-11

SCLOSE: Close RTI channel for spindle

Type: Wait

LD/FBD:

ST:stat_wrd := SCLOSE(rti_num);

INPUT VARIABLE: RTI number (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function frees up a spindle RTI channel; after freeing it, it is possible to open it again withanother axis identifier.

It is impossible to close a spindle channel with active rotations: first you must stop the rotation viaSRESET function.

stat_wrd

Page 188: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-12 10 Series CNC PLUS Library - User Manual (04)

SETRANG: Select spindle gear range

Type: Wait

LD/FBD:

ST:stat_wrd := SETRANG(range_num, rti_num);

INPUT VARIABLES: range number (1..4) (int)RTI number (int)

OUTPUT VARIABLE: function status output word (int)

Description:

This function is used to set the parameters in the spindle driver according to the actual gear range.The system is able to store up to 4 sets of parameters for 4 different gear ranges for each spindle.

The current active range of the spindle will continuously be reported in the monitor word in the RTImonitor table word assigned to that spindle (see SOPEN function).

stat_wrd

Page 189: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-13

SG96RPM: Request G96 constant surface speed spindle control

Type: Wait

LD/FBD:

ST:stat_wrd := SG96RPM(speed, m_ax_id, max_rpm, min_rpm, rti_num);

INPUT VARIABLES: speed in configured measure unit (lreal)physical master axis identifier (diameter axis) (int)Upper spindle speed limit in RPM (lreal)Lower spindle speed limit in RPM (lreal)RTI number (int)

OUTPUT VARIABLES: function output status word (int)

Description:

When G96 is active in the part program, the programmed S-word does not contain the requiredRPM of the spindle but the required surface speed (cutting speed) of the tool. WinPLUS is allowedto read the programmed speed, to convert it (if necessary) and to pass it on to the G96RPMfunction. The spindle RPM is calculated by the system, depending on the diameter of the workpiece (lathe) or of the tool (grinder, mill).To keep the surface speed constant at variable diameter, the RPM has to be calculated based onthe position of the diametrical axis. The subroutine G96RPM accepts a surface speed fromWinPLUS and allows to assign any axis in a process as the master axes.If the speed value (speed) reaches the limit values of max_RPM or min_RPM bits 9 and 10 of thestate word readable with RTIRES are forced to 1.In case the speed value (speed) is higher than the max. value of the active range, the above max.range value is forced and bit 14 of the status word readable with RTIRES is set to 1 (higher feedrate limit reached)

NOTES:• The system does not take the spindle override percentage into account. If the override function

for the G96 constant surface speed is needed, WinPLUS must calculate the effective speed.The system checks the resulting RPM against the spindle speed limits though.

• The direction of rotation is given by the sign of the speed input parameter.

stat_wrd

Page 190: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-14 10 Series CNC PLUS Library - User Manual (04)

See also:

Related system function calls:

SG97RPM Request spindle speed in RPMSORIENT Request spindle orientationSPORIDE Set value of spindle speed override switch

System flags:

S_nSSO (SW 37) actual spindle speed override value

See also the "Spindle Control" section in the WinPLUS Application Manual.

Page 191: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-15

SG97RPM: Set spindle speed in RPM

Type: Wait

LD/FBD:

ST:stat_wrd := SG97RPM(spin_rpm, rti_num);

INPUT VARIABLES: commanded RPM (sign = direction) (lreal)RTI number (int)

OUTPUT VARIABLES: function status output word (int)

Description:

In G97 mode the programmed S-word contains the spindle speed expressed in RPM (revolutionsper minute).This system function call does not take the spindle override percentage into account. It just outputsthe RPM required by the WinPLUS program.If the override function for the G97 mode is needed, WinPLUS must calculate the effectiverevolutions per minute.For every range, there will be a natural limit in RPM, given by the maximum analog voltage outputof ±10 V. If the ranges are configured for different voltages, WinPLUS must limit the RPM. If thereis a minimum RPM for a spindle, it must be controlled by the WinPLUS application program.Rotation direction is given by the parameter's input speed.If the speed value (spin_RPM) set is higher than the active range max. value, the above rangemax. value is forced and bit 14 of the state word readable with RTIRES is set.

stat_wrd

Page 192: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-16 10 Series CNC PLUS Library - User Manual (04)

SOPEN: Open a channel for spindle management

Type: Wait

LD/FBD:

ST:stat_wrd := SOPEN(ax_id, rti_num);

INPUT VARIABLE: axis identifier (int)OUTPUT VARIABLES: RTI number of interpolator (int)

function status output word (int)

Description:

The function returns the number of the interpolator assigned to that spindle (RTI number).

stat_wrd

Page 193: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-17

SORIENT: Request spindle orientation

Type: Wait

LD/FBD:

ST:stat_wrd := SORIENT(angle, rti_num);

INPUT VARIABLES: spindle angle position ( 6.3 digits format) (lreal)spindle interpolator number (RTI number) (int)

OUTPUT VARIABLE: function status output word (int)

Description:

The spindle will be positioned by the system on the requested angle with configured speed andacceleration, while if it is in rotation it will be ramped down and halted by the system in therequested angle. The "angle" format is 6.3 digits.The status of the spindle during the orientation will continuously be reported in the RTI monitortable word at the active RTI index number (see SOPEN function).When you call this function, the RTI interpolator will take the spindle in closed loop position controluntil you activate another system function call for that spindle.

stat_wrd

Page 194: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-18 10 Series CNC PLUS Library - User Manual (04)

SRESET: Request to reset a spindle

Type: Wait

LD/FBD:

ST:stat_wrd := SRESET(rti_num);

INPUT VARIABLE: RTI number (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function stops all spindle operations on the selected RTI spindle channel. You have to reset aspindle before you can close its interpolator channel. When this function is called, with the nextspindle movement the internal value marker will be reset (spindles with transducer only).

IMPORTANTAfter execution of this function, the spindle may still be rotating. In suchcases, any further commands would be refused.

Before sending the spindle new commands, a check must be made (byFBRTIRES) to ensure that a reset has been made.

stat_wrd

Page 195: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-19

RTIRES: Read RTI axes monitor table

Type: Internal

LD/FBD:

ST:stat_wrd := RTIRES(rti_num);

INPUT VARIABLE: RTI index into monitor table (int)OUTPUT VARIABLE: destination variable in WinPLUS (int)

Description:

This function has been built into the function AUX_STAT described below.

stat_wrd

Page 196: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-20 10 Series CNC PLUS Library - User Manual (04)

AUX_STAT: Read point-to-point axis or spindle status

Type: Wait

LD/FBD:

ST:stat_wrd := AUX_STAT(rti_num, axis_sts);

INPUT VARIABLE: RTI number (int)OUTPUT VARIABLE: axis status (int)

status word (int)

Description:

This function allows you to read the status of the auxiliary axes or the spindle. The informationgiven back depends on the type of the controlled axis. If this is a standard auxiliary axis, thevariable axis_sts has to be interpreted as follows:

Bit Significance

0 Movement in execution

1 Movement request executed

2 Axis not in position

3 Axis has not been zeroed

4 Reset executed

5 Outside software stops.

6 Reserved

7 Reached upper feed rate limit

8÷15 Reserved

stat_wrd

Page 197: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-21

If the controlled axis is a spindle, the variable axis_sts has to be interpreted as follows:

Bit Significance

0 Orientation in execution

1 Orientation finished

2 Spindle not in position

3 Reserved

4 Reset executed

5 Range 1 in use

6 Range 2 in use

7 Range 3 in use

8 Range 4 in use

9 Reached upper RPM limit (SSL)

10 Reached lower RPM limit (SLL)

11 RESET running

12÷13 Reserved

14 Reached upper SPEED limit

15 Reserved

NOTE:The bits 9 and 10 have one significance if you program in G96, whereas the bit 14 is significant forG96 and G97, you cannot request rotation or change of range unless the spindle channel has beenopened with the function SOPEN:

Page 198: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-22 10 Series CNC PLUS Library - User Manual (04)

If the axis is controlled via serial line, the values of the output variable axis_sts depend on theoperation the drive is currently carrying out:

Bit n° Zero microswitch search Positioning

0 READY TO START (state machine)

1 SWITCHED ON (state machine)

2 ENABLE OPERATION (state machine)

3 FAULT (state machine)

4 VOLTAGE INHIBIT (state machine) *

5 RAPID HALT (state machine) *

6 INHIBIT START (state machine)

7 X X

8 X X

9 X X

10 reference speed reached position reached

11 zero micro done

12 reference run finished X

13 reference run error X

14 state bit see P134, M state bit 14

15 state bit see P135, M state bit 15

The bits indicated by X are reserved and have the value 0

* enabled low

If "rti_num" does not correspond to an opened channel, the output value "axis_sts" does not haveany significance.

Page 199: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-23

GET_POSD: Read position and feed rate of an axis controlled via serial lineRS-232

Type: Wait

LD/FBD:

ST:stat_wrd := GET_POSD(rti_num, position, feed);

INPUT VARIABLE: RTI number (int)OUTPUT VARIABLE: position (lreal)

feed (lreal)status word (int)

Description:

This function allows you to read the current position and the feed rate of the point-to-point axislinked to the indicated RTI number.

stat_wrd

Page 200: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-24 10 Series CNC PLUS Library - User Manual (04)

GET_AX: Plus gets a parked axis

Type: Wait

LD/FBD:

ST:stat_wrd := GET_AX(ax_id, name);

INPUT VARIABLES: axis identifier (short)axis name (short)

OUTPUT VARIABLES status word (short)

Description:

The function GET_AX acquires a parked axis assigning it the name that is specified in theparameter “axis name”.

The axis name has to be indicated with the corresponding ASCII code.

The allowed names are the same as the available name for the auxiliary axes.

The following table shows the association between the axis name and the corresponding ASCIIcode that has to be assigned to the parameter “axis name”

Cod. ASCII name Cod. ASCII name Cod. ASCII name Cod. ASCII name

A 065 O 079 d 100 r 114B 066 P 080 e 101 s 115C 067 Q 081 f 102 t 116D 068 R 082 g 103 u 117E 069 T 084 h 104 v 118F 070 U 085 i 105 w 119G 071 V 086 j 106 x 120H 072 W 087 k 107 y 121I 073 X 088 l 108 z 122J 074 Y 089 m 109K 075 Z 090 n 110L 076 a 097 o 111M 077 b 098 p 112N 078 c 099 q 113

stat_wrd

Page 201: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-25

An axis can be acquired by the logic only if it has been parked by the process (with the GTAcommand) or by the logic PARK_AX function block.

A name can be assigned to one axis identifier only.

The function returns the following values in the parameter “Stat_wrd”

0 OK

110 Out of range axis identifier (1-32)

111 Non configured axis identifier

112 Axis that is propriety of the logic

113 Process axis

114 Spindle axis

120 Internal mistake

121 Axis name not permitted

123 Axis name already present

Page 202: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-26 10 Series CNC PLUS Library - User Manual (04)

CONN_AX: Connect an axis to the interpolator of the logic

Type: Wait

LD/FBD:

ST:stat_wrd := CONN_AX(ax_id, rti_num);

INPUT VARIABLES: axis identifier (int)OUTPUT VARIABLES: RTI number (real time interpolator) (int)

status word (int)

Description:

The function CONN_AX connects the axis with the identifier “ax_id” to an available logicinterpolator.

In order to execute the function properly the following conditions must be satisfied:

− The axis must be property of the logic;

− The axis cannot be associated to a logic interpolator (after an other CONN_AX or to an auxiliaryaxis channel opening AOPEN)

If the function is executed without errors (stat_wrd=0), the connected axis will appear on the logicscreen page; so the axis name, the real time positions and the programmed positions aredisplayed. Once the axis is connected, it can be moved using the function PALMOVE andmonitored with the function AUXSTAT (as if the function AOPEN was used).If a logic axis that has been set in AMP is connected, the axis name that appears in the screen isthe one defined by AMP.If an axis that has been acquired by the logic with the function GET_AX is connected, the name ofthe axis that appears on screen is the one that has been given in input to the GET_AX function.

stat_wrd

Page 203: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-27

NOTE:The process cannot acquire (with the GTA command) an axis configured as logic axis and havinga different interpolator tick; in this case the GTA command will not be executed and an errormessage will appear on the screen.

The function returns the following values in the “Stat_wrd”:

0 OK

110 Axis identifier out of range (1-32)

111 Axis identifier non configured

117 Axis is propriety of logic

121 No Point to Point interpolators available

124 Axis identifier already present

Page 204: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-28 10 Series CNC PLUS Library - User Manual (04)

SCONN_AX: Disconnect an axis from the interpolator of the logic

Type: Wait

LD/FBD:

ST:stat_wrd := SCONN_AX(ax_id, rti_num);

INPUT VARIABLES: axis identifier (int)number of RTI (real time interpolator) (int)

OUTPUT VARIABLES: status word (int)

Description:

The function SCONN_AX disconnects the axis that has the identifier “ax_id” from the logicinterpolator to which it is associated (rti_num).In order to execute the function correctly the following conditions must be satisfied:

− The axis must be connected to a logic interpolator;

− The axis must not be moving;

If the function is executed without errors (stat_wrd=0), the connected axis will disappear from thelogic screen page; in addition to this the axis is not disabled (instead with ACLOSE the axis isdisabled.)At this point even if the axis is propriety of the logic, it cannot be moved; the logic interpolator isfree and it can be associated to an other axis.

The function returns the following values in the “Stat_wrd” parameter

0 OK

110 Axis identifier out of range (1-32)

111 Axis identifier non configured

117 axis is not property of the logic

118 axis already disconnected

stat_wrd

Page 205: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-29

PARK_AX: Park an axis belonging to the logic

Type: Wait

LD/FBD:

ST:stat_wrd := PARK_AX(ax_id);

INPUT VARIABLE: axis identifier (int)OUTPUT VARIABLE: status word (int)

Description:

The function PARK_AX parks an axis belonging to the logic.In order to execute the function properly the following conditions must be satisfied:

− the axis must belong to the logic

− the axis must not be associated to the a logic interpolator

Once the axis is parked it can be acquired by the process (with the GTA command) or by the logic(with the function GET_AX).

The function returns the following values in the parameter “Stat_wrd”

0 OK

110 Axis identifier out of range (1-32)

111 Axis identifier non configured

113 Process axis

114 Spindle axis

115 Already parked axis

116 Axis not disconnected from the interpolator

120 Internal error

stat_wrd

Page 206: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-30 10 Series CNC PLUS Library - User Manual (04)

PARK_SP: Park a spindle

Type: Wait

LD/FBD:

ST:stat_wrd := PARK_SP(ax_id);

INPUT VARIABLES: axis identifier (1..32) (int)OUTPUT VARIABLES: status word (int)

Description:

The function PARK_SP allows to park a spindle axis.In order to execute the function properly (in addition to the normal conditions – see error codes),these conditions must be satisfied:

− the axis must be associated with a process on an exclusive basis.

− the axis must not be associated to a logic interpolator

Once the axis is parked, it can be acquired by any kind of process (though the GET_SP function)that doesn’t already have a spindle.

The function bock can return the following values in the output parameter “status _word”:

0 OK (operation carried out successfully)

110 Axis identifier out of range (1.32)

111 Non configured axis axis identifier

115 Already parked axis

116 Axis used by an interpolator

120 Internal error

127 The specified axis is not a spindle

129 The specified axis is not part of a process

131 The axis is not associated with a single process; it is shared by several processes

stat_wrd

Page 207: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-31

GET_SP: Process gets a spindle already parked

Type: Wait

LD/FBD:

ST:stat_wrd := GET_SP(ax_id, proc_num);

INPUT VARIABLES: axis identifier (1..32) (int)process number (int)

OUTPUT VARIABLES: status word (int)

Description:

The GET_SP function enables a process (proc_num) to acquire on an exclusive basis a spindleaxis previously parked (with PARK_SP), assigning it the name ‘S’.

The function block can return the following values in the output parameter “status_word”

0 OK (operation carried out successfully)

110 Axis identifier out of range (1..32)

111 non configured axis identifier

112 logic axis (point to point axis)

113 axis belonging to an other process

122 the specified process has already got a spindle (axis identifier already used)

130 wrong process name

131 non available axis-axis hasn’t been parked

stat_wrd

Page 208: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-32 10 Series CNC PLUS Library - User Manual (04)

CONN_SP: Connect a spindle to an interpolator

Type: Wait

LD/FBD:

ST:stat_wrd := CONN_SP(ax_id, rti_num);

INPUT VARIABLES: axis identifier (1..32) (int)rti_num (int)

OUTPUT VARIABLES: status word (int)

Description:

The function CONN_SP connects the axis (spindle) with identifier “ax_id” and a free logicinterpolator.

In order to execute the function properly these conditions must be satisfied:

− the spindle must be property of a process;

− the spindle cannot be already associated to a logic interpolator (after an other CONN_SP or achannel opening through SOPEN);

Once the spindle is connected it can be moved using the functions SG96RPM, SG97RPM,SORIENT and monitored with the function AUXSTAT (like if the function SOPEN has been used).The function block can return the following values in the output parameter “status_word”

0 OK (operation carried out successfully)

21 axis enabling timeout

103 the specified axis is not a spindle

106 axis already assigned to an interpolator (interpolator already open)

110 axis identifier out of range (1..32)

111 non configured axis identifier

121 no more available interpolators

129 the specified axis doesn’t belong to a process

stat_wrd

Page 209: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

10 Series CNC WinPLUS Library - User Manual (04) 4-33

SCONN_SP: Disconnect a spindle from the associated interpolator

Type: Wait

LD/FBD:

ST:stat_wrd := SCONN_SP(ax_id, rti_num);

INPUT VARIABLES: Axis identifier (1..32) (int)Interpolator number (int)

OUTPUT VARIABLE: status word (int)

Description:

The function SCONN_SP disconnects “ax_id” from the logic interpolator to which it is associated.In order to execute the function properly these conditions must be satisfied:

− the axis must be connected to the specified logic interpolator (rti_num);

− the axis must be still

The axis is not disabled (not like the SCLOSE function that disables the axis too); the logicinterpolator is released so it can be associated to an other axis.

The function block can return the following values in the output parameter “status_word”

0 OK (operation carried out successfully)

9 attempt to disconnect from an interpolator when moving

104 the specified interpolator doesn’t exits (or it still hasn’t opened)

110 axis identifier out of range (1..32)

128 axis-interpolator association error

NOTE:If you try to disconnect an interpolator that isn’t disconnected, the code error 101.

stat_wrd

Page 210: 10 Series CNC WinPLUS LIBRARY

Chapter 4Point to Point Axes/Spindle Library

4-34 10 Series CNC PLUS Library - User Manual (04)

END OF CHAPTER

Page 211: 10 Series CNC WinPLUS LIBRARY

Chapter 5

10 Series CNC WinPLUS Library - User Manual (00) 5-1

OFFSET AND TOOLS HANDLING

The activation of offsets (tool offsets, part program origin shifts and G92 presets) is based on fewbasic system function calls and on tables. This chapter contains all information needed for aWinPLUS programmer to be able to activate a tool offset or to change/activate an origin shift.Because of the close relationship between offset activation and table access, the elementary tablefunctions are also covered in this chapter.

For an explanation about the table structures, please refer also to the WinPLUS ApplicationManual Chapter 3 . How a tool offset can be activated, is explained in Chapter 4 of the samemanual.

IMPORTANTIt is essential to update the axes table fields when you make a change to any ofthe active offsets. The system needs the table information for offset related partprogram instructions and human interface commands that are not interfaced by aWinPLUS logic program. Disobeying this rule could lead to unwanted motion,machine damage or injury to personnel.

UPDATE AXIS TABLE WITH NEW TOOL OFFSET ...................................................TOOLACTREQUEST ACTIVATION OF A TOOL OFFSET .........................................................ACTOFFSCOMPUTE NEW AXES OFFSET ...............................................................................COMPOFFACTIVATE NEW AXES OFFSET ................................................................................NAXOFFREAD INT VALUE FROM A TABLE............................................................................TBLGETWREAD LREAL VALUE FROM A TABLE ......................................................................TBLGETDWRITE INT VALUE TO A TABLE ................................................................................TBLPUTWWRITE LREAL VALUE TO A TABLE ..........................................................................TBLPUTDTABLE LREAL SEARCH .............................................................................................TBLSRCDTABLE INT SEARCH...................................................................................................TBLSRCWGET TOOL SLAVE IDENTIFIER .................................................................................TOOL_RD

Page 212: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

5-2 10 Series CNC WinPLUS Library - User Manual (00)

TOOLACT: Update axis table with new tool offset

Type: Internal

LD/FBD:

ST:stat_wrd := TOOLACT(ax1_id, ax2_id, cosdir1, cosdir2, offs_id, tot_offs1,

tot_offs2, tool_offs1, tool_offs2, diam, orient);

INPUT VARIABLES: identifier of 1st axis to apply offset to (int)identifier of 2nd axis to apply offset to (lathe) (int)direction cosine axis 1 (lreal)direction cosine axis 2 (lreal)tool offset table pointer (int)

OUTPUT VARIABLES: total new offset axis 1 (lreal)total new offset axis 2 (grinder/lathe) (lreal)tool length offset axis 1 (mill/grinder) (lreal)tool length offset axis 2 (grinder/lathe only) (lreal)tool tip orientation (lathe / grinder only) (lreal)tool diameter value (int)

stat_wrd

Page 213: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

10 Series CNC WinPLUS Library - User Manual (09) 5-3

Description:

It is the task of the WinPLUS programmer to apply the correct tool offsets. The tool offset numberwill be communicated to WinPLUS in the part program interface task with the command of functionT or can be found in the tool table in the field TOLOFNR. The way a tool offset is handled dependson the inputs ax1_id and ax2_id:

axn_id = 0 there will be no offset calculated for this axis1<=axn_ind<=32 an offset will be calculated for this axis

MILL/MACHINING CENTRE

When you have a standard mill application, you normally apply just one length offset in the axialtool direction, normally the spindle axis ("Z"). The above routine needs the physical axis identifierfor the spindle axis and the offset number as inputs. The input for the second axis identifier is set toa zero value. The function reads all the required data from the tool offset table, calculates theeffective offset for the axis and writes it to the axes table and returns the total offset values, theactual tool length and some other parameters in the indicated WinPLUS variables.In detail, this function executes following steps:

• For the axis indicated with ax_id1 and the offset indicated by offs_id it reads TACTL1, addsTCACTL1 multiplies the sum with cosdir1 and writes the result to the field AXTOFF in the axestable. A copy of the effective tool offset is written to the output tool_offs1. Then it corrects thetotal offset AXOFSET and copies its value to the output tot_offs1.

• Based on offs_id, it reads TDIAMETER, adds TCACDIAM and copies the result to outputdiam_val.

• It writes a 0 value to the outputs tool_offs2 and orient.

You can now use the output values of TOOLACT as input parameters for the system function callACTOFFS which will physically apply the new offsets to the axis.

LATHE/CYLINDRICAL GRINDER

When you have a standard lathe or cylindrical grinder application, you normally apply two lengthoffsets, one in the X direction and one in the Z direction. The above routine now needs the physicalaxis identifiers for the first and the second axis and the offset number as inputs. It reads all therequired data from the tool offset table, writes them to the axes table and returns the total offsetvalues, the actual length offsets and some other parameters in the indicated WinPLUS variables.

In the case of lathe and grinder, this function executes following steps:

• For the first axis ax1_id and the offset number offs_id it reads TACTL1, adds TCACTL1,multiplies the sum with cosdir1 and copies the result to AXTOFF and tool_offs1. Then itcalculates the total offset for axis ax1_id and copies its value to the output tot_offs1.

• For the second axis ax2_id and the offset number offs_id it reads TACTL2, adds TCACTL2,multiplies the sum with dir_cos2 and copies the result to AXTOFF and tool_offs2. Then itcalculates the total offset TOT_OFFS for axis ax2_id and copies its value to the outputtot_offs2.

• It copies the tool table field TORIENT to the function output variable orient.• Based on OFFS-ID it reads TDIAMETER, it adds TCACDIAM and it copies the result to output

DIAM_VAL

You can now use the output parameters of TOOLACT as input parameters for ACTOFFS which willphysically apply the new offsets to the axis.

Page 214: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

5-4 10 Series CNC WinPLUS Library - User Manual (00)

DE-ACTIVATING OFFSETS

To de-activate a tool offset, you can use TOOLACT in the same way as described above, enteringa 0 value as offs_id input. The function will automatically write 0 values to the required table fields.

Alternatively you can write (TBLPUTD) 0 values to the related AXTOFF fields and use COMPOFFto calculate the total new offset. These values can then be used in conjunction with ACTOFFS.

The activation/de-activation of the new offsets is done with a dedicated M code (in most casesM06). In AMP, this code is given the attribute of "offset activation". The WinPLUS program mustnow use the NC library function ACTOFFS to activate the elaborated offsets.

The same M code is normally used to move the physical tool from the magazine to the spindle.

The function is not executed if the "offs_id" parameter is out of range.

If the "ax1_id" parameter is out of range (1÷32), the offset for this axis is not calculated (tot_offs1=0and tool_offs1=0).

If the "ax2_id" is out of range (1÷32), the offset for this axis is not calculated (tot_offs2=0 etool_offs2=0).

See also following functions and table fields:

ACTOFFS request the activation of tool offset(s)COMPOFF compute total axis offsetPPRESUME part program execution after a tool changeTOLOFNR TOOL TABLE : pointer to tool offset table recordTACTL1 TOOL OFFSET TABLE : actual tool length 1TACTL2 TOOL OFFSET TABLE : actual tool length 2 (lathe/grinder)TDIAMETER TOOL OFFSET TABLE : actual tool diameterTCACDIAM TOOL OFFSET TABLE : actual tool tipTORIENT TOOL OFFSET TABLE : tool/wheel orientation angle (lathe /grinder)AXTOFF AXES OFFSET TABLE : actual tool offsetTOT_OFFS AXES OFFSET TABLE : actual total offset valueTCACTL1 TOOL OFFSET TABLE : actual wear length 1TCACTL2 TOOL OFFSET TABLE : actual wear length 2

Page 215: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

10 Series CNC WinPLUS Library - User Manual (09) 5-5

ACTOFFS: Request activation of a tool offset

Type: Wait

LD/FBD:

* The parameter tool_off can be copied.

ST:stat_wrd := ACTOFFS(proc_num, tool_id, offs_id, diam, orient, tool_off, …);

INPUT VARIABLE:process number (1-24) (int)tool identification code (12 figures) (lreal)tool offset identification code (0-300) (int)tool diameter (lreal)tool tip orientatin (for lathe/grinder) (int)

First structure "tool_off" (Toffs) … Last structure "tool_off" (Toffs)

OUTPUT VARIABLE: status word (int)

The type "Toffs" is a data structure composed of:

ax_id: (int) axis identifier for tool length offset

tot_offs: (lreal) total offset value for last axis

tool_offs: (lreal) tool length offset value

stat_wrd

Page 216: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

5-6 10 Series CNC WinPLUS Library - User Manual (00)

Description:

The information can be given to another WinPLUS routine to physically search and change thetool. The M06 code (or any other M code) can be used to activate the offsets related to the newtool. The selected M code for tool offset activation is given the tool activation attribute in AMP.When the NC reads the M06 code, it goes into a halt state (stop of block precalculation) in whichnew offsets can be applied.Follow this step by step procedure when you want to change a tool and activate a new offset:

1. Decide in the logic, which offset(s) must be used for the selected tool.

2. Read the offset values from the offset table and write them to the axis table in the appropriateaxis fields for tool length, tool diameter.

3. Update the axis table total offset fields (add tool offset, G92 offset and origin offset).

4. Read the values for total offset from the axis table, and use this and all other offset values asinput parameters for the function ACTOFFS.

5. After the function ACTOFFS returns a 0 value, call the function PPRESUME to resume theexecution of the part program with the new offsets active.

For standard applications (Mill, Lathe), the steps 2, 3 and 4 can be executed in one single functioncall TOOLACT.

EXAMPLE:

See also:

TOOLACT used to prepare the parameters for ACTOFFS

PPRESUME continue part program execution after a tool change

AXTOFF current tool offset field in the axis table

AXOFSET current total offset field in the axis table

TACTL1 value of first tool length offset

TACTL2 value of second tool length offset

S_nTLOID1 (SW 33) first axis ID for tool length offset

S_nTLOID2 (SW 34) second axis ID for tool length offset

Page 217: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

10 Series CNC WinPLUS Library - User Manual (09) 5-7

COMPOFF: Compute new axes offset

Type: Internal

LD/FBD:

ST:stat_wrd := COMPOFF(ax_id, offset);

INPUT VARIABLE: axis identifier (short)OUTPUT VARIABLE: new total offset value for the indicated axis (lreal)

Description:

This function can be used to calculate the total offset of an axis. The total offset is the sum of:

− active origin offset (AXORIG)

− active G92 offset (AXOFG92)

− active tool length offset (AXTOFF)

The new total offset will automatically be written to the axis offset table in the dual port memory(field TOT_OFFS) and will also be available in the indicated double variable.To activate the total new offset, you can use the function ACTOFFS. Normally ACTOFFS is used inconjunction with a dedicated M code ('activates offset' attribute). This M code (which WinPLUS hasto acknowledge) stops the part program execution. The part program execution will be continued(with the new offsets) when WinPLUS calls the system function PPRESUME.

If the "ax_id" parameter is out of range (1÷32), the function will not be executed.

See also:

ACTOFFS request activation of a tool offset

PPRESUME continue part program execution after a tool change

TOOLACT update axes table with a tool offset

stat_wrd

Page 218: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

5-8 10 Series CNC WinPLUS Library - User Manual (00)

NAXOFF: Activate new axes offset

Type : Wait

LD/FBD:

The parameter axoff can be copied.

ST:stat_wrd := NAXOFF(proc_num, axoff, …);

INPUT VARIABLES: process number (1..20) (int)first structure “axoff” (Axoff)….last structure “axoff” (Axoff)

OUTPUT VARIABLE: status word (int)

The type "Axoff" is a structured data composed of:

ax_id: (int) axis identifier for axis offset

tot_offs: (lreal) total offset value for axis

Description:

This system function call informs the process about the new total offset values for the indicated axes. It issimilar to ACTOFFS but specially defined to activate origins or G92 work position register presets. Thisroutine waits for the system to return the function status output word. When the status word contains azero value, the logic may request the continuation of the part program (PPRESUME)

EXAMPLE:

stat_wrd

Page 219: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

10 Series CNC WinPLUS Library - User Manual (09) 5-9

TBLGETW: Read int value from a table

Type: Internal

LD/FBD:

ST:stat_wrd := TBLGETW(n_tab, n_rec, n_field, value);

INPUT VARIABLES: number of table (int)page number (index) (int)field number in table (int)

OUTPUT VARIABLES: destination Variable (int)function status output word (int)

Description:

The TBLGETW function reads in the "n_table" of index “n_rec” the value contained in the field“n_field”.The value that is read is loaded in the destination variable “value” of int type.

STAT_WRD variable can have the following values:

Value Meaning

0 OK

1 table number out of range (1-4)

2 page number out of range

3 field number out of range

4 required field does not have a int format

stat_wrd

Page 220: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

5-10 10 Series CNC WinPLUS Library - User Manual (00)

TBLGETD: Read lreal value from a table

Type: Internal

LD/FBD:

ST:stat_wrd := TBLGETD(n_tab, n_rec, n_field, value) ;

INPUT VARIABLES: number of table (int)page number (index) (int)field number in table (int)

OUTPUT VARIABLES: destination variable (lreal)function status output word (int)

Description:

The TBLGETD function reads in the table "n-tab” of index “n-rec” the value contained in the field“n-field”."N-field" must be "lreal". The value is read and loaded in the "value" destination variable.See Appendix D for information about function input values.

If you fail to input correct parameters to this function the STAT_WRD output will report this:

Value Meaning

0 OK

1 table number out of range

2 page number (n_rec) out of range

3 field number out of range

4 indicated field does not contain a int variable

stat_wrd

Page 221: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

10 Series CNC WinPLUS Library - User Manual (09) 5-11

TBLPUTW: Write int value to a table

Type: Internal

LD/FBD:

ST:stat_wrd := TBLPUTW(n_tab, n_rec, n_field, value) ;

INPUT VARIABLES: number of table (int)page number (index) (int)field number in table (int)value to be written into table (int)

OUTPUT VARIABLE: function status output word (int)

Description:

The TBLPUTW function writes the value in the parameter “value” (of int type) into “n_field” of thetable “n_tab” of index “n_rec”. “n_ field” must be int type.

STAT_WRD can have the following values:

Value Meaning

0 OK

1 table number out of range

2 page number out of range

3 field number out of range

4 indicated field is not a int format

stat_wrd

Page 222: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

5-12 10 Series CNC WinPLUS Library - User Manual (00)

TBLPUTD: Write lreal value to a table

Type: Internal

LD/FBD:

ST:stat_wrd := TBLPUTD(n_tab, n_rec, n_field, value);

INPUT VARIABLES: number of table (int)page number (index) (int)field number in table (int)value to be written into table (lreal)

OUTPUT VARIABLE: function status output word (int)

Description:

The TBLPUTD function writes the value in the parameter “value” (of int type) into “n_field” of thetable “n_tab” of index “n_rec”. “n_field” must be lreal type.

The variable STAT_WRD can have the following values:

Value Meaning

0 OK

1 table number out of range

2 page number out of range

3 field number out of range

4 indicated field does not have the lreal format

stat_wrd

Page 223: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

10 Series CNC WinPLUS Library - User Manual (09) 5-13

TBLSRCD: Table lreal search

Type: Internal

LD/FBD:

ST:stat_wrd := TBLSRCD(n_tab, n_field, srchval, n_start, n_stop, n_rec);

INPUT VARIABLES: table number (int)field number (int)value searched for (lreal)first page to check (int)last page to check (int)

OUTPUT VARIABLES: first matching table page number (int)function status output stat_wrd (int)

Description:

The function simplifies and accelerates a table look-up. It checks one field on each page of thetable for the wanted floating point value (srch_val). The search can be limited to only a part of thecolumn by indicating the range of pages to search (n_start and n_stop) in. The table lookup iscontinued until a value is found. The function will be aborted if an error is discovered in the inputparameters or if an error occurs during the execution.The table page number corresponding to the matching value will be assigned to the user variablen_rec.For input values to the function refer to Appendix D.

stat_wrd

Page 224: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

5-14 10 Series CNC WinPLUS Library - User Manual (00)

In case of errors, the function status word STAT_WRD will contain a value different from 0:

Value Meaning

0 OK

1 illegal table number

2 illegal field number

3 n_start exceeds table length

4 wrong field format

5 n_start > n_stop

6 n_stop reached without match

7 last page of the table reached without match

When an error occurs, the n_rec variable will not be changed.

Since the execution of this function is quite long, it is wise to limit its use on table sections.

Page 225: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

10 Series CNC WinPLUS Library - User Manual (09) 5-15

TBLSRCW: Table int search

Type: Internal

LD/FBD:

ST:stat_wrd:= TBLSRCW(n_tab, n_field, srchval, srcmask, n_start, n_stop, n_rec)

INPUT VARIABLES: table number (int)field number (int)value to search for (int)mask to search for (int)first page to check (int)last page to check (int)

OUTPUT VARIABLES: first matching table page number (int)function status output word (int)

stat_wrd

Page 226: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

5-16 10 Series CNC WinPLUS Library - User Manual (00)

Description:

This function scans an array of int variables stored in a generic table .

It picks up the value from the table, applies the srch_mask mask to it (boolean AND operationbetween data and mask) and compares the result with the srch_val value.If both data are identical, the function ends by providing the index (in n_rec) of the page in whichsrch_val was found.TBLSRCW may search for 16-bit values (if you write 0xFFFF in the srch_mask) or for subvalues (ifyou set one or more srch_mask bits to zero).

For the input values of this function refer to Appendix D.

The STAT_WRD may have the following values:

Value Meaning

0 OK

1 illegal table number

2 illegal field number

3 n_start > table length

4 wrong field format

5 n_start > n_stop

6 n_stop reached without match

7 last table page Freached without match

Page 227: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

10 Series CNC WinPLUS Library - User Manual (09) 5-17

TOOL_RD: Get tool slave identifier

Type: Internal

LD/FBD:

ST:stat_wrd := TOOL_RD(proc_num, first, tool, value);

INPUT VARIABLES: process number (1÷ 20) (int)index of first tool from which to start reading (1÷ 60) (int)number of slave tools to read (1÷ 60) (int)

OUTPUT VARIABLES: variable starting from which the slave toolidentifiers are unloaded (int)status word (int)

Description:

The F.B. in question must be used in order to acquire the identifiers of the slave tools concerned inprogramming of the multitool T function.The slave tool number is passed in control word MW(K+37) by the decode routine.

Example:This part program line is executed:

T30/31, 32

In the T function decode routine, there are control words with the following values:

MW(K+32) : 11MW(K+37) : 2MD(L+20) : 30

stat_wrd

Page 228: 10 Series CNC WinPLUS LIBRARY

Chapter 5Offset and Tools Handling

5-18 10 Series CNC WinPLUS Library - User Manual (00)

The call to F.B. TOOL_RD is made with the parameters:first : 1number : 2 (value MW(K+37))value : my_val ARRAY [0…59] of INT

On exiting the F.B. the situation is:

stat_wrd : 0value : my_val[31,32,0.. ]

NOTE:The parameter “value” is part of the variable class VAR_IN_OUT and it is an array of 60 words inwhich the tool slave identifiers are unloaded.

It is possible to find the explication of the variables MW(K+…) and MD(L+…) in the ApplicationManual

Variable STAT_WRD may assume one of the following values:

Value Meaning

0 OK

402 process not valid

410 parameters out of range

END OF CHAPTER

Page 229: 10 Series CNC WinPLUS LIBRARY

Chapter 6

10 Series CNC WinPLUS Library - User Manual (04) 6-1

PROCESS/SYSTEM VARIABLES HANDLING

Following variables can be read and written with the function calls in this chapter:

• Boolean process variables. They give information about the active execution mode of someCNC related features.

• Process E-Parameters. These are the parameters used in the parametric programming. All E-parameters have a lreal accuracy floating point format. The number of E parameters isconfigurable.

• Process H-Parameters. They are part program parameters like E-Parameters but speciallyintended for use with paramacros. There are 100 H-parameters, the first 52 of which are linkedto the 52 possible letter addresses in a paramacro call. The format is lreal.

• Process HF-flags. These are 100 Boolean flags (part program parameters) which areconnected to the 100 H-parameters. If a letter (H-Parameter) was used in a paramacro call thecorresponding Boolean HF-Flag will be set true by the system.

• SC global system parameters. This is a set of 100 bytes (characters) which is located in thedual port memory of the I/O processor module. They can be used by all processes as dedicatedpart program parameters for inter-process communications or the ASSET part programlanguage extension.

• SN global system variables. This is a group of 25 double precision floating point variables in thedual port memory of the I/O processor module. They can be used like E-parameters but arecommon to all processes. The SC and SN variables are specially intended for use with ASSETand inter-process communications in a part program.

Page 230: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-2 10 Series CNC WinPLUS Library - User Manual (04)

Each function has a return value ("stat_wrd" parameter).Return values different from 0 indicate an NC error that occurred during execution.Refer to Appendix B for return values and relevant messages.

GET BOOLEAN PROCESS VARIABLE ......................................................................GBPROVARSET BOOLEAN PROCESS VARIABLE.......................................................................SBPROVARGET PART PROGRAM E-PARAMETER.....................................................................GETEPARSET PART PROGRAM E-PARAMETER .....................................................................SETEPARGET PART PROGRAM H-PARAMETER ....................................................................GETHPARSET PART PROGRAM H-PARAMETER.....................................................................SETHPARGET PART PROGRAM H-PARAMETER FLAG..........................................................GETHFLSET PART PROGRAM H-PARAMETER FLAG ..........................................................SETHFLGET ASCII GLOBAL PART PROGRAM VARIABLE ...................................................GETSCSET ASCII GLOBAL PART PROGRAM VARIABLE....................................................SETSCGET LREAL GLOBAL PART PROGRAM VARIABLE .................................................GETSNSET LREAL GLOBAL PART PROGRAM VARIABLE .................................................SETSNREAD THE USER VARIABLES OF A DOUBLE TYPE PROCESS ............................GETUSEDWRITE THE USER VARIABLES OF A DOUBLE TYPE PROCESS...........................PUTUSEDREAD THE USER VARIABLES OF A CHAR TYPE PROCESS .................................GETUSECWRITE THE USER VARIABLES OF A TYPE CHAR PROCESS................................PUTUSECCOPY A RANGE OF M VARIABLES...........................................................................INDEXCOPY A RANGE OF ASCII VARIABLES ....................................................................INDEXA

Page 231: 10 Series CNC WinPLUS LIBRARY

Capitolo 6Process/System Variables Handling

10 Series CNC WinPLUS Library - User Manual (04) 6-3

GBPROVAR: Get Boolean process variable

Type: Wait

LD/FBD:

ST:stat_wrd := GBPROVAR(proc_num, var_ident, dest_var);

INPUT VARIABLES: process number (1..20) (int)number of the variable to be read (1..11) (int)

OUTPUT VARIABLES: destination variable in WinPLUS (int)function status output word (int)

Description: Variables var_ident which can be read :

Number Variable Meaning

1 MBR multi block retrace

2 URL control rapid With manual FRO

3 UVR use rapid feed for interpolation

4 RAP auto jog return/auto home

5 USB block delete enable

6 USO optional stop enable

7 UFE enable disable VFF

8 HMP enable auto home cycle

9 RCM enables/disables memorised search

10 MBA auxiliary modality functions in multiblock retrace

11 REM Jog return

12 PMS Enables/disables the paramacro call of the S function

13 PMT Enables/disables the paramacro call of the T function

14 PMM Enables/disables the paramacro call of the M function

15 TTR Enables/disables the management of the ToroidalTool Radius of length 2 in the offset table.

The Boolean value (0 or 1) of the requested part program variable will be written to the indicated intWinPLUS variable. If desired, you can also take a variable of the type Boolean (M, G,) to store theresult.

stat_wrd

Page 232: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-4 10 Series CNC WinPLUS Library - User Manual (04)

SBPROVAR: Set Boolean process variable

Type: Wait

LD/FBD:

ST:stat_wrd := SBPROVAR(proc_num, var_ident, var_state);

INPUT VARIABLES: process number (1..20) (int)variable number to be set (1..11) (int)required variable status (int)

OUTPUT VARIABLE: function status word (int)

Description: There is a range of Boolean variables in every process which define what processoptions are active or non-active. To switch an option off, write a zero to the variable status: toenable an option write any non-zero value.

Variables which can be set/reset include:

Number Variable Meaning

1 MBR multi block retrace

2 URL control rapid With manual FRO

3 UVR use rapid feed for interpolation

4 RAP auto jog return/auto home

5 USB block delete enable

6 USO optional stop enable

7 UFE enable disable VFF

8 HMP enable auto home cycle

9 RCM enables/disables memorised search

10 MBA auxiliary modality functions in multiblock retrace

11 REM Jog return

12 PMS Enables/disables the paramacro call of the S function

13 PMT Enables/disables the paramacro call of the T function

14 PMM Enables/disables the paramacro call of the M function

15 TTR Enables/disables the management of the ToroidalTool Radius of length 2 in the offset table.

stat_wrd

Page 233: 10 Series CNC WinPLUS LIBRARY

Capitolo 6Process/System Variables Handling

10 Series CNC WinPLUS Library - User Manual (04) 6-5

GETEPAR: Get part program E-parameter

Type: Wait

LD/FBD:

ST:stat_wrd := GETEPAR(proc_num, e_par, dest_var);

INPUT VARIABLES: process number (1. 20) (int)E parameter index (1..max) (int)

OUTPUT VARIABLES: destination variable in WinPLUS (lreal)function status word (int)

Description:

The GETEPAR function reads the value of the "e_par" index E variable belonging to the processspecified in "proc_num".

The "dest_var" variable must be lreal (MD, GD).

The "e_par" parameter is an index and its index can vary between 0 (E0) and the number of Eparameters configured in AMP (max. 8000).

See also:

SETEPAR write to part program E parameters

stat_wrd

Page 234: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-6 10 Series CNC WinPLUS Library - User Manual (04)

SETEPAR: Set part program E parameter

Type: Wait

LD/FBD:

ST:stat_wrd := SETEPAR(proc_num, e_par, e_par_val);

INPUT VARIABLES: process number (1..20) (int)index of E parameter (1..max) (int)value for selected parameter (lreal)

OUTPUT VARIABLE: status word (int)

Description:

The SETEPAR function writes the "e_par_val" value in "e_par" index E variable belonging to theprocess specified in "proc_num".The "e_par_val" variable must be lreal.The "e_par" parameter is an index and its value can vary between 0 (E0) and the number of Eparameters configured in AMP (max. 8000).

stat_wrd

Page 235: 10 Series CNC WinPLUS LIBRARY

Capitolo 6Process/System Variables Handling

10 Series CNC WinPLUS Library - User Manual (04) 6-7

GETHPAR: Get part program H-parameter

Type: Wait

LD/FBD:

ST:stat_wrd := GETHPAR(proc_num, h_par_ind, dest_var);

INPUT VARIABLES: process number (1..20) (int)H parameter index (0..99) (int)

OUTPUT VARIABLES: destination variable in WinPLUS (lreal)function status word (int)

Description:

The GETHPAR function reads the value of the "n_par_ind" index H variable belonging to theprocess specified in "proc_num".The "dest_var" variable must be lreal (MD, GD,).The "h_par_ind" is an index that can vary between 0 and 99.

NOTE:H variables are available ONLY if paramacros are configured in AMP.

See also:

GETHFL reads HF flag of part program H parameter

SETHPAR writes the H part program parameter

SETHFL writes the HF flag of the part program H parameter

stat_wrd

Page 236: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-8 10 Series CNC WinPLUS Library - User Manual (04)

SETHPAR: Set part program H-parameter

Type: Wait

LD/FBD:

ST:stat_wrd := SETHPAR(proc_num, h_par_ind, h_par_val);

INPUT VARIABLES: process number (1..20) (int)index of H parameter (0..99) (int)new value for selected parameter (lreal)

OUTPUT VARIABLE: status word (int)

Description:

Function SETHPAR writes the value of "h_par_val" in the H index variable "h_par_ind". The"h_par_val" parameter must be lreal.The "h_par_ind" parameter is an index that can vary between 0 and 99.

H parameters are generally utilized in NC environment for paramacro call parameters. The valuesprogrammed and associated to letters of the alphabet in the block containing the G code ofparamacro calls are transferred to H parameters. The programmed value associated to letter "A"will be transferred to H01 and the value associated to "Z" will be transferred to H26. For each letterprogrammed in the paramacro, the corresponding H flag will be set.

NOTE:H variables are available ONLY if the paramacros have been configured in AMP.

See also:

SETHFL write to part program H flag

SETHPAR write to part program H parameter

GETHPAR read part program H flag

stat_wrd

Page 237: 10 Series CNC WinPLUS LIBRARY

Capitolo 6Process/System Variables Handling

10 Series CNC WinPLUS Library - User Manual (04) 6-9

GETHFL: Get part program H parameter flag (HF)

Type: Wait

LD/FBD:

ST:stat_wrd := GETHFL(proc_num, hfl_ind, dest_var);

INPUT VARIABLES: process number (1..20) (int)HF flag index (1..99) (int)

OUTPUT VARIABLES: destination variable in WinPLUS (int)function status word (int)

Description:

The GETHFL function reads the value of index HF variable "hfl_par" belonging to the specifiedprocess.The "dest_var" parameter must be short and it contains the logic status (0 to 1) of the addressedHF flag.The function reads the value of the HF "hfl_par" index variable belonging to the process specifiedin "proc_num".The "dest_var" short parameter contains the logic status (0 or 1) of the addresses HF flag.The "hfl_par" parameter is an index that can vary between 0 and 99.

NOTE:HF flags are available ONLY if the paramacros have been configured in AMP.

See also:

GETHPAR reads part program H parameter

SETHPAR writes part program H parameter

SETHFL writes part program HF flag

stat_wrd

Page 238: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-10 10 Series CNC WinPLUS Library - User Manual (04)

SETHFL: Set part program H parameter flag

Type: Wait

LD/FBD:

ST:stat_wrd := SETHFL(proc_num, hfl_ind, hfl_val);

INPUT VARIABLES: process number (1..20) (int)index of HF flag (0..99) (int)new value for selected parameter (int)

OUTPUT VARIABLE: status word (int)

Description:

The SETHFL writes the value of "hfl_val" in the index "hfl_ind" HF variable, belonging to theprocess specified in "proc_num".The "hfl_val" int parameter can be 0 or 1.The "hfl_ind" parameter is an index that can vary between 0 and 99.For each letter programmed in a paramacro call, a corresponding HF Boolean flag: when letter A isprogrammed, the corresponding HF 01 (flag HF) Boolean parameter. When letter Z isprogrammed, HF 26 will be set. 100 HF flags are available in total, 52 of which are reserved forsmall and capital letters of the alphabet. The remaining HF parameters can be freely used forcommunications between logic and part program.

NOTE:HF flags are available only if the paramacros have been configured in AMP.

See also:

GETHPAR reads part program H parameter

SETHPAR writes part program H parameter

GETHFL reads part program H flag

stat_wrd

Page 239: 10 Series CNC WinPLUS LIBRARY

Capitolo 6Process/System Variables Handling

10 Series CNC WinPLUS Library - User Manual (04) 6-11

GETSC: Get ASCII global part program variable

Type: Wait

LD/FBD:

ST:stat_wrd := GETSC(proc_num, sc_ind, sc_num, dest_var);

INPUT VARIABLES: process number (1..20) (int)first character to read (SC index 0..99 max) (int)number of characters to read (0..99) (int)

OUTPUT VARIABLES: ASCII destination variable in WinPLUS (string)function status word (int)

Description:

There is a group of 100 bytes in the dual port memory of the I/O processor module for the storageof global ASCII process variables. These so-called SC variables are common to the up to 4processes.The WinPLUS destination variable which is assigned to this function will contain the string of theaddressed SC variables.

See also :

SETSC write to global ASCII part program variable (SC)

GETSN read global numerical part program variable (SN)

SETSN write to global numerical program variable (SN)

stat_wrd

Page 240: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-12 10 Series CNC WinPLUS Library - User Manual (04)

SETSC: Set ASCII global part program variable

Type: Wait

LD/FBD:

ST:stat_wrd := SETSC(proc_num, sc_ind, sc_num, source_var);

INPUT VARIABLES: process number (1..20) (int)index of first SC parameter to be written (0..99) (int)number of characters to write (int)string variable to be copied to the SC variable (string)

OUTPUT VARIABLE: function output status word (int)

Description:

There is a group of 100 bytes in the dual port memory of the I/O processor module for the storageof characters and strings. These so-called SC variables are global part program variables . Globalmeans that the set is common to all processes.The ASCII WinPLUS variable which is assigned to the input source_val of this function mustcontain the string to be copied to the addressed SC variables. This WinPLUS variable must be ofthe type A.

See also :

GETSC read global ASCII part program variable (SC)

GETSN read global numerical part program variable (SN)

SETSN write global numerical part program variable (SC)

stat_wrd

Page 241: 10 Series CNC WinPLUS LIBRARY

Capitolo 6Process/System Variables Handling

10 Series CNC WinPLUS Library - User Manual (04) 6-13

GETSN: Get lreal global part program variable

Type: Wait

LD/FBD:

ST:stat_wrd := GETSN (proc_num, sn_ind, dest_var);

INPUT VARIABLES: process number (1..20) (int)SN index (0..20) max (int)

OUTPUT VARIABLES: destination variable in WinPLUS (lreal)function status word (int)

Description:

There is a group of 25 lreal variables in the dual port memory of the I/O processor module. Theseso-called SN variables are global part program variables. Global means that the set is common tothe up to 4 processes.The local or global long real destination variable which is assigned to this function will contain thevalue of the addressed SN variable. This WinPLUS variable must be of the type MD, GD.

See also :

SETSN write to global numerical part program variable (SN)

GETSC read global ASCII part program variable (SC)

SETSC write to global ASCII part program variable (SC)

stat_wrd

Page 242: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-14 10 Series CNC WinPLUS Library - User Manual (04)

SETSN: Set lreal global part program parameter

Type: Wait

LD/FBD:

ST:stat_wrd := SETSN(proc_num, sn_ind, sn_val);

INPUT VARIABLES: process number (1..20) (int)SN 0-24 index (max) (int)value for selected SN parameter (lreal)

OUTPUT VARIABLE: function output status word (int)

Description:

There is a group of 25 lreal variables in the dual port memory of the I/O processor module. Theseso-called SN variables are global part program variables. Global means that the set is common toall processes.The local or global long real WinPLUS variable which is assigned to the input sn_val of thisfunction must contain the value for the addressed SN variable. This WinPLUS variable must be ofthe type MD, GD.

See also :

GETSN read global numerical part program variable (SN)

GETSC read global ASCII part program variable (SC)

SETSC write to global ASCII part program variable (SC)

stat_wrd

Page 243: 10 Series CNC WinPLUS LIBRARY

Capitolo 6Process/System Variables Handling

10 Series CNC WinPLUS Library - User Manual (04) 6-15

GETUSED: Read the user variables of a double type process

Type: Wait

LD/FBD:

ST:stat_wrd := GETUSED(proc_num, index, num_var, var_name, dest_idx);

INPUT VARIABLES: process number (1...20) (int)variable index (int)number of variables to be read (int)variable name (string)MD destination variable index (int)

OUTPUT VARIABLE: status word (int)

Description:

This function reads the user variables of a double type process (e.g., !VAR.LR).

The variable is identified by a name ("var_name" parameter) and by the index of the variable itself("index" parameter): the above value must be between 0 and the maximum index configured inAMP.

The "num_var" parameter defines the number of variables to be read starting from "index"; thevalues read will be available in the MD variable starting from the index defined in the "dest_idx"variable for the next "num_var" variables.

The function can read up to 22 variables at a time; if the “index” parameter is assigned a valuegreater than 22, the function is not executed and an error indication is given in the "stat_wrd"parameter.

The value returned in STAT_WRD by this function may assume the following values:

Value Meaning0 OK

410 MD variable index out of rangeOther See appendix B

stat_wrd

Page 244: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-16 10 Series CNC WinPLUS Library - User Manual (04)

PUTUSED: Write the user variables of a double type process

Type: Wait

LD/FBD:

ST:stat_wrd := PUTUSED(proc_num, index, num_var, var_name, dest_idx);

INPUT VARIABLES: process number 1-20 (int)index of MD variable to read from (int)number of variables to be written (int)name of variable (string)index of destination variable (int)

OUTPUT VARIABLE: status word (int)

Description:

The function writes the user variables of a double type process (e.g., !VAR.LR).

This variable is identified by the name ("var_name" parameter) and the index of the variable itself("dest_idx" parameter); this value must be between 0 and the maximum index configured (in theAMP utility).

The "num_var" parameter defines the number of variables to be written starting from the index ofthe MD variables; the values written will be available in the user variables starting from the indexdefined in the "dest_idx" variable for the next "num_var" variables.

This function can write up to 20 variables at a time; if parameter "dest_idx" is assigned a valuegreater than 20, the function is not executed and an error indication is given in the "stat_wrd"parameter.

The value returned in STAT_WRD by this function can assume the following values:

Value Meaning0 OK

410 MD variable index out of rangeOther See appendix B

stat_wrd

Page 245: 10 Series CNC WinPLUS LIBRARY

Capitolo 6Process/System Variables Handling

10 Series CNC WinPLUS Library - User Manual (04) 6-17

GETUSEC: Read the user variables of a char type process

Type: Wait

LD/FBD:

ST:stat_wrd := GETUSEC(proc_num, index, num_var, var_name, dest_idx);

INPUT VARIABLES: process number 1-20 (int)index of variable (int)number of variables to be read (int)variable name (string)index of destination variable A (int)

OUTPUT VARIABLE: status word (int)

Description:

The function reads the user variables of type char processes (e.g., !VAR.CH).

The variable is identified by the name ("var_name" parameter) and the index of the variable itself("index" parameter); this value must be between 0 and the maximum index configured (in the AMPutility).

The "num_var" parameter defines the number of variables to be read, starting from "index"; thevalues read will be available in the A variables starting from the index defined in the "dest_idx"variable for the next "num_var" variables.

The function can read up to 40 variables at a time; if the “index” parameter is assigned a valuegreater than 40, the function is not executed and an error indication is given in the "stat_wrd"parameter.

The value returned in STAT_WRD by this function may assume the following values:

Value Meaning0 OK

410 Variable A index out of rangeOther See Appendix B

stat_wrd

Page 246: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-18 10 Series CNC WinPLUS Library - User Manual (04)

PUTUSEC: Write the user variables of a type char process

Type: Wait

LD/FBD:

ST:stat_wrd := PUTUSEC(proc_num, index, num_var, var_name, dest_idx);

INPUT VARIABLES: process number 1-20 (int)Index of A variable from which to read (int)number of variables to be written (int)name of variable (string)variable destination index (int)

OUTPUT VARIABLE: status word (int)

Description:

The function writes the user variables of a type char process (e.g., !VAR.CH).

The variable is identified by the name (parameter "var_name") and the index of the variable itself("dest_idx" parameter); this value must be between 0 and the maximum index configured (in theAMP utility).

The "num_var" parameter defines the number of variables to be written starting from the “index” ofthe A variables; the values written will be available in the user variables starting from the indexdefined in the "dest_idx" variable for the next "num_var" variables.

The function can write up to 40 variables at a time; if “num_var” exceeds the length of the Avariable, the function limits “num_var” to the length of variable A.

The value returned in STAT_WRD by this function may assume the following values:

Value Meaning0 OK

410 Variable A index out of rangeOther See Appendix B

stat_wrd

Page 247: 10 Series CNC WinPLUS LIBRARY

Capitolo 6Process/System Variables Handling

10 Series CNC WinPLUS Library - User Manual (04) 6-19

INDEX: Copy a range of M variables

Type: Wait

LD/FBD:

ST:stat_wrd := INDEX(start, number, dest)

INPUT VARIABLES: Index first MW variable to copy (int)Number of MW variables to copy (int)Index first MW destination variable (int)

OUTPUT VARIABLE: status word (int)

Description:

The function copies a number, indicated in the parameter “number”, of MW variables starting froman index given by the parameter “start” in other MW variables starting from the index given in theparameter “dest”.

stat_wrd

Page 248: 10 Series CNC WinPLUS LIBRARY

Chapter 6Process/System Variables Handling

6-20 10 Series CNC WinPLUS Library - User Manual (04)

INDEXA: Copy a range of ASCII variabiles

Type: Wait

LD/FBD:

ST:stat_wrd := INDEXA(start, number, dest)

INPUT VARIABLES: Index first A variable to copy (int)Number of A variables to copy (int)Index first A destination variable (int)

OUTPUT VARIABLES: status word (int)

Description:

The function copies a number, indicated in the parameter “number”, of variables A starting from anindex given by the parameter “start” in other A variables starting from the index given in theparameter “dest”.

END OF CHAPTER

stat_wrd

Page 249: 10 Series CNC WinPLUS LIBRARY

Chapter 7

10 Series CNC WinPLUS Library - User Manual (03) 7-1

HUMAN INTERFACE

Calls to the HUMAN INTERFACE functions allow the WinPLUS logic program to communicate withthe system in order to request execution of activates linked to the machine-user interface.

All function may be utilized as a function block or may be called as a function in Instruction List.

Each function is associated to a return value (parameter stst_wrd) that you can find listed inAppendix E (messages relative to HUMAN INTERFACE) or to a zero value should the operation becompleted without errors.

CONNECTS A WINMEDIA OPERATOR CONSOLE TO A PROCESS ....................CONS_ONDISCONNECTS A WINMEDIA OPERATOR CONSOLE FROM A PROCESS..........CONS_OFFSETS THE PARAMETERS OF A WINMEDIA OPERATOR CONSOLE ....................CONS_PUTSELECT A PROCESS TO CONTROL........................................................................HISPROCSET OEM SOFTKEY STATUS; ON/OFF TYPE .........................................................SETCUSKSET OEM SOFTKEY STATUS; MAINTAINED, DATA ENTRY AND NORMAL.........SETCUSLSET HUMAN INTERFACE PROTECTION BITS ........................................................SETHINTASSIGN A PILOT PANEL TO A PROCESS ...............................................................MTB_ONDISCONNECT A PILOT PANEL FROM A PROCESS ...............................................MTB_OFFMANAGE LEDs ON THE OPLINK OPERATOR PANEL ............................................CONS_LEDENABLE SPECIFIED SOFTKEYS ..............................................................................HUM_ABIDISABLE SPECIFIED SOFTKEYS .............................................................................HUM_DIS

Page 250: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-2 10 Series CNC WinPLUS Library - User Manual (03)

HISPROC: Select a process to control

Type: Wait

LD/FBD:

ST:stat_wrd := HISPROC(proc_num);

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLE: function status output word (int)

Description:

When you select a process other than the active one, all pending actions in the human interfaceenvironment will be aborted (data entries will be closed). If you select the process which wasalready active, nothing will happen. Selecting a process means that all softkey operations work onthe selected process.

This function does not work when you have a 10 Series CNC monoprocess .

stat_wrd

Page 251: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-3

SETCUSK: Set OEM softkey status; ON/OFF type

Type: Wait

LD/FBD:

ST:stat_wrd := SETCUSK(sk_menu, sk_num, sk_state);

INPUT VARIABLES: OEM softkey menu number (1..max) (int)softkey number (1..15 see below) (int)state of the softkey (1 = active, 0 = inactive) (int)

OUTPUT VARIABLE: function status output word (int)

Description:

This subroutine is used to change the state of an ON/OFF type OEM softkey. WinPLUS can set thesoftkey to an active state (yellow label) or the non active state (white label). The state can bechanged without selecting the related menu or manually pressing the softkey. Use the menunumber as defined in the AMP configuration. The OEM softkey menus start with number 1.The softkey numbering in each one of the menus is given in the following table:

reserved reserved reserved reserved reserved

6 7 8 9 10

11 12 13 14 15

For further information on how to handle OEM softkeys in your logic program, please refer to theWinPLUS Application Manual chapter 7.

NOTE:This function has a lower priority than the function SETHINT.

See also:

SETHINT enable/disable OEM or system softkeySETCUSL set status of OEM Maintained, DE, Normal softkeys

stat_wrd

Page 252: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-4 10 Series CNC WinPLUS Library - User Manual (03)

SETCUSL: Set OEM softkey status; Maintained, Data Entry and Normal

Type: Wait

LD/FBD:

ST:stat_wrd := SETCUSL(sk_menu, sk_num, sk_state);

INPUT VARIABLES: softkey menu number (1..max) (int)softkey number (1..15) (int)state of the softkey (1 = active, 0 =inactive) (int)

OUTPUT VARIABLE: function status output word (int)

Description:

This system function call is used to change the status of OEM softkeys of the types MAINTAINED,DATA ENTRY and NORMAL. The status can be set active (yellow label) or not active (white label).The state can be changed without selecting the related menu or manually pressing the softkey.Use the menu number as defined in the AMP configuration. The OEM softkey menus start withnumber 1.

The softkey numbering in each one of the menus is as in the following table:

reserved reserved reserved reserved reserved

6 7 8 9 10

11 12 13 14 15

See also:

SETHINT enable/disable OEM or system softkey

SETCUSK set status for OEM ON/OFF softkey

stat_wrd

Page 253: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-5

SETHINT: Set human interface protection bits

Type: Wait

LD/FBD:

ST:SETHINT(proc_num, oem_sys, sk_menu, sk_bit, sk_state);

INPUT VARIABLES: process number 1..20 (int)selection OEM (1) /system (0) softkeys (int)softkey menu number (int)bit(s) corresponding to the selected softkey(s) (int)state of softkey(s) (0 = disable, 1 = enable) (int)

OUTPUT VARIABLE: function status output word (int)

Description:

With this function you can enable or disable system or OEM softkeys. To disable a softkey meansto disable the status passing of this softkey to the system (or to WinPLUS in case of OEMsoftkeys). So using this function, the WinPLUS programmer can decide whether or not a softkeycan be used by the operator.When a softkey is disabled, its label color will be black.SETHINT has a higher priority than SETCUSK or SETCUSL. Only when a softkey is active (yellowlabel) when WinPLUS disables it, it will stay active until the end of its activity (e.g. second softkeypush for an ON/OFF type, releasing the softkey for an maintained type, de-activation by WinPLUS,etc.).

stat_wrd

Page 254: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-6 10 Series CNC WinPLUS Library - User Manual (03)

For OEM softkeys (oem_sys = 1, the sk_menu input parameter must specify a menu number asdefined in the AMP configuration. For the system softkey menus (oem_sys = 0 !) you can select amenu number from the following table:

menu number menu name

1 MAIN MENU2 AUTO3 MANUAL4 MACHINE5 PARAMETERS6 DIAGNOSTICS7 PART PROGRAM8 OEM UTILITY

The bit map for all softkey menus is according to following scheme, each box represents a softkeyaccording to its position in the menu:

16384 8192 4096 2048 1024

512 256 128 64 32

16 8 4 2 1

Please refer to the 10 Series CNC USER GUIDE for the meaning of each one of the systemsoftkeys.

NOTES:1. If a softkey is already disabled (black label), it is obviously not functional or the function it refers

to is not (yet) available. Enabling and using such a softkey may have unpredictable results.

2. The various system softkey menus will be repeated for every process (multiprocess systemsonly). The function SETHINT only enable/disables softkeys in the selected process. To disablea certain softkey for all processes, the function must be repeated for each one of the processes.

3. In a softkey tree, the first line of the system menu will be repeated. It is important to note thatthe disabling/enabling of a softkey in this upper line will only work for the menu specified insk_menu_num.

See also:

SETCUSK set status for OEM ON/OFF softkey

SETCUSL set status of OEM Maintained, DE, Normal softkeys

Page 255: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-7

MTB_ON: Assign a Pilot panel to a process

Type : internal

LD/FBD:

ST:stat_wrd := MTB_ON(proc_num, mtb_num) ;

INPUT VARIABLES: process number (1..20) (int)Pilot panel number (int)

OUTPUT VARIABLE: function status output word (int)

Description:

This function activates an Pilot Panel for a specified process.

The I/O configurator utility allows you to configure up to 16 Pilot Panels. Each one of these PilotPanels has a unique identification code (which is defined with the dip switch in the device). Usingthe functions MTB_ON and MTB_OFF you can define different associations between the PilotPanels and the processes.

These assignments must follow these rules:

• Any of the available Pilot Panels can be associated to any of the available processes. Perprocess only one panel may be active. This allows to have up to 4 active Pilot Panels for up to 4processes.

• If connect a Pilot Panel, (ex. MTB2 to a process that have another Pilot Panel connected, (ex.MTB1) the Pilot Panel activated first (MTB1) is automatically disconnected from those process.

• One single Pilot Panel can be assigned to different processes contemporary (max. 4processes), allowing common operation on all associated processes.

• When a single Pilot Panel is switched between multiple processes the Pilot Panel must first bedisconnected (MTB_OFF) from the process it was previously connected to.

stat_wrd

Page 256: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-8 10 Series CNC WinPLUS Library - User Manual (03)

The STAT_WRD variable can have the following values:

Value Meaning

0 OK

1 Pilot Panel id out of range (0 ≤ mtb_num ≤ 15)

2 Pilot Panel id not present

3 process number out of range (1 ≤ proc_num ≤ 4)

4 process not configured (insert configured proc_num)

See also:

MTB_OFF Disconnect an Pilot Panel

Page 257: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-9

MTB_OFF: Disconnect a Pilot panel from a process

Type : internal

LD/FBD:

ST:stat_wrd := MTB_OFF(proc_num);

INPUT VARIABLES: process number (1..20) (int)OUTPUT VARIABLE: function status output word (int)

Description:

Use this function to disconnect an Pilot Panel from a process. This can be very useful tocompletely inhibit operation from a remote or local Pilot Panel.

The STAT_WRD variable can have the following values:

Value Meaning

0 OK

1 process number out of range (1 ≤ proc_num ≤ 4)

2 process not configured (insert configured proc_num)

See also :

MTB_ON Assign an Pilot Panel to a process

stat_wrd

Page 258: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-10 10 Series CNC WinPLUS Library - User Manual (03)

CONS_LED: Manage leds on the OPLink operator panel

Type: Wait

LD/FBD:

ST:stat_wrd := CONS_LED(led, aon);

INPUT VARIABLES: operation type:identifier of the led to work on (1...5) (int)switching on (1) or off (0) (int)

OUTPUT VARIABLE: status word (int)

Description:

This function allows you to switch the leds for the P1÷P6 keys on the OPLink operator panel onand off.You can only command one led at a time. The value of led has to be set to 0 for the P1 functionkey, to 1 for the P2 function key and so on up to 5 for the P6 function key. The value of on has tobe 0 for switching the led on and 1 for switching the led off.

stat_wrd

Page 259: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-11

HUM_ABI: Enable specified softkeys

Type : Wait

LD/FBD:

ST:stat_wrd := HUM_ABI(roc_num, sfk_word);

INPUT VARIABLES: process number (1..20) (int)softkey word request (int)

OUTPUT VARIABLE: status word (int)

Description:

This function allows to enable Human Interface softkeys associated to the specified process. Whenthe softkey is disabled, its label is black.Following is a list of softkeys that can be enabled:

Bit Softkey Meaning0 Feedrate +/- Feedrate override1 Feedman +/- feed manual override2 SPND over +/- spindle speed override3 SPND over +/- spindle speed manual override4 Rapid over +/- rapid override5 Mode change for each softkey associated to the mode change6 Manual setup jog increment value7 jog +/- jog direction8 jog incr.+/- jog rate override9 Hold hold key

10 Cycle cycle key11 Reserved12 Reserved13 Reserved14 Reserved15 Reserved

If you wish to enable a softkey, you must set to "1" the bit corresponding to the "softkey word".

stat_wrd

Page 260: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-12 10 Series CNC WinPLUS Library - User Manual (03)

NOTE:The HUM_ABI function performs the same functionality of the SETHINT function but it helps theuser that wishes to repeat the same operation various times on different softkeys.This allows the user that has a Pilot Panel, to enable the corresponding softkeys on the FrontPanel when the Pilot Panel is disabled and more precisely, it re-enables the mode change fromfront panel.The HUM_ABI function makes this possible with a single call.

Page 261: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-13

HUM_DIS: It disables specified softkeys

Type : Wait

LD/FBD:

ST:stat_wrd := HUM_DIS(proc_num, sfk_word);

INPUT VARIABLES: process number (1..20) (int)softkey word request (int)

OUTPUT VARIABLE: status word (int)

Description:

This function allows to disable the Human Interface softkeys associated to the specified process.When the softkey is disabled, its label will be black.The following is a list of softkeys that may be enables:

Bit Softkey Meaning0 Feedrate +/- Feedrate override (auto mode)1 Feedman +/- feed manual override2 SPND over +/- spindle speed override3 SPND over +/- spindle speed manual override4 Rapid over +/- rapid override5 mode change for each softkey associated to the mode change6 Manual setup jog increment value7 jog +/- jog direction8 jog incr.+/- jog rate override9 Hold hold key

10 Cycle cycle key11 Reserved12 Reserved13 Reserved14 Reserved15 Reserved

If you wish to enable a softkey, you must set to "1" the bit corresponding to the "softkey word".

stat_wrd

Page 262: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-14 10 Series CNC WinPLUS Library - User Manual (03)

NOTE:The HUM_DIS function is characterized by the same performances as SETHINT; the former hasbeen created in order to help the user repeat the same operation various times, with differentsoftkeys: this allows the user with an Pilot Panel to disable the corresponding softkeys of the FrontPanel when it is activated and more precisely, it can inhibit mode change from Front Panel.

The HUM_DIS makes all this possible with a single call.

IMPORTANT

This function also disables the keys on the OPLink Operator Panel.

Page 263: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-15

CONS_ON: Connects a WinMedia Operator Console to a process

Type: WAIT

LD/FBD:

ST:stat_wrd := CONS_ON(proc_num, ID);

INPUT VARIABLES: process number 1-20 (int)Operator Console ID (int)

OUTPUT VARIABLE: status word (int)

Description:

This function activates a WinMedia Operator Console for the process specified.

The I/O configurator utility makes it possible to configure up to 16 operator consoles. Each of theseoperator consoles has a unique identification code (which is defined by means of the rotary switchof the device). Using the CONS_ON and CONS_OFF functions, you can define differentassociations between the operator console and the processes.

The following association criteria must be complied with:

• Any operator console available can be associated with any available process. Up to 4 operatorconsoles per process can be active at the same time.

• If you want to connect a new operator console to a process which is already associated with 4consoles, the function will notify an error.

• An operator console can be assigned simultaneously to up to 4 processes, enabling commonoperations to be performed on all the processes associated with it.

NOTES ON SPEED ; FEED ; JOG MANUAL AND RAPID OVERRIDE COMMANDS :

In Series 10 systems, Speed, Feed, Manual Jog and Rapid Override speed percentages can bechanged according to different modalities.

The variation can be made through the Human Interface by means of dedicated softkeys; from thelogic it can be made by means of dedicated Function Blocks; finally, through the WinMediaConsole, you can make the change by means of a dedicated trimmer. The three interfaces savethe value in the relative system SW variables.

If the WinMedia Console has been configured to work with MW arrays and the value contained inthe SW system variable is not present in the array values, then the current system value assumedby the WinMedia Console will be the value of the array which is smallest and closest to the systemvalue (approximation by defect). Hence, if a clockwise variation is made with the trimmer, the

stat_wrd

Page 264: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-16 10 Series CNC WinPLUS Library - User Manual (03)

actualised values will be those following the value approximated by defect; the procedure is similarwhen a counterclockwise variation is made on the trimmer.

Example:

Let us assume we have configured the following array for one of the trimmers:

500 1000 1800 2500 3000 3500 4000

If the current system value is 1250 (value save in SW), then the current value for the WinMediaConsole will be 1000 (value approximated by defect) . If you make a clockwise rotation, the valuetransmitted to the filter routine to be actualised on the WinMedia Console will be 1800.

Variable STAT_WRD can take on the following values:

Value: Meaning

0 OK

1 Console already associated with 4 processes

2 Console not found

3 Process not configured

4 Invalid process number

5 No console configured for process in question

See also:

CONS_OFF Disconnects an operator console from a process

CONS_PUT Sets the Operator Console parameters

Page 265: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-17

CONS_OFF: Disconnects a WinMedia Operator Console from a process

Type : WAIT

LD/FBD:

ST:stat_wrd := CONS_OFF(proc_num,ID);

INPUT VARIABLES: process number 1-20 (int)Operator Console ID (int)

OUTPUT VARIABLE: status word (int)

Description:

Use this function to disconnect an Operator Console from a process. This can prove useful toprevent operations from being performed from a remote or local operator console.

Variable STAT_WRD can take on the following values:

Value: Meaning

0 OK

2 Console not found

4 Invalid process number

5 No Console configured for the process in question

See also:

CONS_ON connects an operator console to a process

CONS_PUT sets the Operator Console parameters

stat_wrd

Page 266: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-18 10 Series CNC WinPLUS Library - User Manual (03)

CONS_PUT: Sets the parameters of a WinMedia Operator Console

Type: WAIT

LD/FBD:

ST:stat_wrd := CONS_PUT(proc_num, sele, step_sele,step_val);

INPUT VARIABLES: process number 0-20 (int)selector number (int)number of steps of selector(s) (int)% value single step or MW index (int)

OUTPUT VARIABLE: status word (int)

Description:

This function is used to change the default parameters of the three selectors, SPEED, FEED andJOG, on the WinMedia operator console

This function makes it possible to change the default parameters of the three SPEED, FEED andJOG trimmers on the WinMedia Console. The JOG trimmer is used to change the feedrate both inmanual mode (Manual Override) and in rapid mode (Rapid Override)

For an example of the uses of this function, see the examples at the bottom.

proc_num parameter:

With this parameter you can specify the number of the process on which you wish to work. Thetable below lists all the values that this parameter may assume.

proc_num Description0 Sets the parameters on all processes

1 ÷ 20 Sets the parameters on the process selected

sele parameter:

With this parameter you can define the trimmer and the configuration criterion to be used. Thetable below lists all the values that this parameter may assume.

sele Description0 SPEED, FEED, JOG MANUAL and RAPID working according to the step_sele

stat_wrd

Page 267: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-19

sele Descriptionand step_val parameters

1 SPEED working according to the step_sele and step_val parameters2 FEED working according to the step_sele and step_val parameters3 RAPID working according to the step_sele and step_val parameters4 JOG MANUAL working according to the step_sele and step_val parameters5 SPEED working according to values contained in an MW array (one-

directional)6 FEED working according to values contained in an MW array (one-directional)7 RAPID working according to values contained in an MW array (one-

directional)8 MANUAL JOG working according to values contained in an MW array (one-

directional and two-directional)

Note: With parameter sele=8, MANUAL JOG works in one-directional mode if zero is in the first(JOG +) or the last position of the values (JOG -); if zero is a different position, MANUAL JOGworks in two-directional mode (JOG +/-). In this connection, see example 3.

step_sele parameter:

With this parameter, you can specify the number of steps into which you want the rotation angle ofthe trimmer to be subdivided. The table below lists all the values that this parameter may assume.

step_sele Description0 Sets the default parameters on the trimmers and the processes

selected.2 ÷ 51 Sets the number of steps on the trimmers and the processes

selected.

step_val parameter:

The meaning of this parameter depends on the value of the "sele" parameter

step_val values ofsele

parameter

Description

0 0 to 4 System default values> 0 0 to 4 Specifies the value to be assigned to each single trimmer

step. This value must be multiplied by 100, and thereforeto obtain 10% increments, the value to be supplied is1000 (10x100).

>= 0 5 to 8 Specifies the index of the MW variable containing thearray of values to be ascribed to each step.

Page 268: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-20 10 Series CNC WinPLUS Library - User Manual (03)

NOTES

The default values of the "step_sele" and "step_val" parameters ("sele" = 0 to 4) are listed in thetable below:

step_sele step_valSPEED 10 500FEED 10 1250MANUAL JOG 10 1000RAPID JOG 10 1000

If sele = 5 to 8, the initial index of the array of values is given by the step_val parameter. Bydenoting step_val with K, the array must have the following format:

MW(K) MW(K+1) MW(K+2) MW(K+3) … … MW(K+n)Num Val Current

indexValue 1 Value 2 … … Value n-1

The MW(K) variable will contain the number of values present in the array; variable MW(K+1) willcontain the index of the MW defining the last value actualised; variables from MW(K+2) throughMW(K+n) will contain the values to be actualised with each movement of the trimmer.

Variable MW(K+1) will be updated case by case by the WinMedia Console management softwarefollowing the movement of the trimmer.

stat_wrd parameter

The STAT_WRD variable may assume the following values:

Value Meaning0 OK4 Process number wrong6 Selector number wrong7 "step_sele" parameter out of range8 "step_val" parameter negative9 MW index out of range

USING THE TRIMMERS:

The WinMedia operator console is fitted with three trimmers that are used to change the SPEED,FEED, MANUAL JOG and RAPID OVERRIDE feedrate percentages. The last two are changed bymeans of a single trimmer, the JOG trimmer, which, depending on the process working model,works as either Manual Jog Override or as Rapid Override.

The percentage values of the commands are stored in the relative system SW’s.

If the WinMedia Console has been configured to work with the MW array and the value containedin the SW system variable is not present in the array values, then the current system value

Page 269: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-21

assumed by the WinMedia Console will be the value of the array which is smallest and closest tothe system value (approximation by defect). Thus, if you make a clockwise variation on thetrimmer, the values actualised will be those following the value approximated by defect; a similarprocedure applies if you make a variation in the counterclockwise direction.

Figure 1 shows a trimmer P and the subdivision of the trimmer rotation angle into 10 steps (defaultvalue).

To be able to change the speed associated with a trimmer, you have to make a movement greaterthan the interval between one step and the next.

Example:

Let us assume we have configured the following array for one of the trimmers:

MW100 MW101 MW102 MW103 MW104 MW105 MW106 MW107 MW1087 107 500 1000 1800 2500 3000 3500 4000

If the current system value is 1250 (value saved in SW), then the current value for the WinMediaConsole will be 1000 (value approximated by defect). If you turn the trimmer clockwise, the valueactualised by the WinMedia Console will be 1800.

Furthermore, Feed variations made by means of the trimmer in manual mode will affect bothviewing modalities and routine filter activation; they will be actualised upon the passage toautomatic mode.

P

0

1

2

1. Figure 1

Page 270: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-22 10 Series CNC WinPLUS Library - User Manual (03)

Example 1:

In this example we see how to subdivide the trimmer rotation angle into steps which are ascribed afixed value.

Through the CONS_PUT function described above we can set the working mode of the SPEEDtrimmer in process 1. The rotation angle of the trimmer is subdivided into 10 steps (step_sele =10), each of which is assigned a value of 10% (step_val = 1000). Having set the trimmer, speedpercentage variations can be changed as shown in figure 1.

Let us assume that the trimmer is on position 0. If you turn the trimmer clockwise from 0 to 1 (108degrees), the position is incremented by 3 steps and hence the percentage value will beincremented by:

3 x step_val = 30%

On the other hand, if you turn the trimmer counterclockwise from position 0 to position 2 (180degrees) , the position is decremented by 5 steps and hence the percentage value will be reducedby:

5 x step_val = 50%.

Accordingly, the incremental/decremental values are fixed and determined on the basis of thevalue of step_val.

Page 271: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-23

Example 2:

In this example, we see how to subdivide the trimmer rotation angle into steps and where to findthe speed percentage values as a function of the number of steps covered by the rotation of thetrimmer.

With the CONS_PUT function we set the operation of the SPEED trimmer in process 1. Therotation angle of the trimmer is subdivided into 10 steps (step_sele = 10) and the percentage valueis taken from an array of values in variables MW (MW4000 in the example above). Let us assumewe have an array configured as follows:

MW 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 401110 4007 1000 1500 3500 4000 6000 6500 7000 8500 10000 12500

With reference to figure 1, let us assume that the trimmer is set on 0 and that the system value is65%. If you turn the trimmer from position 0 to position 1, we get a 3 step increment, and hence thedriver will first search for the system value (65%) within the array and after that will actualise thethird next value (100%). The MW4001 variable will be updated with the value of the new index4010.

On the other hand, if you turn the trimmer counterclockwise from position 0 to position 2 we get a 5step decrement and hence the driver will first search for system value (65%) within the array andafter that will actualise the fifth previous value (10%). Variable MW4001 will be updated with thevalue of the new index 4002.

Page 272: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-24 10 Series CNC WinPLUS Library - User Manual (03)

Example 3:

In this example we see how to set the data to obtain a JOG trimmer theoretically divided into twoparts admitting four variations clockwise and four variations counterclockwise (two-directionalMANUAL JOG).

Let us set the operation of the trimmer by means of the CONS_PUT function. The rotation angle ofthe trimmer is subdivided into 8 steps (step_sele = 8) and the percentage value will be taken froman array of values in variables MW (MW4000 in the example above). Negative values must beplaced to the left of the zero, positive values to the right.

The CONS_PUT function must be called before the CONS_ON function. This means that it isnot possible to obtain an immediate activation, and the right sequence is as follows: CONS_OFF,CONS_PUT and CONS_ON.

The array must be compiled as follows:

MW 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 40109 x 1000

07500 5000 2500 0 2500 5000 7500 10000

P

+25%

+50%

+75%+100%-100%

-75%

-50%

-25%0

Page 273: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

10 Series CNC WinPLUS Library - User Manual (03) 7-25

Note:

It is possible to have a one-directional MANUAL JOG with all positive values,

in this case, the array must be compiled as follows:

MW 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 40109 x 0 1000 2000 3000 4000 5000 6000 7000 8000

We can also have a one-directional MANUAL JOG with all negative values,

in this case, the array must be compiled as follows:

MW 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 40109 x 8000 7000 6000 5000 4000 3000 2000 1000 0

See also:

CONS_ON Connects an operator console to a process.

CONS_OFF Disconnects an operator console from a process.

P

+10%

+20%

+30%

+40%

+50%

+60%

+70%0+80%

P

-70%

-60%

-50%

-40%

-30%

-20%

-10%0 -80%

Page 274: 10 Series CNC WinPLUS LIBRARY

Chapter 7Human Interface

7-26 10 Series CNC WinPLUS Library - User Manual (03)

END OF CHAPTER

Page 275: 10 Series CNC WinPLUS LIBRARY

Chapter 8

10 Series CNC WinPLUS Library - User Manual (04) 8-1

AXES RELATED FUNCTIONS

This chapter contains some system function calls dedicated to the servo processor. None of thesefunctions is useful for standard applications. Before you can use these functions in specialapplications a detailed knowledge of the control's architecture and the algorithms applied isrequired.

GET REAL AXIS POSITION ........................................................................................ GETAXINTCHANGE THE SERVO MODE OF AN AXIS............................................................... AX_CHASENABLE PROBING SIGNAL FOR ONE OR MORE AXES......................................... AX_PROBREAD THE PROBED POSITIONS FOR ONE OR MORE AXES................................ AX_RDPBABORT THE ACTUAL OPERATION OF THE ADDRESSED AXIS............................ AX_RESEWRITE TO ZERO SHIFT OFFSET #1......................................................................... AX_ZSH1WRITE TO ZERO SHIFT OFFSET #2......................................................................... AX_ZSH2ACTIVATE AXIS MONITOR FUNCTIONS/GEAR RANGE ......................................... AX_SELERESET THE AXIS' POSITION..................................................................................... AX_RPOSALLOW THE ACTIV. OF DIFF. FUNCTIONS FOR THE SPECIFIED AXIS ............... AX_SETZGET AXIS SPINDLE SERVO PARAMETERS............................................................. AX_GET1GET AXIS SPINDLE SERVO PARAMETERS............................................................. AX_GET2GET AXIS SPINDLE SERVO PARAMETERS............................................................. AX_GET2BGET AXIS SPINDLE SERVO PARAMETERS............................................................. AX_GET3GET AXIS SPINDLE SERVO PARAMETERS............................................................. AX_GET4GET AXIS SPINDLE SERVO PARAMETERS............................................................. AX_GET5GET AXIS SPINDLE SERVO PARAMETERS............................................................. AX_GET6GET AXIS SPINDLE SERVO PARAMETERS............................................................. AX_GET7GET AXIS SPINDLE SERVO PARAMETERS............................................................. AX_GET8SET AXIS SERVO PARAMETERS.............................................................................. AX_PUT1SET AXIS SERVO PARAMETERS.............................................................................. AX_PUT2SET AXIS SERVO PARAMETERS.............................................................................. AX_PUT2BSET AXIS SERVO PARAMETERS.............................................................................. AX_PUT3SET AXIS SERVO PARAMETERS.............................................................................. AX_PUT4GET AXIS STATUS...................................................................................................... AX_GETSWRITES AXIS STATUS............................................................................................... AX_PUTSSET THE TRANSDUCER ERDC................................................................................. TC_CONF

Page 276: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-2 10 Series CNC WinPLUS Library - User Manual (04)

READ THE PHYSICAL POSITION OF THE TRANSDUCER..................................... TC_READ1SET D/A CONVERTER OUTPUT ............................................................................... TC_WRITCONFIGURES DRIVER FOR R.T. DATA COMMUNICATION .................................. FAX_WCONREAL TIME UPDATING OF AN AXIS’ ZERO SHIFT VALUE .................................... FAX_RCONCONFIGURES DRIVER FOR R.T. DATA COMMUNICATION .................................. FAX_PUTREADS IN R.T. A NUMBER OF AXIS PARAMETERS............................................... FAX_GETREADS A NUMERICAL PARAMETER FROM A DIGITAL DRIVE............................. AXD_RDDWRITES A NUMERICAL PARAMETER TO A DIGITAL DRIVE................................. AXD_WRDREADS A STRING PARAMETER FROM A DIGITAL DRIVE .................................... AXD_RDSWRITES A STRING PARAMETER TO A DIGITAL DRIVE ........................................ AXD_WRSSET THE ENABLE/DISABLE BITS FOR A DIGITAL DRIVE ..................................... AXD_PUTSEND A COMMAND TO A DIGITAL DRIVE .............................................................. AXD_CMDWRITES AMP AXES PARAMETERS ......................................................................... AX_WPARREADS AMP AXES PARAMETERS........................................................................... AX_RPARWRITES OS3 DRIVES PARAMETERS ASSOCIATED WITH AXES......................... AX_FWWREAD THE STATUS OF A MECHATROLINK DRIVE................................................ AX_MECSREAD THE PARAMETERS OF A MECHATROLINK DRIVE..................................... AX_MECRWRITE THE PARAMETERS OF A MECHATROLINK DRIVE ................................... AX_MECWREAD OS-WIRE VARIABLES IN REAL TIME............................................................ AX_RTFBCK

NOTE:In the following pages the word "conf" that you will find in a number of tables, corresponds to themeasurement unit configured by the machine (mm or inches).

Page 277: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-3

GETAXINT: Get real axis position

Type: Wait

LD/FBD:

ST:stat_wrd := GETAXINT(ax_id, pos_val, offs_val, units);

INPUT VARIABLE: axes identifier (int)OUTPUT VARIABLES: real axis position (lreal)

active offset (lreal)units of the required value (mode) (int)function status output (int)

Description:

The function returns three output parameters:

POS_VAL is the axis' physical position with respect to HOME POSITION, that is theABSOLUTE value that the screen displays

OFFS_VAL is the total offset that includes all origins (UAO,UTO,UIO) and offset(G92) .

UNITS it is the measurement unit of the active process and of data returned bythe function; it may have one of the following values:

Value Meaning0 inches1 millimetres2 degrees

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id

stat_wrd

Page 278: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-4 10 Series CNC WinPLUS Library - User Manual (04)

AX_CHAS: Change the servo mode of an axis

Type: No Wait

LD/FBD:

ST :stat_wrd := AX_CHAS(ax_id, serv_mod) ;

INPUT VARIABLES: axis identifier (int)servo mode (int)

OUTPUT VARIABLE: function status output word (int)

Description:

The AX_CHAS function changes the axis servo mode (not admissible on digital axis).Servo modes selectable with the "serv mod" parameter, are the following:

1. VFF (Velocity Feed Forward) It is a one-feed servo mode: no feedback check is made (open loop). This servo mode is

utilized for normal spindle management

2. Position Without VFF it is a position servo mode based on the following error, with no check on velocity feed (closed

loop)

3. Stand still The axis is not in servo mode (open loop); only the servo error check is active in order to

monitor the position. Converter voltage (analogic output) is nil

4. Position With VFF It is a servo mode position with velocity check . In this case the following error is close to zero.

Closed loop servo mode with feed rate and error checks. The algorithm used makes it possibleto minimise the following error.

The servo mode type set with this function remains active until the axis is moved, from process toWinPLUS: in this case the system, after sending in execution the motion command and beforestarting the motion, changes the servo mode by re-activating the mode configured in AMP.

The hand wheel, which is controlled directly by the logic, uses modes 2 (position without VFF) and3 (stand still).

The output parameter STAT_WRD always returns 0.

stat_wrd

Page 279: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-5

AX_PROB: Enable probing signal for one or more axis

Type: No Wait

Type: Wait for Mechatrolink axes

LD/FBD:

* ax_id must be copied for the number od desired axis

ST:stat_wrd := AX_PROB(ax_id, …) ;

INPUT VARIABLES: axis identifier 1 (int)....axis identifier n (int)

OUTPUT VARIABLE: function status output word (int)

Description:

The AX_PROB function enables value reading and storage relative to the axes specified in thesame moment when the touch probe signal is generated.The axes involved in this function cannot be virtual axes or cannot be used in the "electronic cam"application: in this case the command is not accepted and no error message is given.Enabling to touch probe sign recognition leads to the armature of the touch probe connected to theaxes board, that is a hardware component (ERDC) handling the touch probe function is activated.When the torch probe carries out the probing cycle, the axes values of the probed point are storedin an internal register that is located in the axes board. After each touch probe the signal must berestored through AX_PROB so that the following touch probe is recognized.Values of the above register may be read through AX_RDPB.To cancel the command, call AX_RESE.

stat_wrd

Page 280: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-6 10 Series CNC WinPLUS Library - User Manual (04)

AX_RDPB: Read the probed positions of one or more axes

Type : Wait

LD/FBD:

∗ The input AI and the output QF must be copied for the number of requested axes. The functionblock is structured to always copy AI and QF in a copy.

ST:stat_wrd := AX_RDPB(ax_val, ax_id, …) ;

INPUT VARIABLES: first axis identifier (int)……last axis identifier (int)

OUTPUT VARIABLES: array probed values (lreal)status word (int)

Description:

The AX_RDPB function reads probed values of the axes involved in the probing cycle.This function must be called after executing the probe cycle.The probed positions returned by the function AX_RDPB are values expressed in configured units(mm, inches or degree).Reading of the probed value DOES NOT take into consideration Horizontal Shift (present in UPAprocess variable), Vertical Shift (present in UPO process variable) and probe ball radius.

stat_wrd

Page 281: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-7

In order to calculate the actual value recorded with respect to the concerned axis' home position, itis necessary to make the following calculation:

value recorded by the logic + probe ball radius - Horizontal Shift

or:

value recorded by the logic + probe ball radius - Vertical Shift

Both Horizontal and Vertical shift values must be used with their relative sign.

Example:Value read through $FAX_GET = 109.7464Probe ball radius = 0.9801Horizontal Shift = 0.2671Actual value = (109.7464 + 0.9801 - ( - 0.2672)) = 110.9937

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id

NOTE:No check is made on the number of “ax_id” duplications and on the execution of the function withthese wrong parameters may generate anomalies.

Page 282: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-8 10 Series CNC WinPLUS Library - User Manual (04)

AX_RESE: Abort the actual operation of the addressed axis

Type: No Wait

LD/FBD:

ST:stat_wrd := AX_RESE(ax_id);

INPUT VARIABLE: axis identifier (int)OUTPUT VARIABLE: function status output word (int)

Description:

This routine is used to abort (reset) a homing or probing cycle in progress.

The output variable STAT_WRD always returns zero.

stat_wrd

Page 283: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-9

AX_ZSH1: Write zero shift offset #1

Type: Wait

LD/FBD:

ST:stat_wrd := AX_ZSH1(ax_id, zero_shf_val);

INPUT VARIABLES: axis identifier (int)zero shift value for register 1 (lreal)

OUTPUT VARIABLE: function status output word (int)

Description:

The zero shift value in above function is interpreted as an absolute value that must be forced in thezero shift registers on the servo processor module. The amount of zero shift offset will be utilizedalthough the axis has not completed a homing cycle.

WinPLUS will cause the addressed axis to move if counts are written (added) to this feedbackoffset register. The axis' actual position register and commanded position registers will not change.The zero shift offset can be used to compensate for axis errors (e.g. temperature) or to cause aphysical shift of the origin.

NOTE:In the present release of the control the zero shift value is expressed in the configured unitmeasure (mm/inch/degrees).

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id

stat_wrd

Page 284: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-10 10 Series CNC WinPLUS Library - User Manual (04)

AX_ZSH2: Write zero shift offset #2

Type: Wait

LD/FBD:

ST:stat_wrd := AX_ZSH2(ax_id, zero_shf_val);

INPUT VARIABLES: axis identifier (int)zero shift value for register 2 (lreal)

OUTPUT VARIABLE: function status output word (int)

Description:

The functionality of this system function call is identical with the call for zero shift #1 register. Thisfunction gives WinPLUS the power to manage a second zero shift independent of the first one.WinPLUS can thus keep track of different sources for the offset such as temperature compensationor hand pulse generator.

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id

stat_wrd

Page 285: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-11

AX_SELE: Activate axis monitor functions / gear range

Type: No Wait

LD/FBD:

ST:stat_wrd := AX_SELE(ax_id, ax_func_val);

INPUT VARIABLES: axis identifier (int)axis monitor function or gear range (int)

OUTPUT VARIABLE: function status output word (int)

Description:

The AX_SELE function allows to:

• select the gear fore spindle axes

• set the axis' type of servo error

GEAR SELECTION

4 gears, configured in AMP, are associated to each spindle axis.The AX_SELE function allows to select the desired gear.The command is always accepted, on condition that the axis:

• is enabled

• is not in TEST mode

• is not involved in an "electronic cam" application

stat_wrd

Page 286: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-12 10 Series CNC WinPLUS Library - User Manual (04)

The 4 available gears may be selected through "ax_func_val" parameter:

ax_func_val Meaning

0 gear 1

1 gear 2

2 gear 3

3 gear 4

The gear set through this function remains active until a further gear change command is given oruntil the system is switched off; when the system is switched on a second time, gear 1 is activated.

SERVO ERROR

Servo Error is a parameter associated to servo mode which is used to set maximum accepteddeviation between the calculated point and the actual axis' position: this value varies in accordancewith the motion type.

Two types of servo error may be selected through "ax_func_val":

ax_func_val Servo error type

4 POSITION WITH VFF (for axis in motion)

5 POSITION WITHOUT VFF (for axis in motion)

6 STAND_BY (to be used only when the axis isstill)

Execution of the above function involves activation of the relevant servo error values configured inAMP.

The type of servo error, and associated values, set with the above function are active until the axisis moved, from process or WinPLUS; before starting the motion, the system starts a servo errorchange by re-activating the mode configured in AMP.

The output STAT_WRD always returns zero.

Page 287: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-13

AX_RPOS: Resets the axis' position

Type: Wait

LD/FBD:

ST:stat_wrd := AX_RPOS(ax_id);

INPUT VARIABLE: axis id (int)OUTPUT VARIABLE: status word (int)

Description:

The function sets the axis' position to zero; the new, displayed value is given by the remainderresulting from the division between the axis position and the mechanic pitch.This way of taking to zero is used for analog axes (not admissible on digital axes) that movealways in the same direction (for example a rotary axis that rolls up a thread or a "tapis roulant"linear axis ); in this case, if AX_RPOS is not utilized, the screen position is always increased untilthe maximum position is exceeded (see formula below) thus generating a system anomaly.

(maximum number of impulses)maximum position = ------------------------------------------------ * mechanical pitch

electrical pitch

"Maximum number of impulses" is: 2147483647 (7FFFFFFF).

The function must be executed only after the axis' homing cycle is over.If a Home Position value is present, the point where the axis' position is reset becomes the newHome Position point.If Zeroshift values are active when the AX_RPOS function is executed, these values are zeroedafter the axis position is reset.The function is not executed if the axis is in motion or if the axis is locked; in the latter case thefunction returns 1 in the "stat_wrd" variable.

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK1 moving axis or in test mode-1 wrong or not configured ax_id

stat_wrd

Page 288: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-14 10 Series CNC WinPLUS Library - User Manual (04)

AX_SETZ: Allows the activation of different functions for the specified axis

Type: No Wait

LD/FBD:

ST:stat_wrd := AX_SETZ(ax_id, funz_num);

INPUT VARIABLES: axis identifier (int)function code (int)

OUTPUT VARIABLE: function status output (int)

Description:

This function performs different operations depending by the funz_num parameter value:

0: it sets the axis position to zero as the AX_RPOS Function Block.

1: it sets the axis position to the Home Position value and resets the internal counters of theZeroshift 1/2 and Nulloffset.

The function is not executed if the axis is moving or in test mode (axis "locked").

This function is not executed for digital axes with D.S.I. interface.

It can be used on digital axes with OS-Wire interface and transducer on the motor.

The function can be used on axes with Mechatrolink interface.

The STAT_WRD output variable may assume the following values:

Value Meaning0 Function executed successfully1 error, axis moving or in test mode-1 error, axis not configured or axis identifier out of range2 error, D.S.I. digital axis or OS-Wire axis with exterior transducer.

stat_wrd

Page 289: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-15

AX_GET1: Get axis (spindle) servo parameters

Type: Wait

LD/FBD:

ST:stat_wrd := AX_GET1(ax_id, para_num, var_val);

INPUT VARIABLES: axis identifier (int)parameter number (int)

OUTPUT VARIABLES: value (lreal)function status output (int)

Description:

This function reads the following parameters:

Para_num Information Unit format

1 POINT: interpolated point conf. lreal

2 ACTPOS: current position conf. lreal

3 FOLERR: following error conf lreal

The POINT parameter allows to read the calculated quota of the operative system in respect of the“home position”.

The ACTPOS parameter allows to read the transducer’s quota in respect of the “home position”

The FOLERR parameter allows to read the following error's value.

stat_wrd

Page 290: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-16 10 Series CNC WinPLUS Library - User Manual (04)

The following error is given by the difference between the calculated and physical positions,including offset and origins; this information can be found on the screen by displaying the axes'position in ERROR mode.

In case of a spindle axis, the FOLERR parameter shows the spindle's actual rotation speedexpressed in interpolator tick.

The spindle's actual rotation speed can be found on the screen, under the axes' position, underletter S (speed), beside the set, percentage value: this value is obtained through the followingformula:

FOLERR * 60000(Screen) speed = -----------------------------------------

interpolator clock

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id1 wrong para_num (the value is 1÷3)

Page 291: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-17

AX_GET2: Get axis (spindle) servo parameters

Type: Wait

LD/FBD:

ST:stat_wrd := AX_GET2(ax_id, para_num, val1, val2, val3);

INPUT VARIABLES: axis identifier (int)parameter number (int)

OUTPUT VARIABLES: value 1 read (lreal)value 2 read (lreal)value 3 read (lreal)function status output (int)

Description:

This function reads parameters relative to available gears for spindle axes.Following are the available information:

Para_num Information Unit format

1 ACTGEAR: current gear usedval1 - KcKvval2 - Kcval3 - Kcs

---

lreallreallreal

2 GEAR1: constants of gear 1val1 - KcKvval2 - Kcval3 - KcKv

---

lreallreallreal

3 GEAR2: constants of gear 2val1 - KcKvval2 - Kcval3 - KcKv

---

lreallreallreal

4 GEAR3: constants of gear 3val1 - KcKvval2 - Kcval3 - KcKv

---

lreallreallreal

stat_wrd

Page 292: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-18 10 Series CNC WinPLUS Library - User Manual (04)

5 GEAR4: constants of gear 4val1 - KcKvval2 - Kcval3 - KcKv

---

lreallreallreal

Parameters relative to each gear have the following values:

KcKv it is the Kv axis gain multiplied by the D/A's Kc constant. This constant is used during allclosed loop operations of an axis and also for the closed loop reset in the in spindleorientation:

(mechanical_pitch) * (interpolated_clock) * (servo_loop_gain) * 16.666KcKv = Kc *

(electrical pitch) * 1000

Kc It is the D/A constant. It defines the relationship between analogical voltage and axesspeed

Voltage * 6000 * 8192Kc =

Max. feed * (clock interpolator)

Kcs It is the spindle's D/A constant. It defines the relationship between analogical voltageand the spindle's RPM

Voltage * 8192Kcs =

Max_feed* 10

Page 293: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-19

Parameters GEAR1, GEAR2, GEAR3 and GEAR4 reflect the values of KcKv, Kc and Kcsconfigured in AMP.

Parameter ACTGEAR reads the values of the gear constants currently used, that is the values ofthe gear active in the precise moment when the parameter is read; currently used gear constantsare a copy of those relative to the gear that has been actualized through the SETRANG orAX_SELE functions.

The values of the currently used gears may be different from those of the AMP-corresponding gearbecause they may have been modified through the AX_PUT3 function (para_num=1).

Any changes present on the currently used constant gears are lost when the system is switchedoff.

Values configured in AMP are not modified by this function.

Value Meaning0 OK-1 wrong or not configured ax_id1 wrong para_num (the value is 1÷5)

Page 294: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-20 10 Series CNC WinPLUS Library - User Manual (04)

AX_GET2B: Get axis (spindle) servo parameters

Type: Wait

LD/FBD:

ST:stat_wrd := AX_GET2B (ax_id, para_num, val1, val2, val3, val4);

INPUT VARIABLES: axis identifier (int)parameter number (int)

OUTPUT VARIABLES: value 1 read (lreal)value 2 read (lreal)value 3 read (lreal)value 4 read (lreal)function status output (int)

Description:

This function reads parameters relative to available gears for spindle axes.Following are the available information:

Para_num Information Unit format

1 ACTGEAR: current gear usedval1 - KcKvval2 - Kcval3 – Kcsval4 - MaxFeed

---

doubledoubledoubledouble

2 GEAR1: constants of gear 1val1 - KcKvval2 - Kcval3 – KcKvval4 - MaxFeed

---

doubledoubledoubledouble

3 GEAR2: constants of gear 2val1 - KcKvval2 - Kcval3 – KcKvval4 - MaxFeed

---

doubledoubledoubledouble

stat_wrdstat_wrdB

val4

Page 295: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-21

4 GEAR3: constants of gear 3val1 - KcKvval2 - Kcval3 – KcKvval4 - MaxFeed

---

doubledoubledoubledouble

5 GEAR4: constants of gear 4val1 - KcKvval2 - Kcval3 – KcKvval4 - MaxFeed

---

doubledoubledoubledouble

Parameters relative to each gear have the following values:

KcKv it is the Kv axis gain multiplied by the D/A's Kc constant. This constant is used during allclosed loop operations of an axis and also for the closed loop reset in the in spindleorientation:

(mechanical_pitch) * (interpolated_clock) * (servo_loop_gain) * 16.666KcKv = Kc *

(electrical pitch) * 1000

Kc It is the D/A constant. It defines the relationship between analogical voltage and axesspeed

Voltage * 6000 * 8192Kc =

Max. feed * (clock interpolator)

Kcs It is the spindle's D/A constant. It defines the relationship between analogical voltageand the spindle's RPM

Voltage * 8192Kcs =

Max_feed* 10

MaxFeed: is the maximum feedrate at which an axis can move, and it also serves as a referencevalue for the determination of the three parameters described above.

Parameters GEAR1, GEAR2, GEAR3 and GEAR4 reflect the values of KcKv, Kc, Kcs andMaxFeed configured in AMP.Parameter ACTGEAR reads the values of the gear constants currently used, that is the values ofthe gear active in the precise moment when the parameter is read; currently used gear constantsare a copy of those relative to the gear that has been actualized through the SETRANG orAX_SELE functions.The values of the currently used gears may be different from those of the AMP-corresponding gearbecause they may have been modified through the AX_PUT3 function (para_num=1).Any changes present on the currently used constant gears are lost when the system is switchedoff.Values configured in AMP are not modified by this function.

Page 296: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-22 10 Series CNC WinPLUS Library - User Manual (04)

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id1 wrong para_num (the value is 1÷5)

Page 297: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-23

AX_GET3: Get axis (spindle) servo parameters

Type: Wait

LD/FBD:

ST:

stat_wrd := AX_GET3(ax_id, para_num, var_val);

INPUT VARIABLES: axis identifier (int)parameter number (int)

OUTPUT VARIABLES: value (lreal)function status output (int)

Description:

This function reads the value of the current servo error constant.

Para_num Information Unit format

1 ACTSERR: current servo error constant

conf. double

The ACTSERR parameter is the current servo error value.The current servo error is the servo error congruent with the axis' status in fact 3 servo errors areconfigured in AMP:

• "position error at stand still"

• "position error without VFF"

• "position error with VFF"

stat_wrd

Page 298: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-24 10 Series CNC WinPLUS Library - User Manual (04)

The ACTSERR parameter is a dynamic parameter since it is a temporary copy of the AMPconfiguration that may be modified from logic through AX_PUT1 (para_num).

Original values are restored in different moments, according to the axis' servo type valid in themoment the request is made (AX_PUT1).

For further information, see also AX_PUT1.

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id1 para_num different from 1

Page 299: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-25

AX_GET4: Get axis (spindle) servo parameters

Type: Wait

LD/FBD:

ST:stat_wrd := AX_GET4(ax_id, para_num, val1, val2, val3);

INPUT VARIABLES: axis identifier (int)parameter number (int)

OUTPUT VARIABLES: value 1 read (lreal)value 2 read (lreal)value 3 read (lreal)function status output (int)

Description:

This function reads the servo error values defined in AMP.

Para_num Information Unit format

1 SERVERR : servo error values

VAL1 position error at stand still

VAL2 position error without VFF

VAL3 position error with VFF

conf.

conf.

conf.

lreal

lreal

lreal

stat_wrd

Page 300: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-26 10 Series CNC WinPLUS Library - User Manual (04)

The SERVERR parameter reads the values of servo error in AMP.

There are three types of servo error, each of which is used according to the axis status:

• servo error at stand still

• position error without VFF

• position error with VFF

The set servo error values cannot be changed.

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id1 para_num different from 1

Page 301: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-27

AX_GET5: Get axis (spindle) servo parameters

Type: Wait

LD/FBD:

ST:stat_wrd := AX_GET5(ax_id, para_num, val1, val2, val3);

INPUT VARIABLES: axis identifier (int)parameter number (int)

OUTPUT VARIABLES: value 1 read (lreal)value 2 read (lreal)value 3 read (lreal)function status output (int)

Description:

This function reads information relative to relative to tolerance constants:Following are the available information:

Para_num Information Unit format1 ACTOLL: currently used tolerance

constantsval1 - in position bandval2 - in position waitval3 - in position window

conf.sec.sec.

lreallreallreal

2 TOLL: configured tolerance constantsval1 - in position bandval2 - in position waitval3 - in position window

conf.sec.sec.

lreallreallreal

stat_wrd

Page 302: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-28 10 Series CNC WinPLUS Library - User Manual (04)

Parameter VAL1 "in position band" represents the tolerance field's length.

Parameter VAL2 "in position wait" represents the maximum time (time out) for the axis to enter thetolerance field.

Parameter VAL3 "in position window" represents the minimum time for the axis to remain in thetolerance filed.

An axis is in tolerance when it remains inside the tolerance field ("in position band") for a minimumtime ("in position window").

This limit allows to filter overshoots that would inevitably make the axis enter and exit the tolerancefield.

Furthermore, the maximum time (in position wait) is also set for tolerance filed entry (in positionband).

If the axis does not enter the tolerance field in the established time "in position wait", a recoverableemergency is generated: the system displays a message (time-out tolerance error) and enters theerror status.

Reading of the "TOLL" parameter supplies tolerance data configured in AMP.

Reading of the "ACTOLL" parameter supplies tolerance data active in that moment; these are acopy of those configured in AMP and modified through AX_PUT3 (para_num=1).

The current values remain valid until further changes are made or until the system is switched off.

On following system switch on, the values configured in AMP are restored.

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id1 para_num different from 1-2

For further information, see "emergency management", WinPLUS Application Manual

Page 303: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-29

AX_GET6: Get axis (spindle) servo parameters

Type: Wait

LD/FBD:

ST:stat_wrd := AX_GET6(ax_id, para_num, var_val);

INPUT VARIABLES: axis identifier (int)parameter number (int)

OUTPUT VARIABLES: value (int)function status output (int)

Description:

This function reads the following information:

Para_num Information Unit format

1 AX_TYPE: axis type -- int

2 CLOCK: servo clock -- int

3 CLOCKRAT: interpol.clock/servo clock -- int

4 AX_MASTER: master axis id for spindle -- int

5 DRIVE_WARNING: reads warning code ofa OSWire drive OS3

-- int

6 DRIVE_STATUS: reads status of a OSWiredrive OS3 or status word of a D.S.I. drive

-- int

7 DRIVE_IOSTAT: reads digital inputs of adrive OS3 or a OSWire Bridge

-- int

8 ERDC_CONFIG : reads channelsconfiguration of the encoder.

-- int

stat_wrd

Page 304: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-30 10 Series CNC WinPLUS Library - User Manual (04)

The AX_TYPE parameter, axis type, is a word that must be read by bit according to the followingtable:

Bit Bin Val. Hex Val. Meaning0 1 1 H linear axis1 2 2 H 0 = co-ordinate axis, 1 = point to point axis2 4 4 H rotary axis3 8 8 H reserved for future use4 16 10 H spindle without transducer5 32 20 H spindle with transducer6 64 40 H diameter axis7 128 80 H reserved8 256 100 H virtual axis9 512 200 H axis with optical string

10 1024 400 H not used11 2048 800 H spindle with acc./dec. ramp12 4096 1000 H split master axis13 8192 2000 H split slave axis14 16384 4000 H rollover axis15 32768 8000 H digital axis

A co-ordinate axis may be linear, virtual or rollover. A point-to-point (or auxiliary) axis may belinear or rotary. According to the above table, if a bit is equal to 0, this means the axis is co-ordinate; if the bit is equal tp 1, this means the axis is point-to-point. Combination of bit 1 with thefollowing bits indicates the type of axis.

Example:AX_TYPE = 4 Bit 1=0 co-ordinate axis

Bit 2=1 rotary axis

AX_TYPE = 3 Bit 1=1 point-to-point axisBit 0=1 linear axis

The CLOCK parameter returns the servo clock configured in AMP ("Position Loop Lock"),multiplied by 10.The CLOCKRAT parameter is the relationship between interpolator clock, presentin AMP, "interpolator clock", and the servo clock.The AX_MASTER parameter shows the master axis identifier used by the spindle when working inG96, constant cut speed.

The significant bits for DRIVE_WARNING parameters are:

Value Message Meaning0 W_NONE no active warning1 W_HEATSINK Heat sink overheat Warning2 W_BUSOVERV Bus Overvoltage Warning4 W_BUSUNDERV Bus Undervoltage Warning

For further details, see “Drive OS3 – Installation Manual”.

Page 305: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-31

For the DRIVE_STATUS parameter for drives OS3, the status word can take on the followingvalues:

Value Message Meaning

Bit 0-3 STO-3 Current status code

Bit 4 STOP Axis stationary

Bit 5 AXREF Axis homed

Bit 6 BRAKE Brake status (0 means not braked or not present)

Bit 7 HOME Homing underway

Bit 8 ZERO_SW Status of zero micro input

Bit 9 AUTOTRG Cmd Point2Point , StepCurr or StepVel underway

Bit 10 FFW_ON Feed Forward (speed and acceleration) enabled

Bit 11 NOT_USED Not Used

Bit 12 ALRM Alarm condition

Bit 13 SERVO Servo Loops are active

Bit 14 POWR Power present: Vbus OK

Bit 15 MARKER_STS Marker found

Drive OS3 status codes:

ST3 ST2 ST1 ST0 Status

0 0 0 0 DRIVE START

0 0 0 1 DIAGNOSTIC

0 0 1 0 DRIVE_OFF

0 0 1 1 DRIVE_ON

0 1 0 0 HOLD

0 1 0 1 SHUT_DOWN

0 1 1 0 SHUT_TFIX

0 1 1 1 SHUT_IGBT

1 0 0 0 HALT

For further details, see “Drive OS3 – Installation Manual”.

For the DRIVE_STATUS parameter for D.S.I. drives, see drive supplier’s manual.

Page 306: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-32 10 Series CNC WinPLUS Library - User Manual (04)

As for the DRIVE_IOSTAT parameter, readable inputs from a drive OS3 are:

Value Meaning

Bit 0 GPI2 General Purpose Input 2

Bit 1 GPI1 General Purpose Input 1

Bit 2 MICRO Zero Micro input

Bit 3 RHALT Rapid Halt input

Bit 4 GP03 General Purpose Output 3

Bit 5 GP02 General Purpose Output 2

Bit 6 GP01 General Purpose Output 1

Bit 7 DRDY Drive Ready output

Bit 8 FRMOT Motor Brake output

Bit 9-15 Not used

For further details, see “Drive OS3 – Installation Manual”.

From a Bridge :

Value Meaning

Bit 0 GPI0 General Purpose Input 0

Bit 1 GPI1 General Purpose Input 1

Bit 2 GPI2 General Purpose Input 2

Bit 3-15 Reserved

ERDC_CONFIG is a programming parameter for analog axes (see also TC CONF). It is word to beread by bits according to the following table:

Bit Bin val. Hex val. Meaning0 1 1 H Inverts the polarity of the signal from channel A1 2 2 H Inverts the polarity of the signal from channel B2 4 4 H Inverts the polarity of the signal from channel Z3 8 8 H Inverts the direction of reading of the counter4 16 10H Marker is detected on level5 32 20H Marker is detected on edge

The STAT_WRD output variable may assume the following values:

Value Meaning

0 OK

Page 307: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-33

-1 ax_id wrong or not configured

1 para_num wrong (must be 1-4)

2 virtual or analog axis (not permitted in some cases)

3 address of device on OSWire bus cannot be traced

4 axis not connected to Bridge

1003 axis inhibited due to severe error

Page 308: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-34 10 Series CNC WinPLUS Library - User Manual (04)

AX_GET7: Get axis (spindle) servo parameters

Type: Wait

LD/FBD:

ST:stat_wrd := AX_GET7(ax_id, para_num, var_val);

INPUT VARIABLES: axis identifier (int)parameter number (int)

OUTPUT VARIABLES: value read (lreal)function status output (int)

Description:

This function reads the following information:

Par. # Par. name Meaning Unit of measure Format1 NULLOFF null offset configured lreal2 VFF VFF value/spindle RPM * lreal3 ELPITCH electrical pitch * lreal4 MECPITCH mechanical pitch * lreal5 RPITCH e-pitch/m-pitch * lreal6 MANACC manual mode acceleration * lreal7 RAPACC rapid traverse acceleration * lreal8 MANVEL manual mode feed * lreal9 RAPVEL rapid traverse feed * lreal10 SPINRAMP spindle acceleration * lreal11 BACKLASH axis reversal error configured lreal12 DEADZONE axis dead zone configured lreal13 VELZEROM home search speed * lreal14 LOP+ positive software limit configured lreal15 LOP- negative software limit configured lreal16 SPIN_POS prefixed position for spindle

orientation* lreal

17 SPIN_SPEED limit speed for spindle orientation * lreal18 ZEROSHIFT1 zeroshift 1 configured lreal19 ZEROSHIFT2 zeroshift 2 configured lreal20 VFF_PERCENT VFF percentage configured lreal

stat_wrd

Page 309: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-35

21 HOME_POS zero setting position configured lreal22 KCKVSTBY stand_by kckv * lreal23 DIST_MARK_MICRO marker-micro offset zero configured lreal24 RAPJRK rapid Jerk * lreal25 MANJRK manual/working * lreal26 BACKLASH_TIME Backlash application time msec double

∗ The unit of measure for these parameters is specified in the description of the relevant field.

The NULLOFF parameter is the current null offset value; it corresponds to the value configured inAMP in the "Null offset value" field.

The VELZEROM parameter shows the homing speed expressed in mm/interpolator clock asshown in the formula below:

(value configured in AMP)VELZEROM = ✱ clock_interp

60,000

NULLOFF and VELZEROM values are those configured in AMP. They can be modified by the logicuser during program execution by means of the $AX_PUT1 (para_num=2 and para_num=10)function; in this case the new input values are updated in the subsequent homing cycle and remainactive unless the system is switched off or further alterations are made.

VFF contains different data, depending on the type of axis.If the axis is a spindle, the parameter will contain the spindle speed in RPM, otherwise it willcontain the axis speed expressed in mm/interpolator clock, as shown in the formula below:

(programmed value) * (interpolator clock)VAR_VAL =

time unit

time_unit is 60,000 if the interpolator clock is expressed in mSec.

600,000 if the interpolator clock is expressed in tenths of mSec.

The ELPITCH parameter shows the electrical pitch value, which is the number of impulses pereach revolution of the transducer multiplied by 4.

The ELPITCH parameter corresponds to the value configured in AMP, in the "electrical pitch" filed.

The MECPITCH parameter shows the mechanical pitch value , that is the distance covered by theaxis for each revolution of the associated transducer; it corresponds to the value configured inAMP, in the "mechanical pitch" field.

The RPITCH parameter shows the value between electrical and mechanical pitch.

The MANACC and MANVEL parameters show manual mode current acceleration and speedvalues respectively.

The MANACC and MANVEL values are those configured in AMP, in "manual acceleration andmanual feed" but they can be modified by the logic user during execution of the program through$AX_PUT1 (para_num=3 and para_num=5); in this case the new inserted values are applied to the

Page 310: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-36 10 Series CNC WinPLUS Library - User Manual (04)

following axis motion and they remain active until the system is switched off or until furtherchanges are made.

The RAPACC and RAPVEL parameters show the current acceleration and Rapid traverse speedrespectively.

The RAPACC and RAPVEL values are those configured in AMP, in "rapid acceleration" and "rapidtraverse feed" but they can be modified by the logic user during the execution of the programthrough the new function $AX_PUT1 (para_num=4 e para_num=6); in this case the new, insertedvalues are applied to the following axis' rapid traverse feed and they are active until the system isswitched off or until further changes are made.

The MANVEL and RAPVEL values are expressed in mm/(interpolator clock).; this value is obtainedfrom the value programmed in AMP (mm/min), according to the following formula:

(value expressed in mm/min inserted in AMP)VAR_VAL = ✱ clock_interp

60,000

Clock_interpolator is the value configured in AMP.

The MANACC and RAPACC values are expressed in square mm/(clock_interp); this value isobtained from the value configured in AMP, according to the following formula:

(value inserted in AMP in mm/sec2)

VAR_VAL = ✱ clock_interp 21,000,000

clock_interpolator is the value configured in AMP.

The SPINRAMP, SPIN_POS e SPIN_SPEED parameters show the spindle current, maximumacceleration values for each servo sampling, the preset position for spindle orientation and thespindle's orientation speed limit, respectively. These last two parameters are configured in AMP, in"offset for spindle orientation" and "speed for orientation", respectively.

The SPINRAMP value is obtained by the values configured in AMP, according to the followingformula:

(servo clock) * Volt * 8192 * 2SPINRAMP =

100,000 * (max spindle reversal time)where "servo clock" is the value obtained with the AX_GET6 function.

The values of SPINRAMP, SPIN_POS and SPIN_SPEED are those configured in AMP but theymay be modified by the logic user during the program execution through $AX_PUT1 (para_num=7,para_num=13 and para_num=14);in this case SPINRAMP's new value is applied immediatelywhile SPIN_POS and SPIN_SPEED are applied at the following spindle orientation: all three ofthem remain active until the system is switched off or until further modifications are made.

SPINRAMP, SPIN_POS and SPIN_SPEED parameters can be changed only on analog axes.

Page 311: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-37

The BACKLASH parameter shows the current rapid traverse speed that is the speed that must becompensated at direction change: it corresponds to the value configured in AMP in "backlash"without including the application time that must be read in the parameter “BACKLASH_TIME”.

The DEADZONE parameter shows the current dead zone's value, that is the programmed finalpoint's tolerance inside which the servo is not updated: it corresponds to the value configured inAMP, in "deadzone". The DEADZONE parameter can be changed only on analog axes.

The BACKLASH and DEADZONE values are a copy of those configured in AMP but they may bemodified by the logic user during program execution through $AX_PUT1 (para_num=8 epara_num=9): in this case the new, inserted values are immediately applied and they remain validuntil the system is switched off or until further changes are made.

The LOP+ and LOP- parameters show the positive software's limit value and the negativesoftware's limit value, respectively; they correspond to the "upper software overtravel" e "lowersoftware overtravel" AMP fields.

LOP+ and LOP- values are a copy of those configured in AMP but they may be modified by thelogic user during program execution through $AX_PUT1 (para_num=11 and para_num=12); in thiscase the new, inserted data is immediately applied because; they remain active until the system isswitched off or until further changes are made.

ZEROSHIFT1 and ZEROSHIFT2 parameters show zeroshift registers 1 and 2, respectively.When the system is switched on ZEROSHIFT1 and ZEROSHIFT2 are at 0 but they may bemodified by the logic user during program execution through $AX_ZSH1 and $AX_ZSH2

Zeroshift register 1 may also be modified through the functions made available by Fast AxesDriver: in this case the new, inserted values will be applied at the servo's first data acquisition andthey will remain active until the system is switched off or until further modifications are made.

The VFF_PERCENT parameter is the percentage of the VFF applying to the axis.

The HOME_POS parameter shows the zero position's value, that is the axis' 0 position referred tothe null offset position and it corresponds to the value configured in AMP in "home position value".

Parameter "KCKVSTBY" is the stand-by value of KcKv, i.e., the gain of axis Kv multiplied by D/Aconstant Kc (only for analog axes).

(mechanical pitch) * (interpolator clock) * (stand still servo loop gain) * 16.666KcKv = KC *

(electrical pitch) * 1000

Kc is the D/A constant and it defines the relationship between analogical voltage and axes speed.

voltage * 6000 * 8192Kc =

(max_feed) * (interpolator clock)

Page 312: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-38 10 Series CNC WinPLUS Library - User Manual (04)

The STAT_WRD output variable can have the following values:

Value Meaning

0 OK

-1 wrong or not configured ax_id

1 wrong para_num (it must be 1÷22,20 excluded)

The parameter “DIST_MARK_MICRO” represents the zero offset between the marker and thehome micro switch. It is signigicant after a HOMING operation. The value is the same as thatdisplayed on the screen at the end of a homing cycle.

The parameters “RAPJRK” and “MANJRK” represent the JERK values used with the rapid and themanual/working speeds and are expressed in mm/interpolator3 clock. This value is derived fromthe value configured in AMP (Rapid JerK or Working JerK) according to the following formula:

(value in AMP in mm/sec3)VAR_VAL = ✱ clock_interp 3

1,000,000,000

where interpolator clock is the value configured in AMP.

The parameter BACKLASH_TIME expresses the time in milliseconds on which the axis backlashis applyed (see notes on BACKLASH_TIME concerning F.B. AX_PUT1.

Page 313: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-39

AX_GET8: Get axis (spindle) servo parameters

Type: Wait

LD/FBD:

ST:stat_wrd := AX_GET8(ax_id, para_num, val1, val2);

INPUT VARIABLES: axis identifier (int)parameter number (int)

OUTPUT VARIABLES: transducer identifier (int)converter identifier (int)function status output (int)

Description:

This function reads the following information:

para_num Information Unit Format

1 TRASD_CONV: trasd/conv. identifierVAL1: transducer identifier - - intVAL2: converter identifier - - int

For non OS-Wire systems, transducer identifiers are given in the table below:

1° board from 0x100 to 0x105

2° board from 0x106 to 0x10B

3° board from 0x10C to 0x111

4° board from 0x112 to 0x117

NOTE:

For number and type of transducers and converters, see also “Table of main resources of axisboards” in Appendix H.

stat_wrd

Page 314: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-40 10 Series CNC WinPLUS Library - User Manual (04)

For OS-Wire systems, transducer identifiers are given in the table below:

1° board from 0x200 to 0x205

2° board from 0x206 to 0x20B

3° board from 0x20C to 0x211

4° board from 0x212 to 0x217

If the board is not a 6-axis or if there are various different boards (i.e. 5.3 and 6 axis), the tablesremain valid only for present transducers and converters.

In OS-Wire systems fitted with Bridge devices or local resources, the identifiers of the transducersand converters follow the rules described in the preface, page 2.

For all types of system, if the transducer or the converter of the axis is not configured, the valuereturned as identifier is –1 -

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id1 para_num different from 1

Example:3 boards with 5.3 and 6 axis with 5.3 and 6 transducers and converters, respectively.

The transducers' identifiers are the following:

Transd.1 Transd.2 Transd.3 Transd.4 Transd.5 Transd.6

1° Board 0x100 0x101 0x102 0x103 0x104

2° Board 0x106 0x107 0x108

3° Board 0x10C 0x10D 0x10E 0x10F 0x110 0x111

The converters' identifiers are the following:

Convert.1 Convert.2 Convert.3 Convert.4 Convert.5 Convert.6

1° Board 0x200 0x201 0x202 0x203 0x204

2° Board 0x206 0x207 0x208

3° Board 0x20C 0x20D 0x20E 0x20F 0x210 0x211

Page 315: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-41

AX_PUT1: Set axis servo parameterType: No Wait

LD/FBD:

ST: stat_wrd := AX_PUT1(ax_id, para_num, par_value);

INPUT VARIABLES: axis identifier (int)parameter number (int)value of the parameter (lreal)

OUTPUT VARIABLE: function status output (int)

Description:

This function writes the following information:

para_num Information Units Format1 ACTSERR actual servo error constant conf. lreal2 NULLOFF null offset conf. lreal3 MANACC manual mode acceleration conf./sec2 lreal4 RAPACC rapid traverse acceleration conf./sec2 lreal5 MANVEL manual mode feed conf./min. lreal6 RAPVEL rapid traverse feed conf./min. lreal7 SPINRAMP spindle acceleration conf./sec2 lreal8 BACKLASH axis reversal error conf. lreal9 DEADZONE axis dead zone conf. lreal10 VELZEROM home search speed conf./min. lreal11 LOP+ positive software limit conf. lreal12 LOP- negative software limit conf. lreal13 SPIN_POS prefixed position for spindle orientation deg. lreal14 SPIN_SPEED limit feed for spindle orientation RPM lreal15 BROKEN WIRE delay time for broken wire detection sec lreal16 HOME_POS home position value conf. lreal17 VFF_PERCENT VFF percentage * lreal18 CHANGECONV new axis converter - lreal19 CHANGETRAS new axis transducer - lreal20 MAX_MICRO_MARKER max. offset micro_marker * lreal21 RAPJRK rapid Jerk * lreal22 MANJRK manual/working * lreal23 ELPITCH Electrical pitch * lreal24 MECPITCH Mechanical pitch * lreal25 STAND STILL-GAIN STAND STILL gain conf. lreal26 BACKLASH_TIME Backlash application time masec lreal

stat_wrd

Page 316: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-42 10 Series CNC WinPLUS Library - User Manual (04)

NOTE:*= for the measurement unit see the following descriptions for each field.

The ACTSERR parameter modifies the servo error's actual value.

The actual servo error is the one congruent with the axis' status; three types of servo error areconfigured in AMP.

• position error at stand still

• position error without VFF

• position error with VFF

ACTSERR parameter is a dynamic parameter because it represents a temporary copy of AMPconfiguration; original values are restored in different moments, according to the axis' status (standstill, in motion) when the AX_PUT1 is called.

If the axis is still: the inserted value remains active until the next motion in fact, at each motionstart the interpolator utilizes the motion configured in AMP.

If the axis is in motion: the inserted value remains active until a new servo error isselected by the interpolator (at "motion start" and "end of motion")

NULLOFF parameter modifies the null offset value configured in AMP ("null offset value" field). Thenew inserted value is utilized in the following homing and is active until the system is switched offor until further modifications are made.

VELZEROM alters the homing velocity value configured in AMP ("home position feed" field). It isexpressed in mm/interpolator clock as shown in the formula below:

(value in mm/min)VELZEROM = ✱ clock_interp

60,000

The new configured value will be utilized in the subsequent homing move and will remain activeuntil the system is switched off or until further modifications are made.

The MANACC and MANVEL parameters show current acceleration and speed values in manualmode. MANACC and MANVEL values are those configured in AMP, in "manual acceleration andmanual feed".

The new configured values are applied to the subsequent axis motion and remain active until thesystem is switched off or until further changes are made.

RAPACC and RAPVEL parameters modify the acceleration and rapid traverse values configured inAMP ("rapid acceleration" and "rapid traverse feed" fields).

MANVEL and RAPVEL values are expressed in mm/interpolator clock.; they are obtained with thefollowing formula:

(value expressed in mm/min)par_value = ✱ clock_interp

60,000

Page 317: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-43

MANACC and RAPACC values are expressed in mm/(clock_interp)2; they are obtained from thevalue configured in AMP with the following formula:

(value in AMP in mm/sec2)VAR_VAL = ✱ clock_interp 2

1,000,000

The new configured values will be utilized in the subsequent homing move and will remain activeuntil the system is switched off or until further modifications are made.The values RAPJRK and MANJRK have to be expressed in mm/(clock_interp)3 and derive out ofthe following formula:

(value to be entered in mm/sec3)Par-value = ✱ clock_interp3

1,000,000,000

The new values will be used for the next axis move and remain enabled until switch-off or the nextchange.

The SPINRAMP, SPIN_POS e SPIN_SPEED parameters modify the spindle maximumacceleration for each servo sampling, the preset spindle orientation and the spindle orientationspeed limit, respectively. The last two parameters are configured in AMP in the "offset for spindleorientation" and "speed for orientation" fields.

SPINRAMP, SPIN_POS and SPIN_SPEED parameters can be changed only on analog axes.

The SPINRAMP value can be obtained from the following formula:

(servo clock) * Volt * 8192 * 2SPINRAMP =

100,000 * (max spindle reversal time)

where "servo clock" is the value obtained with the AX_GET6 function. The new values remainactive until the system is switched off or until further modifications are made.

The BACKLASH parameter modifies the value configured in the "backlash" field of AMP (Theapplication time is modified with the parameter 26)

The new value is updated when the servo acquires the first data and remains active until thesystem is switched off or until further modifications are made.The operative range is-9.99999\+9.99999; if you write out of the range an error 1 will be generated

The DEADZONE parameter modifies the value configured in the "deadzone" field of AMP. It is thetolerance for the last programmed point. Within this tolerance the servo is not updated. The newvalue is updated when the servo acquires the first data and remains active until the system isswitched off or until further modifications are made.

The DEADZONE parameter can be changed only on analog axes.

The LOP+ and LOP- parameters modify respectively the positive and negative software limitvalues configured in AMP (in the "upper software overtravel" and "lower software overtravel"fields). The new values are memorized by the system and become active following a RESETcommand or during the execution of the triliteral SOL. They remain active until the system isswitched off or until further modifications are made.

BROKEN_WIRE specifies the timeout for broken wire detection. It is expressed in seconds andmay range from 0 to 10 (decimal values are not allowed).

Page 318: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-44 10 Series CNC WinPLUS Library - User Manual (04)

The HOME_POS parameter modify the axis home position value, that is the axis 0 positionreferred to the null offset.

The VFF_PERCENT parameter modify the percentage of the VFF applying to the axis.

Parameter ELPITCH specifies the value of the electrical pitch; this value is given by the number ofpulses per turn of the transducer x 4.

Parameter MECPITCH corresponds to the value configured in AMP in the "electrical pitch" field.

STAT_WRD output variable can have the following values:

Value Meaning

0 OK

-1 wrong or not configured ax_id

1 wrong para_num (outside the 1÷17 range)

2 wrong para_num (greater than 10). Only for para_num = 15 (BROKENWIRE)

With the parameter CHANGECONV

2 ax_id belonging to a virtual axis or D.S.I.

3 par_value > 8

With the parameter CHANGETRAS

2 ax_id belonging to a virtual axis or D.S.I.

3 par_value >6

Notes to the parameter “CHANGECONV”

The acceptable values for “Par_Value” are those from 0 to 8; 0 disables the axis reference on theconverter.

When changing this axis transducer features:

1. You can change the transducer on coordinate, auxiliary and spindle axes.

2. You cannot change the transducer on “Gantry” axes (this creates a non-recoverableemergency for "invalid command") and on D.S.I. or virtual axes.

3. You cannot change the transducer on axes used in the "Electronic Cam" application.

4. You can associate only transducer belonging to the same board on which the axis has beendeclared.

5. If you disconnect the transducer the analog reference is not set to zero.

Exchange between spindle and a coordinated axis

Page 319: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-45

If you want to implement the exchange of the spindle with a coordinated axis, you have to followthese rules:

1. You have to declare the transducer and the converter on the spindle axis.

2. If the axis to be exchanged with the spindle is a roll-over axis, “Rapid traverse feed” has to belimited according to the following formula:

Vrapid = 160 * 1000 * Kv

NOTE:If 10/510 systems fitted with OS 8532 boards are used, the local converter codes are as given inAppendix H.

Notes to the parameter “CHANGETRAS”

The acceptable values for “Par_Value” are those from 0 and 6; 0 disables the transducer of theaxis.

When changing the axis converter features:

1. You can change the converter on coordinate, auxiliary and spindle axes with converter.

2. You cannot change the converter on “Gantry” axes (this creates a non-recoverable emergencyfor "invalid command") and on D.S.I. or virtual axes.

3. You cannot change the converter on axes used in the "Electronic Cam" application.

4. You can associate only converters belonging to the same board on which the axis has beendeclared.

5. You cannot associate an analog spindle of an 8026/2 board with other axes.

6. Before using this function you should completely disable the axes and wait until they are reallydisabled.

7. Disconnecting a converter from an axis entails that:

a) the theoretical point and the axis position are set to zero;

b) the internal counter of the converter remains enabled as well as the "broken wire" hold, if thishad been enabled;

c) the screw error corrections associated with the converter are disabled;

d) NC functions acting on the "abandoned" converter or the axis currently without associatedconverter (various homing processes, measuring cycles, etc.) cannot be enabled.

8. Connecting a converter with an axis entails that:

a) the converter has to have already been configured;

b) the theoretical point and the axis position are set to the counter value of the converter in thismoment;

c) you can associate a converter, which belonged to a roll-over axis, to a linear axis and viceversa however keeping in mind that in the latter case the function cannot be inverted outsidethe roll-over range. Consider the following example: the linear axis "X" is in position -180. Itsconverter is assigned to the roll-over axis "A", which results in its position +180 (assuming

Page 320: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-46 10 Series CNC WinPLUS Library - User Manual (04)

the modulo is 360). If you assign the converter back to the axis "X", it will be in position +180and not -180 as before (in praxis you lose the machine zero).

d) the screw error corrections associated with the converter are disabled. If you execute ahoming of the axis, its corrections will be activated (if present).

e) the converter must not be associated with another axis at this moment.

WARNING

The system accepts and applies these two functions without further controlsexcept for those described above. Therefore, they should be used with carein order to avoid undesired functioning.

NOTE:

Version 10/510 systems when integrated with OS 8510/3 board only have available transducersnumber 5 and 6.

If 10/510 systems fitted with OS 8532 boards are used, the local transducer codes are as given inAppendix H.

The parameter MAX_MICRO_MARKER ensures, that the search for the marker is carried outwithin a specified distance during HOMING. If the axis moves outside this distance without havingfound the marker, the cycle is aborted and the recoverable emergency condition “ENCODERPHASE ERROR” is generated.

The distance checked defined by VALUE, is expressed in transducer pitches (where “transducerpitch” means the electrical step set in AMP, e.g. an electrical step of 5000 pulses/rev is 1 pitch) andis taken into account each time that axes homing is initiated.

By default the algorithm is not enabled, and if it has been enabled it can be disabled by calling thefunction a zero in a VALUE.To use this function with gantry axes, the function must be called for both and slave axes.

Notes concerning the “STANDSTILL-GAIN” parameter

By writing this parameter you can change the gain value by machine standstill. The followingconsiderations apply for this parameter:

1. The entered value has to be a positive real value expressed in IPM/mil units (16.666/sec.).

2. The function effects only axes with analog interface.

3. The recalculation of the gain is based on the constant kc for the selected range. If you call thefunction AX_PUT2 (which changes the range values used at that moment), the next call for gainchange is not influenced as the system always uses the characteristic data of the ranges.

4. If the range values are changed, you have to change the range and then the gain.

5. For the spindle axis you have to call the function after every range change in order torecalculate the gain according to the new kc values.

6. The Stand Still gain value will be updated when the tolerance entry procedure for the spindle isactivated. This happens at the end of the orientation phase. For axes the function should becalled at move start.

Page 321: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-47

7. The function is modal, i.e. a change of the standby kv is memorised until the next change andused each time the axis enters into tolerance. No function, operation or event forces the defaultvalue (AMP value) on the axis. When re-starting the controller, it obviously re-sets the initialconditions.

8. For split axis the function has to call for the master and the slave separately.

9. Remember the possible values in AMP go from zero to ten. There is no check on the maximumvalue entered.

Returned errors:

0 OK

-1: id of wrong axis or non-existent axis2: virtual axis or with digital interface3: negative input value4: overflow in internal calculations, the gain remains unchanged.

Notes on the parameter “BACKLASH_TIME”

With this parameter it is possible to define the time of the backlash in ms.According to the decided time the control divides the backlash in equal parts, and applies to eachinterpolator sampling tick one of these parts that is added to the value of the movement that has tobe executed.The value zero allows to apply the backlash only in one sampling.If it not modified through this function after the bootstrap, the activating time of the backlash hasthe value written in the AMP configuration file.

1. The algorithm divides the axis backlash in more parts considering the passed time in input andalso the associated clock interpolator . It applies the different parts to every tick of theinterpolator. If the function is called with a shorter time of the interpolator clock, the algorithmwill round to zero the input value.

2. If the backlash is already applied (the last movement of the axis is in a negative direction) if it isdeactivated, for example writing 0 from Servo Monitor, it will be taken away all in once, soperformance will not be activated.

3. If the set backlash is negative the performance will not be activated.

4. It might appen that is some situations the movement finishes before the servo loop has thetime to (activate) or eliminate all the backlash, for example when there is a minimum inversionof the axis and a stop. In these cases at the end of the movement, the loop activates (oreliminates) the remaining backlash all in once.

5. For the Split axis the function must be called separately for master axis and for the slave axis.

Returned errors:

-1: wrong or non-existent axis id

1 virtual axis

2 negative input value

3 input value too big

Page 322: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-48 10 Series CNC WinPLUS Library - User Manual (04)

AX_PUT2: Set axis servo parameter

Type: Wait

LD/FBD:

ST:stat_wrd := AX_PUT2(ax_id, para_num, par_value1, par_value2, par_value3);

INPUT VARIABLES: axis identifier (int)parameter number (int)value of the first parameter (lreal)value of the second parameter (lreal)value of the third parameter (lreal)

OUTPUT VARIABLE: function status output word (int)

Description:

This function writes the following information:

Para_num Information Unit Format

1 ACTGEAR: gear constants in use

par_value1 - KcKv

par_value2 - Kc

par_value3 - Kcs

- -

- -

- -

lreal

lreal

lreal

ACTGEAR allows to modify the value of the gear constant currently used, gear constants currentlyused are a copy of those relative to the gear that has been utilized through SETRANG orAX_SELE.The values corresponding to the gears currently used are lost when the system is switched off.Values configured in AMP are not changed.

stat_wrd

Page 323: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-49

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id1 para_num different from 1

See also:

AX_GET2 for further information on parameters KcKv, Kc and Kcs.

Page 324: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-50 10 Series CNC WinPLUS Library - User Manual (04)

AX_PUT2B: Sets axis interlocking parameter

Type: Wait

LD/FBD:

ST:stat_wrd := AX_PUT2B (ax_id,para_num, par_value1,par_value2,par_value3,par_value4);

INPUT VARIABLES: axis ID (int)Parameter number (int)value of 1st parameter (lreal)value of 2nd parameter (lreal)value of 3rd parameter (lreal)value of 4th parameter (lreal)

OUTPUT VARIABLE status word (int)

Description:

This function writes the following data:

Para_num Data Unit Format

1 ACTGEAR: current range constants

par_value1 - KcKv

par_value2 - Kc

par_value3 - Kcs

par_value4 - MaxFeed

- -

- -

- -

- -

double

double

double

double

2 GEAR1: range 1 constants

par_value1 - KcKv

par_value2 - Kc

par_value3 - Kcs

par_value4 - MaxFeed

- -

- -

- -

- -

double

double

double

double

stat_wrd

Page 325: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-51

3 GEAR2: range 2 constants

par_value1 - KcKv

par_value2 - Kc

par_value3 - Kcs

par_value4 - MaxFeed

- -

- -

- -

- -

double

double

double

double

4 GEAR3: range 3 constants

par_value1 - KcKv

par_value2 - Kc

par_value3 - Kcs

par_value4 - MaxFeed

- -

- -

- -

- -

double

double

double

double

5 GEAR4: range 4 constants

par_value1 - KcKv

par_value2 - Kc

par_value3 - Kcs

par_value4 - MaxFeed

- -

- -

- -

- -

double

double

double

double

The ACTGEAR parameter makes it possible to change the value of current range constants, i.e.,the range active at the moment; the others change the values of configured ranges. The currentrange constants are a copy of those relating to the range that has been updated with theSETRANG or AX_SELE function.Current range values are lost when the system is shut down.The values configured in AMP are not changed.

The STAT_WRD output variable can take on the following values:

Value Meaning

0 OK

-1 ax_id wrong or not configured

1 para_num other than 1

See also:

AX_GET2B for an explanation of parameters KcKv, Kc, Kcs and MaxFeed.

Page 326: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-52 10 Series CNC WinPLUS Library - User Manual (04)

AX_PUT3: Set axis servo parameter

Type: Wait

LD/FBD:

ST:stat_wrd := AX_PUT3(ax_id, para_num, par_value1, par_value2, par_value3);

INPUT VARIABLES: axis identifier (int)parameter number (int)value of the first parameter (lreal)value of the second parameter (lreal)value of the third parameter (lreal)

OUTPUT VARIABLE: function status output (int)

Description:

This function writes information relative to tolerance constants currently used.

Para_num Information Unit Format

1 ACTTOLL: tolerance constants in usepar_value1 - in position bandpar_value2 - in position waitpar_value3 - in position window

confsecsec

lreallreallreal

2 SERVERR: servo error valuepar_value1 – position error at stand stillpar_value2 - position error without VFFpar_value3 - position error with VFF

confconfconf

doubledoubledouble

The par_value1 "in position band" parameter represents the tolerance field width.The par_value2 "in position wait" parameter is the maximum time (time out) for the axis to enter thetolerance field.The par_value3 "in position window" parameter is the minimum time for the axis to remain in thetolerance field."ACTTOLL" modifies the copy of tolerance data configured in AMP.

Parameter SERVERR changes the servo error values configured in AMP.

stat_wrd

Page 327: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-53

There are three types of servo error, each of which is used as a function of axis status:

• position error at stand still

• servo error without VFF

• servo error with VFF

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id1 para_num different from 12 Error, in internal computations the value of “In position Band” is rounded

to < 1 digit.

See also: See also: AX_GET4 for servo error parameters and AX_GET5 for tolerance parameters.

Page 328: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-54 10 Series CNC WinPLUS Library - User Manual (04)

AX_PUT4: Set axis servo parameter

Type: Wait

LD/FBD:

ST:stat_wrd := AX_PUT4(ax_id, para_num, par_value);

INPUT VARIABLES: axis identifier (int)parameter number (int)parameter value (int)

OUTPUT VARIABLE: status word (int)

Description: This function writes the following information:

Para_num Data Unit Format1 Reserved

2 Reserved

3 WRITE_FW_OUTPUT writes digital outputs of a OSWire OS3or Bridge device

bit int

4 ERDC_CONFIG writes encoder channels configuration bit int

Parameter WRITE_FW_OUTPUT takes on different meanings depending on the deviceconnected. As for drive OS3 the outputs that can be written are:

Bit 0-3 reserved

Bit 4 GPO3 General Purpose Output 3

Bit 5 GPO2 General Purpose Output 2

Bit 6 GPO1 General Purpose Output 1

Bit 7 –15 reserved

For further details, see manual “OS3 Drive – Installation Manual”.

stat_wrd

Page 329: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-55

For a Bridge device:

Bit 0 GPO0 General Purpose Output 0

Bit 1 GPO1 General Purpose Output 1

Bit 2 GPO2 General Purpose Output 2

Bit 3 -15 Reserved

Parameter ERDC_CONFIG, (see also TC_CONF) applies solely to analog axes; it is a word thatmust be assigned by bits according to the following table:

Bit Bin val. Hex val. Meaning0 1 1 H Inverts the polarity of the signal from channel A1 2 2 H Inverts the polarity of the signal from channel B2 4 4 H Inverts the polarity of the signal from channel Z3 8 8 H Inverts the direction of reading of the counter4 16 10H Marker is detected on level5 32 20H Marker is detected on edge

Output variable STAT_WRD can take on the following values:

Value Meaning

0 OK

-1 Ax_id wrong or not configured

1 Para_num wrong

2 Axis not consistent with request

3 Address of device on OSWire bus cannot be traced, or axis withouttransducer

4 Axis not connected to Bridge

1003 Axis disabled due to severe error

Page 330: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-56 10 Series CNC WinPLUS Library - User Manual (04)

AX_PUTS: Writes axis status

Type: Wait

LD/FBD:

ST:stat_wrd := AX_PUTS(ax_id, ax_mask1, ax_mask2, ax_stat1, ax_stat2);

INPUT VARIABLE: axis ID (int)OUTPUT VARIABLES: template for status word 1 status activation (int)

template for status word 2 status activation (int)axis status word 1 (int)axis status word 2 (int)status word (int)

Description:

This function changes the current status of the axis. Parameters "ax_stat1" and “ax_mask1” mustbe read by bits as specified in the table below; field “ax_stat1” defines the required bit level, field“ax_mask1” defines whether the bit has to be changed (if 1) or remain the way it is (if 0) relative tocurrent axis status.

Bit Bin val Hex val MEANING0 1 1 H negative software limits disabled1 2 2 H positive software limits disabled

2 - 5 reserved6 64 40 H zero cycle completed7 128 80 H software limits defined8 256 100 H homing underway9 512 200 H axis in tolerance if 0 tolerance in

execution, if 1 axis in tolerance10 reserved11 2048 800 H axis enabled12 reserved13 8192 2000 H axis in test mode14 16384 4000 H micro search direction negative15 32768 8000 H converter enabled

stat_wrd

Page 331: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-57

Parameters "ax_stat2" and “ax_mask2” must also be read by bits as specified in the followingtable; field “ax_stat2” defines required bit value; field “ax_mask2” defines whether the bit has to bechanged (if 1) or remain the way it is (if 0) relative to current axis status.

BIt Bin val Hex val Meaning0 1 0001 servo error1 2 0002 skew error2 4 0004 transducer error3 8 0008 reserved4 16 0010 measuring cycle completed5 32 0020 probe anomaly6 64 0040 tolerance time out7 128 0080 position tolerance error8 256 0100 (see table below)9 512 0200 (see table below)

10 1024 0400 reserved11 2048 0800 axis share

12 - 15 4096 1000 reserved

Bit 4 (measuring cycle completed) must be set on 1 when the axis has probed and return to 0 onthe next probe command.

Bit 6 (tolerance time out) must be set on 1 when the relative emergency occurs and returns to 0the next time the axis is enabled (AX_ENAB).

Bits 8 and 9 (driver ON and driver ENABLE) indicate enable status of a digital drive (D.S.I. orOSWire) and must be interpreted as a binary code having the values given in the following table:

Driver ENABLE (bit 9) Driver ON (bit 8) Meaning0 0 Driver not ready for power up0 1 Driver ready for main power on1 0 Driver ready and main power applied1 1 Drive ready to operate

Bit 11 (axis shared) is set on 1 when the axis is shared between the process and the logic (an$AX_SHARE function has been executed); it returns to 0 when the axis release command isimparted (function $AX_SHARE with Type = 0).

The STAT_WRD output variable can take on the following values:

Value Meaning0 OK.-1 ax_id wrong or not configured

Page 332: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-58 10 Series CNC WinPLUS Library - User Manual (04)

AX_GETS: Get axis status

Type: Wait

LD/FBD:

ST:stat_wrd := AX_GETS(ax_id, ax_stat1, ax_stat2);

INPUT VARIABLE: axis identifier (int)OUTPUT VARIABLES: axis status word 1 (int)

axis status word 2 (int)function status output word (int)

Description:

This function returns the actual state of the axis in the indicated variables.The "ax_stat1" parameter must be read by bit, in accordance with the following table:

Bit Val.Bin Val.Hex MEANING0 1 1H negative software limits disabled1 2 2H positive software limits disabled

2 - 5 reserved6 64 40H homing cycle done for this axis7 128 80H software limits defined8 256 100H homing in progress9 512 200H axis in tolerance10 reserved11 2048 800H axis enabled12 reserved13 8192 2000H axis in test mode14 16384 4000H negative home switch direction15 32768 8000H converter enabled

Bit 9 ("axis in tolerance") has the following meaning:

0 --> tolerance in execution1 --> the axis is in tolerance

stat_wrd

Page 333: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-59

The "ax_stat2" parameter must be read by bit in accordance with the following table:

Bit Val. Bin Val. Hex Meaning0 1 0001 servo error1 2 0002 skew error2 4 0004 transducer fault3 8 0008 reserved4 16 0010 measuring cycle completed5 32 0020 probe fault6 64 0040 tolerance time out7 128 0080 position tolerance error8 256 0100 (see following table)9 512 0200 (see following table)

10 1024 0400 reserved11 2048 0800 Shared axis

12-15 4096 1000 RESERVED

Bit 4 (measuring cycle completed) is set to 1 when the axis has probed and it returns to 0 in thefollowing probing command.

Bit 6 (tolerance time out) goes to 1 on emergency and returns to 0 on the subsequent axis enable(AX_ENAB ).

Bits 8 and 9 (driver ON and driver ENABLE) reflect enable status of a (D.S.I. or OSWire) digitaldrive and must be interpreted as a binary code having the values given in the table below:

Driver ENABLE (bit 9) Driver ON (bit 8) Meaning

0 0 Driver not ready for power up

0 1 Driver ready for main power on

1 0 Driver ready and main power applied

1 1 Drive ready to operate

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK-1 wrong or not configured ax_id

Bit 11 (shared axis) is set on 1 when an axis is shared by process and logic (if an AX_SHAREfunction has been executed), it returns to 0 upon the axis release command (AX_SHARE functionwith type = 0).

Page 334: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-60 10 Series CNC WinPLUS Library - User Manual (04)

TC_CONF: Set the transducer ERDC

Type: No Wait

LD/FBD:

ST:stat_wrd := TC_CONF(trasd_id, cfg_val);

INPUT VARIABLES: transducer identifier (int)ERDC configuration value (int)

OUTPUT VARIABLE: status word (int)

Description:

This function allows to configure the transducer ERDC.

it must be used to read the transducer value (TC_READ1) when the transducer is not associatedto an axis (AMP) or to an handwheel (HPG_ON).

WARNING

This function can not be used when the transducer is already associated toan axis or to an handwheel

In systems 10/565 and 10/585 the transducer identifier (trasd_id) has this format:

Trasd.1 Trasd.2 Trasd.3 Trasd.4 Trasd.5 Trasd.6

1° Board 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005

2° Board 0x0100 0x0101 0x0102 0x0103 0x0104 0x0105

3° Board 0x0200 0x0201 0x0202 0x0203 0x0204 0x0205

4° Board 0x0300 0x0301 0x0302 0x0303 0x0304 0x0305

stat_wrd

Page 335: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-61

NOTE FOR NON OSWIRE SYSTEMS:

For systems 10/510 and 10/110 use the identifiers given in the table in Appendix H and subtract100Hex.

NOTE FOR OSWIRE SYSTEMS:

For OS-Wire systems, the code used in the transducer identifiers on the bus is 1nntHex, where ‘nn’is the address (from 0 to 3DHex) of the device and ‘t’ is the transducer number from 1 to 3. In driveOS3 you can have (as an option) only one incremental transducer, on the Bridge you can have upto 3 transducers.For local transducers follow the rule specified for non OS-Wire systems.

Examples:To identify the second transducer of a Bridge device with 1b (hexadecimal) address, write 11b2(hexadecimal).

To identify the only external transducer of a drive OS3 with address 2 (hexadecimal), write 1021(hexadecimal).

The configuration value (bits 0,1,2 and 3 of the cfg_val parameter) has the following meaning:

Value Meaning

bit 0: set to reverse the logic signal polarity of channel A

bit 1: set to reverse the logic signal polarity of channel B

bit 2: set to reverse the logic signal polarity of channel C

bit 3: set to reverse the direction of the converter

The output variable STAT_WRD can have the following values:

Value Meaning

0 Ok

2 OSWire transducer resource could not be allocated for timeout.

4 Exceed maximum number of transducers

5 OSWire transducers exhausted (max. number exceeded)

6 Invalid id of OSWire transducer

Page 336: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-62 10 Series CNC WinPLUS Library - User Manual (04)

TC_READ1: Read the physical position of the transducer

Type: Wait

LD/FBD:

ST:stat_wrd := TC_READ1(trasd_id, pos_val);

INPUT VARIABLE: transducer identifier (int)OUTPUT VARIABLES: position value (lreal)

output function status (int)

Description:

This function reads the physical position of the specified transducer. If the transducer hasn't beenassociated to an axis (AMP) or to an handwheel (HPG_ON), it is necessary to use the TC_CONFfunction before reading.For the codes of transducer identifiers, see function TC_CONF.

The output position (pos_val) is expressed in number of impulses of the transducer.

The STAT_WRD output variable may have the following values:

Value Meaning

0 OK

1 error, board not configured

-1 error, transducer identifier incorrect

2 OSWire transducer id invalid or not found

3 OSWire transducer resource could not be allocated for timeout.

stat_wrd

Page 337: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-63

TC_WRIT: Set D/A Converter output

Type: No Wait

LD/FBD:

ST:stat_wrd := TC_WRIT(tc_id, tc_val);

INPUT VARIABLES: D/A converter identifier (int)D/A value (0000..FFFCH) (int)

OUTPUT VARIABLE: function status output word (int)

Description:

For 14-bit D/A’s an increment in the D/A converter output (1.22 mV) corresponds to 4 units in thetc_val variable.For 8-bit D/A’s an increment in the output (78,125 mV) corresponds to 256 units in the tc_valvariable.

A zero (0000H) value corresponds to a D/A voltage of -10V, a value of 8000H corresponds to 0Vand a value FFFCH causes the D/A converter to output +10V. The table below gives the requiredtc_val inputs for some other output voltages.This function can only be used to write to analog outputs which are not dedicated to a physicalaxis. Values written to a dedicated axis D/A output will be overwritten by the servo.

tc_val (HEX) D/A Output (V)FFFC +10E000 +7.5C000 +5A000 2.58000 06000 -2.54000 -52000 -7.50000 -10

stat_wrd

Page 338: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-64 10 Series CNC WinPLUS Library - User Manual (04)

In systems 10/565 and 10/585 converter identifiers are given by the following table:

1° board from 0x200 to 0x205

2° board from 0x206 to 0x20B

3° board from 0x20C to 0x211

4° board from 0x212 to 0x217

Example:3 boards with 5,3 and 6 axes with 5,3 and 6 converters. Converter identifiers, inside the board arethe following:

Convert.1 Convert.2 Convert.3 Convert.4 Convert.5 Convert.6

1° Board 0x200 0x201 0x202 0x203 0x204

2° Board 0x206 0x207 0x208

3° Board 0x20C 0x20D 0x20E 0x20F 0x210 0x211

NOTE FOR NON OSWIRE SYSTEMS:See Appendix H.

NOTE FOR OSWIRE SYSTEMS:In systems OS-Wire, with Bridge devices, the code of D/A converters is 2nncHex, where ‘nn’ is theaddress (from 0 to 3DHex) of the device and ‘c’ is the converter number from 1 to 3.For systems with local converters, see Appendix H.

Example:To identify the third converter of a Bridge with address 5 (hexadecimal) you must write 2053(hexadecimal).

Page 339: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-65

FAX_WCON: Configures driver for real time data communication

Type: Wait

FBD/LD:

ST:stat_wrd := FAX_WCON(ax_id);

INPUT VARIABLES: axis identifier array [0...5] (int)OUTPUT VARIABLE: status word (int)

Description:

This function allows to configure, enable and disable the driver for real time data communicationfrom WinPLUS to AXES. The driver is configured and enabled when this function is activated bygiving in input one of the AX_ID different from zero, at least. The AX_ID of axes not used must beequal to zero. The AX_ID different from zero don't necessarily have to be contiguous and startingfrom AX_ID1.

If you activate this function giving in input all AX_ID different from zero, the driver is disabled. Theconfiguration valid for the driver is the last one signalled by this function, that is each newconfiguration request totally substitutes the previous one. If this function returns an error code, thedriver's configuration remains unvaried.

The output variable STAT_WRD can have the following values:

Value Meaning

0 OK

1 ax_id non-existent

4 ax_id specified more than once

5 virtual axis

See also:

FAX_PUT

FAX_RCON

FAX_GET

stat_wrd

Page 340: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-66 10 Series CNC WinPLUS Library - User Manual (04)

FAX_RCON: Configures the driver for real time data communication

Type: Wait

FBD/LD:

ST:stat_wrd := FAX_RCON(ax_id);

INPUT VARIABLES: axis identifier array [0...5] (int)OUTPUT VARIABLE : status word (int)

Description:

This function allows to configure, enable and disable the driver for real time reading of some AXESdata.

To utilize this function , follow the same steps as for FAX_WCON.

The output STAT_WRD can have the following values:

Value Meaning

0 OK

1 ax_id non-existent

4 ax_id specified more than once

5 virtual axis

See also:

FAX_GET

FAX_WCON

FAX_PUT

stat_wrd

Page 341: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-67

FAX_PUT: Real time updating of an axis' zero shift value

Type: Internal

FBD/LD:

ST:stat_wrd :=FAX_PUT(ax_id, value);

INPUT VARIABLES: axis identifier (int)zero shift value (lreal)

OUTPUT VARIABLE: status word (int)

Description:

The function updates in real time the zero shift value of one axis; the function can be called onlyafter configuring the real time communication driver between WinPLUS and AXES (viaFAX_WCON).The ax_id variable must correspond to one of the ID axes configured with the FAX_WCONfunction.

The zero-shift must be expressed in the configured unit and it is NOT an incremental valuemeaning that the new error signalled will substitute the previous one.The zero shift value is applied to the axis when the AXES are sampled and it is then maintainedduring the following samplings. The difference between previous and new value must be adaptedto the acceleration available to the axis and to the servo error values configured in AMP.

At the end of the reference cycle, the zero shift actually applied to the axis is taken to zero: duringthis phase the real time updating driver must not be active.It is also possible to cancel the zero shift value with the axis disabled: if a 0 value is written into thevalue field when the axis is disabled, the next time the axis is enabled, the system no longer takesinto account the zero shift value used before disabling of the axis.The FAX_PUT function returns errors when the input parameters are incorrect or because it hasbeen activated during execution of the FAX_WCON function (the latter is possible only when thetwo functions are activated from two different logic routines).

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK2 request during driver configuration (&FAX_WCON)

See also:FAX_WCON,FAX_RCON,FAX_GET

stat_wrd

Page 342: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-68 10 Series CNC WinPLUS Library - User Manual (04)

FAX_GET: Read in real time a number of axis parameters

Type: Internal

FBD/LD:

ST:stat_wrd := FAX_GET(ax_id, para_num, status1, status2, value);

INPUT VARIABLES : axis identifier (int)parameter number (int)

OUTPUT VARIABLES : axis status word 1 (int)axis status word 2 (int)value of parameter read (lreal)status word (int)

Description:

This function reads in real time a number of values relative to one axis: it can be called only afterconfiguring the driver for real time communication between AXES and WinPLUS (via FAX_RCON).The ax_id variable must correspond to one of the ID axes configured with function FAX_RCON.The parameter to be read is selected through the para_num variable that can have the followingvalues:

1 for touched position2 for interpolated point3 for current position4 for following error5 for vff/RPM spindle

The parameter specified by para_num will be written in the "value" variable and will be expressedin the configured unit.

Status1 and status2 are updated with the axis status; for more information about the meaning ofthese two fields, refer to the AX_GETS function.

stat_wrd

Page 343: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-69

The reading of the probed value (para_num = 1) takes into consideration NEITHER the HorizontalShift value (available in the UPA process variable), NOR the Vertical Shift value (available in theUPO process variable) and probe ball radius. In order to calculate the actual value with respect tothe Home Position of a given axis it is necessary to use the following formulas:

actual value = value recorded by the logic + probe ball radius - Horizontal Shift

or:

actual value = value recorded by the logic + probe ball radius - Vertical Shift

Horizontal and Vertical Shift values must be used with their sign.

Example:Value read through FAX_GET = 109.7464Probe ball radius = 0.9801Horizontal Shift = -0.2672Actual value = (109.7464 + 0.9801 - ( - 0.2672)) = 110.9937

The reading of the interpolated point (para_num = 2) displays the position calculated by the systemwith respect to the "home position".The reading of the current position (para_num = 3) displays the transducer position with respect tothe "home position".

The reading of VFF/RPM (para_num = 5) displays two different values depending on the axis type:

• coordinated axes: actual axis velocity expressed in the configured unit (mm/min or inch/min)

• spindle: actual spindle speed expressed in rpm.

The FAX_GET function displays errors that occur when the input parameters are incorrect or whenFAX_GET is activated with FAX_RCON in execution (this occurs only when both functions arelaunched from two different logic routines).

The output variable STAT_WRD may have one of the following values:

Value Meaning0 OK2 request during driver set (&FAX_RCON)3 para_num out of range4 non configured ax_id

See also :

FAX_RCON

FAX_WCON

FAX_PUT

Page 344: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-70 10 Series CNC WinPLUS Library - User Manual (04)

AXD_RDD: Read a numerical parameter from a digital drive

Type: Wait

LD/FBD:

ST:stat_wrd := AXD_RDD(ax_id, idn, value);

INPUT VARIABLES: axis identifier (int)identifier of the parameter to be read (IDN) (int)

OUTPUT VARIABLES: returned value (lreal)status word (int)

Description:

With this function you can read one of the numerical parameters foreseen for the D.S.I. interface(binary, decimal with or without sign, hexadecimal or IDN) from a digital drive associated with anaxis.The value to be written of the input variable IDN is determined by adding the bits at 1 of a wordsubdivided as follows:

Bit 15 = 0 standard “S” parameter (default)= 1 personalised “P” parameter (defined by the

producer)Bit 12-13-14 = value between 0 and 7 ID of the set to which the parameter belongsBit 0 to 11 = value between 0 and 4095 parameter number

Example for the IDN value to be written:

parameter parameter set ID binary representation hexadecimal decimalS 104P 104

00

0 000 0000011010001 000 000001101000

688068

104-32664

stat_wrd

Page 345: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-71

If the requested parameter is a value list, only the first value is returned.The output status word can have the following values:

Value Meaning

0 function terminated correctly

-1 error, axis not configured

-3 error, unknown parameter type

-4 error, parameter type not consistent with the function used

from 1 to 28680 D.S.I. interface error (see Appendix F)

-32752 error, not a D.S.I. axis

from -32735 to -32751 error from the handling of the Service Channel

Page 346: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-72 10 Series CNC WinPLUS Library - User Manual (04)

AXD_WRD: Write a numerical parameter to a digital drive

Type: Wait

LD/FBD:

ST:stat_wrd := AXD_WRD(ax_id, idn, value);

INPUT VARIABLES: axis identifier (int)identifier of the parameter to be read (IDN) (int)value to be written (lreal)

OUTPUT VARIABLES: status word (int)

Description:

With this function you can write one of the numerical parameters foreseen for the D.S.I. interface(binary, decimal with or without sign, hexadecimal or IDN) to a digital drive associated with an axis.At the function output the parameter will be updated in the drive. For the IDN variable the sameconsiderations as for F.B. AXD_RDD apply.

The output variable STAT_WRD can assume one of the following values:

Value Meaning

0 function terminated correctly

-1 error, axis not configured

-3 error, unknown parameter type

-4 error, parameter type not consistent with the function used

from 1 to 28680 D.S.I. interface error (see Appendix F)

-32752 error, not a D.S.I. axis

from -32735 to -32751 error from the handling of the Service Channel

stat_wrd

Page 347: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-73

AXD_RDS: Read a string parameter from a digital driveType: Wait

LD/FBD:

ST:stat_wrd := AXD_RDS(ax_id, idn, value);

INPUT VARIABLES: axis identifier (int)identifier of the parameter to be read (IDN) (int)start index in the ASCII buffer (string)

OUTPUT VARIABLES: status word (int)

Description:

With this function you can read a string parameter with a length of max. 80 characters from a digitaldrive associated with an axis. For the variable IDN see F.B. AXD_RDD. It the string receivedexceeds 80 characters it will be truncated.

The output variable STAT_WRD can assume the following values:

Value Meaning

0 function ended correctly-1 error, axis non configured-3 error, the kind of parameter is unknown-4 error, the kind of parameter is not congruent with the used function

100 error, the string start index is greater than the limit allowed for the ASCIIbuffer

101 error, the maximum dimension of the string exceeds the limit allowed forthe ASCII buffer

from 1 to 28680 D.S.I. interface error (see Appendix F)-32752 error, not a D.S.I. axis

from -32735 to -32751 error from the handling of the Service Channel

stat_wrd

Page 348: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-74 10 Series CNC WinPLUS Library - User Manual (04)

AXD_WRS: Write a string parameter to a digital driveType: Wait

LD/FBD:

ST:stat_wrd := AXD_WRS(ax_id, idn, stringa);

INPUT VARIABLES: axis identifier (int)ID of the parameter to be written (IDN) (int)start index in the ASCII buffer (string)

OUTPUT VARIABLES: status word (int)

Description:

With this function you can write a string parameter with a length of max. 80 characters to a digitaldrive associated with an axis. At the function output the string will be updated in the drive. For thevariable IDN see F.B. AXD_RDD.

The output variable STAT_WRD can assume the following values:

Value Meaning

0 function ended correctly-1 error, axis non configured-3 error, the kind of parameter is unknown-4 error, the kind of parameter is not congruent with the used function

100 error, the string start index is greater than the limit allowed for the ASCIIbuffer

101 error, the maximum dimension of the string exceeds the limit allowed forthe ASCII buffer

from 1 to 28680 D.S.I. interface error (see Appendix F)-32752 error, not a D.S.I. axis

from -32735 to -32751 error from the handling of the Service Channel

stat_wrd

Page 349: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-75

AXD_PUT: Set the enable/disable bits for a digital driveType: Wait

LD/FBD:

ST:stat_wrd := AXD_PUT(ax_id, mask);

INPUT VARIABLES: axis identifier (int)bit mask (int)

OUTPUT VARIABLES: status word (int)

Description:

With this function you can set some of the control word bits of a digital drive associated with anaxis. The following bits are considered:

Bit 15 : 0 = Drive OFF 1 = Drive ONBit 14 : 0 = Disable Drive 1 = Enable DriveBit 13 : 0 = Halt Drive 1 = Restart DriveBit 9,8 : Operation Mode 0,0 = Primary Operation Mode (defined by IDN 32)

0,1 = Secondary Oper. Mode-1 (defined by IDN 33)1,0 = Secondary Oper. Mode-2 (defined by IDN 34)1,1 = Secondary Oper. Mode-3 (defined by IDN 35)

Bit 7 : Real-time control bit 2Bit 6 : Real-time control bit 1

IMPORTANT To use these bits correctly see the Technical Specifications of the drive.

The output variable STAT_WRD can assume the following values:

Value Meaning0 function ends correctly-1 error, axes not set correctly

-32752 error, not a D.S.I. axis

stat_wrd

Page 350: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-76 10 Series CNC WinPLUS Library - User Manual (04)

AXD_CMD: Send a command to a digital driveType: Wait

LD/FBD:

ST:stat_wrd := AXD_CMD(ax_id, cmd_code);

INPUT VARIABLE: axis identifier (int)command code (int)

OUTPUT VARIABLE: status word (short)

Description:Through the following FB you can send a command to a digital drive associated to a D.S.I. orMechatrolink axis. The command is identified by the CMD input and cannot have parametersassociated with it.

For example, for a D.S.I. axis, to send the IDN 99 alarm reset command all you have to do is setCMD = 99. The function ends when the command has been executed on the drive. If the executionof a command continues for more than three seconds, the function ends with a timeout error (thecommand is cancelled).

In the case of Mechatrolink drives, you can send the following commands: NOP, CONFIG,ALM_CLR, SYNC_SET, DISCONNECT, BRK_ON, BRK_OFF, SENS_ON, SENS_OFF, HOLD,MLOCK_ON, MLOCK_OFF, ADJ. For the numerical codes and the details of the commands, seethe technical manual. The ALM_CLR command eliminates only the alarm or the current warningand does not delete the entire alarm history saved in the drive.

stat_wrd

Page 351: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-77

In the case of D.S.I. axes, output variable STAT_WRD may assume the following values:

Value Meaning

0 Command completed successfully.

-1 Invalid Id axis.

3 Non D.S.I. axis

from 1 to 28680 Errors from D.S.I. interface (see Appendix F).

-32738 Command ended with an error or maximum command execution wait time(three seconds) exhausted.

from -32735

to -32751

Errors from Service Channel management.

In Mechatrolink axes, STAT_WRD output variable may assume the following values:

Value Meaning

0 Command completed successfully

-1 Invalid Id axis.

1 Transmission channel busy. The command cannot be sent.

2 Command code not envisaged.

Others Errors returned from drive.

IMPORTANT When the axis is moving, no commands can be sent. The error returned willbe 1.

Page 352: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-78 10 Series CNC WinPLUS Library - User Manual (04)

AX_WPAR: Writes the AMP parameters of an axis

Type: Wait/No Wait

LD/FBD:

ST:

stat_wrd := AX_WPAR (ax_id, param, value);

INPUT VARIABLES: axis identifier (int)

parameter number (int)

value (lreal)

OUTPUT VARIABLE: status word (int)

Description:

This function writes the axis parameters corresponding to the characterisation fields in AMP.

Some parameters cannot be written (check the “Read only” field), but can be read through theAX_RPAR function. The function is wait type if the parameter has to be integrated into the realtimeaxis interlock function and therefore you may have to wait for at least one servo loop tick.

The table describing the parameters is given below; for details, see the AMP manual.

Par. no. AMP field Input unit Readonly Type

1 AXIS TYPE (*) Yes ---

2 DIAMETRAL (*) Yes ---

3 ROLLOVER (*) Yes ---

4 DIGITAL AXIS (*) Yes ---

5 LINEAR OPTICAL ENCODER (*) No Wait

6 CHANNEL A POLARITY INVERSION (*) No Wait

Page 353: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-79

7 CHANNEL B POLARITY INVERSION (*) No Wait

8 CHANNEL Z POLARITY INVERSION (*) No Wait

9 DIRECTION COUNT (*) No Wait

10 MARKER DETECTION (*) No Wait

11 RAPID TRAVERSE FEED M.U. / min No No wait

12 RAPID ACCELERATION M.U. / sec^2 No No wait

13 MANUAL FEED M.U. / min No No wait

14 MANUAL ACCELERATION M.U. / sec^2 No No wait

15 RAPID JERK M.U. / sec^3 No No wait

16 WORKING JERK M.U. / sec^3 No No wait

17 ELECTRICAL PITCH pulses No Wait

18 MECHANICAL PITCH M.U. No Wait

19 ROLLOVER PITCH M.U. No Wait

20 RAPID TRAVERSE VOLTAGE Volt No Wait

21 MAXIMUM FEED M.U. / min No Wait

22 HOME POSITION FEED M.U. / min No No wait (*)

23 NULL OFFSET VALUE M.U. No No wait

24 HOME POSITION VALUE M.U. No No wait

25 HOMING DIRECTION (*) No Wait

26 PERCENT OF VFF % No Wait

27 UPPER SW OVERTRAVEL M.U. No No wait

28 LOWER SW OVERTRAVEL M.U. No No wait

29 SERVO LOOP GAIN IPM / mil No Wait

30 STAND STILL LOOP GAIN IPM / mil No No wait

31 POSITION ERROR STAND STILL M.U. No No wait (*)

32 POSITION ERROR WITH VFF M.U. No No wait (*)

33 POSITION ERROR WITHOUT VFF M.U. No No wait (*)

34 IN POSITION BAND M.U. No No wait

35 IN POSITION WAIT sec No No wait

36 IN POSITION WINDOW sec No No wait

37 AXIS BACKLASH M.U. No Wait

38 DEAD ZONE M.U. No Wait

39 DRIVER ADDRESS Driveraddress Yes ---

40 HOMING TYPE (see AMP) No Wait

Page 354: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-80 10 Series CNC WinPLUS Library - User Manual (04)

41 ADDITIONAL SERVICE (see AMP) No Wait

42 MOTOR TRANSDUCER (*) Yes No wait

43 PROBING CONFIGURATION (see AMP) No Wait

44 OFFSET FOR SPINDLE ORIENT. degree No No wait

45 SPINDLE WITH RAMPS (*) No Wait

46 MAX SPINDLE REVERSAL TIME sec No Wait

47 GEAR USED FOR SPINDLE REVERS.TIME #GEAR (1-4) No No wait

48 SPINDLE MASTER AXIS FOR CSS Axis Id No No wait

49 SPINDLE ORIENT. SPEED RPM No No wait

50 SPINDLE ORIENT. ACCELERATION rev / sec^2 No No wait

51 SPINDLE SPEED STOP THRESHOLD RPM No No wait

52 SPINDLE SPEED GEAR1 RPM No No wait (*)

53 SPINDLE SPEED GEAR2 RPM No No wait (*)

54 SPINDLE SPEED GEAR3 RPM No No wait (*)

55 SPINDLE SPEED GEAR4 RPM No No wait (*)

56 SPINDLE VOLTAGE GEAR1 Volt No No wait (*)

57 SPINDLE_VOLTAGE_GEAR2 Volt No No wait (*)

58 SPINDLE_VOLTAGE_GEAR3 Volt No No wait (*)

59 SPINDLE_VOLTAGE_GEAR4 Volt No No wait (*)

60 SPINDLE_GAIN_GEAR1 IPM / mil No No wait (*)

61 SPINDLE_GAIN_GEAR2 IPM / mil No No wait (*)

62 SPINDLE_GAIN_GEAR3 IPM / mil No No wait (*)

63 SPINDLE_GAIN_GEAR4 IPM / mil No No wait (*)

64 OFFSET_BETWEEN_MARKERS pulses No Wait

65 SKEW_ERROR_MIN M.U. No Wait

66 SKEW_ERROR_MAX M.U. No Wait

67 SKEW_GAIN (*) No Wait

M.U. stands for “Measuring Unit” and, depending on axis characterisation, it may mean millimetres,inches or degrees.

The symbol (*) indicates the presence of special notes given below.

The AXIS TYPE parameter may assume the following values: 0 (not defined), 1 (linear axis), 2(rotary axis).

Page 355: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-81

The DIAMETRAL, ROLLOVER and DIGITAL AXIS parameters may assume the following values: 0(NO), 1 (YES).

The LINEAR OPTICAL ENCODER parameter may assume the following values: 0 (NO), 1 (YES).For HOMING purposes, process axis flags are read at the start of each interpolation, for logic axesthey are read only during the OPEN phase. For virtual axes, this function is ignored.

The parameters CHANNEL A POLARITY INVERSION , CHANNEL B POLARITY INVERSION ,CHANNEL Z POLARITY INVERSION and COUNT DIRECTION may assume the following values:0 (NO), 1 (YES). It is advisable to disable the axis completely before inverting the polarity of thechannels or the count direction of the encoder. This function is ignored for axes with no transducerassociated, virtual axes, digital axes.

The MARKER DETECTION parameter may assume the following values: 0 (LEVEL), 1 (EDGE). Itis not advisable to change marker edge type during the HOMING stage. This function is ignoredfor: axes with no transducer associated, virtual axes, digital axes.

For the RAPID TRAVERSE FEED, RAPID ACCELERATION, MANUAL FEED, MANUALACCELERATION, RAPID JERK and WORKING JERK parameters, for purposes of the movement,the values are considered at the start of the next interpolation. No range check is made.

For the ELECTRICAL PITCH and MECHANICAL PITCH parameters it is advisable to disable theaxis completely before calling this function. All the parameters associated with the electrical and/ormechanical pitch are recalculated. The function is ignored for: axes with no transducer associated,virtual axes. For split axes, a call to the Master affects the Slave too.

If you wish to change the ROLLOVER PITCH parameter, it is advisable to disable the axiscompletely before calling the function.

A change to the RAPID TRAVERSE VOLTAGE and MAXIMUM FEED parameters may affect theServo Error variable algorithm. This function is ignored for: virtual axes, digital axes. It is advisableto disable the axis completely before calling the function.

The HOME POSITION FEED parameter is taken into account at the start of the next HOMINGstage. For split axes, the speed of realignment with the slave is also updated by a call to themaster; in this case, the write function becomes wait type. No range check is made.

The NULL OFFSET VALUE and HOME POSITION VALUE parameters are actualised at the end ofthe next reset. It is not advisable to call this function during the HOMING stage. For diametral axes,the write value is halved. No range check is made.

The HOMING DIRECTION parameter may assume the following values: 0 (NEGATIVE), 1(POSITIVE). The value is taken into account at the start of the next HOMING stage. For virtualaxes this function is ignored.

The PERCENT OF VFF parameter is taken into account at the start of the next HOMING stage.For virtual axes this function is ignored.

Parameters UPPER SW OVERTRAVEL and LOWER SW OVERTRAVEL are taken into account atthe start of the next interpolation. No range check is made. Writing either parameter to zerodisables the control of working limits. Writing any value other than zero on either parameteractivates the working limit control function. For diametral axes, the value written is halved. Forvirtual axes this function is ignored.

Page 356: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-82 10 Series CNC WinPLUS Library - User Manual (04)

A change to the SERVO LOOP GAIN parameter may affect the Servo Error variable algorithm. Forvirtual axes this function is ignored.

Parameter LOOP GAIN STAND STILL is taken into account at the end of the interpolation. Forvirtual axes this function is ignored.

Parameter POSITION ERROR STAND STILL is taken into account when the axis stops; if the axishas already come to a standstill, it is actualised immediately (the function becomes wait).

Parameter POSITION ERROR WITH VFF is actualised immediately if the axis is in movement withVFF (the function becomes wait). A change to this parameter may affect the Servo Error Variablealgorithm.

Parameter POSITION ERROR WITHOUT VFF is actualised immediately if the axis is in movementwith VFF disabled (the function becomes wait). A change to this parameter may affect the ServoError Variable algorithm.

Parameter IN POSITION BAND is actualised at the end of the interpolation.

Parameters IN POSITION WAIT and IN POSITION WINDOW are actualised at the end of theinterpolation. No range check is made.

Parameter AXIS BACKLASH is actualised if the axis has been referred to zero. A change to thisparameter affects the “Soft” algorithm for the application of mechanical backlash.

No range check is made when the DEAD ZONE parameter is changed.

HOMING TYPE parameter. For digital axes, the value is taken into account at the start of the nextHOMING stage.

No range check is made when the ADDITIONAL SERVICE parameter is changed.

The MOTOR TRANSDUCER parameter may assume the following values: 0 (NO) , 1 (YES)

No range check is made when the PROBING CONFIGURATION parameter is changed. The fieldonly concerns the programming of the probing mode for digital drives with D.S.I. interface.

The OFFSET FOR SPINDLE ORIENT parameter is taken into account at the start of the spindleorientation stage. No range check is made.

The SPINDLE WITH RAMPS parameter may assume the following values: 0 (NO), 1 (YES).

Parameters SPINDLE ORIENT. SPEED and SPINDLE ORIENT. ACCELERATION are taken intoaccount at the start of the spindle orientation stage. No range check is made.

Parameter SPINDLE SPEED STOP THRESHOLD is taken into account at the start of the boringcycle. No range check is made.

For parameters SPINDLE SPEED GEAR1/2/3/4, SPINDLE VOLTAGE GEAR1/2/3/4 andSPINDLE_GAIN_GEAR1/2/3/4 the function becomes wait type if the change is made on the activerange. The function is ignored for virtual axes, digital axes. It is advisable to disable the spindlecompletely before calling this function.

For parameters OFFSET_BETWEEN_MARKERS, SKEW_ERROR_MIN andSKEW_ERROR_MAX the function is ignored for virtual axes. It must be used solely on the MasterSplit axis.

For the SKEW_GAIN parameter the function is ignored for virtual axes. It must be used solely onthe Master Split axis. No range check is made.

Page 357: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-83

The STAT_WRD status variable may assume the following values:

Value Meaning

0 OK.

-1 Ax_id wrong or not configured.

-2 Wait time for access to data channel has expired. Try calling the function again; if the errorpersists, it might mean that the system has become unstable and this must give rise to an errorstatus.

-3 ID parameter is not valid or attempt to write a read-only parameter.

-4 Input value of range.

-5 Reserved.

-6 Operation not possible. A condition has occurred which has made it impossible to execute theparameter change.

Page 358: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-84 10 Series CNC WinPLUS Library - User Manual (04)

AX_RPAR: Reads the AMP parameters of an axis

Type: No Wait

LD/FBD:

ST:

stat_wrd := AX_RPAR (ax_id, param, value);

INPUT VARIABLES: axis identifier (int)

parameter number (int)

OUTPUT VARIABLES: value (lreal)

status word (int)

Description: This function reads the axis parameters corresponding to the characterisation fieldsin AMP.

For the codes of the parameters and returned values, see the table given in connection with theAX_WPAR function.

The STAT_WRD status variable may assume the following values:

Value Meaning

0 OK.

-1 Ax_id wrong or not configured.

-2 Wait time for access to the data channel expired. Try calling the function again; if the error persists,it might mean that the system has become unstable and this must give rise to an error status.

-3 ID parameter not valid.

-5 Reserved.

-6 Operation not possible. A condition has occurred which has made it impossible to execute theparameter change. Check the input value

Page 359: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-85

AX_FWW: Writes the parameters of an OS3 drive associated with an axis

Type: Wait

LD/FBD:

ST:

stat_wrd := AX_FWW (ax_id, param, type_par, value);

INPUT VARIABLES: axis identifier (int)parameter number (int)write format (int)value to be written (lreal)

OUTPUT VARIABLE: status word (int)

This function writes the parameters of an OS-Wire OS3 drive.

For the codes and formats of the drive parameters, see “OS3 Drive – Installation Manual”.

Parameter “type_par” is not managed at present, force to 0.

The STAT_WRD status variable may assume the following values:

Value Meaning

0 OK.

-1 Ax_id wrong or not configured.

-6 Operation not possible, the “ax_id” parameter refers to an analog axis.

1002 Wait time for access to the data channel expired. Try calling the function again; if the error persists,it might mean that the system has become unstable and this must give rise to an error status.

2114 Parameter “para_num” wrong.

Othervalues

See “OS3 Drive – Installation Manual”.

Page 360: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-86 10 Series CNC WinPLUS Library - User Manual (04)

AX_FWR: Reads the parameters of an OS3 drive associated with an axis

Type: Wait

LD/FBD:

ST:

stat_wrd := AX_FWR (ax_id, param, type_par, value);

INPUT VARIABLES: axis identifier (int)

parameter number (int)

read format (int)

OUTPUT VARIABLE: value returned (lreal)

status word (int)

Description:

This function reads the parameters of an OS-Wire OS3 drive.

For the codes and formats of the drive parameters, see “OS3 Drive – Installation Manual”.

Parameter “type_par” is not managed at present, force to 0.

Page 361: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-87

The STAT_WRD status variable may assume the following values:

Value Meaning

0 OK.

-1 Ax_id wrong or not configured.

-6 Operation not possible, the “ax_id” parameter refers to an analog axis.

1002 Wait time for access to the data channel expired. Try calling the function again; if the error persists,it might mean that the system has become unstable and this must give rise to an error status.

2114 Parameter “para_num” wrong.

Othervalues

See “OS3 Drive – Installation Manual”.

WARNING

An incorrect use of this function may give rise to hazardous conditionsfor the system.

Page 362: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-88 10 Series CNC WinPLUS Library - User Manual (04)

AX_MECS: Read the status of a Mechatrolink driveType: Wait

LD/FBD:

ST:stat_wrd := AX_MECS(ax_id, ax_stat1, ax_stat2);

INPUT VARIABLES: axis identifier (int)OUTPUT VARIABLES: status of drive I/Os (int)

drive status word (int)status word (short)

Description:With this function, from the machine logic it is possible to read the status word and the I/Os of aMechatrolink drive.

Output variable STAT_WRD may assume the following values:

Value Meaning

0 Command completed successfully.

-1 Invalid Id axis.

The I/O signals (returned in ax_stat1) are:

D7 D6 D5 D4 D3 D2 D1 D0EXT2 EXT1 PC PB PA DEC N-OT P-OT

D15 D14 D13 D12 D11 D10 D9 D8- - - - - - BRK EXT3

Where :

stat_wrd

Page 363: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-89

D0 : P-OT (Positive OverTravel) forward direction limit switch inputD1 : N-OT (Negative OverTravel) reverse direction limit switch inputD2 : DEC deceleration limit switch inputD3 : PA encoder phase A signal inputD4 : PB encoder phase B signal inputD5 : PC encoder phase C signal inputD6 : EXT1 no. 1 external latch signal input (used for the probe)D7 : EXT2 no. 2 external latch signal inputD8 : EXT3 no. 3 external latch signal inputD9 : BRK brake status outputD10 : not used…

D15 : not used

The status word of the drive (returned in ax_stat2) is as follows:

D7 D6 D5 D4 D3 D2 D1 D0PSET ZPOINT MLOCK PON SVON CMDRDY WARNG ALARM

D15 D14 D13 D12 D11 D10 D9 D8- - N-SOT P-SOT NEAR L_CMP T_LIM DEN

Where :

D0 : ALARM alarm (1 alarm generated)D1 : WARNG warning (1 warning generated)D2 : CMDRDY command ready (1 ready, 0 busy)D3 : SVON servo ON (1 servo ON)D4 : PON main power ON (1 power ON)D5 : MLOCK machine lock (1 lock ON)D6 : ZPOINT home position (1 absolute position within the home

position range)D7 : PSET positioning complete (1 positioning completed)D8 : DEN command distribution completed flag (1 command distribution

completed)D9 : T_LIM torque limit (1 torque limited, 0 torque not limited)D10 : L_CMP latch completed (1 latch completed)D11 : NEAR positioning proximity (1 absolute position within positioning

proximity range of target position)D12 : P-SOT forward direction software limit (1 forward direction

software limit exceeded)D13 : N-SOT reverse direction software limit (1 reverse direction

software limit exceeded)D14 : reservedD15 : reserved

For further details on the meaning of the bits of the two words, see the Mechatrolink technicalmanual.

Page 364: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-90 10 Series CNC WinPLUS Library - User Manual (04)

AX_MECR: Read the parameters of a Mechatrolink drive

Type: Wait

LD/FBD:

ST:stat_wrd := AX_MECR (ax_id, para_num, para_type, para_val);

INPUT VARIABLES: axis identifier (int)number of parameter read (int)type of parameter read (int)

OUTPUT VARIABLES: para_val (lreal)status word (int)

Description:With this function, from the machine logic it is possible to read the parameters of a Mechatrolinkdrive. See the manual of the drive to see the data types that can be read (number of parameter).

As for parameter type, it is necessary to specify whether the parameter read is defined by 2 bytes(word) or by 4 bytes (long) (as defined in the drive manual) and whether the parameter must beread from the RAM or the EPROM of the drive.

Bit 0 = 1 means parameter on 4 bytes (long), if 0 on 2 bytes (word)

Bit 1 = 1 means read from EPROM, if 0 from RAM

Output variable STAT_WRD may assume the following values:

Value Meaning

0 Command completed successfully.

-1 Invalid Id axis.

stat_wrd

Page 365: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-91

AX_MECW: Write the parameters of a Mechatrolink drive

Type: Wait

LD/FBD:

ST:stat_wrd := AX_MECW (ax_id, para_num, para_type, para_val);

INPUT VARIABLES: axis identifier (int)number of parameter to be written (int)type of parameter to be written (int)para_val (lreal)

OUTPUT VARIABLES: status word (int)

Description:With this function, from the machine logic it is possible to write the parameters of a Mechatrolinkdrive. See the drive manual to determine the types of data that can be written (parameter number).

As for parameter type, it is necessary to specify whether the parameter written is defined by 2bytes (word) or by 4 bytes (long) (as defined in the drive manual) and whether the parameter mustbe written in the RAM or the EPROM of the drive.

Bit 0 = 1 means parameter on 4 bytes (long), if no on 2 bytes (word)

Bit 1 = 1 means write in EPROM, if 0 in RAM

Output variable STAT_WRD may assume the following values:

Value Meaning

0 Command completed successfully.

-1 Invalid Id axis.

stat_wrd

Page 366: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-92 10 Series CNC WinPLUS Library - User Manual (04)

AX_RTFBCK: Read OS-WIRE variables in real time

Type: WAIT/NOWAIT

LD/FBD:

ST:stat_wrd := AX_RTFBCK(ax_id, func, var_id, var_val);

INPUT VARIABLE: axis logic ID (int)Functions to be activated (int)Array of IDs of variables to be monitored (int)

OUTPUT VARIABLE: Array of values of variables (lreal)status word (int)

Description:

The function reads in real time up to 4 variables of the OS3 drive. The procedure consists of 3step: config&start, read variables and stop.

By means of the func parameter, select the sub-command:

Value Sub-command1 config&start2 read variables3 stop

Command config&start is used to specify the variables to be read. The basic input is var_id, whichis the first element of a vector where to place the identifiers of the OS3 variables. The next 3elements are part of the vector. If the variables are fewer than 4, the last element to be introducedis Value –1 (“end of table”).

IMPORTANT In order to determine the identifiers of the OS3 variables, take the Value ofthe code given in Appendix A of the “OS³ Drive Installation and CalibrationManual” and add to it Value 1000 (decimal).

Command config&start converts the block into a WAIT function which therefore has to be called bya background task.

stat_wrd

Page 367: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

10 Series CNC WinPLUS Library - User Manual (04) 8-93

With the read variables command, the block writes the values monitored by the drive in a vector of4 double elements. Output var_val indicates the first element. The next 3 elements are part of thevector. The values refer to the last acquisition of the drive and are expressed in configuredmeasurement units.

Command read variables converts the block into a NOWAIT function and therefore it can be calledfrom the foreground.

With the stop command, the drive concludes the acquisition of the variables. After that, you canperform a new monitoring process with other variables.

Command stop converts the block into a WAIT function which therefore has to be called by abackground task.

Parameter stat_wrd can return the following values:

Value Description0 Function completed successfully-1 Invalid axis ID or axis not configured-6 Operation is impossible (axis is non digital type)

For additional error codes, see “OS3 Drive – Installation Manual”.

Page 368: 10 Series CNC WinPLUS LIBRARY

Chapter 8Axes Related Functions

8-94 10 Series CNC WinPLUS Library - User Manual (04)

END OF CHAPTER

Page 369: 10 Series CNC WinPLUS LIBRARY

Chapter 9

10 Series CNC WinPLUS Library - User Manual (00) 9-1

SPECIAL FUNCTIONS

This chapter contains a number of functions dedicated to particular activities such as active resetand table semaphores.

ACTIVE RESET REQUEST.........................................................................................ACTRESSET TABLE INTERLOCK STATUS.............................................................................LOCKTABCANCEL TABLE INTERLOCK STATUS .....................................................................UNLKTABFAST DATA WRITING ON DP ....................................................................................FAST_WRFAST DATA READING FROM DP ..............................................................................FAST_RDENABLE/DIDSABLE COMMUNICATION VIA ETHERNET…………………………… DE_ETH

Page 370: 10 Series CNC WinPLUS LIBRARY

Chapter 9Special Functions

9-2 10 Series CNC WinPLUS Library - User Manual (00)

ACTRES: Active reset request

Type: Wait

LD/FBD:

ST:stat_wrd := ACTRES(proc_num) ;

INPUT VARIABLE: process number (1..20) (int)OUTPUT VARIABLE: function output status word (int)

Description:

Active reset is a non modal function. It can only be called in AUTO or BLOCK/BLOCK mode underfollowing conditions:

• a part program must be active• the system must be in hold or the program never started or the system must be in an end of

block stop.

Active reset will cause following actions:

• it will clear the active part program block or the remainder of the active block from the buffer• the next blocks in sequence will be set up again, assuming the actual position as the start

position• the next block becomes the active block• the hold will be released (if it was on) S_HOLDA will be false S_RUNH will be true

If the function active reset is invoked during MDI mode, the active block will be cleared from theCRT and the internal buffer, if in hold, hold will be released.Active reset does not have influence on any offsets, G codes and auxiliary functions.There are many cases in which an active reset may lead to an error. Please consult theprogramming manual for proper use of active reset.

When the function ACTRES is executed without problems the function output status word stat_wrdcontains a zero value. When problems arise during its execution, the function will return an errornumber (the same number will be displayed together with the corresponding error message in thetop left message area of the screen). Refer to Appendix B for the error numbers and their meaning.

See also:

WinPLUS Application Manual, chapter 8 for a detailed explanation of active reset.

stat_wrd

Page 371: 10 Series CNC WinPLUS LIBRARY

Chapter 9Special Functions

10 Series CNC WinPLUS Library - User Manual (00) 9-3

LOCKTAB: Set table interlock status

Type: Internal

LD/FBD:

ST:stat_wrd := LOCKTAB(n_tab);

INPUT VARIABLE: number of the table to be locked (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function can be used to lock out table access for other users than WinPLUS. In this way noother table user can interfere when the logic is accessing a table. Using the input operand n_ tab,any of the tables can be interlocked. This operand must be a short variable or a short constant inthe following range:

n_tab TABLE1 AXES2 TOOLS3 TOOL OFFSET4 USER5 TOOL MAGAZINE6 POCKET

The output variable STAT_WRD may have the following values:

Value Meaning

0 OK (table reserved for WinPLUS)

1 n_tab out of range (<1 o >6)

2 the table is already reserved for another user (i.e. TABLE EDITOR)

3 table already reserved for WinPLUS

stat_wrd

Page 372: 10 Series CNC WinPLUS LIBRARY

Chapter 9Special Functions

9-4 10 Series CNC WinPLUS Library - User Manual (00)

See also:

UNLKTAB cancel table interlock status

TBLGETW read table (int)

TBLGETD read table (lreal)

TBLPUTW write table (int)

TBLPUTD write table (lreal)

NOTE:If the table is utilized by another user you must wait for the table to be available.It is possible though to warn the user (through the WARNING function) to end the EDIT session inprogress.

Page 373: 10 Series CNC WinPLUS LIBRARY

Chapter 9Special Functions

10 Series CNC WinPLUS Library - User Manual (00) 9-5

UNLKTAB: Cancel table interlock status

Type: Internal

LD/FBD:

ST:stat_wrd := UNLKTAB(n_tab);

INPUT VARIABLE: number of the table to be locked (int)OUTPUT VARIABLE: function status output word (int)

Description:

This function can be used to re-enable the access to any table by other users (i.e. table editor). Byutilizing the input operand n_tab, the access to any table by other users , is re-enabled. Thisoperand must be a short variable or a short constant of the following range:

value TABLE1 AXES2 TOOLS3 TOOL OFFSET4 USER5 TOOL MAGAZINE6 POCKET

If the addressed table has not bee reserved through the LOCKTAB function, calling this functionhas no effect. The WinPLUS Logic is not allowed to access an unlocked table, i.e. the logic mustalways lock a table before accessing it.The output variable STAT_WRD may have the following values:

Value Meaning0 OK (table released)

410 n_tab out of range (<1 o >6)

See also:

LOCKTAB set table interlock statusTBLGETW read table (int)TBLGETD read table (lreal)TBLPUTW write table (int)TBLPUTD write table (lreal)

stat_wrd

Page 374: 10 Series CNC WinPLUS LIBRARY

Chapter 9Special Functions

9-6 10 Series CNC WinPLUS Library - User Manual (00)

FAST_WR: Fast data writing on DP

Type: Internal

LD/FBD:

ST:stat_wrd := FAST_WR(typ_var, idx_var, num_var, ofs_buf);

INPUT VARIABLE: type of variable (MW,MD,A) (int)index of the first variable to be copied (int)number of variables to be copied (int)buffer offset (0-319) (int)

OUTPUT VARIABLE: status word (int)

Description:

This function writes data in a non volatile memory area, i.e. one whose contents are not clearedafter power up. FAST_WR can be used for back-up purposes or for communications with theREAL TIME DOS.The dedicated DP area is a 320 byte buffer. In this buffer the user may define formattedcommunication areas for different types of applications.The "ofs_buf " parameter indicates the buffer internal offset. It may range from 0 to 319 for Avariables, from 0 to 318 for MW variables, and from 0 to 312 for MD variables.FAST_WR writes "num_var" variables of the "typ_var" type, from the one having the "idx_var"index in the buffer and starting from the address specified by "ofs_buf".

stat_wrd

Page 375: 10 Series CNC WinPLUS LIBRARY

Chapter 9Special Functions

10 Series CNC WinPLUS Library - User Manual (00) 9-7

Data may be copied from the following variables:

typ_var variable indexes

1 MW 0 - 9999

2 MD 0 - 2999

3 A 0 - 1499

The function checks both the indexes of the source variables and the buffer length. For each typeof variable the starting index plus the number of variables to be copied must not be greater thanthe maximum allowed index. The 320 byte buffer must contain all the variables to be copied,starting from the "ofs_buf" index. If the system does not comply with these two conditions, thefunction is not executed and an error code will appear in the status word.

The output variable STAT_WRD can have the following values:

Value Meaning

0 OK

407 (Index of first variable + number of variables ) out of range

415 Unkown type of variable (1-3)

416 (Buffer index + length of variables) out of range

Example:variable type = 1 (MW)index of first variable = 130number of variables = 5buffer offset = 27

Copies variables MW130, MW131, MW132, MW133 and MW134 in the buffer starting from index 27.

0 27 28 29 30 31 32 33 34 35 36 320

... ... MW130 MW131 MW132 MW133 MW134 ... ... ...

BUFFER

NOTE:This DP area is also accessible to a REAL TIME DOS application by means of the PL_FASTDRVfunction.

Page 376: 10 Series CNC WinPLUS LIBRARY

Chapter 9Special Functions

9-8 10 Series CNC WinPLUS Library - User Manual (00)

FAST_RD: Fast data reading from DP

Type: Internal

LD/FBD:

ST:stat_wrd := FAST_RD(typ_var, idx_var, num_var, ofs_buf);

INPUT VARIABLE: type of destination variable (MW,MD,A) (int)index of first destination variable (int)number of variables to be copied (int)buffer offset (0-319) (int)

OUTPUT VARIABLE: status word (int)

Description:

This function reads data from a non volatile memory area, i.e. one whose contents are not clearedafter power up. FAST_RD can be used for back-up purposes or for communications with the REALTIME DOS.The dedicated DP area is a 320 byte buffer. In this buffer the user may define formattedcommunication areas for different types of applications.The "ofs_buf " parameter indicates the buffer internal offset. It may range from 0 to 319 for Avariables, from 0 to 318 for MW variables, and from 0 to 312 for MD variables.

FAST_RD reads "num_var" variables of the "typ_var" type, from the one having the "idx_var" indexin the buffer and copies them in "typ_var" variables starting from the address specified by"idx_buf".Although destination variables must be of the same type as those read from the buffer, the systemdoes not make any specific check. If source and destination variables do not belong to the sametype a system failure may occur.

stat_wrd

Page 377: 10 Series CNC WinPLUS LIBRARY

Chapter 9Special Functions

10 Series CNC WinPLUS Library - User Manual (00) 9-9

Data may be copied into the following variables:

typ_var variable indexes

1 MW 0 - 9999

2 MD 0 - 2999

3 A 0 - 1499.

The function checks both the indexes of the destination variables and the buffer length. For eachtype of variable the starting index plus the number of variables to be copied must not be greaterthan the maximum allowed index. The 320 byte buffer may be read from the "ofs_buf" index for anumber of characters that is equal to or less than the maximum buffer length. If the system doesnot comply with these two conditions, the function is not executed and an error code will appear inthe status word.

The output variable STAT_WRD can have the following values:

Value Meaning

0 OK

407 (Index of first variable + number of variables ) out of range

415 Unknown type of variable (1-3)

416 (Buffer index + length of variable) out of range

Example:variable type = 2 (MD)index of first variable = 0number of variables = 3buffer offset = 200

Reads 3 lreal variables from the buffer starting from index 200 and writes them in MD variablesstarting from the 0 address (MD0).

0 200 207 208 215 216 223 320

... ... ... ... lreal 1 lreal 2 lreal 3 ... ...

BUFFER

After execution, the contents of the MD variables will be:

MD0 = double 1 ; MD1 = double 2 ; MD3 = double 3;

NOTE:This DP area is also accessible to a REAL TIME DOS application by means of the PL_FASTDRVfunction.

Page 378: 10 Series CNC WinPLUS LIBRARY

Chapter 9Special Functions

9-10 10 Series CNC WinPLUS Library - User Manual (00)

DE_ETH: Enable/disable communication via Ethernet

Type: Internal

LD/FBD:

ST:

stat_wrd := DE_ETH(value) ;

INPUT VARIABLES: enable/disable Ethernet communication (int)OUTPUT VARIABLE: status word (int)

Description:

The function enables or disables communication via Ethernet. If the parameter value equals 1, thecommunication is disabled; if it is 0, the communication is enabled.

END OF CHAPTER

stat_wrd

Page 379: 10 Series CNC WinPLUS LIBRARY

Chapter 10

10 Series CNC WinPLUS Library - User Manual (04) 10-1

CANOPEN® HILSCHER MANAGEMENT FUNCTIONS

This chapter describes the functions dedicated to the management of the devices installed on aCANopen bus and connected to the Hilscher master board.

CANOPEN PARAMETERS INITIALISATION ................................................CAN_INITNETWORK MANAGEMENT COMMANDS TRANSMISSION .......................NMT_CMDSYNCHRONISATION COMMAND TRANSMISSION ....................................SYNC_CMDNODE DIAGNOSTICS AND DATA READING...............................................GET_EMCY_INFOPARAMETERS READING THROUGH SDO .................................................READ_SDO_CMDPARAMETERS WRITING THROUGH SDO ..................................................WRITE_SDO_CMDSENDING COMMANDS TO THE MASTER BOARD …………………………CAN_BOARD_CMD

Page 380: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10-2 10 Series CNC WinPLUS Library - User Manual (04)

CAN_INIT: CANopen parameters initialisation

Type: WAIT

LD/FBD:

ST:stat_wrd := CAN_INIT(Board, RefreshTime, IniInpOffset, EndInpOffset,

IniOutOffset, EndOutOffset, DiagnOffset);

INPUT VARIABLE: CANopen Master board (int)Refresh time (int)Input data first byte offset (int)Input data last byte offset (int)Output data first byte offset (int)Output data last byte offset (int)Diagnostic data first byte offset (int)

OUTPUT VARIABLE: status word (int)

Description:

This function is used to set the refresh time of the data available to the logic, i.e., the datatransmitted and received through PDO (Process Data Object).

Moreover, it enables you to inform the board as to the memory mapping of reception andtransmission data, as well as the diagnostic data about the master board and the nodes.

This function must be called before any other operation to be performed on BUS CANopen nodes.The system starts refreshing the Input/Output data only after the CAN_INIT function iscalled.

Parameter "Board": indicates the number of the CANopen master board on which to activate theparameters.

Parameter "RefreshTime": indicates the data refresh time. The time must be set as a multiple of10ms. If the value set is not a multiple of 10ms, the system rounds it up to the nearest highermultiple (E.g., the value set by the logic is 13ms the system sets a value of 20ms).

stat_wrd

Page 381: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10 Series CNC WinPLUS Library - User Manual (04) 10-3

Parameters "IniInpOffset" and "EndInpOffset": these indicate the first and last bytes relating tothe input data, respectively (range: 0-1023). If you want the offsets of the inputs to be remapped,set both parameters on zero; map information is stored in the [INPUT] section of the *.RMP file

Parameters "IniOutOffset" and "EndOutOffset": these indicate the first and last bytes relating tothe output data, respectively (range: 0-1023). If you want the offsets of the outputs to be remapped,set both parameters on zero; map information is stored in the [OUTPUT] section of the *.RMP file.

Parameter "OffsetDiagn": indicates the first byte of the diagnostics buffer. This buffer is allocatedby the system inside the input buffer. The status of the master board and the status of the nodes isstored starting from the byte specified and over a length of 48 bytes. For a description of the datastored in the diagnostics buffer, see the description given in the WinPLUS application manual.

Remapping the PDOs (option)

PDO remapping data must be present in a text file: it will be CANBUS0.RMP for board 0 andCANBUS1.RMP for board 1. The files must reside in the directory that contains the *.DBM files.

Each of the *.RMP files must contain two sections: the input section [INPUT] for the remapping ofthe Input PDOs and the output section [OUTPUT] for the remapping of the Output PDOs; thesesections must end with [END_INPUT] and [END_OUTPUT], respectively. If either section ismissing in a file, the system will refresh the data for the missing section according to themapping used in SyCon.

Each remapping data must be included in each individual line and inside the relative section. Eachline must contain three fields, separated by a comma: the first field will indicate the destinationoffset in the WinPLUS interchange buffer (1024 bytes); the second field will indicate the sourceoffset in the DualPort Hilscher (3.5 Kbytes); the third field will indicate the length in bytes.

You can add to the file comments enclosed between “(*” e “*)” according to the WinPLUS notation.To comment on an entire line, just add the “;” character for first.

File formatting is described below:

[INPUT]

“Offset Input WinPLUS”,”Offset Input Sycon”,”length in bytes”

[END_INPUT]

[OUTPUT]

“Offset Output WinPLUS”,”Offset Output Sycon”,” length in bytes”

[END_OUTPUT]

Page 382: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10-4 10 Series CNC WinPLUS Library - User Manual (04)

Example:Assume we want to remap only the outputs of board 0, and do not want to remap the inputs. Theinitialisation function will be:

retCode := CAN_INIT(0, 10, 10, 30, 0, 0, 300);

Function CAN_INIT informs the system that the mapping of the inputs is the same as is used inSyCOn, whereas for the mapping of the outputs you must refer to file CANBUS0.RMP. Assumingwe have an 8-byte output PDO mapped at offset 10 of the DualPort Hilscher, this file will be drawnup as follows:

[OUTPUT]

(* This is a comment *)

170,10,2 (* RIO 16O *)180,12,1190,13,3194,16,2

[END_OUTPUT]

Parameter stat_wrd may return the following values:

Value Description0 Function completed successfully

307 Initialisation already performed308 The input range, or the diagnostics range, overlaps the input range of another

CANopen master board present in the system309 The input range, or the diagnostics range, overlaps the diagnostics range of

another CANopen master board present in the system310 The output range overlaps the output range of another CANopen master board

present in the system314 Remapping file not found400 Invalid master board number405 Negative offset value406 Inputs offset out of range407 First input byte greater than last input byte408 Outputs offset out of range409 First output byte greater than last output byte410 Diagnostics buffer offset out of range411 Diagnostics buffer overlaps the input range

Page 383: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10 Series CNC WinPLUS Library - User Manual (04) 10-5

NMT_CMD: Send CANopen network or remote node management commands

Type: WAIT/NO WAIT

LD/FBD:

ST:stat_wrd :=NMT_CMD(Board, NodeId, Cmd, Timeout, ExecutionMode);

INPUT VARIABLE: CANopen Master board number (int)Node identifier (= 0 BroadCasting) (int)NMT command (int)Timeout in ms (= 0 no timeout) (int)Function execution mode (0 NOWAIT, 1 WAIT) (int)

OUTPUT VARIABLE: status word (int)

Description:

This function is used for the execution of network management services (NMT: Networkmanagement). Through these services, the nodes can be initialised, started, stopped and reset.

This function is uniquely identified by the node identifier (NodeId 1-127). For the execution of theservice on all the nodes present on the BUS, set NodeId = 0.

Parameter "Cmd": indicates the type of service to be transmitted. Possible values include:

Values Description1 Remote node start2 Remote node stop

128 Set pre-operational status129 Remote node start reset130 Communication reset

stat_wrd

Page 384: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10-6 10 Series CNC WinPLUS Library - User Manual (04)

Function execution modes

WAIT: The function remains waiting from a reply from the remote node, unless a timeoutinterval has been specified; in this case, if no reply has been received, a timeouterror is returned.

NO WAIT: The function does not remain waiting for a reply from the remote node. The firsttime it makes the request, the other times it makes sure a reply has beenreceived, otherwise it remains waiting or quits with a timeout error.

The stat_wrd variable may assume the following values:

Value Description0 Function completed successfully

100 Command rejected (Internal commands list full) (only in NO WAIT mode)101 Command accepted waiting to be transmitted (only in NO WAIT mode)102 Command transmitted to node and waiting for reply (only in NO WAIT mode)103 Timeout error105 Master board reset underway106 CAN chip of master board in OFFLINE status107 CAN chip of master board in STOP status108 CAN chip of master board in CLEAR status306 Channel not initialised yet400 Invalid master board number401 Invalid node identifier403 NMT command wrong

Page 385: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10 Series CNC WinPLUS Library - User Manual (04) 10-7

SYNC_CMD: Send SYNC command to all the nodes

Type: WAIT/NO WAIT

LD/FBD:

ST:stat_wrd :=SYNC_CMD(Board, Timeout, ExecutionMode);

INPUT VARIABLE: CANopen Master board number (int)Timeout in ms (=0 no timeout) (int)Function execution mode (0 NOWAIT, 1 WAIT) (int)

OUTPUT VARIABLE: status word (int)

Description:

This function sends SYNC commands to the entire network. This command is used to actualisedata to/from analog modules.

This function can be executed only in WAIT mode.

The stat_wrd variable may assume the following values:

Value Description0 Function completed successfully

105 Master board reset underway106 CAN chip of master board in OFFLINE status107 CAN chip of master board in STOP status108 CAN chip of master board in CLEAR status306 Channel not initialised yet400 Invalid master board number404 NO WAIT mode not possible

stat_wrd

Page 386: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10-8 10 Series CNC WinPLUS Library - User Manual (04)

GET_EMCY_INFO: Read node information and diagnostic data

Type: WAIT/NO WAIT

LD/FBD:

ST:stat_wrd := GET_EMCY_INFO( Board, NodeId, Timeout, ExecutionMode,

NodeStatus, AddInfo, ProfileNum, NodeState, ActualErr,EmcyLen, EmcyData[0]);

INPUT VARIABLE: CANopen Master board number (int)Node identifier (int)Timeout in ms (=0 no timeout) (int)Function execution mode (0 NOWAIT, 1 WAIT) (int)

OUTPUT VARIABLE: Node status Flag (WORD)Return data from Object 1000H (WORD)Number of profile returned from Object 1000H (INT)Node status (INT)Error underway (INT)Length of EMCY data array (INT)EMCY data array [0..4] (EMCY_TYPE)status word (int)

Description:

This function gets the emergency data relating to a node from the master board internal buffer.

It can be called after checking for emergency nodes. The check is performed on the diagnosticbuffer starting from the OFFSETDIAGN+32 byte over a length of 16 bytes.

stat_wrd

Page 387: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10 Series CNC WinPLUS Library - User Manual (04) 10-9

Function execution modes

WAIT: The function remains waiting for a reply from the remote node, unless a timeoutinterval has been specified; in this case, if no reply is received, a timeout error isreturned.

NO WAIT: The function does not remain waiting for a reply from the remote node. The firsttime it makes the request, the other times it makes sure a reply has beenreceived, otherwise it remains waiting or quits with a timeout error.

Parameter "NodeStatus": the output parameter must be interpreted in bits. The meaning of eachbit, if set, is explained in the table below:

Bit Description0 Node does not respond.1 Buffer limits exceeded by number of emergencies.2 Difference between master board and node

configuration data.3 WatchDog active on node.

4-7 Reserved

Parameter "AddInfo": The information contained in this output parameter is taken from bits 16-31of Object 1000HEX (Device Type) and containing device type.

Parameter "ProfileNum": The information contained in this output parameter is taken from bits 0-15 of Object 1000HEX (Device Type) and containing the CANopen standard profile number.

Parameter "NodeState": If the WatchDog is active for the node in question, node status is givenin this variable. The values are listed in the table below:

Value Description1 Node not connected2 Node being connected3 Node in preparation4 Node prepared5 Node in operational status

127 Node in pre-operational status

Page 388: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10-10 10 Series CNC WinPLUS Library - User Manual (04)

Parameter "ActualErr": node error code. The values it may assume are listed in the table below,the remedy is given in brackets:

Value Description30 WatchDog error (Make sure node is connected)31 Node status has changed and node is no longer operational

(node reset)32 Wrong sequence in WatchDog management (node reset)33 No reply to a PDO (make sure node is enabled for PDOs).34 No reply from node during its configuration (make sure node

is connected and operational).35 Profile number specified in the configuration not the same as

node profile number (check profile number).36 Device type specified in the configuration not the same as

node device type (check services supported by the node).37 Reply has been received from unknown SDO (node not

compatible with CiA specifications).38 Length of message received by an SDO is not 8 (node not

compatible with CiA specifications).39 Node is not managed by master board, node in STOP state.

Parameter "EmcyLen": Number of valid messages contained in parameter EmcyData.

Parameter "EmcyData": the buffer contains the data structures relating to an emergency.

The stat_wrd variable may assume the following values:

Value Description0 Function completed successfully

306 Channel not initialised yet400 Invalid master board number401 Invalid node identifier100 Command rejected (Internal commands list full) (only in WAIT mode)101 Command accepted by driver (only in WAIT mode)102 Command transmitted to node (only in WAIT mode)103 Timeout error105 Master board reset underway106 CAN chip of master board in OFFLINE status107 CAN chip of master board in STOP status108 CAN chip of master board in CLEAR status

1161 Invalid node identifier

Page 389: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10 Series CNC WinPLUS Library - User Manual (04) 10-11

READ_SDO_CMD: Send read objects through SDO commands

Type: WAIT/NO WAIT

LD/FBD:

ST:stat_wrd :=READ_SDO_CMD(Board, NodeId, Index, subIndex, Timeout,

ExecutionMode, DataLength, Data);

INPUT VARIABLE: CANopen Master board number (int)Node identifier (int)Object Index (HEX) (WORD)Object subIndex (int)Timeout in ms (=0 no timeout) (int)Function execution mode (0 NOWAIT, 1 WAIT) (int)

OUTPUT VARIABLE: Received data array length (ANY)Data array [0..79] in bytes (ANY ELEMENTARY)status word (int)

Description:

This function makes it possible to read the information contained in the object of a node. The objectis specified through the Index and subIndex parameters.

The hexadecimal value of the object must be written in the Index parameter, the sub-index of theobject must be specified in the subIndex parameter.

Function execution modes

WAIT: The function remains waiting for a reply from the remote node, unless a timeoutinterval has been specified; in this case, if no reply is received, a timeout error isreturned.

NO WAIT: The function does not remain waiting for a reply from the remote node. The firsttime it makes the request, the other times it makes sure a reply has beenreceived, otherwise it remains waiting or quits with a timeout error.

The function returns as output the length of the array and the array containing the object data.

stat_wrd

Page 390: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10-12 10 Series CNC WinPLUS Library - User Manual (04)

The stat_wrd variable may assume the following values:

Value Description0 Function completed successfully

100 Command rejected (Internal commands list full) (only in WAIT mode)101 Command accepted by driver (only in WAIT mode)102 Command transmitted to node (only in WAIT mode)103 Timeout error105 Master board reset underway106 CAN chip of master board in OFFLINE status107 CAN chip of master board in STOP status108 CAN chip of master board in CLEAR status306 Channel not yet initialised400 Invalid master board number401 Invalid node identifier

1003 Service has been rejected by node with Abort SDO. The cause might be Indexand subIndex parameters not valid, or you don’t have the node access rights.Function output data contain the Abort SDO code.

1017 No reply from node or node not present1019 Node is not in operational status and access is denied. SDO channel is being

used by master board for node configuration at start-up stage. Try requestingservice again.

1051 Reception buffer limits exceeded.1053 Reception buffer limits exceeded by fragmented protocol data.1054 Previous service is still active and has not been confirmed at application.1057 Sequence error in protocol fragmentation. Request is aborted.1200 Master board not configured.

Page 391: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10 Series CNC WinPLUS Library - User Manual (04) 10-13

WRITE_SDO_CMD: Send write objects through SDO commands

Type: WAIT/NO WAIT

LD/FBD:

ST:stat_wrd :=WRITE_SDO_CMD(Board, NodeId, Index, subIndex, Timeout, ExecutionMode

Datalength, Data);

INPUT VARIABLE: CANopen Master board number (int)Node identifier (int)Object Index (HEX) (WORD)Object sub-Index (int)Timeout in ms (=0 no timeout) (int)Function execution modes (0 NOWAIT, 1 WAIT) (int)Data array length (byte, word, int)Data array in bytes (byte, word, int)

OUTPUT VARIABLE: Data array length (ANY)Array of data transmitted/received in bytes (ANY_ELEMENTARY)status word (int)

Description:

This function makes it possible to write the information contained in the Data parameter in theobject of a node. The object is specified by means of parameters Index and subIndex.

The hexadecimal value of the object must be written in the Index parameter, the sub-index of theobject must be specified in the subIndex parameter.

stat_wrd

Page 392: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10-14 10 Series CNC WinPLUS Library - User Manual (04)

Function execution modes

WAIT: The function remains waiting for a reply from the remote node, unless a timeoutinterval has been specified; in this case, if no reply is received, a timeout error isreturned.

NO WAIT: The function does not remain waiting for a reply from the remote node. The firsttime it makes the request, the other times it makes sure a reply has beenreceived, otherwise it remains waiting or quits with a timeout error.

The stat_wrd variable may assume the following values:

Value Description0 Function completed successfully

100 Command rejected (Internal commands list full) (only in WAIT mode)101 Command accepted by driver (only in WAIT mode)102 Command transmitted to node (only in WAIT mode)103 Timeout error105 Master board reset underway106 CAN chip of master board in OFFLINE status107 CAN chip of master board in STOP status108 CAN chip of master board in CLEAR status306 Channel not initialised yet400 Invalid master board number401 Invalid node identifier

1003 Service has been rejected by node with Abort SDO. The cause might be Indexand subIndex parameters not valid, or you don’t have the node access rights.Function output data contain the Abort SDO code.

1017 No reply from node or node not present1019 Node not in operational status. SDO channel is being used by master board for

node configuration at start-up stage. Try requesting service again.1051 Reception buffer limits exceeded.1053 Reception buffer limits exceeded by fragmented protocol data.1054 Previous service is still active and has not been confirmed at application.1057 Sequence error in protocol fragmentation. Request is aborted.1200 Master board not configured.

Page 393: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10 Series CNC WinPLUS Library - User Manual (04) 10-15

CAN_BOARD_CMD: Send commands to Hilscher master board

Type: NOWAIT

LD/FBD:

ST:stat_wrd :=CAN_BOARD_CMD(Board, Command);

INPUT VARIABLE: CANopen Master board number (int)Command type (int)

OUTPUT VARIABLE: status word (int)

Description:

The function sends a command to the master board identified by the “Board” parameter.

Parameter "Command": indicates type of command to be sent. Possible values include:

Values Description1 Master board RESET2 CANopen communication START3 CANopen communication STOP

RESET command initialises the DualPort of the master board with the parameters stored in theFLASH memory of the device. A RESET operation may take up to 10 seconds and it stops allCANopen communications, and hence the remote nodes may change to WatchDog status.To reactivate the communications at the end of the RESET command, you must always give theSTART command.

The START command restores the CANopen communications and executes the entire “NodeBootup” sequence set by means of the SyCon configurator.

The STOP command stops all CANopen activities on the BUS.

In STOP status and during a RESET, remote node status can change to WatcDog.

stat_wrd

Page 394: 10 Series CNC WinPLUS LIBRARY

Chapter 10CANOPEN-HILSCHER Management Functions

10-16 10 Series CNC WinPLUS Library - User Manual (04)

The stat_wrd variable may assume the following values:

Value Description0 Function completed successfully

104 Invalid command type105 Board reset underway400 Invalid master board number

Other See Appendix B of WinPLUS application manual

END OF CHAPTER

Page 395: 10 Series CNC WinPLUS LIBRARY

Appendix A

CNC Serie 10 WinPLUS Library- User Manual (00) A-1

ERROR MESSAGES FOR SERIAL LINES COM1 OR COM2

General errors

01 Illegal device02 Illegal baudrate value03 Illegal parity value04 Illegal bits value05 Illegal stop value06 Illegal task request07 Reset command08 Sconnect command09 Error on line10 RCX buffer full11 No memory for RCX12 Too many terminators13 Device already connected14 Device not connected15 Serial line Setup not executed

Transmit errors

16 TRX mode wrong17 Message TRX too long18 TRX already pending19 TRX no memory available20 TRX command full21 TRX timeout

Receive errors

48 RCX mode wrong49 Message RCX too long50 RCX already pending51 RCX message truncated52 RCX timeout

Page 396: 10 Series CNC WinPLUS LIBRARY

Appendix AError messages for serial line COM1 or COM2

A-2 10 Series CNC WinPLUS Library – User Manual (00)

Line errors

64 Overrun error65 Parity error66 Framing error

System errors

839 Driver already used841 Driver not mounted

END OF APPENDIX

Page 397: 10 Series CNC WinPLUS LIBRARY

Appendix B

10 Series CNC WinPLUS Library - User Manual (00) B-1

NC MESSAGES

ERROR CODES DISPLAYED IN THE NC ENVIRONMENT

001 Syntax error

002 Wrong number of axes for G code

003 Fixed cycles parameters missing

004 Missing parameters for G code

005 Missing J and/or K for G83 cycle

006 Missing I and/or J for G2/G3 code

007 Probing cycle parameter missing

008 Format error

009 Undefined symbol

010 Overflow

011 Undefined symbol

012 Wrong use of slave axis

013 Operand not allowed in fixed cycle

014 K parameter not allowed in G84

015 Wrong programming of G2/G3 code

016 Illegal number of operands

017 Illegal number of pseudo axes

018 Illegal number of axes in G33 code

020 G not allowed

021 Operand not allowed with G code

022 Block and system state not congruent

024 G and program state not congruent

025 G and dynamic mode not congruent

026 G41/G42 and p.p. state not congruent

027 G needs spindle with transducer

Page 398: 10 Series CNC WinPLUS LIBRARY

Appendix BNC Messages

B-2 10 Series CNC WinPLUS Library - User Manual (00)

028 G not congruent with feedrate mode

029 Operand and p.p. state not congruent

030 M/T/S and dynamic mode not congruent

031 M/T/S and motion type not congruent

032 Probing cycle operands inhibited

033 Third axis for helix missing

034 "Expedite" function without motion

035 Feedrate not programmed

037 Read only variable

038 Part program record too long

048 Illegal argument for TAN

049 Illegal argument for SQR

050 Too many programmed axes

051 Division by zero

052 String too long

053 Label duplicated

054 Undefined label

055 Label too long

056 Program table overflow

057 Label table overflow

058 End of file

059 Beginning of file

060 RPT nesting > 5

061 Subroutine nesting > 4

062 EPP nesting > 1

063 RPT/EPP cycle open at end of file

064 ERP without RPT

065 Error during p.p. file handling

066 Part program not found

067 Part program not selected

069 Modal paramacro already active

070 Paramacro not configured

080 Axis not referenced

081 Undefined DPT for probing cycle

082 Too many "expedite" M codes

083 Undefined M code

Page 399: 10 Series CNC WinPLUS LIBRARY

Appendix BNC Messages

10 Series CNC WinPLUS Library - User Manual (00) B-3

084 Circle not congruent

085 Wrong threading parameters (I,K,R)

086 Helix pitch not congruent

087 Plane axes must have the same SCF

088 Profile not congruent

089 Wrong direction on profile

090 Err. disabling cutter compensation

091 Too many blocks to resolve

092 Entry in safety zone

093 Fixed cycle on rotate plane

094 Fixed cycle data not congruent

096 Wrong probing cycle programming

097 Hole probing cycle not complete

098 Probing cycle not executed

099 Probe touches part when probing cycle starts

100 Hardware travel limit

101 Software overtravel

102 Positive hardware travel limit

103 Negative hardware travel limit

104 Positive software overtravel limit

105 Negative software overtravel limit

106 JOG past software overtravel limit

107 Axes not on profile

108 Home and JOG DIR not congruent

109 Error in exit HOLD : mode changed

110 Block not allowed in hold

111 Active reset not permitted

112 Wrong use of rollover axis with G90

113 Wrong jog direction for jog return

115 Probing cycle executed before the end of approach movement

116 Real axes programmed with virtual mode active

117 Move along active tool direction: no other move is allowed

118 Negative software overtravel

120 Selected mode not allowed

121 Selected axes number out of range

123 Bad select mode for cycle

Page 400: 10 Series CNC WinPLUS LIBRARY

Appendix BNC Messages

B-4 10 Series CNC WinPLUS Library - User Manual (00)

124 Wrong axis name

125 Data length out of range

126 Failed to write variable

127 Failed to read variable

128 Operative limit definition wrong

129 Protected area not defined

130 Corrector not defined for the axis

131 Tool orientation code wrong

132 Error from WinPLUS ambient

133 Error from servo ambient

134 Manual move not executed; there are no configured axes

135 Axis not configured

136 The axis ID programmed in GTA specifies an auxiliary axis

137 Axis not available for this process

138 Axis specified twice

139 The axis ID programmed in GTA specifies a spindle axis

140 Set spindle speed failed

141 New tool request failed

142 M execution failed

143 Pseudo axes programming failed

144 Consents to move failed

145 End of move failed

146 Too many blocks without continuous moves

150 Axis homed

151 Axis on profile

152 End of automatic return to profile

153 End of block retrace

160 Command & system state not congruent

161 Internal error: non existing class

162 Internal error: error message from NC

190 Insufficient length for tapping cycle

191 Insufficient length for tapping cycle with transducer

192 Insufficient length for threading cycle

Page 401: 10 Series CNC WinPLUS LIBRARY

Appendix BNC Messages

10 Series CNC WinPLUS Library - User Manual (00) B-5

199 Spindle not enabled

220 Process not defined

222 Wrong process number

224 Data string too long

225 Data upload failed

226 Message already exists in the queue

227 EXE or ECM failed

320 UPR programming not allowed

321 Wrong incremental UPR programming

322 UPV programming not allowed

323 Wrong axis type on UPV programming

324 Wrong programmed radius value

325 UVC programming not allowed

326 Programmed TCP code value out of range

327 TCP programming not allowed

328 TCP programming not congruent

329 Error on tangential TCP activation

330 Error durin get or release axes on GTA command

331 Axis interpolator clock not congruent

340 Circles/lines not defined

341 Wrong definition of circles/lines

342 Circles/lines not intersecting

343 Coinciding circles

344 Coinciding circles/lines/points

345 Points inside circle

346 Parallel lines

347 Aligned points

Page 402: 10 Series CNC WinPLUS LIBRARY

Appendix BNC Messages

B-6 10 Series CNC WinPLUS Library - User Manual (00)

END OF APPENDIX

Page 403: 10 Series CNC WinPLUS LIBRARY

Appendix C

10 Series CNC WinPLUS Library - User Manual (00) C-1

POINT-TO-POINT AXES / SPINDLE MESSAGES

POINT-TO-POINT AXES / SPINDLE MESSAGES

0 OK1 Non-executable command4 Axis not referred5 Motion outside software operating limits6 Optimized motion on non-rollover axis7 Value programmed for rollover axis higher than rollover pitch8 Motion with interpolator already engaged9 Closing of a channel with interpolator in motion11 Range not valid12 Orientation on spindle w/o transducer13 Variation requests on kind of movement not allowed14 SSL less than zero.15 SSL lower or equal to SLL16 Reset in progress17 Attempt to change gear during a spindle orientation18 Reversal motion requested for the rollover axis while the axis is already moving19 Motion type modificated while axis is moving (absolute/incremental)20 Moving requested while axis is already moving101 Axis identifier not between 1 and 32102 Axis identifier does not identify PtP axis103 Axis identifier does not identify a spindle104 Specified interpolator does not exist106 Interpolator channel already open107 Request before opening interpolator channel108 Serial line not configured109 Serial line used by another application111 Drive not enabled125 Serial Auxiliary Axis option not enabled

Page 404: 10 Series CNC WinPLUS LIBRARY

Appendix CPoint to Point Axes / Spindle Messages

C-2 10 Series CNC WinPLUS Library - User Manual (00)

END OF APPENDIX

Page 405: 10 Series CNC WinPLUS LIBRARY

Appendix D

10 Series CNC WinPLUS Library - User Manual (00) D-1

AVAILABLE TABLES

AVAILABLE TABLES

The following pages give an overview of all available tables, their lengths and symbols. Thisinformation also refers to the other functions related to access to table variables.Symbols are not pre-defined but we advise you to use, via PLUSEDIT, the symbols listed in thefollowing tables.

Table number Name Default symbol Allowed index01 axes table AXTAB 1 - 3202 tool table TOLTAB 1 - 25003 tool offset table OFFTAB 1 - 30004 user table USTAB 1 - 100

Axes table

Field # Format Default symbol Contents1 int AXOWNER ambient2 int AXNAME ASCII axis name3 lreal AXORIG actual origin4 lreal reserved5 lreal AXOFG92 G92 offset6 lreal AXTOFF actual offset7 lreal PRO_OFFS total offset with “h”8 lreal TOT_OFFS total offset9 lreal ORIG1 origin 1

10 lreal ORIG2 origin 211 lreal ORIG3 origin 312 lreal ORIG4 origin 413 lreal ORIG5 origin 514 lreal ORIG6 origin 615 lreal ORIG7 origin 716 lreal ORIG8 origin 817 lreal ORIG9 origin 918 lreal ORIG10 origin 1019 int ACT_ORIG current origin20 int reserved

Page 406: 10 Series CNC WinPLUS LIBRARY

Appendix DAvailable Tables

D-2 10 Series CNC WinPLUS Library - User Manual (00)

Tool table

Field# Format Default symbol Contents1 lreal TCODE tool code2 int POCKET pocket position3 int TFAMCOL random4 int TCLASS tool class5 int TSTATUS tool status word6 int TCNTRL control word7 lreal MAXTIME start life8 lreal REMTIME current life9 lreal TUSER1 user parameter 1

10 lreal TUSER2 user parameter 211 lreal TUSER3 user parameter 312 lreal TUSER 4 user parameter 413 int TOLOFNR offset number

Tool offset table

Field # Format Default symbol Contents1 lreal TACTL1 act tool length 12 lreal TCMAXL1 max. change length3 lreal TCACTL1 act. change length4 lreal TACTL2 act tool length 25 lreal TCMAXL2 max. change length 26 lreal TCACTL2 act change length 27 lreal TDIAMETER tool diameter8 lreal TCACDIAM act change diam.9 int TORIENT orientation

User table

Field # Format Default Symbol Contents1 lreal USER1 user variable 12 lreal USER2 user variable 23 lreal USER3 user variable 34 lreal USER4 user variable

Please refer to the WinPLUS Application Manual, for more detailed information about tables.

END OF APPENDIX

Page 407: 10 Series CNC WinPLUS LIBRARY

Appendix E

10 Series CNC WinPLUS Library - User Manual (00) E-1

HUMAN INTERFACE AND PLUS RELATED MESSAGES

Human Interface Related Messages

002 String too long

004 String number out of limit

005 Column number out of limit

010 Process does not exist

011 Softkey menu number does not exist

012 Error during softkey display update

013 Screen number does not exist

014 Command not executed

015 Softkey status out of limit

100 ASCII buffer index out of range

PLUS Related Messages

400 ax_id out of range

401 parameter out of range

Page 408: 10 Series CNC WinPLUS LIBRARY

Appendix EHuman Interface and PLUS Related Messages

E-2 10 Series CNC WinPLUS Library - User Manual (00)

END OF APPENDIX

Page 409: 10 Series CNC WinPLUS LIBRARY

Appendix F

10 Series CNC WinPLUS Library - User Manual (00) F-1

ERROR MESSAGES FOR THE D.S.I. INTERFACE

ERROR LIST

Code Meaning1 Service Channel not open9 Invalid access to closing the Service Channel

4097 No IDN4105 Invalid access to Element 18193 No name8194 Name transmission too short8195 Name transmission too long8196 Name cannot be changed8197 Name is write-protected at this time

12290 Attribute transmission too short12291 Attribute transmission too long12292 Attribute cannot be changed12293 Attribute is write-protected at this time16385 No units16386 Unit transmission too short16387 Unit transmission too long16388 Unit cannot be changed16389 Unit is write-protected at this time20481 No minimum value20482 Minimum value transmission too short20483 Minimum value transmission too long20484 Minimum value cannot be changed20485 Minimum value is write-protected at this time20577 No maximum value20578 Maximum value transmission too short20579 Maximum value transmission too long20580 Maximum value cannot be changed20581 Maximum value is write-protected at this time28674 Operation data transmission too short28675 Operation data transmission too long28676 Operation data cannot be changed28677 Operation data is write-protected at this time28678 Operation data is smaller than the minimum value28679 Operation data is smaller than the maximum value28680 Invalid data

Page 410: 10 Series CNC WinPLUS LIBRARY

Appendix FError Messages for the D.S.I. Interface.

F-2 10 Series CNC WinPLUS Library - User Manual (00)

END OF APPENDIX

Page 411: 10 Series CNC WinPLUS LIBRARY

Appendix G

10 Series CNC WinPLUS Library - User Manual (00) G-1

MESSAGES FOR POINT TO POINT AXIS CONTROLLED VIARS-232 SERIAL LINE

Serial Driver

The errors generated by the serial drive have IDs between 201 and 252 decimal. The following listthe most important ones:

216 TRX mode – wrong mode217 Transmit message too long218 Transmit already pending219 Transmit no memory220 Transmit message truncated221 TRX timeout

248 RCX wrong mode249 RCX message too long250 Receive already pending251 Received message truncated252 RCX timeout

264 Overrun error265 Parity error266 Framing error

280 Checksum error281 Echo failure

Page 412: 10 Series CNC WinPLUS LIBRARY

Appendix GMessages for Point to Point Axis Controlled via RS-232 Serial Line

G-2 10 Series CNC WinPLUS Library - User Manual (00)

DAC/DSC Osai Drive

301 Element is not available

302 Data is too short

303 Data is too long

304 Data is not alterable

305 Parameter is write protected

306 Data is smaller than minimum value

307 Data is greater than maximum value

308 Data is invalid

309 Obtaining of parameter is invalid

END OF APPENDIX

Page 413: 10 Series CNC WinPLUS LIBRARY

Appendix H

10 Series CNC WinPLUS Library - User Manual (04) H-1

APPENDIX H

TABLE OF MAIN RESOURCES OF AXIS BOARDS:

Board type Number of localresources

Transd. Id (hex) 14-bit conv. Id (hex) 8-bit conv.Id (hex)

10/110 3 transd + 4 conv from 0x100 to 0x102 from 0x200 to 0x203 -10/110 4 transd + 6 conv from 0x100 to 0x103 from 0x200 to 0x205 -OS_851X 6 transd + 8 conv from 0x100 to 0x105 from 0x200 to 0x207 -OS_851X/1 3 transd + 4 conv from 0x100 to 0x102 from 0x200 to 0x203 -OS_851X/2 no transd, no conv - - -OS_851X/3 2 transd + 2 conv 0x104 and 0x105 0x200 and 0x201 -OS_851X/4 no transd, no conv - - -OS_8521 1 conv - - 0x200OS_8520/1 1 conv - - 0x200OS_851X/5 4 transd + 8 conv from 0x100 to 0x103 from 0x200 to 0x207 -OS_851X/6 3 transd + 4 conv from 0x100 to 0x102 from 0x200 to 0x203 -OS_8531 no transd, no conv - - -OS_8532 1 transd + 2 conv 0x100 0x200 0x204OS_8532/2 1 conv - - 0x200OS_8361 1 conv - - 0x200OS_8515 4 transd + 5 conv from 0x100 to 0x103 from 0x200 to 0x203 0x204OS_8515/1 1 conv - - 0x204OS_8515/2 1 transd + 2 conv 0x103 0x203 0x204OS_8515/3 1 conv - - 0x204OS_8365 1 conv - - 0x204OS_8516 1 transd + 2 conv 0x100 0x200 0x204OS_8516/1 1 conv - - 0x204OS_8516/2 1 transd + 2 conv 0x100 0x200 0x204OS_8512 2 transd + 2 conv 0x100 and 0x101 0x200 0x204OS_8512/1 1 conv - - 0x204

Page 414: 10 Series CNC WinPLUS LIBRARY

Appendix HTable of main Resources of Axis Boards

H-2 10 Series CNC WinPLUS Library - User Manual (04)

END OF APPENDIX