Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>ICAM</strong> Technologies Corporation<br />
<strong>Virtual</strong> <strong>Machine</strong> ® Version 19<br />
for CAM-POST and Control Emulator<br />
Publication No. DM-XXSIM190D<br />
Printed in Canada
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0<br />
<strong>ICAM</strong> Technologies Corporation makes no warranties whatsoever, either legal or conventional,<br />
express or implied, with respect to this program and documentation. Because of the diversity of<br />
the conditions and hardware under which the program may be used, no warranty of<br />
merchantability or fitness for a particular purpose is offered. Licensee is advised to test the<br />
program thoroughly before relying on it and assumes the entire risk of using said program. No<br />
warrant is given that this program and documentation will be error free. The documentation is<br />
subject to change without notice and is classified as Confidential and Proprietary and is not to be<br />
reproduced in any manner without the expressed permission of <strong>ICAM</strong> Technologies Corporation.<br />
This is an unpublished work created in 2002. <strong>ICAM</strong> Technologies Corporation owns all rights to<br />
this work and intends to keep the work confidential so as to maintain its value as a trade secret.<br />
<strong>ICAM</strong> Technologies Corporation may also seek to protect this work as unpublished copyright<br />
work. In the event of either inadvertent or deliberate publication, <strong>ICAM</strong> Technologies<br />
Corporation intends to enforce its rights for this work under the copyright laws as a published<br />
work; and to that end, <strong>ICAM</strong> Technologies Corporation hereby affixes the following statutory<br />
notice:<br />
Copyright ©<br />
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011<br />
<strong>ICAM</strong> Technologies Corporation<br />
21500 Nassr Street<br />
Sainte-Anne-de-Bellevue, Quebec<br />
Canada H9X 4C1<br />
All Rights Reserved<br />
Portions of this product incorporate copyrighted works of third parties:<br />
Copyright © 1990–2010, 2011 by <strong>Machine</strong>Works Ltd. All rights reserved.<br />
ii <strong>ICAM</strong> Technologies Corporation – Proprietary
Welcome<br />
Welcome<br />
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> (VM) is a CNC machine simulator, which is fully integrated into<br />
<strong>ICAM</strong>‟s CAM-POST GENER post processing and Control Emulator CERUN products.<br />
This manual contains the following sections:<br />
Section 1 “Overview” provides a brief description of <strong>Virtual</strong> <strong>Machine</strong>.<br />
Section 2 “Using <strong>Virtual</strong> <strong>Machine</strong> Models with CERUN and GENER” describes the operation<br />
of <strong>Virtual</strong> <strong>Machine</strong> with <strong>ICAM</strong>‟s CAM-POST post processing (GENER) and Control Emulator<br />
(CERUN) products. It explains the post-processor command interface that can be used with<br />
GENER to control the simulation. It also describes a common user interface used by both CERUN<br />
and GENER to view and manipulate the model during the simulation, as well as to define cutting<br />
tools, holding fixtures, finish part, rough stock, and workpiece and tool compensations, which<br />
are used to validate the simulation.<br />
Section 3 “Creating <strong>Virtual</strong> <strong>Machine</strong> Models with QUEST” describes how to create and<br />
maintain <strong>Virtual</strong> <strong>Machine</strong> models using the <strong>ICAM</strong> QUEST Developer‟s System. It explains how<br />
to define the kinematics (i.e., axes) of the CNC machine, how to flesh out the model by creating<br />
and/or importing machine components and enabling or disabling collision testing of these<br />
components, and how to customize the model to support special features.<br />
Section 4 “<strong>Virtual</strong> <strong>Machine</strong> Reference” describes the input controls (keys, keyboard shortcuts<br />
and mouse actions), toolbar menus and menu bar selections, and macro customization features<br />
available with <strong>Virtual</strong> <strong>Machine</strong>.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary iii
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0<br />
iv <strong>ICAM</strong> Technologies Corporation – Proprietary
Table of Contents<br />
Table of Contents<br />
1 Overview ................................................................................................................................. 1<br />
2 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CERUN and GENER .................................................. 5<br />
2.1 Selecting a <strong>Virtual</strong> <strong>Machine</strong> Model .............................................................................. 6<br />
2.1.1 Selecting a Model from the CERUN or GENER Launch Panel................................... 6<br />
2.1.2 Selecting a Model from the Command Prompt ........................................................ 8<br />
2.2 Controlling <strong>Virtual</strong> <strong>Machine</strong> from the Part Program (GENER only) ........................... 9<br />
2.2.1 Enable/Disable Simulation........................................................................................ 9<br />
2.2.2 Enable/Disable Collision/Overtravel Detection and Avoidance............................. 10<br />
2.2.3 Enable/Disable Positioning Collision Avoidance ................................................... 10<br />
2.2.4 Camera Positioning under Program Control ........................................................... 11<br />
2.3 Activating the Simulation Window ............................................................................ 12<br />
2.4 Navigating the Simulation Window ............................................................................ 13<br />
2.5 Adjusting Lighting ...................................................................................................... 17<br />
2.6 Adding Parts, Fixtures and Stock to the Simulation ................................................... 18<br />
2.6.1 Differences between Part, Fixture and Stock Components .................................... 18<br />
2.6.2 Creating Part, Fixture and Stock Components ........................................................ 20<br />
2.7 Setting Fixture Compensation..................................................................................... 23<br />
2.8 Adding Tooling Definitions to the Simulation ........................................................... 24<br />
2.8.1 Lathe Tool Definition ............................................................................................. 25<br />
2.8.2 Milling Tool Definition........................................................................................... 26<br />
2.8.3 Holder Definition .................................................................................................... 27<br />
2.8.4 Head Definition ....................................................................................................... 28<br />
2.9 Setting Tool Compensation......................................................................................... 29<br />
2.9.1 Length Compensation ............................................................................................. 29<br />
2.9.2 Diameter Compensation.......................................................................................... 29<br />
2.10 Monitoring <strong>Virtual</strong> <strong>Machine</strong>‟s Results ....................................................................... 30<br />
2.10.1 Head-Up Display .................................................................................................... 31<br />
2.10.2 Animation Control .................................................................................................. 31<br />
2.10.3 Tool Path Display ................................................................................................... 32<br />
2.10.4 VM Controller Timeline ......................................................................................... 33<br />
2.10.5 Part / Stock Comparison ......................................................................................... 34<br />
3 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with QUEST ................................................................ 35<br />
3.1 QUEST User Interface .................................................................................................. 36<br />
3.2 Basic Model Requirements ......................................................................................... 38<br />
3.3 Creating a <strong>Virtual</strong> <strong>Machine</strong> Model ............................................................................. 39<br />
3.4 Adding Kinematics to the Model ................................................................................ 42<br />
3.5 Adding Physical Entities to the Model ....................................................................... 46<br />
3.6 Collision Testing ......................................................................................................... 49<br />
3.6.1 Collision Groups ..................................................................................................... 50<br />
3.6.2 Collision Exclusion Groups .................................................................................... 51<br />
3.7 Selection Groups ......................................................................................................... 53<br />
3.8 Customizing the Model ............................................................................................... 54<br />
3.9 Testing the Model ....................................................................................................... 55<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary v
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0<br />
4 <strong>Virtual</strong> <strong>Machine</strong> Reference ................................................................................................. 57<br />
4.1 Input Controls ............................................................................................................. 65<br />
4.1.1 Standard Keyboard Mapping .................................................................................. 65<br />
4.1.2 Construction Keyboard Mapping ............................................................................ 66<br />
4.1.3 Mouse Mapping ...................................................................................................... 66<br />
4.2 Toolbar ........................................................................................................................ 67<br />
4.2.1 View (CERUN & GENER only) .............................................................................. 67<br />
4.2.2 VM Construct (QUEST only) ................................................................................. 67<br />
4.2.3 VM Mode (CERUN & GENER only) ...................................................................... 69<br />
4.2.4 VM Grid .................................................................................................................. 70<br />
4.2.5 VM View ................................................................................................................ 71<br />
4.2.6 VM View Filter (CERUN & GENER only) ............................................................. 71<br />
4.2.7 VM Animation (CERUN & GENER only) .............................................................. 72<br />
4.2.8 VM Measure (CERUN & GENER only) ................................................................. 73<br />
4.3 Menu Bar .................................................................................................................... 74<br />
4.3.1 Simulation»<strong>Virtual</strong> <strong>Machine</strong> (CERUN & GENER only) ......................................... 74<br />
4.3.2 Simulation»Controller (CERUN & GENER only) ................................................... 74<br />
4.3.3 Simulation»Mode (CERUN & GENER only) .......................................................... 78<br />
4.3.4 Simulation»Stock/Fixtures/Part (CERUN & GENER only) .................................... 79<br />
4.3.5 Simulation»Tools/Holders/Heads (Ctrl Alt T) (CERUN & GENER only) .............. 81<br />
4.3.6 Simulation»Construct Entity (QUEST only) .......................................................... 91<br />
4.3.7 Simulation»Construct Axis (QUEST only) ............................................................ 96<br />
4.3.8 Simulation»Camera............................................................................................... 103<br />
4.3.9 Simulation»Show .................................................................................................. 106<br />
4.3.10 Simulation»Measure ............................................................................................. 110<br />
4.3.11 Simulation»Use World CS (QUEST only) ........................................................... 111<br />
4.3.12 Simulation»Group Selection (QUEST only) ........................................................ 111<br />
4.3.13 Simulation»Hide Selection (Ctrl B) ...................................................................... 112<br />
4.3.14 Simulation»Show All/Rehide (Ctrl Alt B) ............................................................ 112<br />
4.3.15 Simulation»Invert Hide State (Ctrl Shift B) ......................................................... 112<br />
4.3.16 Simulation»Grid (Ctrl Alt G) ................................................................................ 113<br />
4.3.17 Simulation»Lights (Ctrl Alt L) ............................................................................. 114<br />
4.3.18 Simulation»Materials (Ctrl Alt M) ....................................................................... 115<br />
4.3.19 Simulation»Display (Ctrl Alt D) ........................................................................... 116<br />
4.3.20 Simulation»Compare (Ctrl Alt Q) ........................................................................ 117<br />
4.3.21 Simulation»Options (Ctrl Alt O) .......................................................................... 118<br />
4.3.22 Simulation»Open Setup (CERUN & GENER only) .............................................. 121<br />
4.3.23 Simulation»Save Setup (CERUN & GENER only) ............................................... 121<br />
4.4 Model Customization ................................................................................................ 122<br />
4.4.1 The Macro Language ............................................................................................ 123<br />
4.4.1.1 Fundamentals of the Macro Language ............................................................. 123<br />
4.4.1.2 Flow Control in a Macro .................................................................................. 132<br />
4.4.1.3 Macro Invocation .............................................................................................. 135<br />
4.4.1.4 Text File I/O from a Macro .............................................................................. 136<br />
4.4.1.5 Other Macro Commands .................................................................................. 138<br />
4.4.1.6 String Format Specification .............................................................................. 139<br />
4.4.2 Model Startup/Shutdown Macros ......................................................................... 145<br />
vi <strong>ICAM</strong> Technologies Corporation – Proprietary
Table of Contents<br />
4.4.2.1 The Model Startup Macro ................................................................................ 145<br />
4.4.2.2 The Model Shutdown Macro ............................................................................ 145<br />
4.4.3 Model Event Macros ............................................................................................. 146<br />
4.4.3.1 The Tape Event Macro (GENER only) ............................................................ 146<br />
4.4.3.2 The Motion Event Macro ................................................................................. 146<br />
4.4.3.3 The Rapid Event Macro .................................................................................... 147<br />
4.4.3.4 The Feed Event Macro ..................................................................................... 147<br />
4.4.3.5 The Load Tool Event Macro ............................................................................ 147<br />
4.4.4 The Dialog Editor ................................................................................................. 148<br />
4.4.4.1 Adding and Deleting Dialogs ........................................................................... 148<br />
4.4.4.2 The Dialog Template Editor ............................................................................. 149<br />
4.4.5 Simulation Macro Functions ................................................................................. 152<br />
4.4.5.1 Function Summary ........................................................................................... 152<br />
4.4.5.2 Mathematical Functions ................................................................................... 153<br />
4.4.5.3 Numerical Functions ........................................................................................ 155<br />
4.4.5.4 Geometric Functions ........................................................................................ 157<br />
4.4.5.5 Vector Functions .............................................................................................. 159<br />
4.4.5.6 Matrix Functions .............................................................................................. 162<br />
4.4.5.7 Conversion Functions ....................................................................................... 164<br />
4.4.5.8 Conditional Functions ...................................................................................... 166<br />
4.4.5.9 Character and Sequence Functions ................................................................... 169<br />
4.4.5.10 Command Line Functions ............................................................................. 175<br />
4.4.5.11 File and Directory Functions ......................................................................... 176<br />
4.4.5.12 <strong>Virtual</strong> <strong>Machine</strong> General Functions .............................................................. 180<br />
4.4.5.13 <strong>Virtual</strong> <strong>Machine</strong> Channel Functions .............................................................. 191<br />
4.4.5.14 <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions ................................... 194<br />
4.4.5.15 Other Functions ............................................................................................. 201<br />
4.4.6 Simulation Macro Variables ................................................................................. 205<br />
4.4.6.1 Variable Summary ............................................................................................ 205<br />
4.4.6.2 Variables Defining Constants ........................................................................... 206<br />
4.4.6.3 <strong>Virtual</strong> <strong>Machine</strong> Variables ............................................................................... 207<br />
4.4.6.4 <strong>Machine</strong> & Workpiece Coordinate Variables .................................................. 209<br />
4.4.6.5 Motion-Related Variables ................................................................................ 210<br />
4.4.6.6 Cutter Compensation Variables ........................................................................ 213<br />
4.4.6.7 Tooling Variables ............................................................................................. 214<br />
4.4.6.8 MCD/Tape Variables ........................................................................................ 215<br />
4.4.6.9 Error Message Variables .................................................................................. 216<br />
4.4.6.10 Miscellaneous Variables ................................................................................ 217<br />
Index ....................................................................................................................................... 219<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary vii
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0<br />
viii <strong>ICAM</strong> Technologies Corporation – Proprietary
1 Overview<br />
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ®<br />
Overview<br />
The <strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> (VM) simulator graphically depicts the operation and motions of a<br />
CNC machine during post processing and MCD 1 simulation.<br />
VM is integrated with CAM-POST GENER (the post processor), which uses the virtual CNC<br />
machine model to detect collisions and overtravel conditions. Collision detection can account for<br />
the effects of work piece and tool compensation, given experimental or actual values for compensation<br />
offsets. Collision detection is a natural part of the look-ahead optimizations that<br />
GENER performs during path planning, meaning that GENER can automatically choose an appropriate<br />
tool path to avoid collisions where possible. The machine simulation can be displayed in<br />
one of the GENER output windows, synchronized with other GENER output. Collision detection<br />
and avoidance can be active even when the simulation is not being show, for example, when<br />
running GENER in a minimized state.<br />
VM is also integrated with CERUN (the control emulator), which uses the virtual CNC machine<br />
model to detect and report collisions and overtravel conditions during MCD based machine<br />
simulation. As with GENER, collision detection with CERUN can account for the effects of work<br />
piece and tool compensation, given experimental or actual values for compensation offsets. The<br />
machine simulation can be displayed in one of the CERUN output windows, synchronized with<br />
other CERUN output. Collision detection can be active even when the simulation is not being<br />
show.<br />
A complete machine simulation requires the following:<br />
� A computerized model of the machine<br />
� A post-processor or control emulator to drive the simulation<br />
� Cutting tool, holding fixture, finish part and rough stock definitions<br />
� Workpiece and tool compensation amounts<br />
The CNC machine model is developed and maintained using the <strong>ICAM</strong> QUEST Developer‟s<br />
System. A model describes both the kinematics and the physical characteristics of the machine.<br />
Kinematics include at a minimum the linear and rotary axes of the machine, and if desired, other<br />
moving components such as tool changers, pallet indexers, flexible holding devices, doors and<br />
the like. The physical components of the machine can be created using rudimentary design<br />
features of QUEST, or can be imported as STL 2 objects from any CAM system. The model<br />
designer can define standard viewpoints and lighting arrangements to best view the simulation.<br />
Models can also be customized using <strong>ICAM</strong>‟s macro programming facility to match special<br />
requirements of the machine.<br />
Post-processors and control emulators are developed and maintained using the same QUEST<br />
system used for models. When GENER (the post-processor) controls VM, model motions reflect<br />
1 MCD: <strong>Machine</strong> Control Data; CNC program code in the form of 8-track tapes or files.<br />
2 STL: Stereo lithography file; represents an object by defining its “skin” as a mesh of triangles.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 1
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Overview<br />
the post-processor‟s understanding of the state of the machine. When CERUN (the control<br />
emulator) controls VM, model motions reflect the state of the machine as defined by the MCD<br />
(machine control data) itself.<br />
Models, post-processors and control emulators are all stored in a proprietary format in an <strong>ICAM</strong><br />
database (.dbf) file.<br />
An accurate simulation involves more than just moving the machine through its paces. Cutting<br />
tools and tool compensation amounts, holding fixtures and workpiece compensation amounts,<br />
and rough stock and finished part definitions should all be present in order to produce a meaningful<br />
result. Once defined, this information is saved in a verification setup (.vsw 1 ) file named after<br />
the input file (i.e., the CLDATA 2 file when running GENER; or the MCD file when running<br />
CERUN). This verification setup file can be reused on subsequent runs to quickly reestablish the<br />
conditions necessary for the simulation.<br />
Cutting tool definitions can be automatically created<br />
from CUTTER commands in the CLDATA file,<br />
however the ISO standard 7-parameter cutter format<br />
limits tools defined this way to milling tools only. A<br />
tool creation facility exists within the VM run-time<br />
interface to define standard milling tools, lathe tool<br />
inserts and 2D revolved profile shapes. Lathe tool<br />
holders and non-revolved shapes must be imported as<br />
STL objects.<br />
Tooling information and associated length and<br />
diameter compensation amounts are saved in the<br />
verification setup file, which can be later imported at<br />
the start of the same or any other verification session.<br />
This is ideal for cases where standard tooling is in use<br />
at a machine. VM also includes an interface to the<br />
TDM System tool data management system, which<br />
automates the definition of tooling within VM. Lastly, a tool creation Wizard is available to help<br />
extract tooling information from tooling data output in list format by other tooling systems.<br />
Holding fixture definitions must be imported as STL objects or created using the rudimentary<br />
design features of VM. Components of the fixture can be identified as machinable or non-<br />
machinable, to handle cases where it is not an error to have contact between the cutting tool and<br />
portions of the fixture. By default, any contact of the machine or tool with the fixture will signal<br />
an error.<br />
Finished part definitions must also be imported as STL objects or created using the rudimentary<br />
design features of VM. Any contact of the machine or tool with the part will signal an error. In<br />
1 vsw: the verification setup file that holds are part-program specific settings.<br />
2 CLDATA: Center-line (or cutter-location) data output by a CAM system, generally in APT-source<br />
format.<br />
2 <strong>ICAM</strong> Technologies Corporation – Proprietary
Overview<br />
order to avoid false collision reports on finish cuts, VM only reports tool/part collisions that<br />
exceed a specified gouge tolerance.<br />
Rough stock definitions, if used, must also be imported as STL objects or created using the<br />
rudimentary design features of VM. When licensed for material removal simulation, VM uses<br />
the stock definition for in-process stock verification and collision testing purposes. If material<br />
removal simulation is not licensed or is not enabled, then VM simply displays the rough stock<br />
for information purposes only (the appearance of the stock model can prove helpful when<br />
viewing the simulation).<br />
Fixture, part and stock information, along with workpiece compensation amounts are saved in<br />
the verification setup file, which can be later imported at the start of the same or any other<br />
verification session.<br />
<strong>ICAM</strong> provides a number of “Manufacturing Extractor” utilities that run with supported CAM<br />
systems. These utilities automatically extract all of the tool, stock, part, fixture and related<br />
compensation information from the CAM manufacturing process and save it as a “job file” to be<br />
used when simulating the process. Extractors are available for:<br />
� Dassault Systèmes CATIA V5<br />
� CNC Software Inc. Mastercam X2 and later<br />
� Parametric Technology Corporation Pro/NC<br />
� Missler Software Topsolid‟CAM<br />
� Siemens UGS NX5 and later<br />
Extractors may have become available for other CAM systems since this document was published.<br />
For up to date information, see the Interface Kits on-line help, available from the “<strong>ICAM</strong><br />
Productivity Tools <strong>V19</strong>” Start menu Setup»Kit»Kit Index entry.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 3
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Overview<br />
4 <strong>ICAM</strong> Technologies Corporation – Proprietary
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
2 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CERUN and GENER<br />
This section describes how to select <strong>Virtual</strong> <strong>Machine</strong> models for use both with Control Emulator<br />
CERUN and with CAM-POST GENER. It explains the post-processor command interface that can<br />
be used with GENER to control the simulation. It also describes a common user interface (UI)<br />
made available by both CERUN and GENER that you can use to view and manipulate the model<br />
during the simulation, as well as to define cutting tools, holding fixtures, finish part, rough stock,<br />
and workpiece and tool compensations used to validate the simulation.<br />
VM provides the ability to test for axis overtravel and for collisions between various components<br />
of the machine and those of the part being manufactured. CERUN and GENER use this information<br />
to report problems, and GENER can use this information in some instances to correct<br />
problems before they occur.<br />
The following is a list of things you should know to effectively use VM. Each of these topics is<br />
discussed in the sections that follow.<br />
� Selecting a <strong>Virtual</strong> <strong>Machine</strong> Model (on page 6)<br />
� Controlling <strong>Virtual</strong> <strong>Machine</strong> from the Part Program (on page 9)<br />
� Activating the Simulation Window (on page 12)<br />
� Navigating the Simulation Window (on page 13)<br />
� Adjusting Lighting (on page 17)<br />
� Adding Parts, Fixtures and Stock to the Simulation (on page 18)<br />
� Setting Fixture Compensation (on page 23)<br />
� Adding Tooling Definitions to the Simulation (on page 24)<br />
� Setting Tool Compensation (on page 29)<br />
� Monitoring <strong>Virtual</strong> <strong>Machine</strong>‟s Results (on page 30)<br />
The steps outlined in this section are not all necessary, but the completeness and accuracy of the<br />
simulation depends on complete and accurate data. At a minimum, tool compensation and fixture<br />
compensation are needed to validate travel and machine related collisions. At a minimum, tool<br />
definitions are needed to validate tool related collisions. Part and fixture definitions improve the<br />
collision detection process. Stock definitions are required to take advantage of material removal<br />
simulation for part verification purposes.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 5
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Selecting a <strong>Virtual</strong> <strong>Machine</strong> Model<br />
2.1 Selecting a <strong>Virtual</strong> <strong>Machine</strong> Model<br />
<strong>Virtual</strong> <strong>Machine</strong> models are stored in an <strong>ICAM</strong> database, typically along with associated post<br />
processors and control emulators. A model must be selected either explicitly or through association<br />
in order to simulate the part program. In addition, simulation must be activated in CERUN<br />
and GENER, either by launch panel settings (described below) or by command line options (on<br />
page 8).<br />
Detailed information on CERUN specific launch panel settings and command line options can be<br />
found in the “<strong>ICAM</strong> Control Emulator <strong>V19</strong> User Guide”.<br />
Detailed information on GENER specific launch panel settings and command line options can be<br />
found in the “<strong>ICAM</strong> CAM-POST <strong>V19</strong> User Guide”.<br />
2.1.1 Selecting a Model from the CERUN or GENER Launch Panel<br />
VM can be activated from the main panel of the CERUN and GENER launch facilities using the<br />
[SIM…] button. Selecting this button raises a “Simulation” dialog that can be used to enable the<br />
VM simulation;<br />
choose the machine<br />
model and its<br />
database; and<br />
select the verification<br />
setup file.<br />
The simulation<br />
panel remembers<br />
the last settings<br />
used, and saves this<br />
information in your<br />
personal registry.<br />
Enable Simulation:<br />
Check this box to enable<br />
the VM simulation.<br />
If this box is not<br />
checked, it will not be<br />
possible to start the simulation once the program has started.<br />
Enable Material Removal Simulation:<br />
Check this box to enable Material Removal Simulation (MRS). When MRS is enabled, VM<br />
simulates the cutting actions of the tool with respect to stock definitions. VM also performs<br />
collision checking between collision enabled components and the in-process stock. If this<br />
box is not checked, it will not be possible to start MRS once the program has started.<br />
MRS is an add-on licensed option to VM. If an MRS license is not available, the MRS check<br />
box cannot be selected.<br />
6 <strong>ICAM</strong> Technologies Corporation – Proprietary
Database:<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Selecting a <strong>Virtual</strong> <strong>Machine</strong> Model<br />
This input field is used to select the database that contains the model to use. You can browse<br />
for a database using the square browse button […] located immediately to the right of the input<br />
field. The most recent database selections are remembered, and they can be quickly accessed<br />
again by selecting them from the drop-down choice list. The browse database panel<br />
remembers the last directory browsed for a database, unless an icam_dbf environment variable<br />
is set.<br />
Model and Revision:<br />
Use these input fields to choose a model from the selected database. The model drop-down<br />
presents a list of all models in the selected database. The revision field lists the latest revision<br />
of the selected model and the drop-down lists other revisions, if any. Information about the<br />
selected model will appear below the input field.<br />
One of the available model choices is “Use associated”, which when selected will use the<br />
model associated with the selected control emulator or post-processor. You cannot choose a<br />
specific revision of a model that is selected by association.<br />
Verification setup file:<br />
This file contains part program specific setup information such as tooling, part, stock, fixture,<br />
compensation, lighting adjustments, and a variety of other settings unique to each NC program.<br />
This field is automatically set to the same name as the NC program input file (i.e., the<br />
MCD file for CERUN or the CLDATA file for GENER), with a file extension of “.vsw”. You<br />
can change the name for a single execution of the control emulator or post-processor, but the<br />
settings will not be remembered the next time CERUN or GENER is launched.<br />
A verification setup file that has been created with GENER during post processing can later be<br />
reused by CERUN during MCD verification, and vice versa.<br />
OK, Cancel and Reset buttons<br />
Press OK to accept any changes to the Simulation panel and return to the main launch panel.<br />
Press Cancel to ignore your changes and return to the main launch panel. Press Reset to remove<br />
all specialized settings, and reset all fields to their defaults.<br />
Run CERUN or GENER with a “Show Full” display setting on the main launch panel to see the<br />
machine simulation. When the full-display window appears, you may have to perform a few<br />
steps to see the simulation. CERUN and GENER remember global display settings in the registry,<br />
and remember part program specific display settings in the vsw file. Once the display is set to<br />
your satisfaction, you normally will not need to perform any special steps to see the same display<br />
on a subsequent run of the same part program.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 7
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Selecting a <strong>Virtual</strong> <strong>Machine</strong> Model<br />
2.1.2 Selecting a Model from the Command Prompt<br />
VM can also be activated using the following CERUN and GENER command line options. These<br />
options can appear in any order on the CERUN or GENER command line.<br />
/model[=ModelName]<br />
Specifies the machine model to use. This option is necessary to activate VM. The model associated<br />
with the control emulator or post processor will be used if a model name is not explicitly<br />
given.<br />
/nomodel<br />
Disables the use of a VM model during control emulation (this is the default).<br />
/mdldbf=DatabaseFile<br />
/mrs<br />
Optionally specifies the name of the database (.dbf) file that contains the model. By default,<br />
the model will be loaded from the same database as the control emulator or post processor.<br />
Enable Material Removal Simulation (MRS). When MRS is enabled, VM simulates the cutting<br />
actions of the tool with respect to stock definitions. VM also performs collision checking<br />
between collision enabled components and the in-process stock. MRS is an add-on licensed<br />
option to VM.<br />
/nomrs<br />
Disables MRS simulation on the stock model (this is the default).<br />
/vsw=VerificationSetupFile<br />
Optionally specifies the name of the verification setup (.vsw) file. On startup, CERUN and<br />
GENER read the verification setup file to setup part program specific setup information such<br />
as tooling, part, stock, fixture, compensation, lighting adjustments, and a variety of other settings.<br />
On exit, CERUN and GENER save this information back to the setup file. By default, the<br />
setup file has the same name as the input file with a file type of “.vsw”. The setup file need<br />
not exist.<br />
When using a command line interface, the “/verbose” command line option must be given to see<br />
the machine simulation. When the full-display window appears, you may have to perform a few<br />
steps to see the simulation. CERUN and GENER remember global display settings in the registry,<br />
and remember part program specific display settings in the verification setup file. Once the<br />
display is set to your satisfaction, you normally will not need to perform any special steps to see<br />
the same display on a subsequent run of the same part program.<br />
8 <strong>ICAM</strong> Technologies Corporation – Proprietary
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Controlling <strong>Virtual</strong> <strong>Machine</strong> from the Part Program (Gener only)<br />
2.2 Controlling <strong>Virtual</strong> <strong>Machine</strong> from the Part Program (GENER only)<br />
GENER can use VM in a proactive fashion, to detect potential collisions and optimize the generated<br />
MCD, where possible, by taking corrective action to avoid these collisions. GENER provides<br />
a post processor command interface to VM, primarily to define a collision avoidance plane, but<br />
also to control other aspects of the VM simulation.<br />
GENER provides post processor commands to control VM for the following purposes, each of<br />
which is described in the sections that immediately follow:<br />
� Enable/Disable Simulation (below)<br />
� Enable/Disable Collision/Overtravel Detection and Avoidance (on page 10)<br />
� Enable/Disable Positioning Collision Avoidance (on page 10)<br />
� Camera Positioning under Program Control (on page 11)<br />
CERUN and GENER can also control the simulation with macro functions. CERUN does not<br />
provide a collision avoidance function because CERUN is used only to verify an MCD program;<br />
CERUN does not change the MCD program in any way.<br />
It is important to note that VM post processor commands and macro functions will have no effect<br />
if VM was not activated when GENER was first started. VM can be activated by selecting the<br />
“Enable Simulation” checkbox on the Simulation panel (available via the [SIM…] button on the<br />
main panel), or by specifying the “/model” option on the GENER command line.<br />
2.2.1 Enable/Disable Simulation<br />
The ADAPTV post processor command can be used to enable or disable simulation of the<br />
model. This global command setting takes precedence over all other settings that control simulation<br />
behavior.<br />
�ON ADAPTV /<br />
�<br />
� �<br />
�OFF<br />
�<br />
The simulation is always enabled (ON) by default. When simulation is disabled (OFF), the<br />
simulation window will no longer be updated to match the post processor status, and most<br />
importantly, simulation diagnostics and collision avoidance motions will no longer be output.<br />
Running with ADAPTV/OFF is equivalent to running without VM at all.<br />
This ON-OFF setting for simulation is primarily intended for use within post processor macros<br />
that perform $FLOOK style look-ahead operations that are not affected by collision testing.<br />
Specify ADAPTV/OFF at the start of the look-ahead operation to increase processing speed of<br />
the look-ahead operation. Do not code ADAPTV/OFF during look-ahead if collision avoidance<br />
might meaningfully affect the results of the look-ahead.<br />
The ADAPTV/ON command will have no effect if the VM was not activated when GENER was<br />
first started.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 9
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Controlling <strong>Virtual</strong> <strong>Machine</strong> from the Part Program (Gener only)<br />
2.2.2 Enable/Disable Collision/Overtravel Detection and Avoidance<br />
The following ADAPTV command controls collision and overtravel detection and avoidance:<br />
�SCAN<br />
�<br />
�AVOID<br />
�<br />
ADAPTV / PROTCT, � �<br />
� �<br />
�<br />
ON<br />
�<br />
�OFF<br />
�<br />
AVOID is the default, which instructs VM to avoid those collisions that are avoidable 1 , and to<br />
diagnose unavoidable collisions and any overtravel conditions. SCAN simply diagnoses collisions<br />
and overtravel conditions, while OFF disables collision and overtravel testing altogether.<br />
ON re-enables the last specified AVOID or SCAN setting. When active, collision and overtravel<br />
diagnostic messages will be reported in the GENER listing file and the Console window, as<br />
follows:<br />
� Error #1409008: Simulation reported collision between object1 and object2.<br />
� Error #1409009: Simulation reported overtravel: axis_name.<br />
Path-planning based overtravel avoidance is automatically enabled in GENER during 5-axis<br />
machining whenever LINTOL/SCAN (linearization path planning) or LINTOL/ROTREF (rotary<br />
turn-around) are active. These commands are documented in the “CAM-POST <strong>V19</strong> User Guide”.<br />
When collision avoidance is enabled (AVOID), GENER uses VM during look-ahead scanning in<br />
an attempt to find a tool path that is also collision free. If a good tool path does not exist (i.e., all<br />
tool paths contain unavoidable problems), then GENER will report:<br />
� Error #1409012: Simulation feedback reports that it is not possible to avoid collision or<br />
overtravel.<br />
From the perspective of the post processor, running with ADAPTV/PROTCT,OFF is equivalent<br />
to running without VM at all. Exercise caution when using this command.<br />
The ADAPTV/PROTCT command will have no effect if the VM was not activated when GENER<br />
was first started, or if ADAPTV/OFF is currently in effect.<br />
2.2.3 Enable/Disable Positioning Collision Avoidance<br />
Positioning collision avoidance can be enabled under program control to avoid collisions that<br />
occur during RAPID positioning motions. When enabled, a positioning collision avoidance<br />
motion will be attempted when a collision occurs somewhere during a positioning motion, while<br />
at the same time both the start-point and end-point of the positioning motion are collision free.<br />
The collision avoidance motion includes an initial rapid retract along a specified machine linear<br />
axis to position clear of the work, followed by a rapid motion along the other two linear axes to<br />
the end-point position, and finally a rapid plunge of the tool to the end-point position.<br />
1 Collisions with in-process stock cannot be avoided by path planning, however any such collisions will<br />
be diagnosed.<br />
10 <strong>ICAM</strong> Technologies Corporation – Proprietary
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Controlling <strong>Virtual</strong> <strong>Machine</strong> from the Part Program (Gener only)<br />
Positioning collision avoidance is controlled with the ADAPTV command as follows:<br />
ADAPTV / CLEAR<br />
� �XAXIS<br />
�<br />
� � � PLUS �<br />
�,<br />
YAXIS , coord , �<br />
� � � �<br />
�<br />
� MINUS �� �ZAXIS<br />
�<br />
�<br />
�<br />
�<br />
�<br />
�<br />
� �ON<br />
, LENGTH,<br />
�<br />
� � �<br />
� �OFF<br />
� �<br />
��<br />
��<br />
0:<br />
n<br />
The clearance avoidance plane is established along the named machine axis (XAXIS, YAXIS or<br />
ZAXIS) at the specified machine coordinate position (not part coordinates). The first motion of a<br />
collision avoidance sequence will be in the specified direction (PLUS or MINUS) to the named<br />
axis position. PLUS is assumed if the direction keyword is omitted. No automatic clearance<br />
avoidance will be attempted if the named axis is already at or beyond the clearance position. If<br />
LENGTH,OFF is specified, then length tool compensation will be removed on the motion to the<br />
clearance position and reinstated on the motion back to the end-point position. The default<br />
(LENGTH,ON) leaves length compensation unchanged during collision avoidance motions.<br />
Positioning clearance avoidance is not active by default. A clearance axis and coordinate must<br />
first be specified to activate this feature. Once this is done, the feature can be disabled (OFF) and<br />
re-enabled (ON) as required using the following command:<br />
�ON ADAPTV / CLEAR,<br />
�<br />
� �<br />
�OFF<br />
�<br />
The ADAPTV/CLEAR feature can produce two different diagnostics. One is a message indicating<br />
that the programmed positioning sequence was successfully altered to avoid a collision. The<br />
second is an error stating that a collision could not be avoided.<br />
� Message #1409013: Simulation adjusted the RAPID positioning sequence to avoid a collision.<br />
� Error #1409012: Simulation feedback reports that it is not possible to avoid collision or<br />
overtravel.<br />
The ADAPTV/CLEAR command will have no effect if the VM was not activated when GENER<br />
was first started, or if ADAPTV/OFF, ADAPTV/PROTCT,SCAN or ADAPTV/PROTCT,OFF<br />
is currently in effect.<br />
2.2.4 Camera Positioning under Program Control<br />
The following CAMERA command will position the camera to one of 10 predefined positions:<br />
CAMERA / a<br />
Predefined camera positions are described on page 15.<br />
The CAMERA command will have no effect if the VM was not activated when GENER was first<br />
started, or if ADAPTV/OFF is currently in effect, or if “Enable CL Camera” is not checked in<br />
the Simulation»Options dialog (Ctrl Alt O shortcut), or if the specified camera position has not<br />
been defined.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 11
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Activating the Simulation Window<br />
2.3 Activating the Simulation Window<br />
CERUN and GENER must be started using the “Show Full” display<br />
setting on the main launch panel in order to see the machine simulation<br />
(this is equivalent to specifying the “/verbose” option on the<br />
command line). Once the CERUN or GENER full user interface (UI) appears, the simulation<br />
window can then be activated from the View toolbar by selecting the button show circled in the<br />
toolbar above. Select the button a second time to either hide the simulation window or to restore<br />
a simulation window that has been minimized. The simulation window can also be controlled by<br />
selecting Simulation»<strong>Virtual</strong> <strong>Machine</strong> from the menu bar.<br />
It is important to note that<br />
collision and overtravel<br />
detection (CERUN and<br />
GENER) and collision<br />
avoidance (GENER) are not<br />
affected in any way by the<br />
state of the simulation<br />
window.<br />
The simulation window can<br />
appear on your screen in<br />
one of two modes: solid or<br />
wire frame. Your choice of<br />
mode will depend partly on<br />
preference and partly on the<br />
capabilities and speed of<br />
your computer and graphics<br />
card. On less capable computers, wire frame mode can be significantly faster. You can switch<br />
between modes using buttons on the VM Mode toolbar or by toggling the Simulation»Show»Wireframe<br />
menu bar selection.<br />
There are various other Simulation»Show settings that affect the amount and types of information<br />
shown in the simulation window. These include…<br />
a “heads up display” that appears overlaid in the main simulation<br />
window, and two modes of tool path trace display, which are also<br />
controllable from the VM Mode toolbar;<br />
selectable datum-plane grids, coordinate<br />
frame references and machine kinematics<br />
markers, all of which are controllable using<br />
the VM Grid toolbar; and<br />
view “filters” that toggle the visibility of the<br />
machine, tooling, fixtures, stock, part, in-process<br />
stock and over-cut/under-cut material, controllable<br />
from the VM View Filter toolbar.<br />
12 <strong>ICAM</strong> Technologies Corporation – Proprietary
2.4 Navigating the Simulation Window<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Navigating the Simulation Window<br />
The simulation window supports both Perspective and<br />
Orthogonal projection, selectable by the left-most button in the<br />
VM View toolbar. The middle six buttons of the VM View<br />
toolbar orient the camera to face the Front, Back, Top, Bottom, Left and Right views of the<br />
machine. The camera can only be panned but not rotated while one of these standard views is<br />
selected. At the start of processing, standard views are with respect to the stock mount point, but<br />
this can be changed by selecting a different component (e.g., the machine origin) in the VM Grid<br />
toolbar or by attaching the camera to an object in the scene (more on grids and attaching the<br />
camera to components later). The right-most button in the VM View toolbar adjusts the camera<br />
aim and zoom (in that order) to fit the currently selected object so that it is fully visible in the<br />
simulation window (if no object is selected, then the camera is adjusted so all objects can be<br />
seen). All of these toolbar functions are also available from the Simulation»Camera menu.<br />
The three buttons on the left side of the VM Mode toolbar select<br />
the primary function of the left-mouse button (this can also be set<br />
from the Simulation»Mode menu). When in “Camera mode”,<br />
holding the left-mouse button down while moving the mouse changes the orientation of the<br />
camera. The cursor appears as a four-way arrow when in Camera mode. When in “Selection<br />
mode”, pressing the left-mouse button selects the object under the mouse pointer. The cursor<br />
appears as a simple arrow when in Selection mode. When in “Measurement mode”, pressing the<br />
left-mouse button either starts or completes a measurement function using the selected object<br />
under the mouse pointer. The cursor appears as an arrow with calipers when in Measurement<br />
mode.<br />
When in Camera mode, press and hold the Ctrl key to temporarily switch to Selection mode.<br />
This can be used to quickly select objects to rotate about or to attach the camera to. When in<br />
Selection or Measurement mode, press and hold the Ctrl key to temporarily switch to Camera<br />
mode. This can be used to get a better view of the object you are trying to select or measure.<br />
It is important to remember that with VM, you are moving (or flying) a camera through a three<br />
dimensional scene. Changing your viewpoint typically involves some combination of panning,<br />
rotation and roll.<br />
� Panning moves the camera up, down, left, right, as well as in and out of the scene. When<br />
in perspective mode, you can pan the camera through an object to see beyond it. When in<br />
orthogonal mode, panning in and out instead acts like a typical zoom lens.<br />
� Rotation changes where the camera is pointing, by angling it to the left, right, up or<br />
down (i.e., pitch and yaw). Camera rotation is similar to the actions of turning your head<br />
to the left or right and up or down. Camera rotation is only possible when a standard view<br />
(e.g., front, back) is not selected, since views lock out camera rotation.<br />
� Roll tilts the camera so that objects can be viewed from a different angle. Camera roll is<br />
similar to the action of tilting your head to the left or right.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 13
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Navigating the Simulation Window<br />
Camera Panning:<br />
The following is a list of panning navigation functions. Hold the Shift key while panning to<br />
reduce the distance the camera moves to 1/10th the normal amount. You can adjust the overall<br />
panning sensitivity by holding the Ctrl key and repeatedly pressing the + (plus) and – (minus)<br />
keys (also available from the Simulation»Camera»Speed menu bar):<br />
Pan Key Mouse<br />
Up Page Up Middle-mouse, move forward<br />
Down Page Down Middle-mouse, move backward<br />
Left Left arrow Middle-mouse, move left<br />
Right Right arrow Middle-mouse, move right<br />
In Up arrow Wheel-mouse forward<br />
Out Down arrow Wheel-mouse backward<br />
Camera Rotation:<br />
Move the mouse while holding down the left mouse button to change the viewing direction of<br />
the camera. There are two types of camera rotation.<br />
1. The default rotation is to keep the camera position fixed but to change where the camera is<br />
aimed. This is similar to how we rotate our head to look around a scene.<br />
2. You can hold the Shift key to change how the camera rotates. When Shift is pressed, the<br />
camera rotates around a point in space. This rotation point is by default the center of the<br />
world or the selected VM Grid object, but can be changed by selecting any object and choosing<br />
Simulation»Camera»Pivot (Ctrl P). As a quick shortcut, double-clicking an object in the<br />
simulation window will set that object as the Pivot center and fit the object in the window.<br />
If you prefer the second form of camera rotation by default, clear the “Default to Look-Around<br />
camera” check-box in the Simulation»Options (Ctrl Alt O) dialog.<br />
You can quickly orient the camera to point at the center of the currently selected object using the<br />
Simulation»Camera»Center (Ctrl Shift Space) menu function. Select the Simulation»Camera»Fit<br />
(Ctrl Space 1 ) menu function to both orient the camera towards the selected object and pan in or<br />
out so that the object fits within the simulation window.<br />
The following is a list of camera rotation functions available when in Camera mode. Note that<br />
camera rotation is not available when a VM View filter is enabled (e.g., Front, Side…).<br />
Rotate Mouse<br />
Up Left-mouse, move forward<br />
Down Left-mouse, move backward<br />
Left Left-mouse, move left<br />
Right Left-mouse, move right<br />
1 The “Ctrl Space” hotkey combination might be unavailable due to a Microsoft Chinese language IME<br />
bug. Use “Ctrl .” (control key plus decimal point) as an alternate.<br />
14 <strong>ICAM</strong> Technologies Corporation – Proprietary
Camera Roll:<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Navigating the Simulation Window<br />
The camera is oriented so that “up” is along the positive Z direction (of the selected VM Grid<br />
object) in all views except Top and Bottom, where “up” is instead along the positive Y direction.<br />
The following keys can be used to roll (i.e., tilt) the camera clockwise or counterclockwise.<br />
Roll Key<br />
90° cclw Ctrl Left arrow<br />
1° cclw Ctrl Shift Left arrow<br />
90° clw Ctrl Right arrow<br />
1° clw Ctrl Shift Right arrow<br />
Camera origin and attachment:<br />
You can attach the camera to an object in the scene. If the object moves, so will the camera. You<br />
must select the object first before you can attach the camera to it (hold the Ctrl button down to<br />
select an object when in Camera mode). Click on an object to select it. Hold Shift when selecting<br />
to select multiple objects or to undo a selection.<br />
� Click left-mouse to select object.<br />
� Hold Shift and click left-mouse to add/remove object from list of selected objects.<br />
� Simulation»Camera»Attach to attach camera to last selected object.<br />
Selecting Simulation»Camera»Attach when no objects are selected resets the camera back to the<br />
world origin (left-mouse clicking on the background is one way to ensure that no objects are<br />
selected).<br />
Camera viewpoint:<br />
The creator of the machine model can (and should) define a series of predefined views (not to be<br />
confused with the standard perspective, front, rear, etc. views described earlier) to simplify<br />
viewing the model during<br />
simulation. These might<br />
show a full view of the<br />
machine, a detailed view of<br />
the table, perhaps a view<br />
from the tool's perspective,<br />
and so on. In the absence of<br />
any view information,<br />
CeRun will show the<br />
machine with the camera<br />
placed well back in the<br />
negative machine Y-axis<br />
direction, as shown in the<br />
image at right.<br />
To switch between predefined<br />
views, press one of the<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 15
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Navigating the Simulation Window<br />
keyboard number keys 0 through 9 while holding down the Ctrl key. If the display does not<br />
change, then that view number is undefined. You can define your own viewpoints by holding<br />
down the Ctrl and Alt keys before pressing a number key. Default views are stored with the<br />
model; personal viewpoints are stored in the vsw file where they override those of the model.<br />
Predefined views can also be activated and set using the Simulation»Camera»Load and Simulation»Camera»Save<br />
menu selections. Selecting Simulation»Camera»Reset in CERUN and GENER<br />
resets the predefined views to those defined and saved in the model by QUEST. Selecting Simulation»Camera»Reset<br />
in QUEST clears the predefined views from the model.<br />
The transition between views can be abrupt or smooth, depending on the camera animation<br />
setting in the Simulation»Options dialog. Smooth transitions are only possible between predefined<br />
viewpoints sharing the same base view (e.g., two perspective views or two orthogonal<br />
views, but not between a perspective and orthogonal view).<br />
To summarize:<br />
� Left-mouse controls camera rotation.<br />
� Middle-mouse and mouse wheel control panning.<br />
� Left / Right / Up / Down arrows and Page Up / Down also control panning.<br />
� Ctrl Left / Right arrows roll the camera cclw and clw.<br />
� Shift modifies all of above functions.<br />
� Left-mouse double-click does a Fit (Ctrl Space) and Pivot (Ctrl P) on the selected object.<br />
� Ctrl P sets the camera pivot origin to the selected object.<br />
� Ctrl Space (or Ctrl .) reorients and zooms the camera to “fit” the object in the window.<br />
� Ctrl Shift Space reorients the camera to point at the selected object.<br />
� Ctrl 0 through Ctrl 9 selects one of 10 prerecorded camera positions.<br />
� Ctrl Alt 0 through Ctrl Alt 9 saves prerecorded camera positions.<br />
� Simulation»Options (Ctrl Alt O) sets camera animation and look-around properties.<br />
16 <strong>ICAM</strong> Technologies Corporation – Proprietary
2.5 Adjusting Lighting<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adjusting Lighting<br />
VM supports up to eight different lights, which can be placed strategically around or even inside<br />
the machine. Each light consumes a little more CPU, so if performance is a problem you might<br />
try reducing the number of lights being used. Unlike in the real world, solid objects do not affect<br />
VM lights. Lights shine through objects, do not cast shadows, and the lights themselves are not<br />
visible in the simulation window.<br />
Lighting will normally not need to be adjusted. If the simulation window is completely dark, it<br />
might not necessarily be due to a lighting problem. Even with all lights off, VM provides a<br />
certain amount of ambient light. Before adjusting the lights, first make sure that the viewpoint is<br />
back and away from the machine (to do so, first press the Ctrl spacebar shortcut, and then press<br />
and hold the down-arrow<br />
to pan back). If the<br />
machine is visible, but<br />
too dark or too light,<br />
select Simulation»Lights<br />
(Ctrl Alt L shortcut) to<br />
bring up the Light dialog.<br />
The horizontal slider<br />
rotates your viewpoint<br />
around the machine. The<br />
vertical slider changes the<br />
viewing distance. Lights<br />
appear as small boxes, but<br />
you may have to hide the<br />
machine (clear the<br />
“Objects” check box) to<br />
see them. Lights are<br />
positioned on a hemisphere using the left and right-mouse buttons. The left-mouse button<br />
controls the position on the hemisphere. The right-mouse button controls the size of the hemisphere.<br />
To adjust the light, place the mouse pointer over the light and then press and hold either<br />
the left or the right-mouse button. Move the mouse to change the lighting position or distance.<br />
Light intensity is controlled by the individual sliders associated with each light. The color of<br />
each light can be adjusted by first selecting the box to the right of the intensity slider and then<br />
choosing a color from the color chart. Using different colors for your light sources will improve<br />
depth perception.<br />
If a light appears immovable, perhaps the distance has been set to a very small value. In this<br />
case, use the right-mouse button to increase the lighting distance. It is also possible to position a<br />
light so far away that it can no longer be selected. In this case, the Reset button can be used to set<br />
all lights to their default positions.<br />
Pressing the Reset button in CERUN and GENER sets the lighting to the default as defined and<br />
saved in the model by QUEST. Pressing the Reset button in QUEST sets the lighting to a built-in<br />
default based on the grid size.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 17
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Parts, Fixtures and Stock to the Simulation<br />
2.6 Adding Parts, Fixtures and Stock to the Simulation<br />
An accurate simulation must include the part(s) being manufactured, so that VM can test for<br />
gouging with the cutting portion of the tool and collisions between the part and the tools, holders<br />
and other components of the machine. The part holding fixture(s) should also be included in the<br />
simulation, again so that VM can accurately test for collisions. Finally, when the Material<br />
Removal Simulation (MRS) license option is available, the rough stock can be added to the<br />
simulation to verify in-process stock removal and collisions against the in-process stock. Even<br />
without the MRS option, adding stock to the simulation can aid in viewing the cutting process.<br />
Select Simulation»Stock (Ctrl Alt S shortcut) to activate the Stock/Fixture/Part dialog. You use<br />
this dialog to import STL definitions of the finished part, holding fixtures and rough stock. You<br />
can also use the<br />
rudimentary design<br />
capabilities available<br />
with this dialog to<br />
interactively create<br />
simple stock, fixture<br />
and part components if<br />
needed (this process is<br />
described further on in<br />
this section).<br />
The stock, fixture and<br />
part information is<br />
automatically saved in<br />
the verification setup (.vsw) file when the program is completed. This verification setup file will<br />
be reused on subsequent runs to quickly reestablish the material conditions necessary for an<br />
accurate simulation.<br />
The Export button on the Stock/Fixture/Part dialog can be used to save the current setup as a 3D<br />
model (.m3d 1 ) file. The Import button can be used to merge the part/fixture/stock setup of a<br />
selected 3D model or verification setup file into the current session. Use the Export and Import<br />
functions to quickly copy the stock, fixture and part setup from one program to another.<br />
2.6.1 Differences between Part, Fixture and Stock Components<br />
Part, fixture and stock are treated differently in VM during collision testing. The differences are<br />
as follows:<br />
� Part: The cutting portion of the tool can interfere (without diagnostics) with the part, to<br />
the extent of the gouge tolerance. The gouge tolerance amount is defined in the Simulation»Options<br />
dialog (Ctrl Alt O shortcut). Some gouging (i.e., undercutting) is to be expected,<br />
due to the effects of the manufacturing tolerance used by the CAM system when<br />
creating the tool path and the tolerance used in the creation of the STL part model. If<br />
CAM manufacturing and STL tolerances are not adjusted, the gouge tolerance should not<br />
1 m3d file: Stores object definitions in an <strong>ICAM</strong> proprietary format.<br />
18 <strong>ICAM</strong> Technologies Corporation – Proprietary
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Parts, Fixtures and Stock to the Simulation<br />
have to be changed from one part to the next. The gouge tolerance is a modal value stored<br />
in the registry; it is not stored on a program-by-program basis in the verification setup<br />
(.vsw) file.<br />
The non-cutting portion of the tool, the tool holder, and all other collision-enabled components<br />
of the machine are also tested for collision with the part. The gouge tolerance is<br />
not applied when testing for part collision with these components.<br />
� Fixture: Individual components of a fixture can be identified as machinable or not, which<br />
affects how they are tested for collisions.<br />
A machinable component might be a “soft” clamp or plate that will be cut by the tool<br />
during the manufacturing process. With the Material Removal Simulation (MRS) license<br />
option enabled, VM can optionally compute the in-process state of machinable fixture<br />
components, treating them as though they were defined as stock objects (see stock definition<br />
below).<br />
If an MRS license is not available, or is not enabled for a machinable fixture component,<br />
then the cutting portion of the tool is not tested for collision with the fixture component if<br />
the tool is spinning and the cutting motion is at feed. The non-cutting portion of the tool,<br />
the tool holder, and all other collision-enabled components of the machine are always<br />
tested for collision with machinable fixture components.<br />
Non-machinable fixture components are always tested for collision against the entire tool,<br />
the tool holder and all other collision-enabled components of the machine.<br />
� Stock: With the Material Removal Simulation (MRS) license option enabled, VM can<br />
compute the in-process state of the raw stock. The path of the cutting portion of the tool<br />
will be “subtracted” from the stock during the manufacturing process in the same way<br />
that material is removed during real machining. Motions that cut the stock at rapid or<br />
while the spindle is stopped, will be diagnosed with an error. These cuts will also appear<br />
highlighted on the in-process stock object and identified as a collision in the Timeline<br />
display. Individual components of the stock can be enabled or disabled for MRS simulation<br />
using the component's Material Removal column setting.<br />
The “Associated Part” column in the Stock tab and companion “Associated Stock” column<br />
in the Part tab, are used to associate pairs of raw stock and finished parts to one another,<br />
so that they can later be compared using the Simulation»Compare (Ctrl Alt Q)<br />
function.<br />
If an MRS license is not available or not enabled, any object defined as stock is shown in<br />
the simulation window but ignored for collision testing purposes. To enable collision testing<br />
on a near-<strong>net</strong> stock shape, define it instead as machinable fixture. This will allow only<br />
the cutting portion of the tool to interfere with the stock, and only then when the motion<br />
is at feed and the spindle is turning.<br />
VM does not check for interference between part and fixture, so they can partially or completely<br />
overlap each other without problems.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 19
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Parts, Fixtures and Stock to the Simulation<br />
Collision testing is performed by sampling the motions of the machine along the tool path. The<br />
rate of sampling, called the collision tolerance, is defined in the Simulation»Options dialog. This<br />
collision tolerance value should match the finest CAM manufacturing tolerance used in the part<br />
program. The collision tolerance is a modal value stored in the registry; it is not stored on a<br />
program-by-program basis in the verification setup (.vsw) file.<br />
VM does not check for interference between part and fixture, so they can partially or completely<br />
overlap each other without problems.<br />
Collision testing is performed by sampling the motions of the machine along the tool path. The<br />
rate of sampling, called the collision tolerance, is defined in the Simulation»Options dialog. This<br />
collision tolerance value should match the finest CAM manufacturing tolerance used in the part<br />
program. The collision tolerance is a modal value stored in the registry; it is not stored on a<br />
program-by-program basis in the verification setup (.vsw) file.<br />
2.6.2 Creating Part, Fixture and Stock Components<br />
The Stock/Fixture/Part dialog tabs all provide similar features. Objects are listed in a scrolling<br />
list. New objects can be added and old ones deleted or modified. Objects can be given names,<br />
which are used by VM when reporting collision diagnostic messages. Adding an object is a twostep<br />
process. The first step is to create a new object, defining its name and where (roughly<br />
speaking) it will be loaded on the machine. The second step is to actually define the physical<br />
components and placement of the object. The simulation window remains active when defining<br />
stock, part and fixtures, to permit interactive creation and placement of objects.<br />
For example, follow the steps below to create a rectangular base plate, whose lower left corner is<br />
(X-200, Y-150, Z0) with a length of 400, width of 300 and height of 25 (all dimensions in mm):<br />
Step 1: Create a new fixture object.<br />
� Select the Fixture tab.<br />
� Select the New button and then select the New Fixture sub-menu option.<br />
� Type in the name of the new item, e.g., “Base plate”. This name will<br />
be used by VM when reporting collisions between this and other objects.<br />
� Objects are always created relative to one or more standard stock axes defined by the<br />
model creator. If there are multiple stock axes (for example, two pallets), then you can<br />
specify where the base plate will be mounted using the Axis drop-list. The “None” choice<br />
can be used to remove a component from the machine once you have finished defining it.<br />
You can change the default mount point and current mount points<br />
Step 2: Define the physical components of the new fixture object.<br />
� Select “Base plate” in the Fixture tab component tree list.<br />
� Select the New button and then select the Cube sub-menu option.<br />
� Type, in order: -200 Enter -150 Enter 0 Enter 400 Enter 300 Enter 25 Enter<br />
20 <strong>ICAM</strong> Technologies Corporation – Proprietary
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Parts, Fixtures and Stock to the Simulation<br />
When defining the physical<br />
components of an object,<br />
the component type (e.g.<br />
“Cube”) and its required<br />
parameters (e.g., x, y, z,<br />
width, length and height)<br />
are listed at the bottom of<br />
the simulation window. You<br />
can enter the parameters<br />
using the keyboard as<br />
instructed above, or you can<br />
move the mouse to an<br />
appropriate position and<br />
click the left-mouse button.<br />
Each click of the mouse can<br />
supply values for one or two<br />
parameters, which will be<br />
dynamically updated as you move the mouse. Hold the Shift key to toggle the snap-to-grid<br />
feature of the mouse. Use the grid button toggle on the VM Grid toolbar or select Simulation»Grid<br />
(Ctrl Alt G shortcut) to change to the default grid settings. You can change the camera<br />
position, standard view or user-defined viewpoint at any time when working in the simulation<br />
window. To summarize:<br />
� Use the mouse pointer or keyboard to set parameter values.<br />
� Use the left-mouse-button or Enter key to accept a parameter value and move to the next<br />
input field.<br />
� Use the Tab and Shift-Tab keys to move forward and backward through the required parameters<br />
without making changes.<br />
� Use the Shift key, VM Grid toolbar or Simulation»Grid (Ctrl Alt G) dialog to change grid<br />
settings.<br />
Once a component is created, it can be given a<br />
name, rotated, repositioned, resized and have its<br />
visual material properties set.<br />
The component name will be used in combination<br />
with the object name (e.g., “Base plate Box01”) in<br />
collision diagnostics. The name can be omitted if<br />
desired, and the same name can be repeated for<br />
other components.<br />
Press the Apply button to immediately see the<br />
effects in the simulation window of any<br />
repositioning or re-dimensioning of the component.<br />
All dimensions are expressed in the units listed in the unit drop-down choice list. The units<br />
can be changed, with the option of either readjusting the object‟s size to match or not.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 21
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Parts, Fixtures and Stock to the Simulation<br />
You can repeatedly select the Rotate button to define a compound rotation of the component.<br />
The Reset choice removes any rotation previously added.<br />
Press the Material button to activate the Materials Dialog, which defines the component‟s<br />
appearance. There are three color selections that can be associated with a material, in addition to<br />
its general shininess and transparency: The Diffuse component is the color of the object. The<br />
Ambient component is the color of light that indirectly strikes the object (for example, the color<br />
of the walls). The Specular component is mixed with the color of the main light sources to<br />
produce the highlights visible as shininess is increased. You can simplify the material property<br />
selection by choosing one from the drop-down list of predefined materials.<br />
Press the OK button when done.<br />
The new Box01 entity will now appear in the list of components that make up the fixture object.<br />
For fixture components that are expected to be cut during the manufacturing process (e.g., a base<br />
plate or soft block), select Yes in the Machinable column in the fixture component list. By<br />
default, fixture components are not machinable. For stock and machinable fixture components,<br />
you must select No in the Material Removal column to disable material removal simulation<br />
(requires an MRS license option), since by default, MRS simulation is enabled for stock and<br />
machinable fixture components.<br />
22 <strong>ICAM</strong> Technologies Corporation – Proprietary
2.7 Setting Fixture Compensation<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Setting Fixture Compensation<br />
Motion data is processed in relation to the machine origin. On most<br />
modern machines, the machine origin (i.e., the position at which all<br />
axes read zero) can be adjusted by the NC operator. Many CNCs<br />
provide for the definition of multiple origins with fixture (or workpiece) compensation. VM<br />
provides a virtual controller that supports both fixture and tool compensation. The VM controller<br />
can be activated from the View toolbar by selecting the button shown circled in the toolbar<br />
above. Select the button a second time to either hide the controller window or to restore a controller<br />
window that has been minimized. This window can also be controlled by selecting Simulation»Controller<br />
from the menu bar.<br />
Once the VM Controller<br />
window is active, select the<br />
Fixture Compensation tab to<br />
define or modify workpiece<br />
offsets. VM supports the<br />
definition of a global “base”<br />
offset, as well as individual<br />
workpiece offsets to match<br />
those in use at the machine.<br />
Fixture compensation data is<br />
automatically saved in the<br />
verification setup (.vsw) file when the program is completed. This setup file will be reused on<br />
subsequent runs to quickly reestablish the workpiece compensation settings necessary for an<br />
accurate simulation.<br />
Base compensation adjusts the machine zero point. All coordinate data is transformed by the<br />
base amount, regardless of the current workpiece compensation settings. Base compensation<br />
should not normally be used except in cases where the machine has a settable zero and no other<br />
form of workpiece compensation. In this case, the base compensation can be used to adjust the<br />
machine zero point to match the zero point that will be set by the NC machine operator.<br />
Fixture compensation offsets are defined relative to the base zero point. Press the Add button<br />
and enter the fixture compensation ID to be added, using the same form of ID numbers you<br />
would use in the CUTCOM/ADJUST command with GENER (e.g., for many controls, the range<br />
1-6 represents G54-G59). You can select any axis of any ID and type a new value. You can also<br />
select one or more IDs and use the Set and Zero buttons to set or zero offsets for all selected IDs<br />
simultaneously. The Add button will be disabled if fixture compensation is not available for the<br />
selected machine. Base compensation is always available.<br />
By accurately setting fixture compensation values, you can obtain a more realistic and complete<br />
simulation of the machine.<br />
<strong>ICAM</strong> provides “Manufacturing Extractors” for many popular CAM systems, which can automatically<br />
define fixture (i.e., workpiece) compensation settings matching coordinate frames used<br />
in the NC program.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 23
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Tooling Definitions to the Simulation<br />
2.8 Adding Tooling Definitions to the Simulation<br />
VM can attach solid model representations of tools and their holders to the machine model when<br />
they are loaded. Once attached, they become part of the collision detection process. When<br />
Material Removal Simulation (MRS) is enabled, VM will modify stock and machinable fixture<br />
objects to simulate the cutting actions of the tool. VM supports a variety of tool types for both<br />
milling and turning applications, and can support both 2D revolved contour or generic 3D shapes<br />
for holder definitions. Select Simulation»Tools (Ctrl Alt T short cut) to activate the<br />
Tools/Holders/Heads dialog.<br />
Select the Tools and Holders tabs to switch between tool and holder definitions. Select the New<br />
button to define a new tool or holder. Select an existing definition and press Modify or Delete<br />
buttons to change or remove it. The Heads tab is used to load or unload head attachments on<br />
machines that support multiple head devices.<br />
Tool and holder definitions are automatically saved in the verification setup (.vsw) file when the<br />
program is completed. This setup file will be reused on subsequent runs to quickly reestablish the<br />
tooling necessary for an accurate simulation.<br />
All tool definitions include a cutting color selection, which is used with MRS (material removal<br />
simulation) to identify surfaces on the in-process stock formed by the cutting action of the tool.<br />
Tools also include a usage setting, which can override the default MRS cutting tolerance, loosening<br />
it for Semi-Finishing and Roughing tools (to reduce CPU usage).<br />
<strong>ICAM</strong> provides “Manufacturing Extractors” for many popular CAM systems, which automatically<br />
create tool and holder definitions that match those used in the NC program.<br />
24 <strong>ICAM</strong> Technologies Corporation – Proprietary
2.8.1 Lathe Tool Definition<br />
Select “Lathe” as the type in the tool builder<br />
dialog to define the shape of the turning tool<br />
insert. The following insert shapes are supported:<br />
� Round: A round or circular insert.<br />
� Trigon: A three cornered insert resembling<br />
a triangle, but with an intermediate<br />
angle on the sides, to allow for a higher<br />
included angles at the tips.<br />
� Diamond: A four-sided insert with two<br />
acute angles.<br />
� Symmetrical: Any “n” equal sided insert.<br />
� Thread: A three cornered threading insert,<br />
with a tooth shape on each corner.<br />
� Groove: A single or double sided insert<br />
that can be used for threading, grooving<br />
or cut-off.<br />
� Profile: An insert defined by a 2D profile.<br />
� Generic: An insert defined by an STL<br />
mesh.<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Tooling Definitions to the Simulation<br />
Inserts are defined in the ZX plane of the machine.<br />
The blue dotted line represents the positive<br />
Z-axis of the machine. The red dotted line<br />
represents the positive X-axis of the machine.<br />
The green dot at the intersection point of these two lines is the point on the tool where tool path<br />
traces will originate. This is the center of the nose (or of the round insert) and not the theoretical<br />
tool tip.<br />
The supporting body (e.g., the bar) of the turning tool must be defined separately as a holder, and<br />
then associated with the insert by selecting the holder by name. As explained in the Holder<br />
Definition topic on page 27, two controlling points are defined on a holder: The SCP (spindle<br />
contact point) defines the mating point of the holder with the turret (or other tool holding device).<br />
The TCP (tool contact point) defines the mating point of the holder with either the nose<br />
center or the center of the insert (as shown by a standard VM “tool icon”). The orientation of the<br />
insert on the holder can be set by defining a Y-axis TCP rotation component (in the holder<br />
definition). The Left and Right settings also affect the orientation of the insert with respect to the<br />
holder.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 25
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Tooling Definitions to the Simulation<br />
2.8.2 Milling Tool Definition<br />
Select “Mill” as the type in the tool builder dialog<br />
to define one of the following types of revolved<br />
tool used for milling or drilling:<br />
� End mill: A sharp corner end mill.<br />
� Ball nose: An end mill with corner radius<br />
equal to ½ the tool diameter.<br />
� Bull nose: An end mill with corner radius<br />
less than ½ the tool diameter.<br />
� Drill: A typical drilling tool.<br />
� APT 7: A milling tool whose shape is defined<br />
by an APT standard CUTTER<br />
command.<br />
� Profile: A tool defined by a revolved 2D<br />
profile.<br />
Milling tools have three sections, as follows.<br />
� Cutter: The bottom “Flute length” portion<br />
of the tool is the part that is permitted to<br />
come in contact both with machinable fixture<br />
components and with the part, to the<br />
limit defined by the gouge tolerance.<br />
� Body: An additional portion of the tool up<br />
to the “Cutter length” height that is noncutting.<br />
� Shank: The top “Shank length” portion of the tool, also non-cutting, which typically mates<br />
with the holder.<br />
When running with GENER, VM will use the APT CUTTER command to automatically define a<br />
default milling tool if a tool definition does not exist for the one being loaded. Tools defined in<br />
this way have a cutting length equal to the total tool length, and do not have a shank or associated<br />
holder. Automatically created tools are by default “unlocked”, meaning that their definition<br />
will change each time a CUTTER command is encountered. Manually defined tools are locked<br />
by default, and are not affected by CUTTER statements in the CL file. Automatic tool definitions<br />
are not possible with CERUN.<br />
Tool holders, if used, must be defined separately and then associated with the tool by selecting<br />
the holder by name. As explained in the “Holder Definition” topic on page 27, two controlling<br />
points are defined on a holder: The SCP (spindle contact point) defines the mating point of the<br />
holder with the turret (or other tool holding device). The TCP (tool contact point) defines the<br />
mating point of the holder with the tool (as shown by the intersection of the dotted blue and<br />
green lines).<br />
26 <strong>ICAM</strong> Technologies Corporation – Proprietary
2.8.3 Holder Definition<br />
A holder can be a stationary or rotating device<br />
that connects the tool to the machine. In the case<br />
of complex tool assemblies, a holder can be<br />
connected to another “parent” holder, which in<br />
turn is connected to the machine or to another<br />
holder, and so on. VM supports two types of<br />
holders:<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Tooling Definitions to the Simulation<br />
� A Profile holder is one that is defined as a<br />
surface of revolution. The profile is defined<br />
in terms of its radial and axial offsets<br />
along the machine‟s tool axis. This<br />
simple 2D profile is then swept in a complete<br />
360° arc to create the final tool holder<br />
shape.<br />
� A Generic holder is any fixed device that<br />
holds the tool and/or the tool assembly.<br />
For example, this can be a simple holding<br />
bar for turning applications or a complex<br />
right-angled head assembly for milling<br />
applications. The generic holder body is<br />
constructed by importing, positioning,<br />
aligning and defining material properties of one or more STL objects in the exact same<br />
way as is done for part, fixture and stock components (see “Adding Parts, Fixtures and<br />
Stock to the Simulation” on page 18).<br />
A holder definition includes two contact points that define how holder is connected to the<br />
machine and the tool, or to other holders:<br />
� The SCP is the spindle contact point, which is the reference point on the holder that<br />
aligns with the gage point of the spindle or with the TCP of the parent holder. A profile<br />
holder‟s axis is aligned with the axis of the spindle. A generic profile holder‟s xyz reference<br />
frame is aligned with the xyz reference frame of the spindle.<br />
� The TCP is the tool contact point, which is the reference point on the holder where the<br />
top of the cutting tool body is attached (extending downwards). For generic holders you<br />
can also define the orientation of the tool at the contact point, in terms of its X-axis, Yaxis<br />
and Z-axis rotations.<br />
Select the “internally geared” option on the generic holder dialog when a generic holder represents<br />
a head assembly. This tells VM that the spindle force is transmitted through the holder<br />
from the SCP to the TCP points. You can also define a spindle ratio in cases where the gearing is<br />
not 1:1.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 27
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Adding Tooling Definitions to the Simulation<br />
2.8.4 Head Definition<br />
A head is a removable device that attaches to the machine and which provides some form of<br />
extended machining capability. Common examples of such devices are 90 degree angled heads<br />
that mount the tool at an angle, long reach heads that extend the Z axis travel of the tool, and<br />
heads with one or more controllable rotary axes that provide 4 or 5-axis control of the tool. Head<br />
devices (there can be multiple heads) are predefined in the model.<br />
The Head Definition tab is<br />
used to establish where the<br />
head devices are currently<br />
located in the model space and<br />
which head device is currently<br />
active. Heads can be parked at<br />
designated stations near the<br />
machine, and automatically<br />
loaded and unloaded by VM in<br />
the same way that tools are<br />
automatically loaded and<br />
unloaded. The Head Definition<br />
tab provides manual control over the placement of heads in the same way that the Tool Definition<br />
tab provides manual control over tools.<br />
A head must be attached to the machine (actually, to a head axis identified as a “head socket”)<br />
for it to be active.<br />
Heads do not have to be visible in the model. A head will not be shown if its current selected<br />
station is “None”.<br />
28 <strong>ICAM</strong> Technologies Corporation – Proprietary
2.9 Setting Tool Compensation<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Setting Tool Compensation<br />
On most machines, the CNC provides some form of tool compensation<br />
to adjust for differences in the length (or position) and diameter of the<br />
tool. VM provides a virtual controller that supports both fixture and<br />
tool compensation. The VM controller can be activated from the View toolbar by selecting the<br />
button shown circled in the toolbar above. Select the button a second time to either hide the<br />
controller window or to restore a controller window that has been minimized. This window can<br />
also be controlled by selecting Simulation»Controller from the menu bar. Once the VM Controller<br />
window is active, select the Tool Compensation tab to define or modify tool length and<br />
diameter compensation amounts.<br />
Note: VM will not let you add length and/or diameter compensation offsets if these features are<br />
not available on the machine (as defined in the post-processor or control emulator).<br />
<strong>ICAM</strong> provides “Manufacturing Extractors” for many popular CAM systems, which can automatically<br />
define tool compensation settings from tooling used in the NC program.<br />
Tool compensation data is<br />
automatically saved in the<br />
verification setup (.vsw) file<br />
when the program is completed.<br />
This setup file will be<br />
reused on subsequent runs to<br />
quickly reestablish the tool<br />
compensation settings necessary<br />
for an accurate simulation.<br />
2.9.1 Length Compensation<br />
Length compensation typically adjusts the Z-axis position of the control point, to account for<br />
differences between programmed and actual tool lengths. If the NC program already compensates<br />
for tool lengths in the coordinate data, then length compensation is not necessary in VM. If<br />
the coordinate data does not take into account the gage length of the tool, then length compensation<br />
must be used with VM to correctly check the NC program. Press the Add button and then<br />
enter the length compensation ID to be added. You can select any axis of any ID and type a new<br />
value. You can also select one or more IDs and use the Set and Zero buttons to set or zero offsets<br />
for all selected IDs simultaneously.<br />
2.9.2 Diameter Compensation<br />
Diameter compensation adjusts the trajectory of the tool to compensate for differences between<br />
the programmed and actual tool diameters. Most CAM systems output coordinate data that is<br />
already offset from the part surface by the radius of the tool, making diameter compensation<br />
unnecessary in VM. If the coordinate data represents the contact point of the tool with the<br />
surface instead of the tool center point, then diameter compensation must be used with VM to<br />
correctly check the NC program. Press the Add button, and then enter the diameter compensation<br />
ID to be added. You can select any ID and type a new diameter value. You can also select one or<br />
more IDs and use the Zero button to zero offsets for all selected IDs simultaneously.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 29
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Monitoring <strong>Virtual</strong> <strong>Machine</strong>’s Results<br />
2.10 Monitoring <strong>Virtual</strong> <strong>Machine</strong>’s Results<br />
Monitoring the simulation is actually the responsibility of CERUN and GENER. GENER monitors<br />
the simulation during look-ahead operations (with LINTOL/SCAN) in an attempt to avoid<br />
interpolating the machine into situations where collisions might occur. GENER reports all unavoidable<br />
collisions and overtravel conditions in the post processor listing file. CERUN monitors<br />
the simulation at all times and reports all collisions and overtravel conditions in the control<br />
emulator log file. CERUN and GENER perform these actions regardless of whether the simulation<br />
window is visible or not.<br />
VM provides various controls and features to aid visual monitoring<br />
of the simulation. Two of these, the HUD (head-up display)<br />
and tool path displays, can both be toggled from the VM Mode<br />
toolbar by selecting the buttons shown circled above, as well as from the Simulation»Show»Display<br />
and Simulation»Show»Tool Path (Ctrl T shortcut) menus. Animation control<br />
options, tool path display options and various other miscellaneous options are all controlled from<br />
the Simulation»Options menu (Ctrl Alt O shortcut). The animation options are also available<br />
from the VM Animation toolbar.<br />
The VM View Filter toolbar provides toggle<br />
buttons to display or hide various types of objects<br />
in the scene, such as (from left to right): the<br />
machine, tools, fixtures, rough stock and design part. When running with MRS (material removal<br />
simulation) active, additional toggle buttons are available to view or hide: the in-process stock,<br />
Boolean overcut and undercut stock (gouge and excess material), a color graduated Boolean<br />
difference between part and stock, and a cross section cutout of the stock. These view filter<br />
toggles are also available from the Simulation»Show»Filters menu. A Simulation»Compare<br />
(Ctrl Q shortcut) menu selection defines settings for colorized differences.<br />
VM provides various functions to measure the distance and angles between<br />
objects. Measurement mode is toggled using the button on the<br />
VM Mode toolbar. Once in measurement mode, clicking with the leftmouse<br />
button causes measurements to be taken between the selected objects. Press and hold the<br />
Ctrl key to manipulate the camera with the mouse while taking measurements. Within VM,<br />
objects are constructed of triangles. The VM Measure toolbar provides a middle series of three<br />
toggle buttons that filter the parts of the triangles that can be selected with the mouse. The leftmost<br />
toggle on the VM Measure toolbar switches between chained (one to the next) and fanned<br />
(one to many) measurements. The rightmost toggle affects the visibility of the objects being<br />
measured; when in “overlay” mode they will not be hidden by other objects that might be<br />
between you (the viewer) and the measured ones.<br />
VM also provides a Timeline feature on the VM Controller window that can be used to review<br />
and play back the simulation.<br />
Finally, VM provides the ability to synchronize both the Timeline display and the simulation<br />
window with any of the other tracing windows available with the CERUN and GENER UI. This<br />
can be used to see the state of the simulation at a particular CLDATA record, NC block, macro<br />
command and operator or diagnostic message (e.g., a collision).<br />
30 <strong>ICAM</strong> Technologies Corporation – Proprietary
2.10.1 Head-Up Display<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Monitoring <strong>Virtual</strong> <strong>Machine</strong>’s Results<br />
The HUD superimposes<br />
status information on the<br />
simulation window. To<br />
change the content or<br />
position of the HUD,<br />
select the Simulation»Display<br />
(Ctrl Alt D<br />
shortcut) menu to bring up<br />
the Display dialog. Status<br />
information can be organized<br />
into different<br />
schemes, which can be<br />
labeled by name and saved<br />
in the Windows Registry<br />
(the Default scheme<br />
cannot be changed). You<br />
can cycle between different<br />
display schemes listed in the simulation window using the Simulation»Show»Next Display<br />
and »Previous Display (Ctrl D and Ctrl Shift D) menu selections. Uncheck the “Use default<br />
schemes in cycle” box to omit the Default scheme when cycling through different displays.<br />
The FPS Status Information item can be selected to measure the simulation window display rate,<br />
in the form “FPS a / b” (useful when testing Graphic card setting). The number “a” is the theoretical<br />
maximum number of screen updates per second that VM could do if all it had to do was<br />
redraw the display. The number “b” is the actual number of updates per second, and takes into<br />
account all other processing requirements.<br />
2.10.2 Animation Control<br />
Animation options are controlled from the VM<br />
Animation toolbar as well as from the Simulation»Options<br />
menu (Ctrl Alt O shortcut).<br />
The animation control options affect the simulation display speed. Selecting the “Continuous”<br />
mode will slow the simulation down to a specified factor of real time within the limitations of the<br />
CPU and graphics capabilities of your computer. When “Motion Step” is selected, the display is<br />
updated at the specified interval in motions, meaning that the simulation display is updated after<br />
every n motion steps. A third “Time Interval” method refreshes the display at the specified<br />
interval in seconds, which has the least impact in terms of CPU requirements.<br />
When in continuous animation mode, extremely slow motions may give the impression that the<br />
software is no longer operating. If unsure, activate the HUD motion display, which will show if<br />
axes are in fact moving. The Simulation Options dialog can be activated while the simulation is<br />
running (and even mid interpolation), allowing you to change the mode from continuous to<br />
another.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 31
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Monitoring <strong>Virtual</strong> <strong>Machine</strong>’s Results<br />
2.10.3 Tool Path Display<br />
Select the Simulation»Show»Tool Path (Ctrl T shortcut) menu<br />
toggle to enable and disable tool path tracing. Tool path tracing<br />
can also be toggled from the VM Mode toolbar by selecting the<br />
left button in the pair shown circled above. Tracing shows the motion of the tool in relation to<br />
the part, taking into account the sweep effects caused by rotary motions and the “hockey stick”<br />
effect caused by independent axis positioning. The trace is shown fixed in relation to the part<br />
(meaning that the trace moves with the part).<br />
Select the Simulation»Show»Tool Path as Overlay menu toggle to control the visibility of the<br />
tool path. Tool path visibility can also be toggled from the VM Mode toolbar by selecting the<br />
right button in the pair shown circled above. When the tool path is shown in “overlay” mode it<br />
will not be hidden by objects that might be between you (the viewer) and the tool path.<br />
Select Simulation»Options (Ctrl Alt O shortcut) to<br />
change tool path display options, which will bring<br />
up the Simulation Options dialog. Tool path<br />
options include:<br />
� The colors used to distinguish feed motions,<br />
rapid motions and motions being<br />
“synchronized” with the CERUN and<br />
GENER trace windows.<br />
� Whether to show the tool path trace at the<br />
SCP (spindle control point) or the tool tip.<br />
� The extent of the tool path to display. Tool<br />
paths containing many motions slow down<br />
the simulation speed due to the CPU requirements<br />
to draw each motion. The tool<br />
path display can be reduced to show only<br />
those motions within a specified period.<br />
� The tolerance used when tracing curved<br />
motions, while respecting an upper limit<br />
on the number of segments that should be<br />
used to show a curved motion. Note that<br />
this tolerance is used for display purposes<br />
only and has no effect on collision testing.<br />
32 <strong>ICAM</strong> Technologies Corporation – Proprietary
2.10.4 VM Controller Timeline<br />
Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Monitoring <strong>Virtual</strong> <strong>Machine</strong>’s Results<br />
The VM <strong>Virtual</strong> Controller includes a Timeline feature that can be<br />
used to review and replay the simulation at any point. The VM controller<br />
can be activated from the View toolbar by selecting the button<br />
shown circled in the toolbar above. Select the button a second time to either hide the controller<br />
window or to restore a controller window that has been minimized. This window can also be<br />
controlled by selecting Simulation»Controller from the menu bar. Once the VM Controller<br />
window is active, select the Timeline tab to view a time graph of the process.<br />
The time scale listed horizontally<br />
at the top of the window<br />
represents the run time of the<br />
process. The pale blue vertical<br />
bar shows the moment in time<br />
that the simulation window is<br />
currently showing. The light<br />
gray vertical line marks the end<br />
of the simulation. When MRS<br />
(material removal simulation)<br />
is active, all collisions involving<br />
the in-process stock (e.g., tool rapids into stock) are identified by horizontal amber bars at the<br />
top edge of the window; the left edge of the amber bar marks the start of the motion where a<br />
collision occurs and the corresponding right edge marks the start of the next motion where the inprocess<br />
stock is again collision free. All other non in-process stock related collisions are identified<br />
by a red bar; the left edge of the red bar marks the moment in time where a collision occurs<br />
and the corresponding right edge marks the point where the simulation is again collision free.<br />
Each motion axis is listed horizontally. Motion axes overtravel conditions are individually<br />
identified by horizontal light purple bars drawn level with the axis on which an overtravel<br />
occurs; the left edge of the light purple bar marks the moment in time where an overtravel occurs<br />
and the corresponding right edge marks the point where the axis is once again within travel.<br />
When the simulation is paused, you can click with the left mouse button anywhere within the<br />
window to see, in the simulation window, the state of the simulation at that moment in time.<br />
Hold the left mouse button down and drag the mouse left and right to replay the simulation<br />
forwards and backwards in time. Use the up and down arrow keys or the mouse wheel to adjust<br />
the time scale to see more or less detail. The Simulation»Camera»Fit (Ctrl Space) function will<br />
fit the entire process within the Timeline window. Use the left and right arrow keys or the<br />
horizontal scroll bar to move the timescale left and right. The Simulation»Camera»Center<br />
(Ctrl Shift Space) function will center the timescale at the current selected time.<br />
Click with the right mouse button anywhere within the window to see a pop-up context menu.<br />
The “play from here” choice will replay the simulation from the selected point, using the continuous<br />
animation control setting. The “synchronize” choice will synchronize the selected moment<br />
in the Timeline display with the simulation window and any of the other tracing windows<br />
available with the CERUN and GENER UI.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 33
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Using <strong>Virtual</strong> <strong>Machine</strong> Models with CeRun and Gener<br />
Monitoring <strong>Virtual</strong> <strong>Machine</strong>’s Results<br />
2.10.5 Part / Stock Comparison<br />
Comparison between the design part and the inprocess<br />
stock is only available with a MRS (Material<br />
Removal Simulation) license available and<br />
enabled via the SIM button on the GENER and CERUN launch panels. The MRS license provides<br />
the added functionality to compute the effect of the cutting process of the tool on the rough<br />
stock. The resultant shape is called the “in-process stock”.<br />
The left-most of the circled buttons above toggles the display of the in-process stock. The two<br />
buttons to its immediate right toggle the display of Boolean Overcut (gouge) and Boolean<br />
Undercut (excess) material. The gouge and excess calculations are done using an exact comparison<br />
between in-process stock and its associated part. These associations must first be setup using<br />
the “Associated Part” setting in the Simulation»Stock (Ctrl Alt S shortcut) dialog (on page 18).<br />
The Boolean excess and overcut results can sometimes<br />
be misleading, since it can be difficult to judge<br />
the thickness of the excess or gouge material. VM<br />
provides a Simulation»Compare (Ctrl Alt Q shortcut)<br />
color graduated part/stock comparison feature to<br />
address this issue. The comparison colorization<br />
settings are applied only to gouge and excess material,<br />
which must first be enabled by selecting one or both<br />
of the Boolean Overcut and Boolean Undercut filters.<br />
Select the Colorized Boolean filter (second from right<br />
in the circled buttons above) to compute and view the<br />
results.<br />
The comparison is done by sampling the surface of<br />
the gouge and/or excess material, and computing the<br />
shortest distance to the part. The distance is then used<br />
to assign a fixed or graduated color, as defined using<br />
the various options of the Compare dialog. If the sample size is small, or the part very large, the<br />
colorization process may take a long time to compute. The comparison can be cancelled at any<br />
time, in which case the displayed results will be incomplete (but perhaps still useful).<br />
When viewing the gouge material in combination with either the part or the in-process stock, it<br />
helps to select the part with the mouse so that its surface becomes transparent, allowing the<br />
gouged material surface to be seen.<br />
34 <strong>ICAM</strong> Technologies Corporation – Proprietary
3 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with QUEST<br />
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
This section describes how to create and maintain <strong>Virtual</strong> <strong>Machine</strong> models using the <strong>ICAM</strong><br />
QUEST Developer‟s System. It explains how to define the kinematics (i.e., axes) of the CNC<br />
machine, how to flesh out the model by creating and/or importing machine components and<br />
enabling or disabling collision testing of these components, and how to customize the model to<br />
support special features.<br />
You should familiarize yourself with the following topics to effectively build VM machine<br />
models. Each of these topics is discussed in the sections that follow.<br />
� QUEST User Interface (on page 36)<br />
� Basic Model Requirements (on page 38)<br />
� Creating a <strong>Virtual</strong> <strong>Machine</strong> Model (on page 39)<br />
� Adding Kinematics to the Model (on page 42)<br />
� Adding Physical Entities to the Model (on page 46)<br />
� Collision Testing (on page 49)<br />
� Selection Groups (on page 53)<br />
� Customizing the Model (on page 54)<br />
� Testing the Model (on page 55)<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 35
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Quest User Interface<br />
3.1 QUEST User Interface<br />
The QUEST user interface consists of three main windows (see the image on page 35).<br />
1. The left hand window is the Navigator, which is used to view the list of models in a database<br />
as well as to access the different information components of a model. Select the “Database”<br />
tab at the bottom of the navigator window to see the list of databases. Individual models can<br />
be read into QUEST from a database so they can be viewed or modified. Each model, once<br />
loaded, can be accessed by selecting its named tab at the bottom of the navigator window.<br />
The Help tab in the Information window displays information about the entry selected in the<br />
Navigator. Double-click on a section entry in the Navigator window to make changes to that<br />
section.<br />
2. The upper right window is the Main working window. This window will change to show the<br />
machine model, lists of questions, dialog panels, macros, etc., resulting from selections made<br />
in the Navigator. Most of your interaction with QUEST will occur in the main window. You<br />
can press the F1 function key to obtain context sensitive on-line help on how to use the main<br />
window.<br />
3. The lower right window is the Information window. This window holds various types of<br />
information, each of which can be accessed by selecting one of the organizational tabs arranged<br />
along the bottom edge of the window. Most of the time, QUEST will automatically select<br />
the proper tab for you based on the last feature or action requested. The tab names and<br />
their purpose are as follows:<br />
� The Help tab provides detailed help when the Main window focus is on a question, or<br />
when a section is selected in the Navigator window.<br />
� The Build tab lists informational and diagnostic messages when they occur. You can often<br />
double-click on a diagnostic message to address the problem in the Main window.<br />
� The Finder tab lists the results of the last search operation. You can double-click on any<br />
line listed in this window to change the Main window focus to the selected item. Use F4<br />
and Shift-F4 to sequentially shift the Finder window focus (and indirectly the Main window<br />
focus) forwards and backwards through the list of items found.<br />
� The Diffs tab lists the differences between two selected models. You can double-click on<br />
any line with a solid arrow to change the Main window focus to the selected item.<br />
� The Axes tab contains sliders that can be used to exercise the axes of the model. It also<br />
has buttons to exercise the spindle(s) and reset axes to their default state.<br />
The menu-bar at the top of the application window provides access to QUEST functions. Not all<br />
menu actions are available at all times. For example, some database actions are only available<br />
when a database or model is selected in the navigator. Other menu actions are related to the<br />
macro and dialog editors. These actions will only be available when a macro or dialog is being<br />
edited. Keyboard shortcuts are available for some common menu actions (the shortcut key is<br />
listed in the menus to the right of the menu item).<br />
The most common menu actions are also available through toolbar shortcuts (the little icons<br />
arranged below the menu-bar). Toolbars are dockable, meaning that they can be dragged to any<br />
36 <strong>ICAM</strong> Technologies Corporation – Proprietary
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Quest User Interface<br />
side of the application window, or even be made to appear as a separate window. Like the menubar<br />
selections they represent, toolbar icons may not be selectable at all times.<br />
The right-mouse button can be used to bring up a pop-up menu (context sensitive menu), listing<br />
the most common menu choices that can be made in the current window or on the item last<br />
selected. Pop-up menus also provide access to modal display and processing options. This<br />
feature is highly recommended, since it lists the most common actions based on the current<br />
context.<br />
The vertical splitter bar can be used to increase or decrease the width of the Navigator window.<br />
The horizontal splitter bar likewise determines how the main working window and informational<br />
window share the full application window height. You can double-click on the splitter bar to<br />
quickly reset it to its last position.<br />
Interface differences between Developer and Run-time Environments<br />
The <strong>Virtual</strong> <strong>Machine</strong> interface used in QUEST is nearly identical to the one used in CERUN and<br />
GENER, with the following differences.<br />
� QUEST does not include the Tool/Holder dialog, nor does it include the Stock/Fixture/Part<br />
dialog, nor is it concerned with Fixture/Length/Diameter compensations. These types of<br />
information are stored (using CERUN or GENER) in the verification setup (.vsw) file associated<br />
with the part program.<br />
� QUEST is primarily concerned with machine components and kinematics, which are<br />
stored in the database (.dbf) file as a part of the model. QUEST also stores the preferred<br />
Grid setup, Lighting arrangement and predefined camera positions with the model. Selecting<br />
the Reset button in Lighting and Grid dialogs inside QUEST resets to safe defaults.<br />
� CERUN and GENER on the other hand cannot change the model or its kinematics. They<br />
use the Grid, Lighting and camera definitions from the model as default values. Changes<br />
made in CERUN and GENER to these features are saved in the verification setup (.vsw)<br />
file. Selecting the Reset button in Lighting and Grid dialogs inside CERUN and GENER resets<br />
these functions to their model defaults.<br />
� QUEST shares the same “heads-up” display dialog as CERUN and GENER. The HUD<br />
schemes are stored in the Windows Registry. QUEST is only concerned with the current<br />
selected HUD colors and fonts, which it uses during interactive component creation. You<br />
can edit or change schemes from within QUEST (as you would from CERUN and GENER).<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 37
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Basic Model Requirements<br />
3.2 Basic Model Requirements<br />
It is a common but true dictum that the accuracy of a result depends on the accuracy of the data<br />
used to determine the result – or more plainly: garbage in, garbage out. Using a rough approximation<br />
of the machine work envelope will reduce the effectiveness of the simulation. There is<br />
little comfort knowing that a collision probably did not occur. However, using a rough approximation<br />
of the machine enclosure (or omitting it entirely) is perfectly valid, if you do not intend to<br />
test for collisions against the roughly defined object.<br />
The first step is to know what to model and what not to model. The answer is quite simple:<br />
� Only model components of the machine that are to be collision tested.<br />
You should carefully and accurately model the table and any devices that are normally attached<br />
to the table. You should model the spindle face and any devices that are attached to it if they can<br />
get in the way of the work. If your work area is enclosed and you are concerned with collisions,<br />
then you should model this area too. Modeling the tool changer, the stand-alone power supply,<br />
chip conveyor, and so on bring a certain degree satisfaction, but they add nothing to the accuracy<br />
of the result you are trying to achieve, which is to detect collisions.<br />
VM models are built up from components, all attached together on a kinematics chain. Simple<br />
rectangular, cylindrical, conical, spherical, revolved and swept volume components can be<br />
created with VM‟s construction features. Components can also be imported as STL objects from<br />
a CAD system. VM is not a CAD system; VM relies on your CAD system to prepare model<br />
components, which can then be imported as STL files.<br />
Curved components are represented in VM as a series of closely meshed triangles. Even simple<br />
objects, such as a cube, are built of many triangles (a cube requires 12). The more triangles a<br />
component is constructed with, the longer it will take for VM to perform collision testing, and<br />
also the longer it will take for the component to be drawn in the simulation window. This leads<br />
us to the next important maxim:<br />
� Use reasonably coarse faceting for cylindrical and STL components.<br />
Models with hundreds of thousands of triangular facets will have poor rendering (drawing)<br />
performance and might have poor collision performance. VM surrounds each component with a<br />
simplified box that it uses in a form of pre-test for collisions, and only looks at the triangles<br />
inside the box if necessary. A model with components that are defined localized (not spread out)<br />
will have much better collision testing performance than one whose components are not. For<br />
example, modeling the entire enclosure of the machine in a single STL will ensure that every<br />
triangle of the enclosure will be tested on every motion (and in fact, many times for each motion).<br />
It is better to model the enclosure in sections: left, right, top and so on.<br />
If a computerized model of the machine cannot be obtained from your machine tool builder, then<br />
you will have to create the model components yourself. If your machine can be modeled using<br />
the simple primitives described earlier, then you will not need the assistance of a CAD system.<br />
Complex curved surfaces can only be created with the assistance of a CAD system capable of<br />
exporting an STL file.<br />
38 <strong>ICAM</strong> Technologies Corporation – Proprietary
3.3 Creating a <strong>Virtual</strong> <strong>Machine</strong> Model<br />
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Creating a <strong>Virtual</strong> <strong>Machine</strong> Model<br />
You create a new model using the<br />
File»New»New Model drop down menu<br />
selection. A model can be developed from<br />
scratch by selecting the “Blank” menu suboption<br />
(Ctrl M shortcut). A model can be<br />
developed based on information previously entered for a<br />
CAM-POST post-processor by selecting the “From Existing Post” menu sub-option. Similarly, a<br />
model can be developed based on information previously entered for an <strong>ICAM</strong> Control Emulator<br />
by selecting the “From Existing CE” menu sub-option.<br />
Regardless of how the model is created, the Main work window will then change to show a short<br />
list of questions.<br />
General Information<br />
Your first action should be to give<br />
the new model a unique name. This<br />
is the name that you will later use<br />
with CERUN and GENER to identify<br />
the machine model (see “Selecting<br />
a <strong>Virtual</strong> <strong>Machine</strong> Model” on page<br />
6). The model name and model ID<br />
number follow the exact same<br />
naming convention as that used for<br />
<strong>ICAM</strong> post-processors and control<br />
emulators (i.e., alphabetic first<br />
character, up to 31 additional<br />
alphabetic, numeric and/or underscore<br />
“_” characters, followed by an optional ID number in the range 1-999999). The model<br />
name/ID combination must not conflict with a post processor or control emulator name/number<br />
combination already in use in the database.<br />
Next, choose the type of machine from the list of selected types. Currently VM supports contouring,<br />
milling and turning type machines. The choice of contouring or milling machine type has no<br />
effect at all on the model. Selecting a lathe machine type though will activate additional features<br />
in VM to handle lathe turrets, live tooling and spindles that can switch between turning and<br />
cutting modes.<br />
The model units system defines the default unit of measure to be used when constructing components.<br />
It need not match the units of the post processor or control emulator. You should select<br />
the same unit system that is used in the drawings and diagrams of your machine.<br />
Important note: You should not change the model units once you have already started<br />
building the model. This is because the model dimensions will be reinterpreted using the<br />
new units value, resulting in a scaling of the model. If you really must change the model<br />
units, then follow these steps: 1) Use the model navigator to select the entire model and<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 39
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Creating a <strong>Virtual</strong> <strong>Machine</strong> Model<br />
cut it into the paste buffer. 2) Change the model units. 3) Use the model navigator to<br />
paste the contents of the buffer back.<br />
Comments<br />
The Comments section provides a rudimentary Notepad style editor that can be used for your<br />
own purposes. Anything you type in this section will be saved with the model. It is recommended<br />
that updates to the model be documented in the Comments section. This will help in later<br />
identifying different revisions of a model in the database.<br />
3D Models»<strong>Machine</strong>s<br />
Next, you should open the “<strong>Machine</strong>s” entry in the Model<br />
Navigator window (as shown at right). Either double-click<br />
on the <strong>Machine</strong>s entry, or right mouse click on the entry and<br />
select Open from the context pop-up menu. In either case, a<br />
view of the model world, with a default grid (and default<br />
lighting) will appear in the upper right work area.<br />
You should now adjust the grid size so that it can comfortably<br />
contain the footprint of the machine model. Select<br />
Simulation»Grid (Ctrl Alt G shortcut) from the menu bar to<br />
bring up the Grid dialog.<br />
A moderately oversized grid<br />
generally provides a pleasing<br />
visual effect. Do not use an<br />
undersized grid, since this<br />
will adversely affect image<br />
rendering. The grid size is<br />
defined by minimum and<br />
maximum values, which are<br />
applied to the world X and Y<br />
axes. The grid zero point is<br />
also the default model zero<br />
point. The grid subdivision<br />
size is for visual effect only<br />
(it gives the floor some<br />
substance) but be aware that<br />
too fine a grid will slow<br />
down the rendering speed.<br />
The snap-to-grid setting can<br />
be of some aid during interactive creation of components.<br />
40 <strong>ICAM</strong> Technologies Corporation – Proprietary
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Creating a <strong>Virtual</strong> <strong>Machine</strong> Model<br />
Grid visibility can be controlled either from the<br />
buttons shown circled on the VM Grid toolbar at<br />
left, or from the Simulation»Show menu-bar.<br />
Grids can be shown for the XY, YZ and ZX<br />
planes, with respect to the base frame of the model, but this can be changed by selecting a<br />
different frame of interest from the drop-down list on the VM Grid toolbar.<br />
The origin of the grid is the point around which the camera will rotate by default, unless another<br />
object is selected as the camera pivot point using Simulation»Camera»Pivot (Ctrl P shortcut)<br />
from the menu bar. The grid origin does not have to be below the machine. It is perfectly valid to<br />
set up a grid origin at the stock mount point of the machine. This is strictly a matter of personal<br />
preference.<br />
Grid settings are stored with the model in the database.<br />
You should next reset the default lighting to respect the new grid size. Select Simulation»Lights<br />
(Ctrl Alt L shortcut) from the menu bar to bring up the Lighting dialog. See “Adjusting Lighting”<br />
on page 17 for details on how to adjust the lighting.<br />
Select the Reset button to setup a default lighting scheme to match the grid size. You should wait<br />
until your machine begins taking shape before further adjusting the lighting.<br />
Light settings are stored with the model in the database. When the Reset button is used in QUEST,<br />
the lighting resets to the default 3-light configuration shown below. When the Reset button is<br />
used in CERUN and GENER, the lighting will reset to the settings stored with the model.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 41
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Adding Kinematics to the Model<br />
3.4 Adding Kinematics to the Model<br />
The machine kinematics must be constructed one axis at a time. Adding the kinematics framework<br />
first and then attaching the physical components to this framework afterwards is one<br />
suggested methodology. It is also possible to do the reverse, or to build the components and<br />
kinematics together.<br />
The placement of axes in the model navigator is very<br />
important. For example, connecting a Y-axis onto an X-axis<br />
produces a very different result from the reverse. When Y is<br />
connected to X, the Y-axis (and its zero point) move as the<br />
X-axis is moved, but moving Y has no effect on X. This<br />
configuration would be used for most gantry mills, or for a<br />
Y table on X table type machine. The reverse, connecting X<br />
on to Y would cause the X-axis origin to be moved when<br />
moving the Y-axis. A second example could be a dual Caxis/A-axis<br />
rotary head. The A-axis must be connected on to<br />
the C-axis to get the correct effect of a change in C causing<br />
the A-axis orientation to change.<br />
Unless the model was created from a post or CE, the model axes will not be automatically<br />
associated to their corresponding axes in GENER and CERUN. You must make the association<br />
using the Axis Mapping tab of the machine‟s Properties dialog (e.g., <strong>Machine</strong>01) in the Model<br />
Navigator (the properties dialog is described later in this section).<br />
To summarize: Axes are connected in chains, each one having an effect on all subsequent axes<br />
farther (lower) down in the chain, and having no effect on any axes closer (higher) up in the<br />
chain. At the highest point<br />
is the machine origin.<br />
There are usually multiple<br />
chains of axes branching<br />
out from the machine<br />
origin. One chain ends at<br />
the tool axis on the spindle<br />
face; the other ends at the<br />
stock axis (or work piece<br />
origin) on the table. The<br />
terminology “lower” and<br />
“higher” refers to how the<br />
axes and components are<br />
listed in the Model<br />
Navigator.<br />
Before proceeding, you<br />
should open the sample<br />
models that are included<br />
with the software and<br />
examine the order in which the axes were defined and the effect this has on machine motion.<br />
42 <strong>ICAM</strong> Technologies Corporation – Proprietary
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Adding Kinematics to the Model<br />
The MHERML50 model, for an example, defines a machine with a C-axis rotary table, mounted<br />
on an A-axis trunnion table, mounted on the machine base. The Z-axis column is mounted on an<br />
X-axis rail, in turn mounted on a Y-axis gantry. For the head assembly, the Y-axis is connected<br />
closest to the machine origin. Moving the Y-axis causes the X and Z axes to move, along with<br />
the tool. Moving the Z-axis leaves the X and Y axes unchanged. This machine model also<br />
defines a number of other axes, which do interesting things like control the doors and position<br />
the operator‟s pendant. These additional axes follow the same rules.<br />
The following axes types can be created using the Simulation»Construct Axis menu bar selection<br />
(and also from the buttons on the VM Construct toolbar shown circled above):<br />
� Linear defines X, Y and Z axes slides<br />
� Rotary defines A, B and C axes tables and heads<br />
� Curve defines axes which move along a profile<br />
� Tool defines where tools are mounted<br />
� Stock defines where fixtures and parts are mounted<br />
� Head defines where removable head attachments are mounted<br />
� A Reference axis doesn‟t control motion; it is used to group related components<br />
All axes share some common parameters (a description<br />
of all axes parameters can be found starting on<br />
page 96).<br />
An axis Name should be a short meaningful string.<br />
The name is used in the lower right “Axes” window<br />
and in the Model Navigator to identify the axis.<br />
The Unit selection by default will match the model<br />
units. This defined the units of measure for position<br />
and range information.<br />
The Position of an axis defines where its origin is, in<br />
respect to the object to which the axis is attached.<br />
Axes attached to the base machine are defined in<br />
relation to the grid origin. The Direction of an axis<br />
can be along one of the major axes. Typically, axes that move the part have a reversed sign and<br />
those that move the tool have a normal sign. You can enter a “Custom” orientation, by giving the<br />
axis‟ XYZ components of positive motion. The Range of an axis defines the limits of its motion.<br />
The Default position specifies the axis setting when the model is opened.<br />
You can Slave one axis to another by selecting a parent axis in the drop-down choice list. When<br />
an axis is slaved, its position is controlled by the parent axis‟ position, multiplied by the signed<br />
Scaling factor. A slaved axis will not have its own slider control in the lower right “Axes”<br />
window; a slaved axis can only be moved by moving its parent axis.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 43
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Adding Kinematics to the Model<br />
Axes can be oriented by selecting the Rotate button. This causes a rotation of the XYZ reference<br />
axes for the current axis and all objects that are attached to it. Linear and Rotary axes should not<br />
need to be rotated; use the Custom direction selection to define a non-standard orientation.<br />
When you add a new axis, it will appear in the Model Navigator attached as a child (below) the<br />
object that was selected in the Navigator when the axis was created. You can move the axis to a<br />
new position in the Navigator by first selecting it with the mouse, then, while holding the leftmouse<br />
button down, dragging it to a new attachment point before releasing the mouse button.<br />
You can change the order of objects listed at any given level by holding the Ctrl key down while<br />
pressing the up and down arrow keys.<br />
The axis name will also appear in the lower right “Axes” window. Axes are listed in this window<br />
in the same order that they appear (top down) in the model navigator view. Move the axis slider<br />
to see its full range of motion (sliders for rotary axes with unlimited travel sliders are limited to<br />
�360ºdegrees). Press the right-mouse button on the slider to reset the axis to its default position.<br />
Press the Reset All Axes button to reset all of the axes to their default positions.<br />
Do the following to add a C-axis table rotary mounted on an X-axis table:<br />
Step 1: Create the X-axis<br />
� Select Simulation»Construct Axis»Linear Axis.<br />
� Press the Tab key three times to accept a default position<br />
of (0,0,0) for the X-axis origin. The Linear Axis<br />
properties dialog will appear.<br />
� Select “-X Axis” for the axis direction.<br />
� Choose -1500 and 1500 for the Min and Max axis<br />
range values.<br />
� Press OK.<br />
Enable the kinematics and axes marker displays in the VM Grid toolbar (also controllable from<br />
the Simulation»Show menu). Select the lower-right “Axes” window and experiment by moving<br />
the X-axis slider. You should see the X-axis origin coordinate frame moving along its range of<br />
travel (shown as a narrow blue band) with respect to the grid origin. Expand the model navigator<br />
(left hand window) to see the current model tree, which should look like the image above.<br />
Step 2: Create the C-axis.<br />
� Make sure that the “X-axis” entity is selected in the Model Navigator view.<br />
� Select Simulation»Construct Axis»Rotary Axis.<br />
� Press the Tab key three times to accept a default position<br />
of (0,0,0) for the C axis origin. The Rotary Axis<br />
properties dialog will appear.<br />
� Select “–Z Axis” for rotation axis.<br />
� Clear the Use range validation check box to have<br />
unlimited rotation (no travel limitation) for this axis.<br />
� Press OK.<br />
44 <strong>ICAM</strong> Technologies Corporation – Proprietary
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Adding Kinematics to the Model<br />
Two axes will now be listed in the lower-right “Axes” window. Move the X-axis and C-axis<br />
sliders to see the effect on the C-axis coordinate frame. The model navigator should appear as<br />
shown above.<br />
If non-zero values are used for the axes positions, objects attached to them will be in relation to<br />
the offset position. The choice to use zero values (as done here) or to define axes at some position<br />
(e.g., at the table face) depends on how the physical components of the model will be<br />
defined (discussed in the next section).<br />
Step 3: Associate axes with GENER<br />
Creating the X-axis and C-axis defines them in the model, but if you ran a post processor or<br />
control emulator with this model, neither of these axes would move. You must manually define<br />
the association between model axes and the list of possible axes that CERUN and GENER can<br />
control. You do this by selecting the Properties dialog of the top-level machine object (typically<br />
“<strong>Machine</strong>01” unless renamed).<br />
� Right-mouse on the “<strong>Machine</strong>01”<br />
entry and select Property.<br />
� Select the Axis Mapping tab.<br />
� Double-click in the Model Axis<br />
column in the X Axis row and<br />
then choose “X Axis” (the<br />
model axis name).<br />
� Do the same for the C Table<br />
axis, choosing “C Table Axis”<br />
in the Model Axis drop-down.<br />
� Select OK.<br />
Manually associating model axes to<br />
their CERUN and GENER counterparts<br />
provides flexibility both in axis naming and in the orientation of standard axes. For example, a<br />
horizontal machine model might use an X-axis to control the Z-axis column; in which case the Zaxis<br />
control axis would map to the X-axis model axis.<br />
On machines with multiple controller channels, there can be multiple axes of the same type. For<br />
example, on a 4-axis merging lathe there will be two X axes and two Z axes. In this case, you<br />
must create a second channel and assign the model‟s secondary turret X and Z axes to the<br />
channel 2 X and Z controllable axes.<br />
Lastly, if there are multiple spindles defined in the model, then they must be assigned as milling<br />
or turning spindles for the appropriate channel. A milling spindle must also be assigned for VM<br />
to correctly simulate boring bars and other 3D tool shapes.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 45
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Adding Physical Entities to the Model<br />
3.5 Adding Physical Entities to the Model<br />
Once you have defined the kinematics framework of your machine, you are now ready to add<br />
physical entities such as tables, heads, bases, etc. These objects give substance to your model so<br />
it can be seen, but more importantly, it is the physical entities of the model on which collision<br />
testing is performed.<br />
Entities are attached to axes or other entities in the same way that axes are attached to each other<br />
and the machine. Objects that are attached to moving axes will move when that axis moves.<br />
Sometimes, a physical entity on the machine will have some of its parts attached to one axis and<br />
the remainder attached to another axis. For example, a rotary table base would be attached to one<br />
axis (e.g., a linear axis), while the table itself would be attached to the rotary axis (so it rotates<br />
when the rotary axis moves). Another example: An X-axis table would be attached to the X-axis,<br />
but the guide-ways and base would be attached to the world.<br />
All entities are located in terms of an XYZ offset from their parent object. An offset of zero<br />
would place the entity origin at the same position as the parent object‟s origin. In the examples to<br />
this point, the axes have been defined at the machine origin. Doing so allows us to define geometry<br />
in terms of the machine coordinate frame. If machine dimensions are relative to some other<br />
position, then you should create a “Reference Axis” attached to the “<strong>Machine</strong>01” object and<br />
define the offset to the reference point used by the machine tool builder. All other objects should<br />
then be defined in the tree leading out from the reference axis.<br />
The following entity types can be created using the Simulation»Construct Entity menu bar<br />
selection (and also from the buttons on the VM Construct toolbar shown circled above):<br />
� A Cube is a box defined by its width, length and height.<br />
� A Cylinder is defined by a length and radius at each end.<br />
� A Cone is also defined by a length and radius at each end.<br />
� A Sphere is defined by a radius.<br />
� A Revolved is a 2D profile shape revolved about its local Z-axis.<br />
� An Extruded is a 2D profile shape extruded along its local Z-axis.<br />
� A Mesh is an STL object imported from the CAD/CAM system.<br />
� A Picture is a bitmap image.<br />
All entities share some common parameters (a description of entity parameters can be found<br />
starting on page 96).<br />
Do the following to add a base, X table and C rotary table entities to the kinematics model<br />
constructed in the previous section:<br />
46 <strong>ICAM</strong> Technologies Corporation – Proprietary
Step 1: Create the base<br />
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Adding Physical Entities to the Model<br />
� Select “<strong>Machine</strong>01” in the model navigator so that the base will be defined attached to<br />
the machine.<br />
� Select Simulation»Construct Entity»Cube<br />
� Type the following:<br />
–1500 Enter –500 Enter 0 Enter<br />
3000 Enter 1000 Enter 200 Enter<br />
� The Cube properties dialog will then appear.<br />
Type “Base” as the entity name.<br />
� Select the Material button and select or create<br />
a material color (e.g., black plastic looks nice<br />
for a base).<br />
� Press OK.<br />
Step 2: Create the sliding table<br />
� Select “X Axis” in the model navigator so that the sliding table will be defined attached<br />
to the X-axis of the machine. It will then move when the X-axis moves.<br />
� Select Simulation»Construct Entity»Cube<br />
� Type the following:<br />
–1550 Enter –550 Enter 200 Enter<br />
3100 Enter 1100 Enter 50 Enter<br />
� Type “Shroud” as the entity name.<br />
� Select the Material button and select or create<br />
a material color (e.g., silver has a nice metallic<br />
look).<br />
� Press OK.<br />
Step 3: Create the rotary table<br />
� Select “C Table Axis” in the model navigator so that the rotary table will be defined attached<br />
to the C-axis. It will then move when the C-axis moves (and when the X-axis<br />
moves because C is attached to X).<br />
� Select Simulation»Construct Entity»<br />
Cylinder<br />
� Type the following:<br />
0 Enter 0 Enter 250 Enter<br />
500 Enter 50 Enter<br />
� Type “TableTop” as the entity name.<br />
� Select the Material button and select or create<br />
a material color (e.g., pewter).<br />
� Press OK.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 47
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Adding Physical Entities to the Model<br />
After these three steps are complete, the model and navigator should look like the image shown<br />
below. Select the table top in the Model Navigator and then use the X and C axes sliders on the<br />
lower right Axes tab to position and rotate the C-axis table.<br />
48 <strong>ICAM</strong> Technologies Corporation – Proprietary
3.6 Collision Testing<br />
The model as defined so far does not have collision testing<br />
enabled. Without collision testing of the model, VM will not<br />
detect when a tool, part or fixture touches a component of<br />
the machine. However, even with model collision testing<br />
disabled, VM will continue to check for collisions and<br />
gouging between the tool and the part, in-process stock and<br />
fixtures.<br />
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Collision Testing<br />
Setting collision testing for the entire model is a simple step.<br />
Right-mouse on the “<strong>Machine</strong>01” machine object and select<br />
the “Test for collision” menu entry. When the Collision<br />
dialog appears, first select the “Entire branch” radio button,<br />
then select the “Enable” check box, and finally press OK to<br />
set the collision status. A green dot will now be shown in the model navigator in front of each<br />
physical component of the model. This green dot indicates that collision testing is enabled for<br />
that component; a red dot would be shown if collision testing is disabled. Note: if you have been<br />
following the steps up to this point in the manual, the model will now appear in a transparent red<br />
color signifying that its objects are colliding. This will be explained in “Collision Exclusion<br />
Groups” on page 51.<br />
Collision testing takes CPU. Model performance can be improved by only testing for collisions<br />
on objects that are of concern. You can select individual components or a range of components<br />
to apply or remove collision testing.<br />
To apply or remove collision testing; right-mouse on the highest component (hierarchically<br />
speaking) of interest in the navigator and select the “Test for collision” menu entry. You can<br />
enable or disable collision testing on a range of components in the model, starting at the selected<br />
component, as follows:<br />
� Current selection: Sets the collision testing status for the object that was selected. This<br />
choice is only available if the selected object is a physical component.<br />
� Current selection and direct children: Sets the collision testing status for the object that<br />
was selected and all objects directly below it (i.e., a single level only). This choice is only<br />
available if one or more of the objects (i.e., selected or children) are physical components.<br />
� Branch to any axis: Sets the collision testing status for the object that was selected and<br />
all objects in the branch below it, but no further in the branch than any axis component.<br />
Note that a Reference Axis is an “axis” by definition. This choice is only available if at<br />
least one of the objects in the branch is a physical component.<br />
� Branch to movable axis: Sets the collision testing status for the object that was selected<br />
and all objects in the branch below it, but no further in the branch than any movable axis<br />
component. Note that a Reference Axis is not a movable axis. This choice is only available<br />
if at least one of the objects in the branch is a physical component.<br />
� Entire branch: Sets the collision testing status for the object that was selected and all<br />
objects in the branch below it. This choice is only available if at least one of the objects<br />
in the branch is a physical component.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 49
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Collision Testing<br />
The following entries on the dialog will be applied to the range of components selected by your<br />
choice above:<br />
� Enable: Set or clear this check box to enable or disable collision testing on the selected<br />
objects. When multiple objects are involved, a third “grayed” state is available for the<br />
button, which can used to change the safety distance for collision-enabled objects without<br />
affecting the collision state of the objects in the branch.<br />
� Safety zone: Use this field to specify a safe clearance distance around collision enabled<br />
objects. A collision will be signaled when another object intersects with the safety zone,<br />
which is offset from the original surface by the distance specified. Safety zone testing can<br />
use considerably more CPU, so use this feature only where necessary. You can see the effect<br />
of the safety zone around objects by toggling Simulation»Show»Safety Zones from<br />
the menu bar. This field will be blank if the selected objects have different safety settings.<br />
The collision testing status and safety zone value can also be viewed and modified from the<br />
Properties dialog of physical components.<br />
VM tests for collisions only between objects that can move with respect to each other. Another<br />
way of saying it is that VM tests for collisions only between objects that are separated from each<br />
other in the model navigator by a movable axis (i.e., linear, rotary or curve). A collision occurs<br />
when two such objects touch or overlap each other.<br />
Objects are drawn in a red transparent color when colliding, with a highlighted yellow line<br />
marking the intersection between the surfaces of the colliding objects. If the safety zone around<br />
the object is violated, then the safety zone is drawn in a yellow transparent color, with a highlighted<br />
yellow line marking the intersection between the safety zone surface and the surface of<br />
the object that is too close.<br />
Collision testing takes CPU time. Safety zone testing can take considerably more CPU time. You<br />
should disable collision testing for any objects where collision testing is not required.<br />
3.6.1 Collision Groups<br />
All objects that are enabled for collision testing are also<br />
listed in one of the collision groups that can be found in the<br />
navigator window under the Groups»Collision header.<br />
When objects are first enabled for collision, they are added<br />
to the first collision group in this section – “Collision<br />
Group001” by default. Objects can also be enabled for<br />
collision by dragging them from the <strong>Machine</strong>s or Heads<br />
sections of the model navigator to a particular collision<br />
group, or to the Groups»Collision header, which will create<br />
a new group containing the dragged object. You can hold<br />
the Ctrl key down when dragging to also include all dependent<br />
objects in the model navigator tree.<br />
Multiple collision groups can be created for your own organizational purposes, but an object can<br />
only appear in a single collision group at a time. Objects can be easily dragged from one collision<br />
group to the next.<br />
50 <strong>ICAM</strong> Technologies Corporation – Proprietary
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Collision Testing<br />
Delete an object from the collision group to<br />
disable collision testing on that object. You can<br />
also delete the collision group itself, which disables<br />
collision testing on all objects that were in<br />
that group. Finally, you can open the Properties of<br />
a collision group and disable the collision property<br />
of the group. This has the same effect as though the group was deleted (i.e., collision testing will<br />
be disabled on all objects listed), without actually affecting the collision enabled/disabled state of<br />
the objects themselves. This can be very useful for “what if?” testing of the collision behavior of<br />
the model.<br />
3.6.2 Collision Exclusion Groups<br />
In the example machine created to this point, the physical components are touching (i.e., the base<br />
touches the shroud, and the shroud touches the rotary table). When collision testing is enabled on<br />
these objects, they are then displayed as colliding. One way to avoid this problem is to change<br />
the physical definition of objects such that they do not overlap or touch, but this may not always<br />
be practical or even possible. VM has a “collision exclusion” feature that provides a much better<br />
way of handling this problem.<br />
With collision exclusion, you can tell VM to ignore collisions between groups of related objects.<br />
For example, you could group all of the elements of the base of the machine in one exclusion<br />
group, and all of the objects of the head of the machine in another exclusion group. VM will not<br />
test for collisions between any objects that reside in the same group, but it will continue to test<br />
for collisions between those objects and all other collision enabled objects.<br />
Collision exclusion groups can be found in the navigator window under the Groups»Exclusion<br />
header. You create a new group by dragging an object to the Groups»Exclusion header. You add<br />
objects to an existing group by dragging them to the group header. You can also drag an entire<br />
collision group to the exclusion group header to create a new exclusion group. You can create as<br />
many groups as are necessary to handle the collision exclusion requirements of your model. The<br />
same object can appear in multiple exclusion groups. Objects and entire groups can be deleted to<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 51
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Collision Testing<br />
remove collision exclusion relationships. Finally,<br />
you can open the Properties of a collision exclusion<br />
group and disable the exclusion property of<br />
the group. This has the same effect as though the<br />
group was deleted, which can be useful for “what<br />
if?” testing.<br />
GENER and CERUN automatically perform collision exclusion on any objects that are colliding<br />
when the model is first loaded. So left unchanged, the example machine model defined to this<br />
point will properly appear in Gener or CeRun without the base, shroud and table being marked as<br />
colliding. However, it is better practice to not rely on this feature, but instead create exclusion<br />
groups based on your own understanding of how the model behaves. To do so for the example<br />
model, simply drag the “Collision Group001” to the Groups»Exclusion thereby creating a new<br />
“Exclusion Group001”.<br />
52 <strong>ICAM</strong> Technologies Corporation – Proprietary
3.7 Selection Groups<br />
Selection groups are used to combine various objects into a<br />
group, so that selecting any one object in the group has the<br />
same effect as selecting all of the objects in the group. Grouping<br />
related objects in selection groups makes it easier in<br />
GENER and CERUN to select and hide (or unhide) a component<br />
of the machine.<br />
For example, in the sample machine created to this point, the<br />
Shroud and Base objects could be grouped together into a<br />
single selection group, so that at run-time the entire base of the<br />
machine could easily be hidden by a single click followed by a<br />
Simulation»Hide Selection (Ctrl B shortcut) menu selection.<br />
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Selection Groups<br />
Selection groups can be found in the navigator window under the Groups»Selection header. You<br />
create a new group by dragging an object to the Groups»Selection header. You add objects to an<br />
existing group by dragging them to the group header. You can also drag an entire collision or<br />
exclusion group to the selection group header to<br />
create a new selection group. You can create as<br />
many selection groups as are necessary to best<br />
represent the grouping of objects of your model.<br />
Note though that the same object cannot appear in<br />
multiple selection groups. Objects and entire<br />
groups can be deleted to remove the selection relationships. Finally, you can open the Properties<br />
of a selection group and disable the visibility property of the group, so that the group starts off<br />
hidden in GENER and CERUN.<br />
The grouping of objects can make it impossible to select and edit the properties of a particular<br />
object in the simulation window if it is grouped with other objects. For that reason, in QUEST<br />
only, selection grouping can be toggled on and off using the Simulation»Group Selection menu<br />
bar function (and also using the Group button shown circled above on the VM Construct<br />
toolbar).<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 53
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Customizing the Model<br />
3.8 Customizing the Model<br />
Models can be customized using the <strong>ICAM</strong> macro language to perform special actions. The<br />
sample MHERML50 model for example contains a startup macro that closes the front door at the<br />
start of processing.<br />
Model macros are not necessary for normal processing.<br />
Model macros are called when certain events occur, to allow for any special processing needed<br />
to keep the model up to date. Information about the event is passed to the model macro in the<br />
form of $P variables. The following macro types are available:<br />
� A Startup Macro is executed once at the start of<br />
processing.<br />
� A Shutdown Macro is executed once at the end of<br />
processing.<br />
� A Tape Event macro is executed each time a block<br />
of tape (i.e., MCD) is processed.<br />
� A Motion Event macro is executed each time the<br />
model is moved.<br />
� A Rapid Event macro is executed before a positioning<br />
motion.<br />
� A Feed Event macro is executed before all other interpolation<br />
motions.<br />
� A Load Tool Event macro is executed whenever the tool is changed.<br />
Model macros share the same macro environment as the post processor or control emulator,<br />
which gives them full access to system variables and user defined global variables. Model<br />
macros are somewhat restricted in that they cannot generate post processor commands or call<br />
matching macros that in turn generate post processor commands.<br />
Model event macros and simulation function are described starting on page 122.<br />
54 <strong>ICAM</strong> Technologies Corporation – Proprietary
3.9 Testing the Model<br />
Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Testing the Model<br />
The Tools»Start GENER (Ctrl F9) and Tools»Start CERUN (Ctrl Shift F9) menu-bar selections<br />
provide a convenient method of running CERUN and GENER against a model currently being<br />
edited. When testing a model in this manner, it is not necessary to save the model before starting<br />
the test. The standard CERUN or GENER launch panel will appear. When it does, the default<br />
simulation database will show “QUEST – (Models in Memory)” and the model name drop-down<br />
selection will list all of the models out for editing.<br />
Any changes made to the model in QUEST while the test is running will not be seen until CERUN<br />
or GENER is restarted.<br />
Because the test feature does not require a saved model, you might be tempted to go long periods<br />
before saving. You are cautioned to save your work periodically to minimize loss of data caused<br />
by power outages or other serious problems.<br />
The Tools»Test and Tools»Retest menu bar selections cannot be used to test a model.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 55
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Creating <strong>Virtual</strong> <strong>Machine</strong> Models with Quest<br />
Testing the Model<br />
56 <strong>ICAM</strong> Technologies Corporation – Proprietary
4 <strong>Virtual</strong> <strong>Machine</strong> Reference<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference<br />
This section describes the input controls (keys, keyboard shortcuts and mouse actions), toolbar<br />
menus, menu bar selections and macro customization features available with <strong>Virtual</strong> <strong>Machine</strong>.<br />
Reference Table of Contents<br />
4.1 Input Controls ...................................................................................................................... 65<br />
4.1.1 Standard Keyboard Mapping ..................................................................................... 65<br />
4.1.2 Construction Keyboard Mapping .............................................................................. 66<br />
4.1.3 Mouse Mapping ......................................................................................................... 66<br />
4.2 Toolbar ................................................................................................................................. 67<br />
4.2.1 View (CERUN & GENER only) ................................................................................ 67<br />
4.2.2 VM Construct (QUEST only) ................................................................................... 67<br />
4.2.3 VM Mode (CERUN & GENER only) ........................................................................ 69<br />
4.2.4 VM Grid .................................................................................................................... 70<br />
4.2.5 VM View ................................................................................................................... 71<br />
4.2.6 VM View Filter (CERUN & GENER only) ............................................................... 71<br />
4.2.7 VM Animation (CERUN & GENER only) ................................................................. 72<br />
4.2.8 VM Measure (CERUN & GENER only) .................................................................... 73<br />
4.3 Menu Bar .............................................................................................................................. 74<br />
4.3.1 Simulation»<strong>Virtual</strong> <strong>Machine</strong> (CERUN & GENER only) ........................................... 74<br />
4.3.2 Simulation»Controller (CERUN & GENER only) ..................................................... 74<br />
Simulation»Controller: Axes ..................................................................................... 74<br />
Simulation»Controller: Fixture Compensation .......................................................... 75<br />
Simulation»Controller: Tool Compensation.............................................................. 76<br />
Simulation»Controller: Time Line ............................................................................ 77<br />
4.3.3 Simulation»Mode (CERUN & GENER only) ............................................................ 78<br />
Simulation»Mode»Camera ........................................................................................ 78<br />
Simulation»Mode»Selection...................................................................................... 78<br />
Simulation»Mode»Measurement ............................................................................... 78<br />
4.3.4 Simulation»Stock/Fixtures/Part (CERUN & GENER only) ....................................... 79<br />
4.3.5 Simulation»Tools/Holders/Heads (Ctrl Alt T) (CERUN & GENER only) ................ 81<br />
Tools .......................................................................................................................... 81<br />
Lathe Tool Type ................................................................................................. 83<br />
Mill Tool Type ................................................................................................... 85<br />
Holders ....................................................................................................................... 87<br />
Profile Holder Type ............................................................................................ 88<br />
Generic Holder Type .......................................................................................... 89<br />
Heads ......................................................................................................................... 90<br />
4.3.6 Simulation»Construct Entity (QUEST only)............................................................. 91<br />
Simulation»Construct Entity»Cube ........................................................................... 92<br />
Simulation»Construct Entity»Cylinder ..................................................................... 92<br />
Simulation»Construct Entity»Cone ........................................................................... 92<br />
Simulation»Construct Entity»Sphere ........................................................................ 93<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 57
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference<br />
Table of Contents<br />
Simulation»Construct Entity»Revolved .................................................................... 93<br />
Simulation»Construct Entity»Extruded ..................................................................... 94<br />
Simulation»Construct Entity»Mesh........................................................................... 94<br />
Simulation»Construct Entity»Picture ........................................................................ 95<br />
4.3.7 Simulation»Construct Axis (QUEST only) ............................................................... 96<br />
Simulation»Construct Axis»Linear Axis ................................................................... 97<br />
Simulation»Construct Axis»Rotary Axis .................................................................. 97<br />
Simulation»Construct Axis»Curve Axis ................................................................... 98<br />
Simulation»Construct Axis»Tool Axis...................................................................... 99<br />
Simulation»Construct Axis»Stock Axis .................................................................. 100<br />
Simulation»Construct Axis»Head Axis ................................................................... 101<br />
Simulation»Construct Axis»Reference Axis ........................................................... 102<br />
4.3.8 Simulation»Camera ................................................................................................. 103<br />
Simulation»Camera»Fit (Ctrl Space) .................................................................... 103<br />
Simulation»Camera»Center (Ctrl Shift Space) ..................................................... 103<br />
Simulation»Camera»Pivot (Ctrl P) ........................................................................ 103<br />
Simulation»Camera»Attach ..................................................................................... 103<br />
Simulation»Camera»Perspective ............................................................................. 104<br />
Simulation»Camera»Front ....................................................................................... 104<br />
Simulation»Camera»Back ....................................................................................... 104<br />
Simulation»Camera»Top ......................................................................................... 104<br />
Simulation»Camera»Bottom ................................................................................... 104<br />
Simulation»Camera»Left ......................................................................................... 104<br />
Simulation»Camera»Right ...................................................................................... 104<br />
Simulation»Camera»Speed (Ctrl + , Ctrl –) ............................................................ 104<br />
Simulation»Camera»View Angle (Shift + , Shift –) ............................................... 105<br />
Simulation»Camera»Load (Ctrl 0-9) ....................................................................... 105<br />
Simulation»Camera»Save (Ctrl Alt 0-9) ................................................................. 105<br />
Simulation»Camera»Reset ...................................................................................... 105<br />
4.3.9 Simulation»Show .................................................................................................... 106<br />
Simulation»Show»Wireframe ................................................................................. 106<br />
Simulation»Show»Tool Path (Ctrl T) (CERUN & GENER only) ............................ 106<br />
Simulation»Show»Tool Path as Overlay (Ctrl Shift T) (CERUN & GENER only) . 107<br />
Simulation»Show»Filters (CERUN & GENER only) ............................................... 107<br />
Simulation»Show»XY Plane Grid ........................................................................... 108<br />
Simulation»Show»YZ Plane Grid ........................................................................... 108<br />
Simulation»Show»ZX Plane Grid ........................................................................... 108<br />
Simulation»Show»Axes Marker .............................................................................. 108<br />
Simulation»Show»Kinematics ................................................................................ 108<br />
Simulation»Show»Safety Zones .............................................................................. 109<br />
Simulation»Show»Workpiece Coords (Ctrl W) (CERUN only) ............................ 109<br />
Simulation»Show»Display ...................................................................................... 109<br />
Simulation»Show»Next Display (Ctrl D) (CERUN & GENER only) ...................... 109<br />
Simulation»Show»Previous Display (Ctrl Shift D) (CERUN & GENER only) ....... 109<br />
4.3.10 Simulation»Measure ................................................................................................ 110<br />
4.3.11 Simulation»Use World CS (QUEST only).............................................................. 111<br />
4.3.12 Simulation»Group Selection (QUEST only) ........................................................... 111<br />
58 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference<br />
Table of Contents<br />
4.3.13 Simulation»Hide Selection (Ctrl B) ........................................................................ 112<br />
4.3.14 Simulation»Show All/Rehide (Ctrl Alt B) .............................................................. 112<br />
4.3.15 Simulation»Invert Hide State (Ctrl Shift B) ............................................................ 112<br />
4.3.16 Simulation»Grid (Ctrl Alt G) .................................................................................. 113<br />
4.3.17 Simulation»Lights (Ctrl Alt L) ................................................................................ 114<br />
4.3.18 Simulation»Materials (Ctrl Alt M) .......................................................................... 115<br />
4.3.19 Simulation»Display (Ctrl Alt D) ............................................................................. 116<br />
4.3.20 Simulation»Compare (Ctrl Alt Q) ........................................................................... 117<br />
4.3.21 Simulation»Options (Ctrl Alt O) ............................................................................. 118<br />
Animation Control Options ..................................................................................... 118<br />
Tool Path Options .................................................................................................... 118<br />
World Background Color Options ........................................................................... 119<br />
Backface Options ..................................................................................................... 119<br />
Miscellaneous Options ............................................................................................. 119<br />
4.3.22 Simulation»Open Setup (CERUN & GENER only) ................................................. 121<br />
4.3.23 Simulation»Save Setup (CERUN & GENER only) .................................................. 121<br />
4.4 Model Customization ........................................................................................................ 122<br />
4.4.1 The Macro Language ............................................................................................... 123<br />
4.4.1.1 Fundamentals of the Macro Language .................................................................... 123<br />
Basic Macro Syntax ................................................................................................. 124<br />
Macro Data Types .................................................................................................... 124<br />
Macro Variables ....................................................................................................... 126<br />
Detecting Data Type Mismatching ................................................................... 127<br />
Explicit Type Declaration (DECLAR) .................................................................... 127<br />
Array Declaration (RESERV) ................................................................................. 128<br />
Operators .................................................................................................................. 129<br />
Numeric, String and Sequence Operators ........................................................ 129<br />
Logical Operators ............................................................................................. 130<br />
Function Calls .......................................................................................................... 131<br />
External Functions ................................................................................................... 131<br />
4.4.1.2 Flow Control in a Macro ......................................................................................... 132<br />
The IF Block ............................................................................................................ 132<br />
The CASE Statement ............................................................................................... 133<br />
The WHILE Loop .................................................................................................... 133<br />
The REPEAT Loop .................................................................................................. 133<br />
The DO Loop ........................................................................................................... 134<br />
Exiting Loops (EXIT) .............................................................................................. 134<br />
Unconditional Jumps (JUMPTO) ............................................................................ 134<br />
Exiting a Macro (TERMAC) ................................................................................... 135<br />
Ending a Macro (ENDMAC) ................................................................................... 135<br />
4.4.1.3 Macro Invocation .................................................................................................... 135<br />
Enable/Disable Macro Matching (MATCH) ........................................................... 135<br />
Outputting the Matched Record (OUTPUT) ........................................................... 136<br />
4.4.1.4 Text File I/O from a Macro ..................................................................................... 136<br />
Opening a Text File (OPEN) ................................................................................... 136<br />
Closing a Text File (CLOSE) .................................................................................. 136<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 59
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference<br />
Table of Contents<br />
Writing to a Text File (WRITE) .............................................................................. 137<br />
Reading from a Text File (READ) .......................................................................... 137<br />
Reading from a String Value (READ) ..................................................................... 137<br />
4.4.1.5 Other Macro Commands ......................................................................................... 138<br />
Outputting Error Messages (ERROR) ..................................................................... 138<br />
Calling other programs (SYSTEM) ......................................................................... 138<br />
4.4.1.6 String Format Specification ..................................................................................... 139<br />
Output String Format Specifications ....................................................................... 139<br />
Numeric Output Format ................................................................................... 139<br />
String Output Format ........................................................................................ 140<br />
Minor Word Output Format ............................................................................. 140<br />
Logical Output Format ..................................................................................... 141<br />
Wildcard Output Format ................................................................................... 141<br />
ASCII Value Output Format ............................................................................ 141<br />
Input String Format Specifications .......................................................................... 142<br />
Space Input Format Character .......................................................................... 142<br />
Exclamation Input Format Character ............................................................... 142<br />
Numeric Input Format ...................................................................................... 142<br />
String Input Format .......................................................................................... 143<br />
Minor Word Input Format ................................................................................ 143<br />
Logical Input Format ........................................................................................ 143<br />
Skip Character Input Format ............................................................................ 144<br />
Wildcard Input Format ..................................................................................... 144<br />
4.4.2 Model Startup/Shutdown Macros ............................................................................ 145<br />
4.4.2.1 The Model Startup Macro ....................................................................................... 145<br />
4.4.2.2 The Model Shutdown Macro ................................................................................... 145<br />
4.4.3 Model Event Macros ............................................................................................... 146<br />
4.4.3.1 The Tape Event Macro (GENER only) ................................................................... 146<br />
4.4.3.2 The Motion Event Macro ........................................................................................ 146<br />
4.4.3.3 The Rapid Event Macro .......................................................................................... 147<br />
4.4.3.4 The Feed Event Macro ............................................................................................ 147<br />
4.4.3.5 The Load Tool Event Macro ................................................................................... 147<br />
4.4.4 The Dialog Editor .................................................................................................... 148<br />
4.4.4.1 Adding and Deleting Dialogs .................................................................................. 148<br />
4.4.4.2 The Dialog Template Editor .................................................................................... 149<br />
4.4.5 Simulation Macro Functions ................................................................................... 152<br />
4.4.5.1 Function Summary .................................................................................................. 152<br />
4.4.5.2 Mathematical Functions .......................................................................................... 153<br />
The $FACOS Function ............................................................................................ 153<br />
The $FASIN Function ............................................................................................. 153<br />
The $FATAN Function ............................................................................................ 153<br />
The $FATAN2 Function .......................................................................................... 153<br />
The $FCOS Function ............................................................................................... 154<br />
The $FEXP Function ............................................................................................... 154<br />
The $FLN Function ................................................................................................. 154<br />
The $FLOG Function .............................................................................................. 154<br />
The $FSIN Function ................................................................................................ 154<br />
60 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference<br />
Table of Contents<br />
The $FSQRT Function ............................................................................................ 154<br />
The $FTAN Function .............................................................................................. 154<br />
4.4.5.3 Numerical Functions ............................................................................................... 155<br />
The $FABS Function ............................................................................................... 155<br />
The $FFRAC Function ............................................................................................ 155<br />
The $FINT Function ................................................................................................ 155<br />
The $FMAX Function ............................................................................................. 155<br />
The $FMIN Function ............................................................................................... 155<br />
The $FMOD Function ............................................................................................. 156<br />
The $FNINT Function ............................................................................................. 156<br />
The $FSIGN Function ............................................................................................. 156<br />
4.4.5.4 Geometric Functions ............................................................................................... 157<br />
The $FGLNXPL Function ....................................................................................... 157<br />
The $FGLSXSP Function ........................................................................................ 157<br />
The $FGPLPT3 Function ........................................................................................ 158<br />
4.4.5.5 Vector Functions ..................................................................................................... 159<br />
The $FVADD Function ........................................................................................... 159<br />
The $FVANG Function ........................................................................................... 159<br />
The $FVCROSS Function ....................................................................................... 160<br />
The $FVDOT Function ............................................................................................ 160<br />
The $FVLEN Function ............................................................................................ 160<br />
The $FVMULT Function ........................................................................................ 160<br />
The $FVNORM Function ........................................................................................ 160<br />
The $FVROTN Function ......................................................................................... 161<br />
The $FVSUB Function ............................................................................................ 161<br />
4.4.5.6 Matrix Functions ..................................................................................................... 162<br />
The $FMX Function ................................................................................................ 162<br />
The $FMXINV Function ......................................................................................... 163<br />
The $FMXMULT Function ..................................................................................... 163<br />
The $FMXTRFP Function ....................................................................................... 163<br />
The $FMXTRFV Function ...................................................................................... 163<br />
The $FMXTRSP Function ....................................................................................... 163<br />
4.4.5.7 Conversion Functions .............................................................................................. 164<br />
The $FATOF Function ............................................................................................ 164<br />
The $FCVINT Function .......................................................................................... 164<br />
The $FCVREAL Function ....................................................................................... 164<br />
The $FMAJOR Function ......................................................................................... 164<br />
The $FMINOR Function ......................................................................................... 165<br />
4.4.5.8 Conditional Functions ............................................................................................. 166<br />
The $FCHOOSE Function ....................................................................................... 166<br />
The $FIF Function ................................................................................................... 166<br />
The $FISNUM Function .......................................................................................... 167<br />
The $FISSEQ Function............................................................................................ 167<br />
The $FISSTR Function ............................................................................................ 167<br />
The $FISWRD Function .......................................................................................... 167<br />
The $FSWITCH Function ....................................................................................... 167<br />
4.4.5.9 Character and Sequence Functions .......................................................................... 169<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 61
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference<br />
Table of Contents<br />
The $FCHAR Function............................................................................................ 169<br />
The $FEDIT Function .............................................................................................. 169<br />
The $FELEM Function ............................................................................................ 171<br />
The $FFIND Function ............................................................................................. 171<br />
The $FICHAR Function .......................................................................................... 172<br />
The $FINDEX Function .......................................................................................... 172<br />
The $FLEN Function ............................................................................................... 172<br />
The $FMATCH Function ........................................................................................ 172<br />
The $FSEQ Function ............................................................................................... 173<br />
The $FSUBSQ Function .......................................................................................... 173<br />
The $FSUBST Function .......................................................................................... 173<br />
The $FSWRIT Function .......................................................................................... 173<br />
The $FTOLOWR Function ...................................................................................... 174<br />
The $FTOUPER Function ....................................................................................... 174<br />
4.4.5.10 Command Line Functions ....................................................................................... 175<br />
The $FARGC Function............................................................................................ 175<br />
The $FARGV Function ........................................................................................... 175<br />
The $FPNAME and $FPVALUE Functions ........................................................... 175<br />
4.4.5.11 File and Directory Functions ................................................................................... 176<br />
The $FACCESS Function........................................................................................ 176<br />
The $FBASNAM Function...................................................................................... 177<br />
The $FCTIME Function .......................................................................................... 177<br />
The $FDIRNAM Function ...................................................................................... 177<br />
The $FEOF Function ............................................................................................... 178<br />
The $FGETCWD Function ...................................................................................... 178<br />
The $FSETCWD Function ...................................................................................... 178<br />
The $FSTAT Function ............................................................................................. 178<br />
4.4.5.12 <strong>Virtual</strong> <strong>Machine</strong> General Functions ........................................................................ 180<br />
The $FMSADPT Function ...................................................................................... 181<br />
The $FMSATA Function ......................................................................................... 181<br />
The $FMSBTC Function ......................................................................................... 181<br />
The $FMSCMRA Function ..................................................................................... 182<br />
The $FMSETC Function ......................................................................................... 182<br />
The $FMSGDCV Function...................................................................................... 182<br />
The $FMSGFCV Function ...................................................................................... 182<br />
The $FMSGLCV Function ...................................................................................... 183<br />
The $FMSGOUG Function ..................................................................................... 184<br />
The $FMSID Function ............................................................................................. 184<br />
Named Component ID ...................................................................................... 184<br />
Head Component ID ......................................................................................... 185<br />
Tool Component ID .......................................................................................... 185<br />
Stock Axis Component ID ................................................................................ 185<br />
Child Component ID ........................................................................................ 186<br />
The $FMSIDN Function .......................................................................................... 186<br />
The $FMSIDT Function .......................................................................................... 186<br />
The $FMSLCS Function.......................................................................................... 187<br />
The $FMSMAX Function........................................................................................ 187<br />
62 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference<br />
Table of Contents<br />
The $FMSMOVE Function ..................................................................................... 187<br />
The $FMSMSP Function ......................................................................................... 188<br />
The $FMSPCK Function ......................................................................................... 188<br />
The $FMSSDCV Function ...................................................................................... 188<br />
The $FMSSFCV Function ....................................................................................... 188<br />
The $FMSSLAV Function ...................................................................................... 189<br />
The $FMSSLCV Function ....................................................................................... 189<br />
The $FMSTRN Function ......................................................................................... 190<br />
4.4.5.13 <strong>Virtual</strong> <strong>Machine</strong> Channel Functions ........................................................................ 191<br />
The $FMSACH Function ........................................................................................ 191<br />
The $FMSDCH Function ........................................................................................ 192<br />
The $FMSGAX Function ........................................................................................ 192<br />
The $FMSGCH Function ........................................................................................ 192<br />
The $FMSNCH Function ........................................................................................ 193<br />
The $FMSRAX Function ........................................................................................ 193<br />
The $FMSWCH Function........................................................................................ 193<br />
4.4.5.14 <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions ............................................. 194<br />
The $FMSCEZ Function ......................................................................................... 195<br />
The $FMSGCS Function ......................................................................................... 195<br />
The $FMSLSR Function.......................................................................................... 196<br />
The $FMSPDAT Function ...................................................................................... 197<br />
The $FMSPPOS Function ....................................................................................... 197<br />
The $FMSPRID Function ........................................................................................ 198<br />
The $FMSPROB Function ...................................................................................... 198<br />
The $FMSVCL Function ......................................................................................... 199<br />
Single Component Collision Status .................................................................. 199<br />
Aggregate Component Collision Status ........................................................... 199<br />
Component Pair Collision Status...................................................................... 200<br />
4.4.5.15 Other Functions ....................................................................................................... 201<br />
The $FDIALOG Function ....................................................................................... 201<br />
The $FDIST Function .............................................................................................. 202<br />
The $FERSEV Function .......................................................................................... 202<br />
The $FERSTA Function .......................................................................................... 202<br />
The $FERTXT Function .......................................................................................... 202<br />
The $FGETDEF Function ....................................................................................... 202<br />
The $FGETENV Function ....................................................................................... 203<br />
The $FPAUSE Function .......................................................................................... 203<br />
The $FSORT Function ............................................................................................ 203<br />
4.4.6 Simulation Macro Variables .................................................................................... 205<br />
4.4.6.1 Variable Summary ................................................................................................... 205<br />
4.4.6.2 Variables Defining Constants .................................................................................. 206<br />
4.4.6.3 <strong>Virtual</strong> <strong>Machine</strong> Variables ...................................................................................... 207<br />
4.4.6.4 <strong>Machine</strong> & Workpiece Coordinate Variables ......................................................... 209<br />
4.4.6.5 Motion-Related Variables ....................................................................................... 210<br />
4.4.6.6 Cutter Compensation Variables ............................................................................... 213<br />
4.4.6.7 Tooling Variables .................................................................................................... 214<br />
4.4.6.8 MCD/Tape Variables .............................................................................................. 215<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 63
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference<br />
Table of Contents<br />
4.4.6.9 Error Message Variables ......................................................................................... 216<br />
4.4.6.10 Miscellaneous Variables .......................................................................................... 217<br />
64 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.1 Input Controls<br />
4.1.1 Standard Keyboard Mapping<br />
Ctrl<br />
Alt<br />
Shift<br />
Key<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Input Controls<br />
Standard Keyboard Mapping<br />
Description Menu<br />
■<br />
Hide selected objects Sim»Hide Selection<br />
■ ■ B Invert hidden state for all objects Sim»Invert Hide State<br />
■ ■ Show all or re-hide hidden objects Sim»Show All/Rehide<br />
■<br />
Cycle heads-up display in normal order Sim»Show»Next<br />
■ ■ D Cycle heads-up display in reverse order Sim»Show»Previous<br />
■ ■ Open Display dialog Sim»Display<br />
■ ■ G Open Grid dialog Sim»Grid<br />
■ ■ L Open Lights dialog Sim»Lights<br />
■ ■ M Open Materials dialog Sim»Material<br />
■ ■ O Open Options dialog Sim»Options<br />
■ P Set camera pivot to selected object Sim»Camera»Pivot<br />
■<br />
■ ■<br />
Q<br />
Toggle on-screen measurement tracking<br />
Open Compare dialog<br />
Sim»Compare…<br />
Sim»Compare<br />
■ ■ S Open Stock/Fixture/Part dialog Sim»Stock<br />
■<br />
Toggle tool path trace Sim»Show»Tool Path<br />
■ ■ T Toggle tool path overlay trace Sim»Show»Tool Path as<br />
■ ■ Open Tool/Holder/Head dialog Sim»Tools<br />
■ W Toggle workpiece coordinate display Sim»Show»Workpiece<br />
■<br />
■ ■<br />
0-9<br />
Switch to one of 10 user-defined viewpoints<br />
Record one of 10 user-defined viewpoints<br />
Sim»Camera»Load<br />
Sim»Camera»Save<br />
■<br />
■ ■<br />
space<br />
Fit selected object in view<br />
Center camera on selected object<br />
Sim»Camera»Fit<br />
Sim»Camera»Center<br />
■<br />
■<br />
+<br />
Increase default camera motion step size<br />
Increase camera view angle<br />
Sim»Camera»Speed �<br />
Sim»Camera»View �<br />
■<br />
■<br />
–<br />
Decrease default camera motion step size<br />
Decrease camera view angle<br />
Sim»Camera»Speed �<br />
Sim»Camera»View �<br />
■<br />
�<br />
Pan camera forward<br />
Slowly pan camera forward<br />
■<br />
�<br />
Pan camera backward<br />
Slowly pan camera backward<br />
Pan camera left<br />
■<br />
■<br />
�<br />
Slowly pan camera left<br />
Roll camera cclw to nearest 90°<br />
■ ■ Roll camera cclw 1°<br />
■<br />
�<br />
Pan camera right<br />
Slowly pan camera right<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 65
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Input Controls<br />
Construction Keyboard Mapping<br />
Ctrl<br />
Alt<br />
Shift<br />
Key<br />
Description Menu<br />
■<br />
■ ■<br />
�<br />
Roll camera clw to nearest 90°<br />
Roll camera clw 1°<br />
Page Pan camera upward<br />
■ Up Slowly pan camera upward<br />
Page Pan camera downward<br />
■ Down Slowly pan camera downward<br />
Selection: toggle replace/add selection<br />
■<br />
Construction: toggle snap-to-grid<br />
Panning: switch to minimum speed<br />
Rotation: toggle look/turn around<br />
Selection: toggle Camera mode<br />
■<br />
Measurement: toggle Camera mode<br />
Construction: toggle Camera mode<br />
Camera: toggle Selection mode<br />
4.1.2 Construction Keyboard Mapping<br />
Ctrl<br />
Alt<br />
Shift<br />
Key<br />
Description<br />
0-9 . Enter numeric value for current input field<br />
Backspace<br />
Remove last character entered into current input field<br />
– Toggle sign of current numeric input field<br />
Enter Set input field to mouse position (if empty) and advance to next field<br />
■<br />
Tab<br />
Advance to next field<br />
Return to previous field<br />
Esc Cancel construction<br />
4.1.3 Mouse Mapping<br />
Mouse Button Description<br />
Left<br />
Selection: Select/Unselect object under cursor<br />
Measurement: Select object under cursor<br />
Camera: Rotate camera<br />
Construction: Set input field value(s) using mouse position<br />
Middle Pan left, right, upward and downward<br />
Right Pop-up context menu<br />
Wheel Pan forward and backward<br />
66 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.2 Toolbar<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Toolbar<br />
View (CeRun & Gener only)<br />
Toolbars provide quick and easy access to the most commonly used controls. Toolbars can be<br />
activated or hidden using the Tools»Toolbar menu selection, which opens the Toolbars dialog.<br />
With CERUN and GENER, toolbars can also be activated or hidden using a right-mouse context<br />
menu from the application window background. Toolbars are dockable, meaning that you can<br />
drag a toolbar to any of the four sides of the main window. Toolbars can also be undocked by<br />
dragging them away from the sides (or by holding the Ctrl key). This section describes the<br />
<strong>Virtual</strong> <strong>Machine</strong> toolbars and their associated functions and short-cut keys.<br />
Not all toolbars and toolbar functions are available in all products. If a toolbar is not universally<br />
available, the applicable products are listed in the title.<br />
4.2.1 View (CERUN & GENER only)<br />
The View toolbar is one of the standard toolbars available with the CERUN and GENER<br />
UI. This toolbar has buttons that control the visibility of windows used to trace the inputs<br />
and outputs of the process. Two of these buttons are unique to VM, as follows:<br />
Simulation»<strong>Virtual</strong> <strong>Machine</strong>: Activates/deactivates the main simulation window.<br />
Simulation»Controller: Activates/deactivates the virtual controller window, which is<br />
used to jog axes, set tool and fixture compensation, as well as to replay the simulation at<br />
any point in time.<br />
4.2.2 VM Construct (QUEST only)<br />
Simulation»Use World CS: When selected, object coordinates are listed in world coordinates,<br />
originating from the center of the grids. When unselected, an object‟s coordinates<br />
are listed relative to its parent (i.e., in local coordinates). This button also affects<br />
the placement of objects copied from one place to another in the model navigator. When<br />
world coordinates are selected, the object retains its position despite being moved or copied<br />
from one place to another in the navigator hierarchy. When local coordinates are selected,<br />
the object is placed relative to its new parent at the same offset it was originally at<br />
relative to its old parent.<br />
Simulation»Group Selection: When selected, picking any component of a group will<br />
select the entire group. Objects can be grouped into larger components, for selection purposes,<br />
in the 3D Models»Groups»Selection section of the model navigator.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 67
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Toolbar<br />
VM Construct (Quest only)<br />
Simulation»Construct Entity»Cube: Creates a cubic entity, given an XYZ origin and<br />
the width, length and height of the cube. Once created, the cube can be further rotated to<br />
the required orientation.<br />
Simulation»Construct Entity»Cylinder: Creates a cylindrical entity, given an XYZ<br />
origin and the radius and height of the cylinder. Once created, the cylinder can be further<br />
rotated to the required orientation. The starting and ending radii can also be modified.<br />
Simulation»Construct Entity»Cone: Creates a conical entity, given an XYZ origin,<br />
base radius and height of the cone. Once created, the cone can be further rotated to the<br />
required orientation. The starting and ending radii can also be modified.<br />
Simulation»Construct Entity»Sphere: Creates a spherical entity, given an XYZ origin<br />
and radius of the sphere. Once created, the sphere can be further rotated to the required<br />
orientation. The “number of subdivisions” controls the smoothness of the sphere, with a<br />
value 0 producing a (20 face) icosahedron, and increasing subdivisions increases the faces<br />
by a factor of 3. A maximum of 6 subdivisions is permitted (very CPU intensive).<br />
Simulation»Construct Entity»Revolved: Sweeps a 2D profile over a complete or partial<br />
arc to produce a surface of revolution. The profile is defined as a series of (radius,<br />
height) pairs of coordinates, which is swept around the Z-axis. Once created, the surface<br />
can be further rotated to the required orientation.<br />
Simulation»Construct Entity»Extruded: Sweeps a 2D closed profile along a vector to<br />
produce an extruded surface. The profile is defined as a series of (x, y) pairs of coordinates,<br />
joined at the start an end, which is extruded along a vector (positive Z by default)<br />
for a specified distance. Once created, the surface can be further rotated to the required<br />
orientation.<br />
Simulation»Construct Entity»Mesh: Imports an STL mesh into the model. Once imported,<br />
the mesh surface can be further scaled and rotated to its required size and orientation.<br />
Simulation»Construct Entity Picture: Loads a bitmap image, given the point in the<br />
model for the lower left corner of the image, and the X-axis width and Y-axis height of<br />
the image in model coordinates. The picture can be rotated to the required orientation.<br />
Simulation»Construct Axis»Linear Axis: Creates a linear axis, given a point of origin<br />
and the direction and range of motion.<br />
Simulation»Construct Axis»Rotary Axis: Creates a rotary axis, given a point of origin,<br />
the rotation axis and an optional range of motion.<br />
Simulation»Construct Axis»Curve Axis: Creates a curved axis, given a point of origin<br />
and an open or closed 2D profile. The profile is defined as a series of (x, y) pairs of coordinates.<br />
The curved axis can be further rotated the required orientation.<br />
68 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Toolbar<br />
VM Mode (CeRun & Gener only)<br />
Simulation»Construct Axis»Tool Axis: Creates a tool reference point that can identify<br />
one of: the SCP of the machine, a specific pocket in the tool changer, or other named<br />
places where tools might be attached.<br />
Simulation»Construct Axis»Stock Axis: Creates a part reference point that identifies<br />
where fixtures and parts are loaded on the machine.<br />
Simulation»Construct Axis»Head Axis: Creates a head reference point that can identify<br />
one of: the head attachment point on the machine, head storage locations for inactive<br />
heads, and other places where heads might be attached.<br />
Simulation»Construct Axis»Reference Axis: Creates a reference point in the model.<br />
Reference points are used to group related entities.<br />
4.2.3 VM Mode (CERUN & GENER only)<br />
Simulation»Mode»Camera: Selects “camera” mode, which is equivalent to selecting<br />
the “Default to camera mode” check box in the Simulation»Options (Ctrl Alt O) Misc<br />
settings. The left-mouse button will subsequently control the orientation of the camera.<br />
The mouse pointer will appear as a four-way arrow. Hold the Ctrl key down to temporarily<br />
(while the key is held) switch to “selection” mode.<br />
Simulation»Mode»Selection: Selects “selection” mode, which is equivalent to clearing<br />
the “Default to camera mode” check box in the Simulation»Options (Ctrl Alt O) Misc<br />
settings. The left-mouse button will subsequently select objects. The mouse pointer will<br />
appear as an arrow. Hold the Ctrl key down to temporarily (while the key is held) switch<br />
to “camera” mode.<br />
Simulation»Mode»Measurement: Selects “measurement” mode. The left-mouse button<br />
will subsequently select objects for measurement purposes. The mouse pointer will appear<br />
as caliper/square combination. Hold the Ctrl key down to temporarily (while the key<br />
is held) switch to “camera” mode.<br />
Simulation»Show»Wireframe: Activates or deactivates wire-frame rendering of the<br />
simulation window.<br />
Simulation»Show»Display: Activates or deactivates the heads-up status display that<br />
floats above the simulation window. The HUD is not available with QUEST.<br />
Simulation»Show»Tool Path (Ctrl T): Activates or deactivates the display of the tool<br />
path trace in the simulation window. Trace data is always recorded, regardless of the display<br />
setting. Tool path trace functions are not available with QUEST.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 69
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Toolbar<br />
VM Grid<br />
Simulation»Show»Tool Path as Overlay (Ctrl Shift T): When selected, the tool path<br />
trace is always visible, even when the tool path is behind objects that would normally obscure<br />
the trace. Tool path trace functions are not available with QUEST.<br />
4.2.4 VM Grid<br />
The VM Grid toolbar contains a drop-down list of all axes defined in the model (including<br />
tool, head and stock axes). The grid reference zero and orientation will be with respect<br />
to the selected axis. The standard viewpoint settings in the VM View toolbar are<br />
also with respect to the selected grid axis.<br />
Simulation»Show»XY Plane Grid: Activates or deactivates the XY plane grid. Line<br />
spacing, colors, units and other settings are controlled by selecting Simulation»Grid<br />
(Ctrl G shortcut).<br />
Simulation»Show»YZ Plane Grid: Activates or deactivates the YZ plane grid.<br />
Simulation»Show»ZX Plane Grid: Activates or deactivates the ZX plane grid.<br />
Simulation»Show»Axes Marker: Activates or deactivates the axes marker showing the<br />
origin. Marker size, colors and other settings are controlled by selecting Simulation»Grid<br />
(Ctrl G shortcut).<br />
Simulation»Show»Kinematics: Activates or deactivates the kinematics markers showing<br />
the type and position of linear axes, rotary axes, and the TCP and SCP control point<br />
positions.<br />
Simulation»Show»Safety Zones: Activates or deactivates the display of the safety zone<br />
that surrounds objects that have a safe distance setting for collision testing. The safety<br />
zone is drawn with a fixed transparent color, so that the underlying object can also be<br />
seen.<br />
Simulation»Grid (Ctrl Alt G): Activates or deactivates the “snap-to-grid” mode of object<br />
construction using the mouse. When activated, mouse coordinates snap to a defined<br />
grid size. Hold the Shift key to temporarily (while the key is held) reverse the snap-togrid<br />
setting. Grid spacing can also be set by selecting Simulation»Grid.<br />
70 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.2.5 VM View<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Toolbar<br />
VM View<br />
The 6 middle buttons on the VM View toolbar lock the simulation window camera rotation<br />
to one of 6 standard views, with respect to the axis selected in the VM Grid toolbar.<br />
While any one of these 6 buttons is selected, camera rotation functions are disabled and<br />
the camera can be panned only.<br />
Simulation»Camera»Perspective: Switches to a 3D Perspective view of the simulation<br />
window. When deselected, switches to an Orthogonal view of the simulation window.<br />
Simulation»Camera»Front: Switches to a front view of the simulation window.<br />
Simulation»Camera»Back: Switches to a back view of the simulation window.<br />
Simulation»Camera»Top: Switches to a top view of the simulation window.<br />
Simulation»Camera»Bottom: Switches to a bottom view of the simulation window.<br />
Simulation»Camera»Left: Switches to a left side view of the simulation window.<br />
Simulation»Camera»Right: Switches to a right side view of the simulation window.<br />
Simulation»Camera»Fit: Fits the selected object(s) in the simulation window view.<br />
4.2.6 VM View Filter (CERUN & GENER only)<br />
Simulation»Show»Filters»<strong>Machine</strong>: Activates or deactivates the display of the machine<br />
model and any head components.<br />
Simulation»Show»Filters»Tools: Activates or deactivates the display of the tools.<br />
Simulation»Show»Filters»Fixtures: Activates or deactivates the display of the fixtures.<br />
Simulation»Show»Filters»Stock: Activates or deactivates the display of the initial<br />
stock.<br />
Simulation»Show»Filters»Parts: Activates or deactivates the display of the finished<br />
parts.<br />
Simulation»Show»Filters»In-process Stock: Activates or deactivates the display of the<br />
in-process stock, as calculated by the Material Removal Simulation option.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 71
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Toolbar<br />
VM Animation (CeRun & Gener only)<br />
Simulation»Show»Filters»Boolean Overcut: Activates or deactivates the display of<br />
gouges in the finished part, as calculated by the Material Removal Simulation option.<br />
Simulation»Show»Filters»Boolean Undercut: Activates or deactivates the display of<br />
excess stock material, as calculated by the Material Removal Simulation option.<br />
Simulation»Show»Filters»Colorized Boolean: Activates or deactivates the display of a<br />
color graduated difference between stock and part, as calculated by the Material Removal<br />
Simulation option. Select Simulation»Compare (Ctrl Alt Q) to view or modify comparison<br />
settings. Colorized differences are available only when one or both of the Overcut or<br />
Undercut buttons are selected.<br />
Simulation»Show»Filters»Transparent Zero: Modifies the display of colorized differences<br />
between stock and part to either show in a transparent color, or not show, all faces<br />
of the gouge or excess material that are within an acceptable tolerance with respect to the<br />
part.<br />
4.2.7 VM Animation (CERUN & GENER only)<br />
Selects continuous animation mode, which is equivalent to selecting “Continuous” in the<br />
Simulation»Options (Ctrl Alt O) Animation control settings. Select this method to slow<br />
the simulation down to some factor of real time, as controlled by the slider.<br />
Selects stepped animation mode, which is equivalent to selecting “Motion Step” in the<br />
Simulation»Options (Ctrl Alt O) Animation control settings. Select this method to refresh<br />
the display after every step number of motions, as controlled by the slider.<br />
Selects timed refreshed animation mode, which is equivalent to selecting “Time Interval”<br />
in the Simulation»Options (Ctrl Alt O) Animation control settings. Select this method to<br />
refresh the display after every interval number of seconds, as controlled by the slider.<br />
72 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.2.8 VM Measure (CERUN & GENER only)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Toolbar<br />
VM Measure (CeRun & Gener only)<br />
The buttons on the VM Measure toolbar are only available while in measurement mode,<br />
as set using the button on the VM Mode toolbar or Simulation»Mode»Measurement<br />
menu bar. The 3 middle buttons are filters that enable or disable picking of the various<br />
components of the triangles that make up the in-process stock.<br />
Simulation»Measure»Fan: Switches between chained (one to the next) and fanned (one<br />
to many) measurements.<br />
Simulation»Measure»Vertex: Enables or disables the picking of points on the boundary<br />
of the triangles that make up the in-process stock object.<br />
Simulation»Measure»Edge: Enables or disables the picking of edges of the triangles<br />
that make up the in-process stock object.<br />
Simulation»Measure»Triangle: Enables or disables the picking of faces of the triangles<br />
that make up the in-process stock object.<br />
Simulation»Measure»Overlay: When enabled, the objects selected for measurement<br />
will always be visible, no matter how the camera is oriented.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 73
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»<strong>Virtual</strong> <strong>Machine</strong> (CeRun & Gener only)<br />
4.3 Menu Bar<br />
<strong>Virtual</strong> machine can be nearly completely controlled from the Simulation menu bar selection.<br />
4.3.1 Simulation»<strong>Virtual</strong> <strong>Machine</strong> (CERUN & GENER only)<br />
Activates the <strong>Virtual</strong> <strong>Machine</strong> main simulation<br />
window if inactive or minimized. Deactivates<br />
the simulation window if already active. This<br />
window can also be toggled from the View<br />
toolbar.<br />
See “Navigating the Simulation Window” on<br />
page 13 for details on how to manipulate your<br />
viewpoint in the main simulation window.<br />
It is important to note that collision and<br />
overtravel detection (CERUN and GENER) and<br />
collision avoidance (GENER) are not affected in any way by the state of the simulation window.<br />
4.3.2 Simulation»Controller (CERUN & GENER only)<br />
Activates the <strong>Virtual</strong> <strong>Machine</strong> Controller<br />
window if inactive or minimized. Deactivates<br />
the VM Controller window if already active.<br />
This window can also be toggled from the<br />
View toolbar.<br />
The VM Controller window has tabs to support<br />
the following functions, each of which are<br />
described in the sections that immediately<br />
follow:<br />
� Jogging model axes (below)<br />
� Setting fixture compensation (on page 75)<br />
� Setting tool compensation (on page 76)<br />
� Replaying the simulation (on page 77)<br />
Simulation»Controller: Axes<br />
Provides interactive motion control over the axes of the model when processing is in a paused<br />
state. The sliders move each axis through its available range of travel. Linear axes positions are<br />
listed in the units selected in the Unit drop-down list. For rotary axes with unlimited travel,<br />
sliders move the axis through �405º of travel. Axes can be moved to any position (within travel<br />
or otherwise) by entering a value in the input-field next to the slider. When the Enable tooltip<br />
check box is selected, resting the mouse pointer over an axis name, slider bar or input-field, will<br />
pop-up a tool-tip dialog showing the minimum, maximum and current axis position.<br />
74 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Controller (CeRun & Gener only)<br />
When Simulation»Show»Workpiece Coords (Ctrl W shortcut) is in effect, the linear axes values<br />
are the local coordinates with respect to part zero instead of model axes values. (CERUN only)<br />
Select Reset All Axes to reset all axes to the last interpolated position (i.e., to the positions they<br />
were at before they were changed via the slider or position input field). Axes are automatically<br />
reset whenever processing is continued. Note that it is not possible to interactively set an axis<br />
position and continue processing with the axis at that set position.<br />
The spindle state can also be interactively controlled and tested from Axes tab. First, select the<br />
spindle identifier in the Spindles drop-down selection field and then press one of the buttons<br />
immediately to the right as follows:<br />
Toggles on and off the selected spindle. Any objects attached to the spindle will be swept<br />
around the spindle axis to create the volume that will then be used for collision detection<br />
and material removal. When the spindle is turning, the swept volume is displayed as a<br />
solid object. When the spindle is subsequently stopped, the swept volume continues to be<br />
shown in a transparent color (representing the fact that the position of the spindle is unknown),<br />
with the unswept object shown inside for reference purposes.<br />
Stops and locks the selected spindle.<br />
Places the selected spindle in neutral.<br />
Orients the selected spindle to the angle specified in the field immediately to the right of<br />
the button. The swept profile is no longer used once a spindle is oriented, since its position<br />
is then known.<br />
Computation of swept volume from a 3D shape can be CPU intensive.<br />
Simulation»Controller: Fixture Compensation<br />
This tab provides control of fixture compensation<br />
(also known as work piece compensation).<br />
It is important to accurately set appropriate<br />
fixture compensation amounts if non-zero<br />
fixture compensation amounts will be used at<br />
the machine.<br />
Fixture compensation offsets are identified by<br />
an integer ID number ranging from 1 up to the<br />
number of different offsets available on the<br />
CNC. For example, on a CNC with G54<br />
through G59 codes defining fixture compensation,<br />
ID number 1 would represent G54, ID number 2 would represent G55, and so on, up to ID<br />
number 6 for G59. Select the Add button to define the compensation amounts for a particular ID.<br />
Fixture compensation is defined by the control emulator or post-processor, not the model. If<br />
fixture compensation is not defined in the CE or PP, then the Add button will not be available.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 75
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Controller (CeRun & Gener only)<br />
The offset amounts are entered and listed in the units specified in the Unit drop-down list.<br />
Double-click on an axis entry to change its value. Use the Tab and Shift Tab keys to quickly<br />
move between entries. Press the Set button to set the offset values of the selected ID lines to the<br />
current Axes positions (as set via the Axes tab). Press the Zero button to quickly zero the offset<br />
values of the selected ID lines. You can completely remove an offset ID by selecting the entire<br />
line and pressing the Delete key.<br />
By default, only the primary linear axes are listed. Select the<br />
Advanced button if it is necessary to choose other axes that<br />
can be offset using fixture compensation on the CNC. For<br />
example, if the CNC has the ability to offset rotary axes, you<br />
should select the Advanced button, choose the rotary axis from<br />
the list of available axes, and then press the center Add button<br />
to include that rotary axis in the list of axes that can be compensated.<br />
You can later disable compensation for any axis<br />
other than a primary linear, by first selecting it in the list of<br />
axes in use and then pressing the center Remove button (the<br />
center button label dynamically changes between Add and<br />
Remove depending on the axis selected).<br />
Base compensation is always available, whether fixture compensation is supported or not. The<br />
base compensation amounts are added to the axes position, regardless of the fixture compensation<br />
state in effect on the CNC. Base compensation should to be used to handle the case where<br />
the machine operator must manually reset the zero point of the machine to match some reference<br />
point on the fixture or part. This is common on older controls that do not have fixture compensation<br />
abilities.<br />
The currently active fixture compensation ID can be seen in simulation window heads-up display<br />
by activating the “Active Compensations” check box in the Simulation»Display dialog<br />
(Ctrl Alt D shortcut).<br />
Fixture compensation data is automatically saved in the verification setup (.vsw) file when the<br />
program is completed. This setup file will be reused on subsequent runs to quickly reestablish the<br />
workpiece compensation settings necessary for an accurate simulation.<br />
Simulation»Controller: Tool Compensation<br />
This tab provides control of tool length and<br />
tool diameter compensation. It is important to<br />
accurately set appropriate tool compensation<br />
amounts if non-zero compensation amounts<br />
will be used at the machine.<br />
Tool length and tool diameter compensation<br />
offsets can be associated with the tool ID, or<br />
they can be defined as a simple table of offsets.<br />
When compensation is defined with respect to<br />
the tool, each offset is identified by the combi-<br />
76 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Controller (CeRun & Gener only)<br />
nation of its tool number and the offset ID for that specific tool (e.g., tool 12, offset 1). Otherwise,<br />
the compensation is defined as a simple offset ID (e.g., offset 12). Select the appropriate<br />
Add button to define the length or diameter compensation amounts for a particular offset. Tool<br />
length and diameter compensation are defined by the control emulator or post-processor, not the<br />
model. If tool length or diameter compensation is not defined in the CE or PP, then the appropriate<br />
Add button will not be available.<br />
The offset amounts are entered and listed in the units specified in the Unit drop-down list.<br />
Double-click on an axis or diameter entry to change its value. Use the Tab and Shift Tab keys to<br />
quickly move between entries. Press the Set button to set the offset values of the selected ID<br />
lines to the current Axes positions (as set via the Axes tab). Press the Zero button to quickly zero<br />
the offset values of the selected ID lines. You can completely remove an offset ID by selecting<br />
the entire line and pressing the Delete key.<br />
The currently active length and diameter compensation IDs can be seen in simulation window<br />
heads-up display by activating the “Active Compensations” check box in the Simulation»Display<br />
dialog (Ctrl Alt D shortcut).<br />
Tool compensation data is automatically saved in the verification setup (.vsw) file when the<br />
program is completed. This setup file will be reused on subsequent runs to quickly reestablish the<br />
tool compensation settings necessary for an accurate simulation.<br />
Simulation»Controller: Time Line<br />
This tab provides control over the Timeline<br />
review and replay function of VM.<br />
The Timeline shows the collision and axes<br />
overtravel state of the simulation in a timegraph<br />
format. Pause the simulation to select<br />
any point in time with the left-mouse button;<br />
the simulation window will update to show the<br />
state of the simulation at that time. You can<br />
also drag the mouse pointer left and right to<br />
cause the simulation window to replay the<br />
motion events backwards and forwards in<br />
time.<br />
See “VM Controller Timeline” on page 33 for more details.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 77
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Mode (CeRun & Gener only)<br />
4.3.3 Simulation»Mode (CERUN & GENER only)<br />
Simulation»Mode»Camera<br />
When the Camera mode menu bar selection is active, holding the<br />
left-mouse button down while moving the mouse changes the<br />
orientation of the camera. The cursor appears as a four-way arrow<br />
when in Camera mode. This mode can also be activated by selecting the circled button in the VM<br />
Mode toolbar above. While in Camera mode, you can press and hold the Ctrl key to temporarily<br />
switch to Selection mode. This can be used to quickly select objects to rotate about or to attach<br />
the camera to.<br />
There are two types of camera rotation.<br />
1. The default rotation is to keep the camera position fixed but to change where the camera is<br />
aimed. This is similar to how we rotate our head to look around a scene.<br />
2. You can hold the Shift key to change how the camera rotates. When Shift is pressed, the<br />
camera rotates around a point in space. This rotation point is by default the center of the<br />
world or the selected VM Grid object, but can be changed by selecting any object and choosing<br />
Simulation»Camera»Pivot (Ctrl P). As a quick shortcut, double-clicking an object in the<br />
simulation window will set that object as the Pivot center and fit the object in the window.<br />
If you prefer the second form of camera rotation by default, clear the “Default to Look-Around<br />
camera” check-box in the Simulation»Options (Ctrl Alt O) dialog.<br />
Simulation»Mode»Selection<br />
When the Selection mode menu bar selection is active, pressing<br />
the left-mouse button selects the object under the mouse pointer.<br />
The cursor appears as a simple arrow when in Selection mode.<br />
Thus mode can also be activated by selecting the circled button in the VM Mode toolbar above.<br />
While in Selection mode, you can press and hold the Ctrl key to temporarily switch to Camera<br />
mode. This can be used to get a better view of the object you are trying to select.<br />
Selection mode is useful when developing models with QUEST, or to select objects to make them<br />
transparent, or to hide selected objects using the Simulation»Hide Selection (Ctrl B) menu bar<br />
selection.<br />
Simulation»Mode»Measurement<br />
When the Measurement mode menu bar selection is active,<br />
pressing the left-mouse button selects the object under the mouse<br />
pointer for measurement purposes. Measurements can be taken<br />
between any objects, including in-process stock. The cursor appears as an arrow with calipers<br />
when in Measurement mode and measurements are shown in the simulation window. Measurement<br />
mode can also be activated by selecting the circled button in the VM Mode toolbar above.<br />
While in Measurement mode, you can press and hold the Ctrl key to temporarily switch to<br />
Camera mode.<br />
78 <strong>ICAM</strong> Technologies Corporation – Proprietary
Within VM, objects are<br />
constructed of triangles.<br />
The VM Measure<br />
toolbar provides a middle series of three toggle<br />
buttons that filter the parts of the triangles that<br />
can be selected with the mouse. The left-most<br />
toggle on the VM Measure toolbar switches<br />
between chained (one to the next) and fanned<br />
(one to many) measurements. The rightmost<br />
toggle, when selected, ensures that objects<br />
being measured are always visible.<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Stock/Fixtures/Part (CeRun & Gener only)<br />
Measurement information appears in the form of a small HUD (heads-up display) in the simulation<br />
window.<br />
4.3.4 Simulation»Stock/Fixtures/Part (CERUN & GENER only)<br />
This menu bar selection provides the<br />
ability to add rough stock, fixtures and<br />
final parts to the simulation.<br />
This information is stored in a 3D model<br />
(.m3d) file, in the same directory and with<br />
the same name as the verification setup<br />
(.vsw) file. These two files are automatically<br />
saved when the program is completed,<br />
and will be reused on subsequent runs<br />
to quickly reestablish the material conditions<br />
necessary for an accurate simulation.<br />
See “Differences between Part, Fixture and Stock Components” on page 18 for a more detailed<br />
description of how each of these object types are used by VM. In brief:<br />
� Stock: Represents the uncut material at the start of an operation. Stock definitions are<br />
ignored for collision testing purposes unless running with the Material Removal Simulation<br />
(MRS) license option enabled.<br />
� Fixture: Represents the part holding device. Two forms of collision testing are enabled,<br />
depending on whether the fixture is machinable or not.<br />
� Final Part: Represents the final shape expected to be produced. Collision testing is always<br />
enabled, with an addition allowable gouge tolerance on the cutting portion of the<br />
tool.<br />
Objects are maintained in three separate lists, accessible by selecting one of the Stock, Fixture or<br />
Part tabs at the upper left corner of the dialog. For each type, a navigator along the left hand side<br />
of the dialog lists all of the objects defined for that specific type. For example, a fixture might<br />
consist of many parts, such as a base plate, clamps, spacers and so on. Select Import to bring in<br />
the stock, fixture and part definitions from a different part program. Select Export to save the<br />
current stock, fixture and part definitions to a named file for use in a different part program.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 79
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Stock/Fixtures/Part (CeRun & Gener only)<br />
Select the top entry in the navigator to see list of objects for the selected type. Select New and<br />
then New Stock (or New Part or New Fixture in the pop-up context menu that will appear) to<br />
create a new object. The object‟s name is used by VM when reporting collision diagnostics. The<br />
object‟s current axis defines the stock axis (or mounting point) where the object will be attached<br />
to the machine model at the start of the program. <strong>Machine</strong> models with multiple tables or pallets<br />
may define multiple stock axes. Click on an entry in the table to change the object‟s name, its<br />
default axis (used when the program starts) or the current axis (the association in force at this<br />
point in the program). Setting the stock axis value to “None” removes it from the simulation, but<br />
not from the list of objects. You can select one or more objects in the right hand list and press the<br />
Delete button to completely remove them.<br />
Each object can consist of one or more<br />
physical components, which are listed<br />
when you select an object name in the left<br />
hand list box, or when you select an object<br />
in the right hand object list and press the<br />
Modify button. Each component of an<br />
object can be given a name, which will be<br />
reported during collision diagnostics (e.g.,<br />
“Stopper”). Fixture components can be<br />
tagged as machinable or not. Part components<br />
are never machinable; stock components<br />
are ignored for collision testing<br />
purposes.<br />
Select the New button to add a new component. The following component types can be added:<br />
� Cube: Defines a rectangular region given the XYX coordinates of one corner and the<br />
length, width and height (ΔXYZ).<br />
� Cylinder: Defines a cylindrical or conical region given an XYZ coordinate of the center,<br />
an initial radius, a final radius and the overall length. The surface of the cylinder is approximated<br />
by a number of faces, which can be specified. The light rendering at the edges<br />
between faces can be set smooth or sharp, allowing shapes like a hexagon to be<br />
defined.<br />
� Cone: Defines a conical region given an XYZ coordinate of the center, an initial radius, a<br />
final radius and the overall length. The Cone and Cylinder definitions are identical; they<br />
differ during construction only.<br />
� Import STL: Imports an STL file relative to a specified XYZ location in the model.<br />
Components are created interactively in the simulation window. The various Hide… check<br />
boxes can be selected to reduce the visual clutter in the simulation window during component<br />
creation. When a component is being created, its type and required parameters are listed at the<br />
bottom of the simulation window. You can enter the parameters using the keyboard, or you can<br />
move the mouse to an appropriate position and click the left-mouse button. Each click of the<br />
mouse can supply values for one or two parameters. You can change the camera position,<br />
standard view or user-defined viewpoint at any time. Use the Tab key and Shift-Tab key to move<br />
forwards and back through the required parameters to make changes. When creating new objects<br />
80 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
with the mouse, the pointer might be locked to a fixed grid size. You can temporarily toggle the<br />
grid setting by pressing the Shift key. Select Simulation»Grid (Ctrl Alt G shortcut) to make<br />
changes to the default grid.<br />
Existing objects can be selected from the component list and modified by pressing the Modify<br />
button, or removed from the object by pressing the Delete button.<br />
When the Material Removal Simulation (MRS) license option is enabled, stock and machinable<br />
fixture components can be enabled or disabled for MRS simulation using the object‟s Material<br />
Removal column setting. Stock and Part objects must be associated with each other to enable<br />
stock/part comparison (Simulation»Compare) and viewing of undercut/overcut material (Simulation»Show»Filters»Boolean…).<br />
The stock/part association can be made either in the Associated<br />
Part column in the Stock List or in the corresponding Associated Stock column of the Part List.<br />
When running VM with an <strong>ICAM</strong> Manufacturing Extractor, stock will by default be enabled for<br />
MRS, and the association between stock and part will automatically be set.<br />
4.3.5 Simulation»Tools/Holders/Heads (Ctrl Alt T) (CERUN & GENER only)<br />
This menu bar selection provides the ability to add tool and associated holder 1 definitions to the<br />
simulation, as well as to select the active head on a machine that supports multiple head attachments.<br />
Tools<br />
Tooling definitions, like fixture and part definitions, are not a required element for simulation,<br />
but if used they add to simulation accuracy and realism. VM attaches solid model representations<br />
of holders and tools to the spindle control point (SCP). Once attached, they become a part of the<br />
collision detection process.<br />
You switch between tool and holder<br />
definitions by selecting the Tools and<br />
Holders tab buttons. Select the Tools<br />
tab to add or modify tool definitions.<br />
Select the New button to define a new<br />
tool. Select an existing definition and<br />
press Modify or Delete to change or<br />
remove the selected tools.<br />
GENER will automatically define a<br />
default milling/drilling tool if a tool definition does not exist for the one being loaded. GENER<br />
uses the APT CUTTER command to define the shape of the tool. Tools defined in this way have<br />
a cutting length equal to the total tool length, and do not have a shank or associated holder.<br />
Automatically created tools are by default “unlocked”, meaning that their definition will change<br />
each time a CUTTER command is encountered. Manually defined tools are locked by default,<br />
1 The term “Holder” is used by VM to refer to a device used to securely hold the tool in the spindle. The<br />
term “Head” is used by VM to refer to detachable spindle units (e.g., a right angle head attachment).<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 81
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
and are not affected by CUTTER statements in the CL file. CERUN does not have the ability to<br />
automatically define tools.<br />
The tool table lists the following information for each tool:<br />
� ID: Identifies the tool using the native form of tool numbering on the controller.<br />
� Type: Lists the tool type as defined when the tool was created or last modified.<br />
� Unit: Shows the units of measure used for non-angular tool dimensions.<br />
� Lock: GENER can automatically generate milling tool definitions based on the APT<br />
CUTTER command (automatic tool definitions are not possible with CERUN). Any tool<br />
created automatically by GENER is initially set unlocked (i.e., the Lock state is “No”).<br />
Any tool that is created manually or that is subsequently modified is set locked (i.e., the<br />
Lock state is “Yes”) so that these modifications will not be overridden. Double click on<br />
this field to change the locked state of a tool.<br />
� Holder: Specifies a tool holder ID or the word “None” if a tool holder is not being used.<br />
Double click on this field to choose a different holder for a tool.<br />
� Usage: Specifies the intended use of the tool, which can be one of “Finishing”, “Semi-<br />
Finishing” or “Roughing”. A tool‟s intended usage affects the in-process stock machining<br />
tolerance when the Material Removal Simulation (MRS) option is enabled. A “finishing”<br />
tool will use the gouge tolerance for MRS simulation; a “semi-finishing” tool will use a 5<br />
times coarser tolerance; and a “roughing” tool will use a 10 times coarser tolerance. The<br />
gouge tolerance amount is defined in the Simulation»Options dialog (Ctrl Alt O<br />
shortcut). <strong>ICAM</strong> Manufacturing Extractors will set the tool usage if this information is<br />
available from the CAM system, otherwise the usage will be set to Finishing.<br />
� Cut Color: Specifies the normal cutting color to use with the selected tool on the inprocess<br />
stock when the Material Removal Simulation (MRS) option is enabled. The selection<br />
drop-down provides “Auto”, “Custom” and “Stock” choices. The “Auto” selection<br />
will automatically assign a color (from a pallet of 12 basic colors) to the tool each<br />
time it is loaded. The “Custom” selection allows any color to be chosen from a standard<br />
color picker. The “Stock” selection will use the actual stock color instead of a special<br />
color.<br />
� Default pocket: Primarily used when simulating tool changers on models that define tool<br />
pocket locations. Double click on this field to choose the pocket where the tool will reside.<br />
� Current pocket: The current location of the tool. This field is updated dynamically by<br />
VM as tools are loaded. You can manually insert a tool into the spindle by double clicking<br />
on this field and selecting the primary tool axis.<br />
Tool and holder definitions are automatically saved in the verification setup (.vsw) file when the<br />
program is completed. This setup file will be reused on subsequent runs to quickly reestablish the<br />
tooling necessary for an accurate simulation.<br />
Tool and holder definitions from another part program can be imported into the current session<br />
by pressing the Import button and then selecting the verification setup (.vsw) file of the other<br />
part program.<br />
82 <strong>ICAM</strong> Technologies Corporation – Proprietary
Lathe Tool Type<br />
Select “Lathe” as the tool type to define a turning<br />
tool insert/holder combination. The following<br />
lathe insert types can be defined:<br />
� Round: A round or circular insert.<br />
� Trigon: A three cornered insert resembling<br />
a triangle, but with an intermediate<br />
angle on the sides, to allow for a higher<br />
included angles at the tips.<br />
� Diamond: A four-sided insert with two<br />
acute angles.<br />
� Symmetrical: Any “n” equal sided insert.<br />
� Thread: A three cornered threading insert,<br />
with a tooth shape on each corner.<br />
� Groove: A single or double sided insert<br />
that can be used for threading, grooving<br />
or cut-off.<br />
� Profile: An insert defined by a 2D profile.<br />
� Generic: An insert defined by an STL<br />
mesh.<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
Inserts are defined in the ZX plane of the machine.<br />
The blue dotted line represents the positive<br />
Z-axis of the machine. The red dotted line<br />
represents the positive X-axis of the machine. Tool path traces are drawn originating from the<br />
center point of the fillet radius of the insert. Currently, tool nose compensation is only available<br />
from the center of the insert nose (i.e., P0 or P9 type compensation) and not from the theoretical<br />
tool tip.<br />
All turning tools have the following settings:<br />
� Units: The unit of measure for non-angular values. Angles are always measured in degrees.<br />
� ID number: Identifies the tool using the native form of tool numbering on the controller.<br />
� Left/Right hand: Controls how the insert is mated with the holder.<br />
� Colors: Defines the display color of the lathe insert tool. When the MRS license option is<br />
enabled, the Cut selection defines the color to show the cutting action of the tool on the<br />
in-process stock. See the “Cut Color” description on page 82 for more information.<br />
� Usage: Specifies the intended use of the tool, which can be one of “Finishing”, “Semi-<br />
Finishing” or “Roughing”. A tool‟s intended usage affects the in-process stock machining<br />
tolerance when the Material Removal Simulation (MRS) option is enabled. See the “Usage”<br />
description on page 82 for more information.<br />
� Holder: Defines a parent holder of the insert. The parent holder should first be defined<br />
before creating the insert shape. Select “None” if a holder is not available or not required.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 83
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
The Round, Trigon, Diamond, Symmetrical, Thread and Groove turning tools have one or<br />
more additional parameters follows:<br />
� Number of sides: Defines the number of cutting edges on the insert. Applicable to Symmetrical<br />
and Groove insert types only.<br />
� Inscribed circle: An ANSI standard measure of insert size. Setting this field automatically<br />
adjusts the cutting length dimension.<br />
� Internal angle: Specifies the angle between adjacent sides of the insert at the cutting<br />
edge. Applicable to Trigon and Diamond insert types only.<br />
� Corner radius: The radius of the cutting edge of the insert. Not applicable for Round<br />
insert types.<br />
� Tooth width, height, offset, clearance: Defines the form shape of the thread or groove<br />
insert. Applicable to Thread and Groove insert types only.<br />
� Width: The width of the insert. Applicable to Groove insert types only.<br />
� Joint radius: The radius of the center hole.<br />
� Height: The height of the insert.<br />
� Clearance angle: The relief angle of the insert.<br />
The Profile turning tool has a different set of parameters, as follows:<br />
� Cutting profile: Defines the outer edge of the insert as a 2D profile, with one set of coordinates<br />
per line, in the form “z-axis, x-axis”. Press the Apply button to immediately see<br />
the effect of any edits made to the profile.<br />
� ZX Offset: Defines the offset from the contour origin to the holder mating point.<br />
� Height: The height of the insert.<br />
� Clearance angle: The relief angle of the insert.<br />
Finally, the Generic turning tool is defined as follows:<br />
� Mesh: A 3D STL shape defining the insert. For material removal purposes, the insert will<br />
be intersected along the cutting plane and the resultant 2D shape used for MRS calculations.<br />
Press the Modify button to import the STL.<br />
� XYZ Offset: Defines the offset from the STL origin to the holder mating point.<br />
Select the Preview button to view the insert with or without the attached holder.<br />
84 <strong>ICAM</strong> Technologies Corporation – Proprietary
Mill Tool Type<br />
Select “Mill” as the tool type to define a milling<br />
or drilling tool/holder combination. The following<br />
mill tool types can be defined:<br />
� End mill: A milling tool with sharp corner<br />
radius.<br />
� Ball nose: A milling tool with corner radius<br />
equal to ½ the tool diameter.<br />
� Bull nose: A milling tool with non-zero<br />
corner radius less than ½ the tool diameter.<br />
� Drill: A typical drilling tool.<br />
� APT 7: A milling tool whose shape is defined<br />
by the APT standard CUTTER definition.<br />
� Profile: A tool defined by a revolved 2D<br />
profile.<br />
Milling tools are defined in a 2D profile view.<br />
The blue dotted line represents the positive Zaxis<br />
of the machine. The red dotted line represents<br />
the positive X-axis of the machine. Tool<br />
path traces are drawn originating from the center<br />
bottom tip of the tool.<br />
All milling tools have the following settings:<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
� Units: The unit of measure for non-angular values. Angles are always measured in degrees.<br />
� ID number: Identifies the tool using the native form of tool numbering on the controller.<br />
� Left/Right hand: Defines the cutting direction.<br />
� Colors: Defines the display colors for the shank (if used), body and cutting portions of<br />
the tool. When the MRS license option is enabled, the Cut selection defines the color to<br />
show the cutting action of the tool on the in-process stock. See the “Cut Color” description<br />
on page 82 for more information.<br />
� Usage: Specifies the intended use of the tool, which can be one of “Finishing”, “Semi-<br />
Finishing” or “Roughing”. A tool‟s intended usage affects the in-process stock machining<br />
tolerance when the Material Removal Simulation (MRS) option is enabled. See the “Usage”<br />
description on page 82 for more information.<br />
� Holder: Defines a parent holder of the tool. The parent holder should first be defined before<br />
creating the tool. Select “None” if a holder is not available or not required.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 85
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
The End mill, Ball nose, Bull nose, Drill and APT 7 milling tools have one or more additional<br />
parameters follows:<br />
� Tool diameter: The diameter of the cutting portion of the tool, measured at the intersection<br />
of the bottom and sides of the tool.<br />
� Cutter length: The total length of the tool from bottom tip to the mating point (TCP) of<br />
the holder, or if not using holders, to the spindle control point (SCP).<br />
� Flute length: The cutting length of the tool, measured from the bottom tip.<br />
� Corner radius: The corner radius of the tool. Not applicable for end mills (whose corner<br />
radius is zero), ball nose end mills (whose corner radius is ½ the diameter), or for drills.<br />
� Bottom angle: The angle of the bottom cutting edge of the tool. The angle must be zero<br />
or larger. Only applicable for drills and APT 7 cutter types.<br />
� Side angle: The angle of the side cutting edge of the tool. The angle can be positive or<br />
negative. Only applicable for APT 7 cutter types.<br />
� Body offset: Defines the relief on the tool diameter to apply to the cutter body portion of<br />
the tool.<br />
� Set shank: Select this check box to define the shank of the tool extending above the mating<br />
point with the holder or spindle.<br />
� Shank length: The length of the shank, measured from the mating point with the holder<br />
or spindle.<br />
� Shank diameter: The diameter of the shank.<br />
The Profile milling tool has a different set of parameters, as follows:<br />
� Cutting profiles: Defines the radial and axial coordinates of the cutting tool profile, with<br />
one set of coordinates per line, in the form “radial, axial”. Only define the right half profile<br />
of the tool (i.e., zero or positive radial values only). Positive axial values are measured<br />
downwards, from the mating point of the holder (TCP) or spindle face (SCP)<br />
towards the bottom tip of the tool. Use a semi-colon “;” to separate multiple cutting profiles.<br />
Press the Apply button to immediately see the effect of any edits made to the profile.<br />
� Non-Cutting profiles: Defines the radial and axial coordinates of the non-cutting tool<br />
profile, in the same fashion as described above for the cutting profile. Press the Apply<br />
button to immediately see the effect of any edits made to the profile.<br />
Select the Preview button to view the milling tool with or without the attached holder.<br />
86 <strong>ICAM</strong> Technologies Corporation – Proprietary
Holders<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
Holder definitions add to simulation accuracy and realism. VM attaches solid model representations<br />
of holders and tools to the spindle control point (SCP). Once attached, they become a part<br />
of the collision detection process. Holders are associated with tools using the Tools dialog.<br />
Note that the term “Holder” is used by VM to refer to a device used to securely hold the tool in<br />
the spindle. The term “Head” is used by VM to refer to detachable spindle units (e.g., a right<br />
angle head attachment). The CAM-POST HEAD keyword on a LOAD or TOOLNO command<br />
refers to a head attachment, not the tool holder.<br />
You switch between tool and holder<br />
definitions by selecting the Tools and<br />
Holders tab buttons. Select the Holders<br />
tab to add or modify holder definitions.<br />
Select the New button to define a new<br />
holder. Select an existing definition<br />
and press Modify or Delete to change<br />
or remove the selected holders.<br />
The holder table lists the following<br />
information for each holder:<br />
� ID: A textual identification of the holder.<br />
� Type: Identifies the sub-type of the holder as being Revolved (a holder defined by a 2D<br />
profile revolved about the spindle axis) or Generic (a holder defined by one or more STL<br />
meshes).<br />
� Unit: Defines the units of measure for non-angular holder dimensions.<br />
Tool and holder definitions are automatically saved in the verification setup (.vsw) file when the<br />
program is completed. This setup file will be reused on subsequent runs to quickly reestablish the<br />
tooling necessary for an accurate simulation.<br />
Tool and holder definitions from another part program can be imported into the current session<br />
by pressing the Import button and then selecting the verification setup (.vsw) file of the other<br />
part program.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 87
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
Profile Holder Type<br />
Select “Profile” as the holder type to define a<br />
cylindrical holder by a 2D profile that will be<br />
swept around the spindle axis. A 2D profile<br />
holder is defined as follows:<br />
� Holder ID: A textual identification of<br />
the holder. This name must be used in a<br />
tool definition to reference the holder, or<br />
in the parent holder definition described<br />
below.<br />
� Units: The unit of measure for profile<br />
and contact coordinates.<br />
� Color: Defines the display color for the<br />
holder body.<br />
� Contact point: Defines how the holder<br />
is attached to the machine and tool models.<br />
The Spindle contact point is aligned<br />
with the machine SCP (spindle control<br />
point) or another parent holder. The Tool<br />
contact point identifies where the top of<br />
the tool or the SCP of another child<br />
holder is aligned.<br />
� Parent: Optionally identifies another<br />
holder to which the current one is mated.<br />
� Profile: Defines the radial and axial coordinates of the holder profile, with one set of coordinates<br />
per line, in the form “radial, axial”. Only define the right half profile of the<br />
holder (i.e., zero or positive radial values only). Positive axial values are measured<br />
downward, from the spindle face (SCP) or mating point of a parent holder (TCP), towards<br />
the bottom tip of the holder.<br />
Select the Preview button to view the holder with or without its parent holder (if defined).<br />
88 <strong>ICAM</strong> Technologies Corporation – Proprietary
Generic Holder Type<br />
Select “Generic” as the holder type to define a<br />
holder defined by one or more STL mesh<br />
components. A generic holder is defined as<br />
follows:<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
� Holder ID: A textual identification of<br />
the holder. This name must be used in a<br />
tool definition to reference the holder, or<br />
in the parent holder definition described<br />
below.<br />
� Units: The unit of measure for contact<br />
coordinates.<br />
� Contact point: Defines how the holder<br />
is attached to the machine and tool models.<br />
The Spindle XYZ contact point is<br />
aligned with the machine SCP (spindle<br />
control point) or another holder. The<br />
Tool XYZ contact point identifies where<br />
the top of the tool or the SCP of another<br />
holder is aligned. The XYZ Rot angles<br />
define the orientation of tool as mounted<br />
in the holder.<br />
� Internally geared: Select this check box<br />
if the holder itself does not rotate, but instead<br />
transmits the spindle rotation force internally from the spindle contact point to the<br />
tool contact point. You can then specify a signed spindle ratio that defines the effect internal<br />
gearing (if any) has on the tool.<br />
� Parent: Optionally identifies another holder to which the current one is mated.<br />
� Meshes: Select the New button to add a STL mesh component to the holder definition.<br />
Select one or more existing mesh definitions and press the Delete button to remove them.<br />
Double-click on a mesh component name to modify the position, orientation or color of<br />
the object.<br />
An STL mesh is added to holder definition using the<br />
same Mesh Component dialog used in QUEST to import<br />
machine components into the model (described on page<br />
94). From this dialog, you can specify the name of the<br />
STL mesh component, its position and orientation in<br />
space and its material color properties. An Import<br />
button on the dialog is used to specify the STL file to<br />
read and the units of measure of the STL object. A<br />
Scale button on the dialog can be used to change the<br />
size of the imported object if required. The Keep as an<br />
external reference setting saves a reference to the STL<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 89
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Tools/Holders/Heads (Ctrl Alt T) (CeRun & Gener only)<br />
in the verification setup (.vsw) file instead of the object itself. Note that the Collision detection<br />
options are not available since holders are always tested for exact collision.<br />
Use the 4 view buttons along the top edge of the holder dialog to change the view orientation.<br />
Hold the left mouse button down while moving the mouse to rotate the holder. Hold the middle<br />
mouse down while moving the mouse to pan the scene. The slider on the right hand side and the<br />
mouse wheel both control the zoom. The red/green/blue dotted lines show the zero-point origin<br />
of the holder. A tool-axis kinematics marker shows the mating point of the holder with the SCP<br />
of the machine (or the TCP of a parent holder). A solid red/green/blue axis marker shows where<br />
and at what orientation the tool will be mounted to the holder (the TCP).<br />
Select the Preview button to view the holder with or without its parent holder (if defined).<br />
Heads<br />
A head is a removable device that attaches to the machine and which provides some form of<br />
extended machining capability. Common examples of such devices are 90 degree angled heads<br />
that mount the tool at an angle, long reach heads that extend the Z axis travel of the tool, and<br />
heads with one or more controllable rotary axes that provide 4 or 5-axis control of the tool. Head<br />
devices (there can be multiple heads) are predefined in the model.<br />
The head table lists the following information for each head defined in the model:<br />
� ID: Identifies the head using<br />
the native form of head numbering<br />
on the controller.<br />
� Name: Identifies the head using<br />
the name assigned by the creator<br />
of the VM model.<br />
� Current station: The current<br />
location of the head. This field<br />
is updated dynamically by VM<br />
as heads are loaded. You can<br />
manually load or park a head by<br />
double clicking on this field and selecting a head attachment point from the drop-down<br />
list.<br />
Head attachment points are defined in the model with QUEST using the Simulation»Construct<br />
Axis»Head axis menu selection (see description on page 101). Only one head at a time can reside<br />
at any single head attachment point.<br />
90 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.3.6 Simulation»Construct Entity (QUEST only)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Entity (Quest only)<br />
Provides the ability to add<br />
physical entities (i.e.,<br />
things you can see) to the<br />
model. This menu selection<br />
is only available in QUEST. The “<strong>Machine</strong>s” section must be opened before you can add<br />
entities to the model. The VM Construct tool bar provides buttons (as shown circled above) for<br />
each of the entities that can be constructed.<br />
All entities share some common parameters, listed below:<br />
� Name: Entity names are used in the Model Navigator in QUEST, and in collision diagnostic<br />
messages in CERUN and GENER. VM assigns default names when objects are created.<br />
You should change the default to something that is both short and meaningful.<br />
� Unit: Specifies the unit of measure for all non-rotary values (angles are always specified<br />
in degrees).<br />
� Position: Specifies the X, Y and Z axis position of the origin of the current object in relation<br />
to the origin and rotational alignment of the parent object. When world coordinates<br />
are selected (Simulation»Use World CS), the position of the entity is shown in world coordinates<br />
instead of relative to the parent object. When constructing an entity, the mouse<br />
pointer can be used to define the entity start position (and other parameters as well).<br />
� Collision detection: Select the Enable check box to activate collision testing against the<br />
current entity. A Safety zone amount can be specified when collision checking is enabled,<br />
which checks for a collision at the specified distance from the surface. You can see the<br />
extended collision envelope of all entities by toggling Simulation»Show»Safety Zones<br />
from the menu bar.<br />
� Spindle sweep: Select the “Do not generate sweep for spindle” check box to exclude the<br />
entity from spindle sweep volume calculations, which dynamically compute the swept<br />
volume of objects attached to a turning spindle for visualization and collision detection<br />
purposes. Excluding an object from spindle sweep calculations will reduce the CPU<br />
overhead of these calculations, but at the same time will omit the object for collision and<br />
visualization purposes while the spindle to which it is attached is turning.<br />
� OK button: Creates the entity as defined.<br />
� Cancel button: Ignores this entity creation request.<br />
� Apply button: Updates the simulation window to show the effects of the latest changes.<br />
� Rotate button: Use this button to rotate the entity to its required final orientation. When<br />
an entity is rotated, anything attached below this entity in the Navigator will be defined in<br />
the new frame of rotation.<br />
� Material button: Use this button to define the appearance (color) of the object. Material<br />
properties are described later under the topic “Materials Dialog”. Objects are by default<br />
created using the material of the last object created or selected using the Materials Dialog<br />
(Ctrl Alt M shortcut).<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 91
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Entity (Quest only)<br />
Entities that represent curved shapes are approximated by faceted surfaces. The following<br />
parameters are used for curved entities:<br />
� Number of faces: Specifies the number of facets to use to approximate a curved surface.<br />
The greater the number of facets, the smoother the surface will appear. Note that the<br />
tradeoffs for smooth appearance are a longer rendering time and a higher CPU cost for<br />
collision detection.<br />
� Use sharp edges: Specifies how the object should be drawn. When sharp edges are used,<br />
a cylinder will appear with clearly defined facets (a cylinder with 4 facets and sharp edges<br />
looks identical to a cube entity). When smooth edges are used, the graphic engine will<br />
attempt to blend the edges, smoothing them out. You can get surprisingly smooth looking<br />
surfaces even with coarse faceting.<br />
Simulation»Construct Entity»Cube<br />
Creates a cubic (i.e., box) entity, given an XYZ origin<br />
and the width, length and height of the cube. Once<br />
created, the cube can be further rotated to its required<br />
orientation. Parameters common to all entities (not listed<br />
below) can be found on page 91.<br />
� Width: The X axis width of the cube.<br />
� Length: The Y axis length of the cube.<br />
� Height: The Z axis height of the cube<br />
Simulation»Construct Entity»Cylinder<br />
Simulation»Construct Entity»Cone<br />
Creates a cylindrical or conical entity, given an XYZ<br />
origin and the radius and height of the cylinder. Once<br />
created, the cylinder can be further rotated to its required<br />
orientation. The starting and ending radii can<br />
also be modified. Parameters common to all entities (not<br />
listed below) can be found on page 91.<br />
� Radius0: The radius of the cylinder or cone at<br />
the initial position.<br />
� Radius1: The radius of the cylinder or cone at<br />
the “length” height.<br />
� Length: The height of the cylinder or cone in<br />
the Z axis (use the Rotate button to orient the<br />
cone as required).<br />
92 <strong>ICAM</strong> Technologies Corporation – Proprietary
Simulation»Construct Entity»Sphere<br />
Creates a spherical entity, given an XYZ origin and the<br />
radius of the sphere. Once created, the sphere can be<br />
further rotated to its required orientation. The radius can<br />
also be modified. Parameters common to all entities (not<br />
listed below) can be found on page 91.<br />
� Radius: The radius of the sphere.<br />
� Number of subdivisions: Controls the smoothness<br />
of the sphere. A value of 0 produces a (20<br />
face) icosahedron, and increasing the subdivision<br />
value increases the faces by a factor of 3. A<br />
maximum of 6 subdivisions is permitted (very<br />
CPU intensive).<br />
Simulation»Construct Entity»Revolved<br />
Sweeps a 2D profile over a complete or partial arc to<br />
produce a surface of revolution. Once created, the<br />
surface can be further rotated to its required orientation<br />
using the Rotate button. Parameters common to all<br />
entities (not listed below) can be found on page 91.<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Entity (Quest only)<br />
� Partial revolution: If selected the profile will be<br />
rotated between the Start angle and End angle<br />
positions. When not selected, a complete 360°<br />
arc is used.<br />
� Profile button: Select this button to enter the<br />
surface profile. The profile is defined as a series<br />
of (radius, height) pairs of coordinates, one pair<br />
per line, which is swept around the Z-axis. The order in which points are defined is important;<br />
the outside surface of the profile is to the left of the curve defined by the points.<br />
The profile does not have to be closed (i.e., it does not have to start and end at the same<br />
point). Use the Apply button in the profile builder to see changes to the profile curve.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 93
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Entity (Quest only)<br />
Simulation»Construct Entity»Extruded<br />
Sweeps a 2D closed profile along a vector to produce an<br />
extruded surface. Once created, the surface can be<br />
further rotated to its required orientation using the<br />
Rotate button. Parameters common to all entities (not<br />
listed below) can be found on page 91.<br />
� Length: Specifies the distance to sweep the profile<br />
along the vector defined by the direction<br />
components.<br />
� Direction: Specifies the XYZ components of the<br />
vector to sweep the profile along.<br />
� Profile button: Select this button to enter the<br />
surface profile. The profile is defined as a series of (x, y) pairs of coordinates, one pair<br />
per line, which is extruded along a vector (positive Z by default) for the specified distance.<br />
The order in which points are defined is important; the outside surface of the profile<br />
is to the left of the curve defined by the points. The profile must be closed (i.e., it<br />
must start and end at the same point). You can specify one or more additional “island”<br />
contours to be subtracted from the main extruded shape by first specifying a semicolon”;”<br />
contour separator followed by the series of (x, y) pairs of coordinates of the island contour,<br />
one pair per line. Use the Apply button in the profile builder to see changes to the<br />
profile curve.<br />
Simulation»Construct Entity»Mesh<br />
Imports an STL mesh into the model. Once imported,<br />
the mesh surface can be further rotated to its required<br />
orientation using the Rotate button. Parameters common<br />
to all entities (not listed below) can be found on page<br />
91.<br />
� Import button: Select this button to choose the<br />
STL file to be imported. An STL file does not<br />
define its units of measure; use the Units field on<br />
the STL import dialog to specify the dimensional<br />
units of the file. The import dialog also provides<br />
a File format field to specify the STL file format. Normally the default Auto selection<br />
should suffice; but if you have difficulty importing an STL file, try selecting other<br />
file formats.<br />
� Scale button: Use this button to scale the STL mesh object if the object as imported is the<br />
wrong size. Alternately, you could import the object again this time specifying different<br />
dimensional units.<br />
94 <strong>ICAM</strong> Technologies Corporation – Proprietary
Simulation»Construct Entity»Picture<br />
Loads a bitmap image, given the point in the model for<br />
the lower left corner of the image, and the X-axis width<br />
and Y-axis height of the image in model coordinates.<br />
The picture can be rotated to its required orientation<br />
using the Rotate button. Parameters common to all<br />
entities (not listed below) can be found on page 91.<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Entity (Quest only)<br />
� Width: Specifies the length of the image measured<br />
along the X-axis.<br />
� Height: Specifies the length of the image measured along the Y-axis.<br />
� Keep aspect ratio: If checked, the image will retain its original shape, which may result<br />
in the length or height being smaller than intended. Clear this check box to stretch the<br />
image into the space defined.<br />
� Load button: Select this button to choose the bitmap image (.bmp) to load into the model.<br />
Bitmap images must be compatible for OpenGL graphic texturing, and therefore they have some<br />
important restrictions. Also note that Textures can place a heavy CPU burden on the rendering<br />
(image drawing) process, and can take up a lot of space in the <strong>ICAM</strong> database.<br />
� Bitmaps must be constructed in 16-color or 256-color mode.<br />
� Bitmaps must not use RLE compression (i.e., they must be uncompressed).<br />
� The length and height of the image must be evenly divisible by a power of two.<br />
Collision testing is not performed on picture entities.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 95
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Axis (Quest only)<br />
4.3.7 Simulation»Construct Axis (QUEST only)<br />
Provides the ability to add<br />
axes (i.e., things that<br />
move) to the model. These<br />
menu selections are only<br />
available in QUEST. The “<strong>Machine</strong>s” section must be opened before you can add axes to the<br />
model. The VM Construct tool bar provides buttons (as shown circled above) for each of the axis<br />
types that can be constructed.<br />
All axes share some common parameters, listed below:<br />
� Name: Axis names are used in the Model Navigator in QUEST. Linear, Rotary and Curve<br />
axis names also appear in (and can be controlled from) the QUEST lower right Axes window<br />
as well as the VM Controller Axes window in CERUN and GENER. VM assigns default<br />
names when objects are created. You should change the default to something that is<br />
both short and meaningful.<br />
� Unit: Specifies the unit of measure for all non-rotary values (angles are always specified<br />
in degrees).<br />
� Position: Specifies the X, Y and Z axis position of the origin of the current axis in relation<br />
to the origin and rotational alignment of the parent object. When world coordinates<br />
are selected (Simulation»Use World CS), the position of the axis is shown in world coordinates<br />
instead of relative to the parent object. When constructing an axis, the mouse<br />
pointer can be used to define the axis origin.<br />
� OK button: Creates the axis as defined.<br />
� Cancel button: Ignores this axis creation request.<br />
� Apply button: Updates the simulation window to show the effects of the latest changes.<br />
� Rotate button: Use this button to rotate the entity to its required final orientation. When<br />
an entity is rotated, anything attached below this entity in the Navigator will be defined in<br />
the new frame of rotation.<br />
Linear, Rotary and Curve axes share the following additional parameters:<br />
� Range: Specifies the Minimum and Maximum travel extent of the axis with respect to the<br />
axis origin position. The range does not have to include the zero position.<br />
� Slave axis to: Specifies the name of another axis that will be used to control the current<br />
one. When the named axis moves, the current axis will also be moved. You can specify a<br />
Scaling factor to change the proportion of motion, and even the direction (by specifying<br />
a negative scale factor). An axis that is slaved will not appear in the QUEST lower right<br />
Axes window or the VM Controller Axes window in CERUN and GENER. Motion of a<br />
slaved axis is only possible by moving the parent axis (i.e., the one the axis is slaved to).<br />
� Default position: Specifies the position the axis will be set to when the model is loaded,<br />
or when the axis position is reset to its default.<br />
When you add a new axis, it will appear in the lower right “Axes” window. The axis name will<br />
also appear in the Model Navigator, attached as a child (below) the object that was selected (in<br />
the Navigator) when the axis was created. You can move the axis to a new position in the<br />
96 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Axis (Quest only)<br />
Navigator by first selecting it with the mouse, then, while holding the left-mouse button down,<br />
move to a new attachment point and release the mouse button. Moving the axis name in the<br />
model navigator may change the kinematics of the machine.<br />
Simulation»Construct Axis»Linear Axis<br />
Creates a linear axis, given an XYZ origin and the<br />
direction vector and range of interpolation. Parameters<br />
common to all axes (not listed below) can be found on<br />
page 96.<br />
� Direction: The direction of interpolation. Linear<br />
axes that move the tool typically have a standard<br />
positive direction, and those that move the part<br />
have a negative (reversed) direction, For example,<br />
moving the part in the negative X direction<br />
has the effect of moving the tool in the positive<br />
X direction with respect to the part. Select “Custom”<br />
if the linear axis does not interpolate along<br />
one of the major axes. When Custom is selected,<br />
you must enter a Custom direction, which defines<br />
the positive sense of interpolation given its X, Y and Z-axis vector components (the<br />
values do not have to be unitized).<br />
When defining a linear axis with a Custom orientation, you can enter the custom direction<br />
vector, or you can use a standard orientation and use the Rotate button to orient the axis. Both<br />
methods produce identical kinematics, but the Rotate method has the side effect of changing the<br />
XYZ reference coordinates for any objects attached to<br />
the axis.<br />
Simulation»Construct Axis»Rotary Axis<br />
Creates a rotary axis, given an XYZ origin and the<br />
direction vector and range of interpolation. Parameters<br />
common to all axes (not listed below) can be found on<br />
page 96.<br />
� Rotation axis: The axis about which the rotation<br />
occurs. Standard rotations have the A, B and C<br />
axes rotating about the X, Y and Z axes respectively.<br />
Rotary axes that move the tool (e.g., rotary<br />
heads) typically have a standard positive<br />
direction, and those that move the part (e.g., rotary<br />
tables) have a negative (reversed) direction.<br />
For example, rotating the part in a CCLW direction<br />
has the effect of moving the tool in a CLW<br />
direction with respect to the part. Select “Custom”<br />
if the rotary axis does not rotate around<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 97
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Axis (Quest only)<br />
one of the major axes. When Custom is selected, you must enter a Custom rotation vector,<br />
which defines the X, Y and Z-axis vector components of the axis of rotation, using<br />
the “right hand rule”. Using your right hand, point your thumb in the direction of the vector;<br />
your fingers curl in the direction of positive rotation.<br />
� Use range validation: Clear this check box if the rotary axis has unlimited physical travel.<br />
� Spindle definition: Select the “This rotary axis connects to a spindle” check box if the<br />
rotary axis can double as a spindle. This is common for mill/turn lathes, where the spindle<br />
can freely rotate when turning but then be interpolated as a rotary axis when milling.<br />
VM uses the Spindle ID to differentiate between the different spindles that might be<br />
available on a machine. Once defined, a spindle can be later mapped as a milling or turning<br />
spindle using the Axes mapping tab page of the machine properties dialog. A Ratio<br />
can be specified if the spindle rotation is not 1:1.<br />
� Turret definition: Select the “This rotary axis is used as a turret” check box if the rotary<br />
axis defines the rotation of a lathe tool turret. VM uses the Turret number to differentiate<br />
between the different turrets that might be available on a machine. Turret number 1<br />
should be used for the main turret. Turret number 2 should be used for a second turret if<br />
one exists. The Positioning field is used by VM to position the turrets as tools are loaded.<br />
With Automatic positioning, the turret is expected to have the available tool slots equally<br />
distributed around the perimeter. Use Predefined positioning and select the Set positions<br />
button to define the turret rotation angle for each of the available tool slots.<br />
� Label offset: Defines the offset of the informational kinematics marker along the rotation<br />
axis. Kinematics markers can be enabled or disabled using the VM Grid tool bar.<br />
When defining a rotary axis with a Custom orientation, you can enter the custom rotation vector,<br />
or you can use a standard orientation and use the Rotate button to orient the axis. Both methods<br />
produce identical kinematics, but the Rotate method has the side effect of changing the XYZ<br />
reference coordinates for any objects attached to the axis.<br />
Simulation»Construct Axis»Curve Axis<br />
Creates a curved profile axis, given an XYZ origin and<br />
a profile curve. Curved axes can be used to interpolate<br />
along an opened or closed track. Parameters common to<br />
all axes (not listed below) can be found on page 96.<br />
� Profile button: Select this button to enter a 2D<br />
profile curve. The profile is defined as a series<br />
of (x, y) pairs of coordinates, one pair per line.<br />
Use the Apply button in the profile builder to see<br />
changes to the profile curve.<br />
� Translation only: When a curve axis moves, the<br />
objects that are attached to it can be moved<br />
through space as a simple translation, or they<br />
can be both translated and rotated to stay “normal”<br />
to the curve.<br />
98 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Axis (Quest only)<br />
If a single child object is attached to a curve axis, that object is attached to the curve axis origin<br />
in the standard way. If a second object is attached to the curve axis, that object is shown moved,<br />
or both moved and rotated, to the halfway point along the curve axis. The critical concept here is<br />
the word “shown”. All objects are attached to the curve axis at the origin, but they are shown<br />
equally spaced along the curve axis. Use a Reference axis to group two or more components that<br />
must be moved together along the curved axis.<br />
Because the profile curve is defined in the XY plane, the Rotate button must be used to orient the<br />
profile to its true position. The Rotate method has the side effect of changing the XYZ reference<br />
coordinates for any objects attached to the axis. You can eliminate this effect by attaching a<br />
“Reference Axis” to the curve axis, which you can use to rotate the coordinate system back to a<br />
standard orientation.<br />
Simulation»Construct Axis»Tool Axis<br />
Creates a tool axis, given an XYZ origin and tool<br />
reference type. Tool axes can define the spindle control<br />
point of the machine, pockets in a tool changer, or<br />
anywhere else that tools might be stored. Parameters<br />
common to all axes (not listed below) can be found on<br />
page 96.<br />
� Spindle: Specifies that this tool axis defines the<br />
spindle control point (SCP) of the machine. The<br />
Tool axis ID should be set to 1 (one) for the<br />
main spindle of the machine. Other tool ID‟s can<br />
be used if there are additional controllable spindles<br />
on the machine. The tool axis ID to use for<br />
a given tool can be selected in the model Load<br />
Tool Event macro.<br />
� Turret: Specifies that this tool axis defines one of a series of available tool mount positions<br />
arrayed on a lathe turret. The Tool axis ID should be set to 1 (one) for the main turret<br />
of the machine. Set the ID to 2 for the side turret of the machine. The Pocket ID is<br />
used by VM to know which turret position is active based on the current tool selected.<br />
Pocket numbers must be unique for each turret.<br />
� Pocket: Specifies that this tool axis defines a pocket in the tool changer or some other<br />
holding area. A Pocket ID must be given to identify the pocket number. VM automatically<br />
moves tools in and out of pockets during tool change operations. Use the CERUN and<br />
GENER Simulation»Tools menu to assign tools to pockets.<br />
� Other: Specifies a location where tools can be held. A typical use for this type of tool<br />
axis is to define a position on a tool change mechanism where tools are held while in<br />
transit. Tools can be attached or detached from an “other” axis type using the $FMSATA<br />
macro function.<br />
� Spindle activation: Select the “This tool axis is turning when the following spindle is<br />
activated” check box if the tool axis represents a spindle. This is common for the spindle<br />
on milling machines, and for live tooling on mill/turn machines. You would normally not<br />
select this for a Pocket or Other tool axis type. VM uses the Spindle ID to differentiate<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 99
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Axis (Quest only)<br />
between the different spindles that might be available on a machine. For mill/turn machines,<br />
use the Axes mapping tab page of the machine properties dialog to identify the<br />
spindle as milling or turning. For milling machines, the spindle ID should be 1 (one) for<br />
the main spindle of the machine. The choice of current active spindle can also be controlled<br />
using the $FMSMSP macro function.<br />
Use the Rotate button to establish the orientation of the tool when it is attached to the tool axis<br />
object.<br />
Note that, for QUEST at least, the tool axis represents one end of the kinematics chain. You<br />
cannot attach any other axis or entity to a tool axis. CERUN and GENER on the other hand allow<br />
holders and tools to be attached to a tool axis at run-time.<br />
Simulation»Construct Axis»Stock Axis<br />
Creates a stock axis given an XYZ origin. Stock axes<br />
define the table control point (TCP) of the machine.<br />
When stock, fixtures and parts are loaded onto the<br />
machine (using CERUN or GENER), they are mounted<br />
relative to a predefined stock axis.<br />
� Part: Specifies that this stock axis defines a table<br />
control point (TCP) of the machine. The ID<br />
should be set to 1 (one) for the most common<br />
mount point used on the machine. Other stock<br />
ID‟s can be used if there are additional part<br />
mount points on the machine, for example, if<br />
there are multiple work areas. Use the CERUN<br />
and GENER Simulation»Stock, Simulation»Fixture and Simulation»Part menus to import<br />
or define stock, fixture and part objects relative to stock axes.<br />
� Other: Specifies a location where stock, fixtures and parts can be held. The current active<br />
part can be set using the $PART macro variable.<br />
� Spindle activation: Select the “This stock axis is turning when the following spindle is<br />
activated” check box if the stock axis represents a spindle. This is common for the turning<br />
spindle on lathe machines. You would normally not select this for an Other stock axis<br />
type. VM uses the Spindle ID to differentiate between the different spindles that might<br />
be available on a machine. For mill/turn machines, use the Axes mapping tab page of the<br />
machine properties dialog to identify the spindle as milling or turning. For lathes without<br />
a C controllable axis, the spindle ID should be 1 (one) for the main turning spindle of the<br />
machine. The choice of current active spindle can also be controlled using the $FMSMSP<br />
macro function.<br />
You can define multiple stock axes if there are different places where stock and fixtures might be<br />
loaded. For example, a tombstone with 4 faces might define 4 stock axes; each positioned and<br />
rotated (using the Rotate button) to establish a part normal vector away from the surface. If your<br />
model simulates pallet changing, you should define a stock axis at the part reference point for<br />
each pallet.<br />
100 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Axis (Quest only)<br />
Note that, for QUEST at least, the stock axis represents one end of the kinematics chain. You<br />
cannot attach any other axis or entity to a stock axis. CERUN and GENER on the other hand allow<br />
stock fixtures and parts to be attached to a stock axis at run-time.<br />
Simulation»Construct Axis»Head Axis<br />
Creates a head axis, given an XYZ origin and head<br />
reference type. Head axes can define the location on the<br />
machine where exchangeable heads are mounted;<br />
positions on or around the machine where heads are<br />
stored when not in use; or anywhere else where heads<br />
might be attached. Parameters common to all axes (not<br />
listed below) can be found on page 96.<br />
� Head Socket: Specifies that this head axis defines<br />
the head control point (HCP) of the machine.<br />
The Socket ID should be set to 1 (one)<br />
for the main head control point of the machine.<br />
Other head ID‟s can be used if there are additional<br />
head mount points on the machine. The<br />
head axis ID to use for a given head can be selected in the model Load Tool Event macro.<br />
� Head Station: Specifies that this head axis defines a station in the head changer or some<br />
other holding area for head devices. A Station ID must be given to identify the station<br />
number. VM automatically moves heads in and out of stations during head change operations.<br />
Use the CERUN and GENER Simulation»Heads menu to assign heads to stations.<br />
� Other: Specifies a location where heads can be held. A typical use for this type of head<br />
axis is to define a position on a head change mechanism where heads are held while in<br />
transit. Heads can be attached or detached from an “other” axis type using the $FMSATA<br />
macro function.<br />
� Spindle definition: Select the “This head axis is connected to a spindle” check box if the<br />
head axis transmits the spindle force to attached head devices. This is common for the<br />
main head Socket. You would normally not select this for a Station or Other head axis<br />
type. VM uses the Spindle ID to differentiate between the different spindles that might<br />
be available on a machine. For mill/turn machines, use the Axes mapping tab page of the<br />
machine properties dialog to identify the spindle as milling or turning. For milling machines,<br />
the spindle ID should be 1 (one) for the main spindle of the machine. The choice<br />
of current active spindle can also be controlled using the $FMSMSP macro function.<br />
� Default head: Select the head device that will be attached to the head axis by default at<br />
the start of processing. This can be used to define the initial layout of heads at their predefined<br />
head stations if required. Changing the default head does not affect the current<br />
state of the model as shown in QUEST.<br />
� Currently loaded head: Use this to test the head processing of the model. Loading a<br />
head into a station will adjust the model navigator tree to show the selected head attached<br />
to the head axis. It will also draw the head at the head attachment axis. Only one head can<br />
be attached to a head axis at a time.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 101
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Construct Axis (Quest only)<br />
Use the Rotate button to establish the orientation of the head when it is attached to the head axis<br />
object.<br />
Simulation»Construct Axis»Reference Axis<br />
Creates a reference axis, given an XYZ origin and<br />
possible rotation (using the Rotate button). Reference<br />
axes do not cause motion. Instead, reference axes can be<br />
used to organize the model in the Model Navigator.<br />
You can attach a group of related objects to a reference<br />
and then collapse the group (in the model navigator),<br />
which might make the model easier to understand. You can also use a reference to establish a<br />
new coordinate frame for a group of related objects.<br />
102 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.3.8 Simulation»Camera<br />
Controls various aspects of the positioning of the camera.<br />
Simulation»Camera»Fit (Ctrl Space 1 )<br />
The Camera Fit function first points the camera towards the center<br />
of the currently selected object, and then pans in or out so that the<br />
selected object is fully visible within the simulation window. If no<br />
object is selected, then the camera will be adjusted to view the<br />
entire model. You can use this function to quickly reorient the<br />
camera when you are unsure of where you are pointing or if you<br />
cannot see the model. The Fit function is also available from the<br />
VM View toolbar.<br />
When the current focus is on the Controller Timeline window, the<br />
Fit function will adjust the scale of the Timeline window so that the<br />
entire process is visible.<br />
Simulation»Camera»Center (Ctrl Shift Space)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Camera<br />
The Camera Center function points the camera towards the center of the currently selected<br />
object, or if no object is selected, then towards the origin of the Grid reference (i.e., the center of<br />
the three grids).<br />
When the current focus is on the Controller Timeline window, the Center function will adjust the<br />
position of the Timeline scale so that the blue vertical line (marking the current time position) is<br />
visible and centered in the Timeline window.<br />
Simulation»Camera»Pivot (Ctrl P)<br />
The Camera Pivot function sets the center of rotation for the camera to the center of the currently<br />
selected object. The pivot center is the point in space at which the camera will aim as it is<br />
rotated. If no object is selected, then the camera will rotate about the origin of the Grid reference<br />
(i.e., the center of the three grids).<br />
Simulation»Camera»Attach<br />
Attaches the camera to the currently selected object. If no object is selected, the camera is<br />
attached to the world coordinate system (this is the default). When the camera is attached to an<br />
object, the camera moves with the object. Standard viewpoints are always in relation to the<br />
attached object.<br />
1 The Ctrl Space hotkey combination might be unavailable due to a Microsoft Chinese language IME bug.<br />
Use “Ctrl .” (control key and decimal point) as an alternate.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 103
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Camera<br />
Simulation»Camera»Perspective<br />
Switches between Perspective and Orthogonal projection in the simulation window. The Perspective<br />
projection provides a more realistic viewing of the simulation, equivalent to what you<br />
would see in the natural world. With Orthogonal projection, distance has no effect on the size of<br />
an object. Orthogonal views typically provide better control when defining part, stock and fixture<br />
objects.<br />
Simulation»Camera»Front<br />
Simulation»Camera»Back<br />
Simulation»Camera»Top<br />
Simulation»Camera»Bottom<br />
Simulation»Camera»Left<br />
Simulation»Camera»Right<br />
Switches the camera to one of six standard viewpoints (the VM<br />
View toolbar shown at left provides buttons for each standard<br />
viewpoint). Viewpoints are relative to the frame defined in the<br />
VM Grid toolbar (the stock axis by default).<br />
The camera can only be panned (i.e., not rotated) when a standard viewpoint is selected. You can<br />
select and then immediately unselect a view button, to first snap to a standard view and then<br />
allow camera rotation.<br />
Simulation»Camera»Speed (Ctrl + , Ctrl –)<br />
The Speed»Increase and Speed»Decrease<br />
menu selections (Ctrl + and Ctrl – shortcuts)<br />
adjust the default step size used when panning<br />
the camera. Each activation of the menu will<br />
only adjust the speed setting by one notch, so it<br />
is far more convenient to use the shortcut keys.<br />
When adjusting the camera speed, a “volume<br />
control” type bar will appear briefly in the<br />
simulation window to show a relative measure<br />
of the current step size.<br />
The step size can be temporarily reduced, while panning, to 1/10 th the normal amount by holding<br />
the Shift key.<br />
104 <strong>ICAM</strong> Technologies Corporation – Proprietary
Simulation»Camera»View Angle (Shift + , Shift –)<br />
The View Angle»Increase and View Angle»<br />
Decrease menu selections (Shift + and Shift –<br />
shortcuts) adjust the viewing angle of the<br />
camera lens. Each activation of the menu will<br />
only adjust the viewing angle by one notch, so<br />
it is far more convenient to use the shortcut<br />
keys. The viewing angle is used in Perspective<br />
mode only.<br />
When adjusting the angle, a viewing angle size<br />
indicator will appear briefly in the simulation<br />
window.<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Camera<br />
The default viewing angle is 40 degrees. Increasing the viewing angle makes it possible to see<br />
more of the model, at the expense of some distortion. Decreasing the viewing angle makes it<br />
possible to look at the model in fine detail, but makes it a little harder to navigate.<br />
Simulation»Camera»Load (Ctrl 0-9)<br />
Simulation»Camera»Save (Ctrl Alt 0-9)<br />
The Camera Save menu selection (Ctrl Alt 0 through Ctrl Alt 9 shortcuts) records the current<br />
camera viewpoint, position and orientation in one of 10 standard user-defined viewpoints. The<br />
Camera Load menu selection (Ctrl 0 through Ctrl 9 shortcuts) resets the camera to a previously<br />
saved position. The camera can directly switch to the new position, or it can smoothly interpolate<br />
to the new position, if both the old and new positions share the same underlying viewpoint (i.e.,<br />
both are perspective views, or both are front views). The Camera animation mode can be set<br />
from the Simulation»Options “use camera animation” check box.<br />
Simulation»Camera»Reset<br />
The Camera Reset menu entry resets all camera settings and moves the camera to an application<br />
default viewpoint. The reset operation also removes all saved camera viewpoints and resets the<br />
camera speed and viewing angle to the application defaults.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 105
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Show<br />
4.3.9 Simulation»Show<br />
Toggles the display of various visual aids, including: wireframe<br />
vs. solid rendering, tool path tracing, visibility of various<br />
component categories (i.e., filters), datum reference grids,<br />
coordinate system markers, kinematics component markers,<br />
safety zone visibility, workpiece vs. model coordinates, and the<br />
heads-up display.<br />
Simulation»Show»Wireframe<br />
The Show Wireframe function switches<br />
between solid and wire-frame rendering of the<br />
simulation window.<br />
Wire-frame mode enables objects that are<br />
behind others to be seen. However, an object<br />
that is obscured by another still cannot be<br />
selected with the mouse pointer, even when in<br />
wire-frame mode, because the selection is<br />
done on the faces of surfaces, not on their<br />
vertices.<br />
When looking at the backside of a surface in “solid” mode, the surface may appear as solid, or as<br />
wire-frame, or invisible. This setting is controlled by the “Backface” options in the Simulation»Options<br />
(Ctrl Alt O shortcut) panel.<br />
Simulation»Show»Tool Path (Ctrl T) (CERUN & GENER only)<br />
The Show Tool Path function activates or<br />
deactivates tool path tracing in the simulation<br />
window. Tracing can also be toggled from the<br />
VM Mode toolbar. Tracing shows the path of<br />
the tool with respect to the part. Rotary motions<br />
may cause linear tool paths to appear as<br />
curves; this is natural and reflects the actual<br />
path of the tool with respect to the part.<br />
The tool path trace shows different colors for<br />
rapid and feed motions. The default is red for<br />
rapid positioning motions and green for all<br />
106 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Show<br />
feed interpolated motions. When using the Trace window and Timeline “Synchronize” feature,<br />
the corresponding motion is traced in blue. The trace can appear at the tool-tip or the spindle<br />
control point. The trace can be limited to a specified elapsed time, or it can show the tool path for<br />
the entire program. Trace options are set by selecting Simulation»Options (Ctrl Alt O shortcut).<br />
Simulation»Show»Tool Path as Overlay (Ctrl Shift T) (CERUN & GENER only)<br />
Selecting the Show Tool Path as Overlay function will ensure that the tool path always remains<br />
visible, even when it would normally be hidden behind other objects in the scene.<br />
Simulation»Show»Filters (CERUN & GENER only)<br />
The Show Filter functions<br />
are toggles that<br />
activate or deactivate the<br />
display of various components in the scene. Filters can also be toggled<br />
from the VM View Filters toolbar.<br />
The <strong>Machine</strong> filter toggles the display of all components defined<br />
within the model. This includes the machine, heads and<br />
any other model objects as defined and saved in the model with<br />
QUEST.<br />
The Tools filter toggles the display of all tooling components defined at run-time via the<br />
Simulation»Tools (Ctrl Alt T) function. This includes tools and their holders, both active<br />
and inactive.<br />
The Fixtures, Stock and Parts filters toggle the display of the workpiece and<br />
holding devices as defined at run-time via the Simulation»Stock (Ctrl Alt S) function.<br />
The remaining filters are only available when the Material Removal Simulation (MRS) license<br />
option is enabled.<br />
The In-process Stock filter toggles the display of the stock as modified by the cutting<br />
action of the tools. At the start of processing, the Stock and In-process Stock are identical,<br />
but they should be quite different by the end of processing.<br />
The Boolean Overcut filter toggles the display of any gouges in the in-process stock as<br />
compared to the original part. Gouges are shown in red. VM only compares those inprocess<br />
stock and part components that are associated to each other. Part/stock association<br />
is done from the Simulation»Stock/Fixtures/Part menu.<br />
The Boolean Undercut filter similarly toggles the display of excess in-process stock<br />
when compared to the original part. Excess material is shown in blue.<br />
The Colorized Boolean filter modifies the color of the Boolean overcut and undercut<br />
regions, based on the thickness of the gouge or excess material. Colorized Boolean settings<br />
are controlled from the Simulation»Compare (Ctrl Alt Q) dialog.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 107
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Show<br />
The Transparent Zero filter modifies the display of the colorized Boolean comparison,<br />
to show in a transparent color all faces of the object that are in the tolerance zone between<br />
gouge and excess material. This setting can be used to see a gouge or excess in the<br />
context of the entire part.<br />
Simulation»Show»XY Plane Grid<br />
Simulation»Show»YZ Plane Grid<br />
Simulation»Show»ZX Plane Grid<br />
The Show XYZ Plane Grid functions activate<br />
or deactivate wire-frame grids showing the<br />
XY, YZ and ZX datum planes of the model.<br />
Grid visibility can also be toggled from the VM Grid toolbar. Grids are normally displayed with<br />
respect to the base frame of the model, but this can be changed by selecting a different frame of<br />
interest from the drop-down list on the VM Grid toolbar.<br />
Grid spacing, colors, units and other settings are all controlled by selecting Simulation»Grid<br />
(Ctrl Alt G shortcut).<br />
Simulation»Show»Axes Marker<br />
The Show Axes Marker function activates or<br />
deactivates the axes arrows that show the<br />
origin (i.e., 0,0,0 point) of the currently<br />
selected object. These markers can also be<br />
toggled from the VM Grid toolbar.<br />
By default, each axis appears in a different<br />
color; red for X, green for Y and blue for Z.<br />
The default axes marker color settings as well<br />
as the arrow appearance and size can all be<br />
changed by selecting Simulation»Grid<br />
(Ctrl Alt G shortcut).<br />
Simulation»Show»Kinematics<br />
The Show Kinematics function activates or deactivates the markers that show all axes types<br />
except for Reference Axes. The visible marker types are as follows:<br />
� A linear axis appears as a pale blue ribbon line with arrows at each end. The current axis<br />
position is indicated by a darker colored band.<br />
� A rotary axis appears as a light mauve ribbon arc, with a single arrow serving the dual<br />
purpose of pointing in the positive rotation direction and indicating the current position.<br />
� A curve axis appears as a dark mauve ribbon connecting each of the points in the curve<br />
axis profile. The current axis position is indicated by a lighter colored band.<br />
� A tool axis appears as two 2D profiles of a holder and tool; one aligned with the X axis<br />
and the other with the Y axis.<br />
108 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Show<br />
� A stock axis appears as a gold colored rectangle, with an internal red-green-blue coordinate<br />
frame marker.<br />
� A head axis appears as a gold colored 2D profile of a 90º head.<br />
� A reference axis appears as a red-green-blue coordinate frame marker.<br />
The kinematics markers can also be toggled from the VM Grid toolbar.<br />
Simulation»Show»Safety Zones<br />
The Show Safety Zones function enables or disables the display of the safety zone that surrounds<br />
any collision enabled object that also has a safety clearance distance defined. The safety zone<br />
appears as a transparent light blue surface, offset from the original surface by the safety distance.<br />
An object‟s safety zone is always shown in transparent orange when another collision-enabled<br />
object touches it, regardless of the Show Safety Zones setting. Colliding objects are always<br />
shown in transparent red. The intersection between colliding objects is shown as a bright yellow<br />
line, unless this feature is disabled in the Simulation»Options dialog (Ctrl Alt O shortcut).<br />
Simulation»Show»Workpiece Coords (Ctrl W) (CERUN only)<br />
The Show Workpiece Coords function toggles between the display of linear axes values and<br />
workpiece linear coordinates in both the Controller Axes tab and the simulation window HUD.<br />
When workpiece coordinates are enabled, the linear axes are labeled Xw, Yw, Zw, and the value<br />
shown is the distance from the local coordinate system (LCS) origin.<br />
Simulation»Show»Display<br />
Simulation»Show»Next Display (Ctrl D) (CERUN & GENER only)<br />
Simulation»Show»Previous Display (Ctrl Shift D) (CERUN & GENER only)<br />
The Display menu selection activates or<br />
deactivates the “heads-up” status display that<br />
floats in front of the simulation window. The<br />
HUD lists the status of various components of<br />
the model (e.g., current tool, axes positions,<br />
feed rate). The content of the heads-up displays<br />
(there can be many) are defined by<br />
selecting Simulation»Display (Ctrl Alt D<br />
shortcut) described on page 116.<br />
Display menu choices are stored in the<br />
Windows Registry – not with the model or<br />
the .vsw setup file.<br />
During processing with GENER or CERUN, you can cycle between the various display content<br />
types using the Next Display and Previous Display menu selections (Ctrl D and Ctrl Shift D<br />
shortcuts). Note that these shortcuts are not available with QUEST (in fact, the Ctrl D shortcut<br />
activates the Database navigator).<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 109
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Measure<br />
The heads-up display can also be cycled from the VM Mode toolbar available with GENER and<br />
CERUN.<br />
4.3.10 Simulation»Measure<br />
The Simulation»Measure settings only take effect while in measurement mode,<br />
as set using the button on the VM Mode toolbar or Simulation»<br />
Mode»Measurement menu bar. Once in measurement mode, clicking with the<br />
left-mouse button causes measurements to be taken between the selected<br />
objects. Press and hold the Ctrl key to manipulate the camera with the mouse<br />
while taking measurements.<br />
Within VM, objects are constructed of triangles. The Simulation»Measure<br />
menu-bar functions and matching VM Measure toolbar provide toggles<br />
that: change how measurements are taken; affect the objects that can be<br />
picked for measurement; and affect the visibility of the measurement results.<br />
The Fan selection switches between chained (one to the next) and fanned (one to many)<br />
measurements.<br />
The Vertex selection enables or disables the picking of points on the boundary of the<br />
triangles that make up the in-process stock object.<br />
The Edge selection enables or disables the picking of edges of the triangles that make up<br />
the in-process stock object.<br />
The Triangle selection enables or disables the picking of faces of the triangles that make<br />
up the in-process stock object.<br />
The Overlay selection, when enabled, ensures that the objects selected for measurement<br />
will always be visible, no matter how the camera is oriented.<br />
If none of the Vertex, Edge or Triangle selections is active, then by default all objects are enabled<br />
for selection.<br />
Measurement information appears as a HUD (head-up display) in the simulation window,<br />
showing the distance and angle between selected entities, as well as the xyz offset using the<br />
frame selected in the VM Grid tool-bar.<br />
110 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.3.11 Simulation»Use World CS (QUEST only)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Use World CS (Quest only)<br />
The Use World CS function toggles between two possible representations of component coordinates.<br />
When selected, component coordinates are listed in world coordinates, originating from<br />
the center of the grids. When unselected, a component‟s coordinates are listed relative to its<br />
parent (i.e., in local coordinates). The Use World CS function can also be toggled from the VM<br />
Construct toolbar.<br />
The Use World CS setting also affects the placement of objects copied from one place to another<br />
in the model navigator. When world coordinates are selected, the object retains its position in<br />
space despite being moved or copied from one place to another in the navigator hierarchy. When<br />
local coordinates are selected, a copied or moved object is always placed relative to its new<br />
parent at the same offset it was originally at relative to its old parent.<br />
It is also important to note that when world coordinates are selected, objects are attached to the<br />
model based on the current model axes settings. You might get unexpected results if the axes are<br />
not at their default locations. You should select the Reset All Axes button in the QUEST Axes<br />
window before creating, copying or moving objects.<br />
4.3.12 Simulation»Group Selection (QUEST only)<br />
Objects can be grouped together in QUEST so that picking any object in a group will cause the<br />
entire group to be selected. For example, the cosmetic features of a machine could all be grouped<br />
together so that they could then be easily selected and hidden during GENER or CERUN processing<br />
(see the Hide Selection function on page 112).<br />
To create a selection group, drag the first object of the group from the model navigator to the<br />
Groups»Selection header. A new “Selection Group01” group will be created containing that<br />
object. Other related objects can then be added to the group by dragging them from the model<br />
navigator to the selection group. Hold the Ctrl key down when dragging to also include all<br />
dependent objects in the model navigator tree.<br />
Multiple selection groups can be created as necessary, but an object can only appear in a single<br />
selection group at a time. Objects can be easily dragged from one selection group to the next.<br />
Delete an object from a selection group to remove its “grouped” attribute.<br />
When the Group Selection function toggle is active, picking an object that belongs to a selection<br />
group will cause all objects of that group to be selected. This is the only form of object picking<br />
that is supported with GENER and CERUN. When the Group Selection function toggle is not<br />
active and an object is picked, only that object is selected. The Group Selection function can also<br />
be toggled from the VM Construct toolbar.<br />
The default visibility of a selection group can be set from the selection group Properties.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 111
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Hide Selection (Ctrl B)<br />
4.3.13 Simulation»Hide Selection (Ctrl B)<br />
The Hide Selection function makes the currently<br />
selected object or objects invisible.<br />
Once an object is hidden, it is no longer shown<br />
in the simulation window. Hidden objects<br />
continue to be tested for collisions.<br />
To select an object, press and hold the Ctrl key<br />
(if you are in Camera mode), move the mouse<br />
pointer to the object to be selected, and then<br />
press the left-mouse button. The selected<br />
object will become transparent. You can<br />
unselect an already selected object, or add<br />
more objects to the list of selected ones, by holding the Shift key down when making a selection.<br />
Press the Ctrl B shortcut to make the selected objects invisible.<br />
In the image shown at right, the machine enclosure has been hidden (it is longer visible), and the<br />
tables and fixtures have been selected (they are shown transparent). Hiding and selecting are two<br />
methods you can use to get an unobstructed view of the manufacturing process.<br />
4.3.14 Simulation»Show All/Rehide (Ctrl Alt B)<br />
The Show All/Rehide function makes visible all hidden objects. Select this function a second<br />
time to again hide the objects that were just made visible.<br />
4.3.15 Simulation»Invert Hide State (Ctrl Shift B)<br />
The Invert Hide State function reverses the “hidden” state setting for all objects. Objects that are<br />
hidden will now be shown, and those are shown will now be hidden. You can use this feature to<br />
unhide one or more selected objects, as follows:<br />
� Type Ctrl Shift B to show just the hidden (and any selected) objects<br />
� Select the objects you no longer want hidden<br />
� Type Ctrl B to remove them from view<br />
� Type Ctrl Shift B to return back to the original display<br />
112 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.3.16 Simulation»Grid (Ctrl Alt G)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Grid (Ctrl Alt G)<br />
Activates the Grid dialog, which defines the boundaries and appearance of the world. The Reset<br />
button resets the grid appearance and size to reasonable values.<br />
Grid Units can be set to any convenient value and need not match the units used when the model<br />
was created. For optimal display and control, the grid dimensions (Min/Max grid value) should<br />
exceed the dimensions of the model itself. The Grid subdivision size defines the spacing of the<br />
grid, for visual clarity only (excessively small spacing can greatly increase the CPU requirements<br />
during scene rendering). The Snap to grid check box and associated input field define a rounding<br />
factor that can optionally be used when interactively constructing objects using the mouse<br />
pointer.<br />
Select Grid color to set the color of the grid lines (the background color is set using the Simulation»Options<br />
dialog).<br />
The main axis (model origin), grid contour boundary and grid subdivision lines can all be<br />
toggled visible or invisible using the Display Show check boxes.<br />
The coordinate frame marker size, color and style can also be controlled from the Grid dialog.<br />
The three horizontal sliders in the Dimensions area control the size of the arrow. Colors for each<br />
axis of the marker can be set in the Colors area. The arrow style can be set using the Arrow type<br />
selection.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 113
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Lights (Ctrl Alt L)<br />
4.3.17 Simulation»Lights (Ctrl Alt L)<br />
Activates the Light dialog, which is used to place and control the intensity of up to 8 different<br />
light sources. VM lights are not affected by solid objects. Lights shine through objects, do not<br />
cast shadows, and the lights themselves are not visible in the simulation window (but they are<br />
visible in the Light dialog to simplify placement). The Reset button sets all lights to default<br />
positions around the extremity of the grid. Lights should be reset whenever the underlying grid is<br />
reset (see Simulation»Grid). VM provides a certain amount of ambient light, but with ambient<br />
light you cannot differentiate the edges of similarly colored and aligned faces. Lights that are<br />
placed far back from the machine have essentially the same appearance as ambient light. The<br />
light sources must be moved closer to the machine, or their intensity increased, to be able to<br />
differentiate object edges.<br />
The horizontal slider rotates your viewpoint around the machine. The vertical slider changes the<br />
viewing distance. Lights appear as small boxes, but you may have to hide the machine (clear the<br />
Objects check box) to see them. Lights are positioned on a hemisphere using the left and rightmouse<br />
buttons. The left-mouse button controls the position on the hemisphere. The right-mouse<br />
button controls the size of the hemisphere. To adjust the light, place the mouse pointer over the<br />
light and then press and hold either the left or the right-mouse button. Move the mouse to change<br />
the lighting position or distance. Light intensity is controlled by the individual sliders associated<br />
with each light. The color of each light can be adjusted by first selecting the box to the right of<br />
the intensity slider and then choosing a color from the color chart. Using different colors for your<br />
light sources will improve depth perception.<br />
If a light appears immovable, perhaps the distance has been set to a very small value. In this<br />
case, use the right-mouse button to increase the lighting distance. It is also possible to position a<br />
light so far away that it can no longer be selected. In this case, the Reset button can be used to set<br />
all lights to their default positions.<br />
114 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.3.18 Simulation»Materials (Ctrl Alt M)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Materials (Ctrl Alt M)<br />
Activates the Materials dialog, which can be used to define standard material visual properties.<br />
Material properties are saved in a materials (.mat) file; work/materials.mat in the <strong>ICAM</strong> software<br />
installation directory by default. Select the […] button to choose an alternate materials file.<br />
There are five separate controls that affect how a material appears:<br />
� The Diffuse component is the color of the object.<br />
� The Ambient component is the color of light that indirectly strikes the object (for example,<br />
the color of the walls). For simplicity, the ambient component should be set to the<br />
same color as the diffuse component.<br />
� The Specular component is the color of the light given off by the main light source.<br />
� The Shininess slider determines how reflective the material‟s surface is. A shiny object<br />
reflects more of the specular light component back to the viewer.<br />
� The Transparency slider can be used to set material properties for plastics and glass. Set<br />
“stock” components transparent to have an unobstructed view of the tool path trace.<br />
The five material property values are assigned to each component when it is created or modified.<br />
The material name is also saved, for informational purposes only. Changing the properties of an<br />
existing material will not affect the model or any stock/fixture/part objects that have already been<br />
created. When displaying the material properties of a component, the material name will appear<br />
as “Custom” if the 5 properties cannot be exactly matched in the current materials file.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 115
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Display (Ctrl Alt D)<br />
4.3.19 Simulation»Display (Ctrl Alt D)<br />
Activates the Display dialog, which is used to change the HUD “heads-up” display settings. The<br />
heads-up display is a small status screen that floats above the simulation window. The position,<br />
content and appearance of the heads-up display are controlled from the Display dialog.<br />
Individual layout schemes can be saved in the windows registry by selecting Save As and<br />
entering a name. Changes to the currently listed scheme (in the Scheme drop-down) are saved<br />
when OK is pressed. A<br />
scheme can be removed<br />
from the registry by<br />
selecting the name in the<br />
scheme drop-down and<br />
then selecting Delete. The<br />
“Default” scheme cannot<br />
be changed or deleted.<br />
Select the Show Display<br />
check box to activate the<br />
heads-up display in the<br />
simulation window (the<br />
Ctrl D shortcut does the<br />
same when the Display<br />
dialog is not active).<br />
Select the Use default<br />
schemes in cycle check<br />
box to include the Default<br />
display when using the Ctrl D shortcut to cycle through each of the schemes in sequence. The<br />
following status information can appear in the heads-up display.<br />
� Tool number: The current tool ID or tool pocket number.<br />
� <strong>Machine</strong> axis: The linear and rotary axes controlled by CERUN and GENER.<br />
� Feedrate: The current feed interpolation rate or the keyword RAPID.<br />
� Motion type: A keyword describing the type of motion, e.g., LINEAR, CIRCULAR.<br />
� Active compensations: Fixture, length and diameter compensation settings.<br />
� Coolant: The current coolant status.<br />
� Spindle: The current spindle status and rpm.<br />
� Time: Elapsed machining time.<br />
� Channels: Current active channel and time.<br />
� Extra spindles: Additional information about spindles.<br />
� Extra channels: Additional information about channels.<br />
� Head number: The current head ID or head pocket number.<br />
� FPS: The simulation window display rate in the form “a / b”. The value “a” is the redraw<br />
speed in frames/second and is an indicator of graphic performance. The value “b” is actual<br />
screen updates/second and is an indicator of total model performance.<br />
116 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Compare (Ctrl Alt Q)<br />
The Position input field specifies in which corner the heads-up display will appear. The text<br />
appearance is controlled by the Font, font Size, Bold, Italic and Text Color input fields. The<br />
heads-up display will appear directly over the simulation window contents. You can experiment<br />
with various frame background colors (BG Color) and vary the background opacity<br />
(BG Opacity) to obtain the best contrast.<br />
4.3.20 Simulation»Compare (Ctrl Alt Q)<br />
Activates the Simulation Compare dialog, which defines<br />
various settings used when comparing the in-process stock<br />
against the related part. This function is only available with<br />
a Material Removal Simulation (MRS) license.<br />
The association between a part and its corresponding inprocess<br />
stock are defined in the Simulation»Stock/Fixtures<br />
/Part dialog (on page 79).<br />
The comparison colorization settings are applied only to<br />
gouge and excess material, which must first be enabled by<br />
selecting one or both of the Boolean Overcut and Boolean<br />
Undercut filters (on page 107).<br />
The comparison is done by sampling the surface of the<br />
gouge and/or excess material, and computing the shortest distance to the part. The distance is<br />
then used to assign a fixed or graduated color, as defined using the various options of the Compare<br />
dialog. If the sample size is small, or the part very large, the colorization process may take a<br />
long time to compute. The comparison can be cancelled at any time, in which case the displayed<br />
results will be incomplete (but perhaps still useful).<br />
The settings of note on the Compare dialog are:<br />
� Units: Specifies the units of measure for all numeric values in the dialog.<br />
� Sampling steps: Specifies the maximum distance along the surface between comparison<br />
measurements. Using a small value may greatly increase the computation time and complexity<br />
of the resulting colorized object.<br />
� Scale style: Defines how the excess and gouge distances will be colorized. Three excess<br />
and three gouge zones are available, at increasing offsets from the part. With the Solid<br />
color and Gradient color settings, each zone is represented by a single user definable color<br />
(using the color buttons to the right of the scale). With the Gradient zone setting, the<br />
inner two zones can individually be color graduated between two colors.<br />
� Track measurement…: If selected, the measured distance between stock and part under<br />
the cursor will be shown and dynamically updated as the cursor moves. You can also<br />
toggle this feature on and off using Ctrl Q.<br />
Those surfaces on the colorized in-process stock that are neither gouged or excess will not be<br />
shown, unless the Simulation»Show»Filters»Transparent zero filter is enabled.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 117
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Options (Ctrl Alt O)<br />
4.3.21 Simulation»Options (Ctrl Alt O)<br />
Activates the Simulation Options dialog, which defines<br />
various settings used in the simulation.<br />
Animation Control Options<br />
The animation control options affect the simulation<br />
display speed. There are three modes of display:<br />
� Continuous: Select this method to slow the<br />
simulation down to some Scale factor of real<br />
time (within the limitations of the CPU and<br />
graphics capabilities of your computer). Select<br />
Motion Step during Tool Change to speed up the<br />
animation of tool changes.<br />
� Motion Step: Select this method to update the<br />
<strong>Virtual</strong> <strong>Machine</strong> window at the endpoint of every<br />
Step Size motions.<br />
� Time Interval: Select this method to only update<br />
the <strong>Virtual</strong> <strong>Machine</strong> window at a set Interval<br />
in seconds. This method has the least impact<br />
in terms of CPU requirements.<br />
Animation control settings are also available from the<br />
VM Animation toolbar available with GENER and<br />
CERUN.<br />
When in continuous animation mode, extremely slow motions may give the impression that the<br />
software is no longer operating. If unsure, activate the HUD motion display, which will show if<br />
axes are in fact moving. Animation control settings can be changed while the simulation is<br />
running (and even mid interpolation).<br />
Tool Path Options<br />
The Tool Path options control the display of the tool path trace. The trace appears as a thin line,<br />
with different colors representing interpolation and positioning.<br />
� The Enable tool path check box activates or deactivates tracing in the simulation window.<br />
� When the Tool path as overlay check box is selected, the tool path trace will not be hidden<br />
by objects that might be between you (the viewer) and the tool path.<br />
� The Feed, Rapid and Sync color boxes can be used to set the tool path trace display color<br />
for interpolation, positioning and synchronized motions.<br />
� Tool path trace selects whether the trace will appear at the tool tip or at the spindle control<br />
point (SCP). Tooling must be defined to see a difference between tool-tip and SCP<br />
traces.<br />
118 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Options (Ctrl Alt O)<br />
� Tool path mode selects the extent of the trace. The entire program can be traced or the<br />
trace can be restricted to motions that occurred within a specified time.<br />
� Tool path resolution defines the tolerance to use when approximating curved motions by<br />
short straight-line segments. The Max steps/motion setting limits the number of segments<br />
that will be draw for any one motion.<br />
World Background Color Options<br />
The world background color setting sets the underlying color of the simulation window.<br />
� The Use gradient check box can be selected to use a two-color smooth gradient background.<br />
� The Top color defines the background color if gradient fill is not selected, or the color to<br />
use at the upper edge of the simulation window when using a gradient fill background.<br />
� The Bottom color defines the color to use at the lower edge of the simulation window<br />
when using a gradient fill background.<br />
Backface Options<br />
The back-face setting controls how the backside of a surface should be shown. VM uses a mesh<br />
of triangles to represent objects. Each triangle has a concept of in and out, which is used in the<br />
drawing process to correctly color and shade the triangle. When an object is viewed from the<br />
inside looking out, VM provides the following choices on how the backside surface should be<br />
displayed:<br />
� Wireframe: An object‟s surface will be drawn in wire-frame mode when viewed from<br />
the inside. This setting may result in faint lines appearing at the edges of objects. Some<br />
graphic cards exhibit poor performance in this mode.<br />
� Solid: An object‟s surface will be drawn as a solid when viewed from the inside (this setting<br />
is only valid when not in Simulation»Show»Wireframe mode).<br />
� Hidden: An object‟s surface will be hidden when viewed from the inside.<br />
Miscellaneous Options<br />
The Miscellaneous options define various other settings as follows:<br />
� The Use 3D construction positioning check box controls the operation of the left-mouse<br />
button when constructing objects. When set, it takes two mouse clicks to define a point in<br />
space: the first defines the XY location and the second defines the Z. When the 3D check<br />
box is clear, the first mouse-click defines the XYZ coordinates.<br />
� The Default to Look-Around camera check box sets the default mode of camera rotation.<br />
When set, camera rotation by default rotates around the current camera position<br />
(like turning your head) and the Shift key must be pressed to rotate around a point in<br />
space in front of the camera. When this check box is clear, the default is the reverse. The<br />
camera will rotate around a point in space in front of the camera, and the Shift key will<br />
cause the camera to rotate around the current position.<br />
� The Use camera animation check box when set causes the camera to smoothly interpolate<br />
between any two user-defined viewpoints sharing the same projection type (i.e., per-<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 119
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 <strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Options (Ctrl Alt O)<br />
spective vs. orthogonal). When this check box is cleared, the camera jumps directly to<br />
each new viewpoint.<br />
� The Default to Camera mode check box sets the default<br />
functionality of the left-mouse button. When set, the default<br />
is “Camera” mode; meaning that the left-mouse button<br />
controls the orientation of the camera, and the Ctrl button must be held down to select<br />
objects. When this check box is clear, the default is “Selection” mode; meaning that the<br />
left-mouse button is used to select objects, and the Ctrl button must be held down to orient<br />
the camera. The Camera and Selection mode defaults can also be set using the camera<br />
and pointer buttons shown circled above on the VM Mode toolbar.<br />
� The Enable CL CAMERA check box when set allows the simulation window viewpoint<br />
to be changed under post processor or part program control, using the CAMERA post<br />
processor command. Clear this check box to ignore CAMERA post processor command<br />
settings.<br />
� The Show collision interference check box when set will dynamically show, as a yellow<br />
line, the intersection between colliding objects. Computing the intersection takes considerably<br />
more CPU than simply detecting if a collision has occurred. You can disable the<br />
viewing of collision interference if you encounter unacceptable performance with colliding<br />
objects on complex scenes.<br />
� The Limit Timeline memory check box and associated input field can be used to avoid<br />
out-of-memory conditions on very large programs. If set, the Timeline window will only<br />
use the specified amount of memory to track the events of the model. Once the limit has<br />
been reached, events earlier in the program will no longer be accessible via the Timeline<br />
window.<br />
� The Gouge tolerance setting specifies an acceptable collision tolerance between the cutting<br />
portion of the tool and the part model. Some undercutting is to be expected, which is<br />
normally a function of the manufacturing tolerance used by the CAM system. When the<br />
Material Removal Simulation (MRS) license option is enabled, the gouge tolerance also<br />
defines the cutting tolerance to use when computing the in-process stock. The actual cutting<br />
tolerance used is a function of the gouge tolerance and tool usage (see tool usage description<br />
on page 82)<br />
� The Collision tolerance setting specifies the accuracy in space of the beginning and end<br />
of a collision event between two objects.<br />
� The Faceting tolerance setting specifies the accuracy of mesh objects generated at<br />
runtime from swept profiles. A tighter tolerance produces more accurate results, but at<br />
the cost of increased memory and CPU. One of the key uses of the faceting tolerance is in<br />
the generation of 3D tooling given either a 2D profile or tool definition parameters (i.e.,<br />
diameter, corner radius, length…).<br />
120 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.3.22 Simulation»Open Setup (CERUN & GENER only)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Menu Bar<br />
Simulation»Open Setup (CeRun & Gener only)<br />
Activates a standard file dialog to select the name of the Verification Setup (.vsw) file to use for<br />
simulation. The setup file contains settings for lighting, grid, camera, viewpoints, etc. The setup<br />
file also contains a reference to a similarly named 3D Model (.m3d) file, which contains the part,<br />
stock and fixture definitions. Typically, each NC program input file will have an associated setup<br />
and 3D model file.<br />
4.3.23 Simulation»Save Setup (CERUN & GENER only)<br />
Activates a standard file dialog to save the current simulation settings. Simulation settings are<br />
saved in the Verification Setup (.vsw) and 3D Model (.m3d) files.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 121
4.4 Model Customization<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
This section describes the model customization features available with QUEST.<br />
� <strong>Virtual</strong> <strong>Machine</strong> uses the <strong>ICAM</strong> Macro Language facility (described starting on page<br />
123) to customize models. This is the same programming facility used with CERUN and<br />
GENER.<br />
� The Startup macro and Shutdown macro (on page 145) allow you to customize the actions<br />
of the model at the start and end of processing.<br />
� Event macros (on page 146) provide customization control at other key events in the<br />
simulation of the program.<br />
� The Dialog Editor (on page 148) allows you to build custom dialog boxes, which can be<br />
activated during processing to query the NC programmer for any necessary information.<br />
� Many built-in <strong>Virtual</strong> <strong>Machine</strong> specific macro functions (on page 147) are available to<br />
control model behavior.<br />
� There are also a couple of <strong>Virtual</strong> <strong>Machine</strong> specific macro variables (on page 194) that<br />
may prove useful.<br />
Syntax Conventions<br />
The syntax for the macro language is listed using the following format:<br />
� Square brackets [ ] encase syntax that is optional. The ~ symbol preceding the item, as in<br />
~[,a], indicates that the item can be repeated zero or more times.<br />
� Parentheses ( ) encase syntax that lists a number of choices, one of which is required. The<br />
~ symbol preceding the item, as in ~(,a), indicates that the item can be repeated one or<br />
more times. The parentheses are omitted when the syntax is a simple choice among a<br />
number of keywords.<br />
� Any value not contained in square brackets or parentheses must be programmed each<br />
time the command is used.<br />
� Formal keywords will be shown in upper case, as in ON and WHILE.<br />
� Lower case italicized words identify requirements for numeric values, as in label_name<br />
or value.<br />
� Alternate forms for a command will be listed separately, with the command name repeated.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 122
4.4.1 The Macro Language<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
The <strong>ICAM</strong> macro language is used for the customization of <strong>Virtual</strong> <strong>Machine</strong> models, as well as<br />
for the customization of CAM-POST post-processors and <strong>ICAM</strong> control emulators. Model<br />
macros share the same macro environment as the post processor and control emulator, giving<br />
them full access to system variables as well as user defined global variables. However, care<br />
should be taken to clearly separate the macro functions necessary in the model, from those<br />
necessary in the post-processor (GENER) or control emulator (CERUN).<br />
For example, global variables used in model macros should be defined in the model Startup<br />
macro, and not in the Startup macro of the post or control emulator. This ensures that the model<br />
is fully self-contained and can be used with another post processor if desired without undue<br />
changes.<br />
Model macros should not generate post processor commands. This is because the model customization<br />
environment is not post-processor command based; therefore, any post processor command<br />
contained in a model macro will have to be interpreted by GENER. This makes the model<br />
unavailable for use with CERUN, which does not recognize post processor commands.<br />
4.4.1.1 Fundamentals of the Macro Language<br />
There are a number of different macro types available with the <strong>ICAM</strong> macro language:<br />
� Startup and Shutdown macros are executed at the start and end of “special” events.<br />
For example, control emulators, post-processors and models all have main startup and<br />
shutdown macros. The startup macro is used to initialize global variables that are shared<br />
by all other macros. The shutdown macro typically performs any required housekeeping<br />
duties at the end of processing. Other startup/shutdown macro types exist in the different<br />
products to allow customization at the start and ends of key events. Model startup and<br />
shutdown macros are described in section 4.4.2 on page 145.<br />
� Event macros are similar to Startup and Shutdown macros, with the exception that a single<br />
macro is executed to handle customization necessary during the event. A special<br />
OUTPUT macro command in the event macro specifies where the built-in action is to occur.<br />
Model event macros are described in section 4.4.3 on page 146.<br />
� Control Emulator uses Code macros to customize the processing associated with CNC<br />
functions (i.e., code identifiers) that are read from the MCD. Control Emulator uses Data<br />
macros to customize the evaluation of register data (i.e. data identifiers). Code and Data<br />
macros are not described in this document as they are not used by <strong>Virtual</strong> <strong>Machine</strong>.<br />
� CAM-POST uses User-Defined macros to customize the processing associated with<br />
post-processor commands and other record data that are read from the CLDATA. Userdefined<br />
macros are not described in this document as they are not used by <strong>Virtual</strong> <strong>Machine</strong>.<br />
All of these macro types share the same common macro language syntax, and all of these macro<br />
types get information about the event that they are customizing via $P variables (described later).<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 123
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
Basic Macro Syntax<br />
Macro lines are APT-like in appearance, similar to the ASCII CL file output by many CAM<br />
systems. Statements begin on a new line, in the form “variable=expression”, “command/parameter-list”<br />
or simply “command”. If a statement is too long to fit within an 80 character<br />
line, it can be continued from one line to the next by ending the previous line with a single<br />
dollar character “$”.<br />
Macro comment lines begin with two dollar characters “$$”. Comments can be appended to the<br />
end of any statement by coding $$ followed by the comment text. A comment can also be<br />
specified following the $ continuation mark, but at least one space must separate the $ character<br />
from the comment text that follows.<br />
Blanks and the case of letters are ignored by the compiler unless they appear within a string<br />
constant (e.g., 'Hello World') or comment.<br />
Macros can be shown in one of two styles (set your preference from the “Macro Editor” tab of<br />
the Tools»Preferences menu-bar selection):<br />
� “Standard” is the traditional format. Macro commands and variables are shown in uppercase<br />
and logical operators are shown using the ANSI APT “.XX.” style.<br />
IF/I.GT.3.AND.I.LE.6<br />
� “C” is a more modern format. Macro commands and variables are shown in lowercase<br />
and logical operators are shown using the C style.<br />
if/i>3&&i
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
� An expression with STRING data type is a character string. String constants begin and<br />
end with single quotes ('). In order to include the single quote character within a string<br />
constant, two single quotes in a row must be specified. The string constant composed only<br />
of two single quotes represents a string composed of zero characters, called the “empty<br />
string”. The following are examples of valid numeric constants:<br />
'THIS IS A STRING'''<br />
' '<br />
'This string contains a single quote ('').'<br />
'a'<br />
If a string is too long to fit on one line, it can be broken into pieces using the concatenation<br />
operator (//) and the continuation character ($). Operators are discussed further in a<br />
later section. For example:<br />
%L01='This string could not fit on a single '//$<br />
'line so it was broken into pieces in order to '//$<br />
'fully specify it.'<br />
� An expression with KEYWORD data type is a Minor word. If a minor word is not defined<br />
for a specific code, then the keyword code constant can be specified in the form<br />
“#code”. The Minor word list (and associated codes) can be modified using the QUEST<br />
Words Manager. The following are examples of keyword constants:<br />
ON or #71<br />
RANGE #145<br />
CCLW #59<br />
� An expression with RECORD data type is a Major word or Reserved word representing<br />
a CLDATA record type. If a Major word or Reserved name is not defined for a specific<br />
record type, then the record type constant can be specified in the form “#class:subclass”.<br />
The Major word list (and associated codes) can be modified using the QUEST Words<br />
Manager. The following are examples of record constants:<br />
COOLNT or #2000:1030<br />
GOTO #5000:5<br />
#28000:*<br />
An asterisk (*) can be used in place of the class or subclass code to represent all classes<br />
or all subclasses. In the third example above, the record type constant represents all subclasses<br />
of record class 28000. The constant “#*:*” represents all record types.<br />
There are two other special types in the macro language: null and sequence.<br />
� If an expression has a null value, it is as if it has no value or an unknown value. The readonly<br />
system variable $NULL represents a null value. Note that zero is not equal to<br />
$NULL.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 125
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
� An expression with sequence data type consists of an ordered set of data elements. The<br />
data elements within a sequence can be of any type, and do not all have to be the same<br />
data type.<br />
The macro language does not require strong data typing. This means that the same variable can<br />
hold information of different types during the course of processing. This provides a great deal of<br />
flexibility and simplifies coding. For those who prefer a more formal arrangement, the DECLAR<br />
command can be used to strongly type variables.<br />
Macro Variables<br />
There are five types of variables: user variables, predefined global variables, predefined local<br />
variables, $P arguments and macro system variables. The following table describes the format of<br />
the various types of variables:<br />
Variable Type Variable Format Examples<br />
User A...Z~[A...Z 0...9_ ] I,ABC2,M4_J<br />
Predefined Global %Gnn %G2,%G02,%G23<br />
Predefined Local %Lnn %L2,%L02,%L23<br />
$P Argument $Pnn $P2,$P02,$P23<br />
System $name $XC,$PI,$T<br />
User variables must always start with an alphabetic character. The remaining characters can be<br />
any combination of letters, digits and the underscore character. The maximum size of a user<br />
variable is 32 characters.<br />
Global variables retain their value across all macros; local variables only retain their value while<br />
a macro is running and are forgotten once it is finished. Global values can therefore be used (and<br />
in fact are the only way) to pass information from one macro to another, whereas local variables<br />
are used for calculations local to a specific macro. By default, user variables are local unless a<br />
DECLAR command is given in the machine startup macro declaring the variable as global.<br />
For predefined local variables, predefined global variables and $P arguments, the leading zero of<br />
the variable number is optional (in other words, %G02 is same as %G2, %L02 is same as %L2,<br />
and $P02 is same as $P2). Predefined global variables (%G00…%G99) do not need a DECLAR<br />
statement since they are predefined as global. The same is true for predefined local variables<br />
(%L01…%L99).<br />
There is a predefined set of macro system variables. Some variables cannot be assigned values,<br />
and most that can be assigned can take only numeric values. See “Simulation Macro Variables”<br />
on page 205 for a list of available macro system variables.<br />
126 <strong>ICAM</strong> Technologies Corporation – Proprietary
Detecting Data Type Mismatching<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
The compiler tries to ensure data type agreement between the argument expressions and the<br />
operators, functions or macro commands that operate on them. Each line is checked independently<br />
of any other line. Since variables can have any data type, the amount of type checking done is<br />
limited. For example, the following line of code would cause a macro compiler error in QUEST:<br />
%L02='abc'+4<br />
The following two lines would not cause a compiler error, even though they are equivalent to the<br />
line above. These lines however would cause a processing error at run-time when the VM macro<br />
is executed.<br />
%L03='abc'<br />
%L02=%L03+4<br />
Explicit Type Declaration (DECLAR)<br />
The DECLAR command can be used to explicitly define a user variable as being GLOBAL or<br />
LOCAL, and can optionally restrict the type of information held by the variable. All variables<br />
defined using DECLAR are automatically initialized. The basic syntax is as follows:<br />
, LOGICAL<br />
KEYWORD<br />
RECORD<br />
REAL<br />
� STRING �<br />
� �<br />
DECLAR /<br />
�GLOBAL<br />
� � �<br />
�� LOCAL �� � �<br />
�<br />
�<br />
�<br />
�<br />
1:<br />
n<br />
�, variable _name<br />
�<br />
If GLOBAL is specified, then the variable being declared is global to all macros. If LOCAL is<br />
specified (the default) then the variable is local to the macro in which it is declared. Global<br />
variables should all be defined in the model startup macro. Local variables of course must be<br />
defined in the macro where they are being used.<br />
By default, a variable can hold any type of information, and the type can change at any time<br />
without restriction. If a variable is declared with a specific type, then an error will be issued at<br />
run-time if data of the wrong type is loaded into the variable.<br />
One or more variable names can be defined in a single DECLAR command. In addition, variables<br />
can be defined as arrays by specifying the number of array elements within parentheses ( )<br />
immediately following the variable name. The RESERV command (described a little further<br />
below) can also be used to define arrays in a more traditional way for those familiar with APT<br />
programming.<br />
Variables are assigned a default value when they are declared. These defaults are: blank string<br />
for STRING, zero for REAL, .FALSE. for LOGICAL, #0 for KEYWORD, #0:0 for RECORD,<br />
and $NULL for an untyped variable. An undeclared variable is assigned a default value of zero if<br />
it is referenced before it is assigned a value.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 127
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
For example:<br />
$$ a global untyped variable named LU1<br />
DECLAR/GLOBAL,LU1<br />
$$ a global logical variable array size 10<br />
DECLAR/GLOBAL,LOGICAL,FLAG(10)<br />
$$ 3 local variables that can only hold real values<br />
DECLAR/LOCAL,REAL,X1,Y1,Z1<br />
It is illegal to specify a predefined variable name in a DECLAR command. For example, any<br />
variable with a leading “%” symbol or “$” symbol is predefined and cannot appear in a<br />
DECLAR command. In addition, once a variable is declared it in effect becomes “predefined”<br />
and must not be declared again. That is why it is recommended that all global declarations be<br />
placed in the model startup macro, where they are only declared once.<br />
Array Declaration (RESERV)<br />
The RESERV command is used to define a variable as being an array (the DECLAR command<br />
can also be used for the same purpose). The basic syntax is as follows:<br />
RESERV<br />
/<br />
1 : n<br />
� � � �<br />
, variable _name,<br />
elements , length<br />
The “elements” is a whole number specifying how many elements there are in the named variable.<br />
If the array is to hold text strings, a second whole number can be given specifying the length<br />
of each string in the string array. If “length” is omitted for a string array, the length will be<br />
determined based on the first assignment operation.<br />
To refer to a specific element in an array variable, specify the element number within parentheses<br />
immediately following the array variable name. The element number can be specified either<br />
as a numeric constant or by an expression that returns a numeric result.<br />
An array of 10 elements is defined in the following example. The first element is assigned a<br />
value of 1 (one). Each subsequent element is double the value of the preceding one.<br />
DECLAR/GLOBAL,A1<br />
RESERV/A1,10<br />
A1(1)=1<br />
DO/I=2,10<br />
A1(I)=2*A1(I-1)<br />
ENDOF/DO<br />
128 <strong>ICAM</strong> Technologies Corporation – Proprietary
Operators<br />
Numeric, String and Sequence Operators<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
The following table summarizes the numeric, string and sequence operators available in the<br />
macro language in decreasing order of precedence. You cannot use numeric operators on strings,<br />
nor can you use the string operator on numbers.<br />
Operator Function Example<br />
** Exponentiation $P3**2<br />
/ Division $PI/2<br />
* Multiplication 3.5*$P1<br />
+ Addition %G00+%L00<br />
- Subtraction %G00-3<br />
: Sub-string/sequence $P2(1:3)<br />
// String concatenation 'PART'//%L02<br />
( ) Group %L01/(%L02+4)<br />
{ } Sequence {$XC,$YC,$ZC}<br />
A series of exponentiation operations are evaluated from right to the left. The following are<br />
equivalent:<br />
a**b**c<br />
a**(b**c)<br />
The multiplication and division operators have the same level of precedence. A series of<br />
multiplications and/or divisions are evaluated from left to right. The following are equivalent:<br />
a*b/c<br />
(a*b)/c<br />
The addition and subtraction operators similarly have the same level of precedence and are<br />
evaluated from left to right. The following are equivalent:<br />
a+b-c<br />
(a+b)-c<br />
Putting the numeric operators together, the following are equivalent:<br />
a+b**c/d<br />
a+((b**c)/d)<br />
The substring/subsequence operator is used as “variable(start:end)” to return a range of characters<br />
instead of a single character of the named string variable, or to return a range of elements<br />
instead of a single element in the named sequence variable. It is important to note that the<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 129
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
sequence operator cannot be used to return a range of elements of an array. If the starting position<br />
is omitted, the returned range starts at the first character or element. If the ending position is<br />
omitted, the returned range ends at the last character or element.<br />
STR(6:)<br />
$P3(1:3)<br />
The concatenation operator can only be used with string constants and variables or functions<br />
have a string type.<br />
'(MSG, '//$PARTNO//')'<br />
The grouping operator “( )” has a variety of purposes. It can used following an array, string or<br />
sequence variable name to identify the element(s) to return. It can be used following a function<br />
name to define the input parameters of the function. It can also be used in an expression to<br />
influence the order of evaluation since expressions in parentheses are evaluated first, and from<br />
the deepest nest level outwards. Use of the grouping operator can be seen in nearly all of the<br />
examples above.<br />
The sequence operator “{ }” is used to construct a sequence of zero or more elements. The<br />
return value is a sequence expression consisting of all the elements contained within the braces.<br />
{1,'str',.TRUE.}<br />
Logical Operators<br />
This next table lists the logical operators available in the macro language (two styles are available)<br />
in decreasing order of precedence. A logical operator compares two variables or constants,<br />
returning a value of “.TRUE.” or “.FALSE.”. Both items being compared must be of the same<br />
type.<br />
Operator Function Example<br />
.EQ. == Equality %L23.EQ.$NULL<br />
.NE. != Non equality $P0.NE.1.0<br />
.GT. > Greater than $FLEN(%G00).GT.10<br />
.LT. < Less than 1.0.LT.$XC<br />
.GE. >= Greater than or equal $YM.GE.4<br />
.LE.
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Fundamentals of the Macro Language<br />
tion operator, then the logical “and” followed lastly by the logical “or”. The following are<br />
equivalent:<br />
A.LT.B.OR..NOT.C.GT.D.AND.E.EQ.F<br />
(A.LT.B).OR.((.NOT.(C.GT.D)).AND.(E.EQ.F))<br />
ad&&e==f<br />
(ad))&&(e==f))<br />
Function Calls<br />
The macro language provides a wide variety of functions to simplify the task of writing macros.<br />
Functions accept zero or more arguments as input and return a value of a specific type (e.g., real<br />
or logical), although there are a few functions that can return various result types. See<br />
“Simulation Macro Functions” on page 152 for a description of available VM specific macro<br />
functions, their input arguments and return values.<br />
The general syntax of a function call is as follows:<br />
$Ffunction_name( [argument [,argument...]] )<br />
The order in which the arguments are specified is very important. Some functions require no<br />
arguments, but the parentheses must still be specified. For example, the $FGETCWD() function<br />
(always called without parameters) returns the file path of the current working directory.<br />
A function can be used in an expression anywhere a value is permitted, if the function returns a<br />
data type consistent with the rest of the expression. Functions can be called as arguments to other<br />
functions.<br />
External Functions<br />
The macro processor supports the use of global user functions written in C ++ that have been<br />
compiled and linked into a shareable library (e.g., a .dll file on Windows or a .so file on UNIX).<br />
Sample source files, an API development kit and HTML documentation can all be found in the<br />
installation “Samples/SDK” folder.<br />
External functions must be defined before they can be used, so that the macro processor will<br />
know the name of the function and the number and data types of the parameters that are passed<br />
to the function. The declaration syntax is as follows:<br />
DECLAR / EXTERN,FUNCTION,'filename'[,type],name([type[,...])<br />
The filename string specifies the name of the shareable library. If the filename does not include<br />
the file type (e.g., .dll). then the default file type for the current Windows or UNIX architecture<br />
will be used. If the filename does not include a file path, or if the file path is relative, then the<br />
default path is the installation “bin/system-type” folder. On UNIX systems, the file name is case<br />
sensitive.<br />
The name defines the name of the function. External function names must always start with an<br />
alphabetic character. The remaining characters can be any combination of letters, digits and the<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 131
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Flow Control in a Macro<br />
underscore character. The maximum size of an external function name is 32 characters. The<br />
chosen name must not conflict with any local or global variable already defined, or with any<br />
Major, Minor or reserved keyword name.<br />
External functions return a value to the macro processor in the same way that built-in functions<br />
do. By default functions are “un-typed”, meaning that they can return any type of data (real,<br />
logical, etcetera). Run-time checking of the function return type can be enforced by specifying<br />
one of the REAL, LOGICAL, STRING, KEYWORD or RECORD type keywords just in front of<br />
the function name. Functions can also return a “sequence” of values of any type instead of a<br />
single return value. Omit the type definition, or use the keyword ALL to define a function that<br />
returns a sequence of data.<br />
External functions can take zero or more parameters. External functions cannot change the value<br />
of any parameter passed to it (i.e., they are passed “by value”). The count of allowable parameters<br />
and the data type of each is specified by a parenthesized list of ALL, REAL, LOGICAL,<br />
STRING, KEYWORD or RECORD type keywords. The ALL keyword identifies a parameter<br />
that can be of any type, including a sequence.<br />
The following declares and uses an external function named “myfunc”, residing in a shared<br />
library named “myfile.dll”, which requires a numeric and a string parameter, and returns a<br />
numeric value:<br />
DECLAR/EXTERN,FUNCTION,'myfile.dll',REAL,MYFUNC(REAL,STRING)<br />
...<br />
%L01=MYFUNC(25.4,'metric')<br />
4.4.1.2 Flow Control in a Macro<br />
Normally, macro statements are processed in the order in which they appear. There are several<br />
macro commands that can be used to control the sequence in which the lines of the macro are<br />
executed. These are discussed below.<br />
The IF Block<br />
An IF block describes one or more blocks of macro lines, where one or more conditional tests<br />
determine which block is executed, if any. The most general format of an IF block is as follows<br />
(the ELSEIF and ELSE blocks are optional):<br />
0:<br />
n<br />
IF/ conditiona l_expressi on<br />
statements<br />
�ELSEIF/<br />
conditiona l_<br />
expression �<br />
�� statements<br />
�� �ELSE<br />
�<br />
�� statements �� ENDOF/IF<br />
The condition of each IF and ELSEIF line is checked in turn until one evaluates to TRUE, or<br />
there are no more to check. If an IF or ELSEIF condition evaluates to TRUE, the following block<br />
of statements is executed. If none of the conditions evaluates to TRUE and the last block is<br />
preceded by an ELSE line, the last block of statements is executed. If none of the conditions is<br />
132 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Flow Control in a Macro<br />
TRUE and there is no ELSE block, no blocks of statements are executed. After a block of<br />
statements is executed, control passes to the statement after the “ENDOF/IF” line.<br />
The CASE Statement<br />
A CASE statement allows the user to branch to different blocks of macro code depending on the<br />
value of one expression. It is similar to a complex IF block. The syntax of the CASE statement is<br />
as follows:<br />
1:<br />
n<br />
CASE/ any_expres sion<br />
� 1:<br />
n<br />
�<br />
WHEN/<br />
� statements<br />
�WHEN/OTHER<br />
S �<br />
�� statements �� ENDOF/CASE<br />
�constant [, THRU, constant ] �<br />
�<br />
�<br />
�<br />
The CASE line defines the expression that will be used for comparison against the constants<br />
defined on the WHEN lines. If a WHEN constant matches the CASE expression, the lines<br />
following the WHEN statement are executed up until the next WHEN statement or the<br />
ENDOF/CASE line. The OTHERS keyword following the last of the WHEN statements is<br />
similar to the ELSE statement in the IF block; it matches any remaining conditions. The OTH-<br />
ERS line is optional.<br />
The WHEN statement can list multiple constants and/or ranges of constants. The THRU keyword<br />
specifies a range of constants starting at the value specified before THRU and ending at the<br />
value specified after THRU. Any type of constant can be checked for in a WHEN statement,<br />
with the restriction that the same type of constant be used on both sides of a THRU qualifier.<br />
The WHILE Loop<br />
A WHILE loop describes a block of macro lines to be executed while a given condition is<br />
TRUE. The format of a WHILE loop is as follows:<br />
WHILE/ conditiona l_expressi on<br />
statements<br />
ENDOF/WHIL E<br />
The conditional_expression is tested before entering the block of macro lines. If the condition is<br />
FALSE, control passes to the line following the ENDOF/WHILE line. Otherwise, if the condition<br />
is TRUE, the first line following the WHILE line is executed. When the ENDOF/WHILE<br />
line is reached, control is passed back to the WHILE line, which tests its condition again. The<br />
block of macro lines of the WHILE loop are never entered if the condition is initially FALSE.<br />
The REPEAT Loop<br />
A REPEAT loop describes a block of macro lines to be executed until a given condition is<br />
TRUE. The format of a REPEAT loop is as follows:<br />
REPEAT<br />
statements<br />
UNTIL/ conditiona l_expressi on<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 133
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Flow Control in a Macro<br />
The block of statements is always executed at least once. Each time the UNTIL line is reached,<br />
the conditional_expression is tested. If it is TRUE, control is passed to the line following the<br />
UNTIL line. Otherwise, control is passed back to the top of the block of statements, which are<br />
executed again. The block of statements of a REPEAT loop are entered at least once, unlike<br />
those of the WHILE loop.<br />
The DO Loop<br />
The DO statement iterates a loop variable over a range of values, executing a block of macro<br />
statements on each iteration. The format of the DO statement is as follows:<br />
DO/ variable � start,<br />
end [, step ]<br />
statements<br />
ENDOF/DO<br />
The step increment does not need to be specified. It defaults to one (1). The start value, end<br />
value and step increment value are evaluated when the DO line is first reached. The loop variable<br />
is then assigned the start value. A test is performed on each iteration before executing the<br />
statements. If the loop variable has passed the end value, control passes to the statement after the<br />
ENDOF/DO. Each time the ENDOF/DO line is reached, the step increment value is added to the<br />
loop variable and the cycle repeats.<br />
If the step increment value is positive, the termination test is that the loop variable is greater than<br />
the end value. If the increment value is negative, the termination test is that the loop variable is<br />
less than the end value. For the default case in which the increment is one, the loop variable has a<br />
value of one added to it until it is greater than the end value.<br />
Exiting Loops (EXIT)<br />
The EXIT command is used to exit a given number of nested loop levels, transferring control to<br />
the statement immediately following the given loop. Each WHILE, REPEAT or DO loop that the<br />
EXIT statement is nested within counts as one level (note that IF and CASE statements do not<br />
count as a level).<br />
The format of the EXIT statement is as follows:<br />
EXIT [ / levels ]<br />
The levels value is a whole unsigned number. If not specified, the default number of levels is 1.<br />
Unconditional Jumps (JUMPTO)<br />
The JUMPTO statement is used to transfer control to a labeled statement within the same macro.<br />
The label may be above or below the JUMPTO statement. The labeled statement starts with the<br />
name of the label, followed by a colon (:). Labels must be alphanumeric. They can start with<br />
either a letter or a digit, but must contain at least one letter. The format of the JUMPTO statement<br />
is as follows:<br />
JUMPTO<br />
/ label _name<br />
�<br />
label _name<br />
:<br />
134 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Macro Invocation<br />
It is poor practice to jump to a label inside the body of a DO, IF, REPEAT, WHILE or CASE<br />
statements from outside that statement. Using JUMPTO to enter a DO loop is particularly<br />
inadvisable, since it may lead to unexpected behavior.<br />
Exiting a Macro (TERMAC)<br />
The TERMAC command can be used to exit a macro from anywhere inside the macro. There is<br />
an implicit TERMAC at the end of each macro, so it is not necessary to end a macro with a<br />
TERMAC statement. The TERMAC statement has no arguments.<br />
Ending a Macro (ENDMAC)<br />
The ENDMAC command is a special one that marks the end of a macro when the macro is<br />
output to a file or is listed with other macros in the macro editor. The ENDMAC command is not<br />
a “real” macro command since it is not compiled into the macro object code. Instead, it simply<br />
acts as a separator to distinguish one macro from the next, where necessary.<br />
4.4.1.3 Macro Invocation<br />
Macros are automatically invoked (i.e., called) by the macro processor when specific events<br />
happen, or when “matching” CLDATA records, CNC codes or data identifiers are processed.<br />
The types of macros and their execution timing are as follows:<br />
� Startup and Shutdown macros: Executed before and after key events (see section 4.4.2<br />
“Model Startup/Shutdown Macros” on page 145).<br />
� Event macros: Executed at key events (see section 4.4.3 “Model Event Macros” on page<br />
146).<br />
� Code and Data macros: Executed when matching code or data identifiers are processed<br />
by Control Emulator. Code and Data macros are not described in this document as they<br />
are not used by <strong>Virtual</strong> <strong>Machine</strong>.<br />
� User-Defined macros: Executed when matching CLDATA records are processed by<br />
CAM-POST. User-defined macros are not described in this document as they are not<br />
used by <strong>Virtual</strong> <strong>Machine</strong>.<br />
Enable/Disable Macro Matching (MATCH)<br />
The MATCH macro command can be given within a macro to turn macro matching ON or OFF.<br />
It is not recommended to use this command in a VM model macro, since this command affects<br />
CAM-POST and Control Emulator macro processing.<br />
�ON MATCH /<br />
�<br />
� �<br />
�OFF<br />
�<br />
MATCH/ON specifies that CLDATA record and Code/Data identifier matching should be<br />
enabled. This is the initial condition at the start of any macro. MATCH/OFF specifies that<br />
matching should be disabled.<br />
When macro matching is disabled, no attempt is made to invoke User-Defined, Code or Data<br />
macros that match those generated in the current macro.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 135
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Text File I/O from a Macro<br />
Macro matching is always automatically turned back on when the current macro is exited.<br />
Startup, shutdown and event macros are always invoked even if macro matching is turned OFF.<br />
Outputting the Matched Record (OUTPUT)<br />
The OUTPUT command instructs the macro processor to execute the actions associated with the<br />
current event. The syntax of the OUTPUT command is simply:<br />
OUTPUT<br />
The OUTPUT command must be coded in Model Event macros only; do not code OUTPUT in a<br />
startup or shutdown macro. If the OUTPUT command is not encountered in an event macro, then<br />
the built-in processing for that event will not occur. This gives you the opportunity in an event<br />
macro to insert your own processing before, after, or even in place of the built-in processing.<br />
Note that the OUTPUT command is also used with CERUN and GENER User-Defined macros to<br />
indicate the point in the user-defined macro where the matched command should be processed.<br />
4.4.1.4 Text File I/O from a Macro<br />
The macro language provides the ability to read from and write to external text files. These files<br />
are connected to and disconnected from the macro processor using OPEN and CLOSE commands.<br />
Input and output to external files is done using the READ and WRITE commands.<br />
When a file is opened, it must be assigned a “unit” number. This is a number from 20 through 29<br />
that will then be used in subsequent READ, WRITE and CLOSE statements to identify the<br />
particular file opened. This enables multiple files to be simultaneously opened for processing.<br />
If an error occurs during text file I/O, the error return code will be stored in the $ERRNO macro<br />
system variable. Macros must test for I/O errors and act accordingly since a diagnostic will not<br />
be output to indicate an I/O failure.<br />
Opening a Text File (OPEN)<br />
The OPEN command opens a text file with a given name on a given unit. The file name is<br />
optional if the unit is pre-connected. If FRONT is specified, the unit is rewound. If REAR is<br />
specified, the unit is positioned at the end-of-file. FRONT is the default. The OPEN command<br />
has the following syntax:<br />
OPEN/ unit<br />
� FRONT<br />
,<br />
�<br />
�<br />
[ , filename ]<br />
� REAR �� Two special file names are predefined to permit input and output to the console; they are STDIN<br />
and STDOUT.<br />
Closing a Text File (CLOSE)<br />
The CLOSE command closes a text file. It has the following syntax:<br />
CLOSE/<br />
unit<br />
136 <strong>ICAM</strong> Technologies Corporation – Proprietary
It is good programming practice to close files when finished using them.<br />
Writing to a Text File (WRITE)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Text File I/O from a Macro<br />
The WRITE command writes a string into a text file. The syntax of the WRITE command is:<br />
0:<br />
n<br />
WRITE/ unit ', format ' ,<br />
� value �<br />
See the “Output String Format Specifications” below for a description of how the string to be<br />
written is constructed using the format argument.<br />
Normally, a file must be opened before a write operation is attempted. This is true for units 20<br />
through 29. All other units may be written to but may not be opened or read. It is important to<br />
exercise caution when writing to units outside of the safe range (20 to 29). This is especially<br />
important when considering the database files. These files are binary format and an inadvertent<br />
write could corrupt your database. All I/O should be restricted to units 20 through 29.<br />
Reading from a Text File (READ)<br />
The READ command can be used to read a line from a text file into one or more macro variables.<br />
The text file must be open when the READ is executed. The syntax of the READ from text<br />
file command is:<br />
INCR<br />
READ/ unit<br />
�<br />
,<br />
�<br />
1:<br />
n<br />
� DECR �<br />
', format ' ,<br />
� �<br />
� variable �<br />
If INCR is specified, the next line is read. This is the default. A READ using INCR should only<br />
be performed if “$FEOF(unit)” returns false. If DECR is specified, the last line is read again. If<br />
no lines have been read yet, the first line is read.<br />
See the “Input String Format Specifications” on page 142 for a description of how the variables<br />
in the input list are assigned values from the input unit text using the format string.<br />
Reading from a String Value (READ)<br />
The READ command can also be used to do an “internal read” from a string value. The syntax of<br />
the internal READ command is:<br />
1 : n<br />
� �<br />
READ/ strvar ', format ' , variable<br />
See the “Input String Format Specifications” on page 142 for a description of how the variables<br />
in the input list are assigned values from the input string variable strvar using the format string.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 137
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, Other Macro Commands<br />
4.4.1.5 Other Macro Commands<br />
Outputting Error Messages (ERROR)<br />
The ERROR command outputs a diagnostic message to the listing file. Two forms of ERROR<br />
command syntax are available, to output user defined and standard error messages, as follows:<br />
0:<br />
n<br />
ERROR/ severity ', message ' ,<br />
0:<br />
n<br />
� �<br />
ERROR/ errnum , value<br />
� value �<br />
The “severity” form of the ERROR command is used to output a user defined error. The diagnostic<br />
message severity must be a whole number in the range 0-99, where by standard convention:<br />
0 is a message, 4 a warning, 8 an error and 16 a severe error.<br />
The diagnostic message text follows the severity. See “Output String Format Specifications” on<br />
page 139 for a description of how the string to be written is constructed using the format_string<br />
argument.<br />
For example:<br />
ERROR/0,'Pallet change'<br />
ERROR/4,'Cannot determine diameter of tool !(*)',$T<br />
The “errnum” form of the ERROR command is used to output standard error diagnostics. The<br />
diagnostic error number must be a whole number greater than 99, matching one of the standard<br />
diagnostics found in the pos190.err or err190.err diagnostic file. Because a model could be used<br />
with either a post-processor or a control emulator, this form of the ERROR command is not<br />
recommended for use in model macros.<br />
Calling other programs (SYSTEM)<br />
The SYSTEM command is used to spawn processes while simulating. The SYSTEM command<br />
allows the model to run another program or issue an operating system command from within a<br />
macro. The command takes the form:<br />
SYSTEM/'command '<br />
The command defined within the string is sent to the Windows or UNIX shell from the current<br />
working directory. If the command name and/or file name specifications contain embedded<br />
blanks, you will likely have to enclose them in quotes as you would if you typed the command<br />
from the shell prompt.<br />
The $ERRNO system variable contains the status code returned by the operating system when<br />
control was returned to the macro processor.<br />
138 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.1.6 String Format Specification<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, String Format Specification<br />
String formatting is used to read and write variables to external files, and to write information to<br />
the verification listing. Output string formatting converts variables to a text string. Input string<br />
formatting extracts information from a text string and loads it into variables.<br />
Output String Format Specifications<br />
String formatting is used to transfer different data types into a text format depending upon<br />
certain control characters in the format string. The format processing described below is used by<br />
the $FSWRIT function, and also by the ERROR and WRITE commands.<br />
A format string is made up of two separate parts. The first part is a character string that may or<br />
may not have certain control characters. The second part is a list of arguments that are to be<br />
formatted into the first part of the format string. The number of arguments required for the<br />
second part depends upon the number of control characters in the first.<br />
The following sections describe the action taken when certain control characters are found in the<br />
first part of the format string. Each control character may require a different type of argument in<br />
the second part of the format string. The type required will be described in the pertinent section.<br />
The exclamation character (!) is used as an attention character to indicate that the characters to<br />
follow are to be validated as formats for different argument types. If an exclamation character is<br />
required on the output string, specify two exclamation characters (!!). All formats should be<br />
placed in open and close parentheses. For example, “!(s4.3s)”.<br />
Numeric Output Format<br />
(!<br />
� �<br />
�� X�� V<br />
��� �s�<br />
n<br />
�.<br />
�<br />
n<br />
�s�<br />
)<br />
�� e��<br />
�� f��<br />
�� e��<br />
V Output as variable length string (default)<br />
X Output as fixed length string<br />
+ Output + sign for positive numbers<br />
s Suppress leading/trailing zeros<br />
e One digit must appear left or right of decimal<br />
n Maximum number of digits left or right of decimal<br />
. Always output decimal<br />
f Omit decimal point for whole numbers<br />
This format is used to place a value into the character string using a given “format”. This format<br />
requires a numeric argument for each occurrence of the format. This value can be any numeric<br />
value. The macro processor will take this value and format it using the specified “format”. The<br />
“format” can be in the following appearance.<br />
The “V” or “X” character provides for optional fixed length output. When using the X format,<br />
leading and trailing zeroes that are converted to blanks will remain significant. This is useful<br />
when outputting tables of values that should be aligned. The default is variable length output.<br />
The V format character can be omitted.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 139
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, String Format Specification<br />
The “+” character is used to force a plus sign to be output if the value is a positive number. This<br />
character is optional and if omitted, positive values will not have a plus sign output.<br />
The “s” or “S” character is used to suppress leading and/or trailing zeroes from the number to be<br />
output. This character is optional and if omitted, the leading and/or trailing zeroes will be output.<br />
If the decimal point is not to be output then it is recommended that either leading or trailing<br />
zeroes not be suppressed depending on the machine control specifications.<br />
The “e” or “E” character is used to ensure that at least one digit will exist on the given side of the<br />
decimal point. For example, the number “.22” would be represented by “0.22”.<br />
The “f” or “F” character is used to signify that only fractional numbers will have the decimal<br />
character. Whole numbers are represented without the decimal character.<br />
The “9” character is used to indicate the number of digits to be output before and/or after the<br />
decimal point. A maximum of 9 digits can be output before and/or after the decimal point giving<br />
a maximum of 18 digits of precision. This character may be replaced with any digit from 0<br />
through 9.<br />
The “.” character is used to force the decimal point selected in the “Punching Requirements”<br />
section of QUEST to be output. This character is optional and if omitted, the decimal point will<br />
not be output.<br />
String Output Format<br />
)<br />
a A<br />
(!<br />
� �<br />
� � n<br />
� �<br />
A Output string as-is<br />
a Output as lowercase string<br />
n Maximum number of characters to output<br />
A string format is specified by the character “A” or “a” optionally followed by an integer value<br />
from 0 to 999. The “a” format will force all letters of the string to lower case while “A” will<br />
preserve the case. The integer value is used to specify the maximum number of characters to be<br />
output. If no value or 0 is specified, the number of characters output is dependent on the size of<br />
the string specified as the argument for this format. If a size is specified, and the string is larger<br />
than the size, the remaining characters will be truncated. If the string is shorter than the size,<br />
blanks will be added to extend the string to the size specified. This format requires a string<br />
argument for each occurrence of the format. This value can be any string value of any length.<br />
Minor Word Output Format<br />
(!<br />
� M �<br />
� n )<br />
m �<br />
� �<br />
M Output as uppercase keyword<br />
m Output as lowercase keyword<br />
n Maximum number of characters to output<br />
140 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, String Format Specification<br />
A minor word format is specified by the character “M” or “m” optionally followed by an integer<br />
value from 0 to 999. The “m” format will force the minor word name to be presented in lower<br />
case. The length processing is performed in the same manner as the string formats. This format<br />
requires a minor word argument for each occurrence of the format.<br />
Logical Output Format<br />
)<br />
l L<br />
(!<br />
� �<br />
� � n<br />
� �<br />
L Output as uppercase “TRUE” or “FALSE”<br />
l Output as lowercase “true” or “false”<br />
n Maximum number of characters to output<br />
A logical format is specified by the character “L” or “l” optionally followed by an integer value<br />
from 0 to 999. The “l” format will force the logical argument value to be presented in lower case.<br />
The length processing is performed in the same manner as the string formats. A string of<br />
“TRUE” or “FALSE” will be output depending upon the value of the logical argument. This<br />
format requires a logical argument for each occurrence of the format.<br />
Wildcard Output Format<br />
(! * n )<br />
* Output using default format rules<br />
n Maximum number of characters to output<br />
A wildcard format is specified by the character “*”. This format is used to output any type of<br />
argument in a fixed format. The following table shows the equivalent formats that would be used<br />
depending upon the type of argument specified when “!(*)” is used as a format descriptor.<br />
Type of argument Format<br />
Numeric<br />
Minor<br />
Text string<br />
Logical<br />
!(s9f9s)<br />
!(M)<br />
!(A)<br />
!(L)<br />
In addition to the equivalent types shown, two more types can be output. If the argument is a<br />
$NULL type, the characters “$NULL” will be output. If the argument type is a “sequence” type,<br />
the characters “” will be output. Where “sq1” represents the first argument of the<br />
sequence and “sqn” represents the last. Each argument of the sequence is output as though they<br />
were specified individually using a wildcard format.<br />
ASCII Value Output Format<br />
^ Output ASCII character matching value<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 141
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, String Format Specification<br />
The circumflex character (^) is used as an attention character to indicate that an ASCII character<br />
is to be output in its place. If a circumflex character is required on the output string, specify two<br />
circumflex characters (^^). This control character requires a numeric argument and is processed<br />
in the same manner as the $FCHAR function.<br />
Input String Format Specifications<br />
Input string formatting is used to transfer different data types from a text string depending upon<br />
certain control characters in the format string. The format processing described below is used by<br />
the READ command. The input string formats are similar to those used for output string formats<br />
with some exceptions.<br />
A format string is made up of two separate parts. The first part is a character string that contains<br />
one or more format specifications and optional space characters. The second part is a list of<br />
arguments that are to receive the values read from the string or file based on the format specification.<br />
The number of arguments required for the second part depends upon the number of format<br />
specifications in the first.<br />
The following sections describe the action taken when certain control characters are found in the<br />
first part of the format string.<br />
Space Input Format Character<br />
The space character is used to advance the internal pointer on the input string to the next character<br />
that is neither a space nor a tab. This allows you to reposition the internal pointer to the next<br />
“word” of the input string.<br />
Exclamation Input Format Character<br />
The exclamation character (!) is used as an attention character to indicate that the characters to<br />
follow are to be validated as formats for different input types. The following formats should be<br />
placed in open and close parentheses. For example, “!(some_format)”. The type of argument<br />
created will be described in the pertinent section.<br />
Numeric Input Format<br />
(!<br />
�s�<br />
�� e��<br />
�.<br />
�<br />
�� f��<br />
�s�<br />
�� e��<br />
��� n n )<br />
+ Expect + sign for positive numbers<br />
s Leading/trailing zeros might be suppressed<br />
e One digit must appear left or right of decimal<br />
n Max number of digits left or right of decimal<br />
. Fractional numbers must include decimal<br />
f Decimal point will be omitted for whole numbers<br />
This format is used to read a numeric value from the character string using a given “format”. The<br />
main objective is to ensure that the input number (in string format) conforms to the given format.<br />
This is especially useful if the input number has an implied decimal place (does not have a<br />
142 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, String Format Specification<br />
decimal point punched). The wildcard format can be used if the format of the input number is not<br />
important.<br />
String Input Format<br />
)<br />
a A<br />
(!<br />
� �<br />
� � n<br />
� �<br />
A Input string as-is<br />
a Same as A; input string as-is<br />
n Maximum number of characters to input<br />
A string format is specified by the character “A” or “a” followed by an integer value from 1 to<br />
999. The integer value is used to specify the number of characters to be read from the input<br />
string. This format is used to transfer characters from one location to another. If the length<br />
specified exceeds the record length, the length of the argument is set to the record length. This<br />
format creates a string argument for each occurrence of the format.<br />
Minor Word Input Format<br />
(!<br />
� M �<br />
� n )<br />
m �<br />
� �<br />
M Input as keyword<br />
m Same as M; input as keyword<br />
n Maximum number of characters to input<br />
A minor word format is specified by the character “M” or “m” optionally followed by an integer<br />
value from 0 to 999. A value of 0 results in the same action as if no value was specified. The<br />
value specified indicates the number of characters on the input string that are to be validated as a<br />
minor word. Any trailing spaces read from the input string will be ignored. A valid minor word<br />
can be a maximum of 6 alphanumeric characters or have the form #nnnn, where nnnn is the<br />
minor word code. If no size value is specified, then all characters up to the next nonalphanumeric<br />
will be validated as a minor word. This format creates a minor word argument for<br />
each occurrence of the format.<br />
Logical Input Format<br />
)<br />
l L<br />
(!<br />
� �<br />
� � n<br />
� �<br />
L Input as case insensitive “true” or “false”<br />
l Same as L; input as case insensitive “true” or “false<br />
n Maximum number of characters to input<br />
A logical format is specified by the character “L” or “l” optionally followed by an integer value<br />
from 0 to 999. The length processing is performed in the same manner as the minor word formats.<br />
The input string should match one of “TRUE” or “FALSE”. This format creates a logical<br />
argument for each occurrence of the format.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 143
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Macro Language, String Format Specification<br />
Skip Character Input Format<br />
x<br />
)<br />
X<br />
(!<br />
� �<br />
� � n<br />
� �<br />
X Skip input characters<br />
l Same as X; skip input characters<br />
n Number of characters to ignore<br />
A skip character format is specified by the character “X” or “x” optionally followed by an<br />
integer value from 0 to 999. A value of 0 results in the same action as if a value of 1 was specified.<br />
This format is used to advance the internal pointer on the input string by the specified<br />
number of characters. No argument is required for this format.<br />
Wildcard Input Format<br />
(! * n )<br />
* Input using default format rules<br />
n Maximum number of characters to input<br />
A wildcard format is specified by the character “*”. This format is used to read any type of value<br />
in a fixed format. Before the read is performed, the internal pointer on the input string is advanced<br />
to the next “word”. This is equivalent to specifying a space character before the format.<br />
The type of argument created by this format is dependent upon the first character. If the first<br />
character is a dollar sign ($), the following characters should be one of $NULL, true or false,<br />
resulting in a NULL or LOGICAL value. If the first character is a single quote ('), the following<br />
characters up to the matching quote, is converted to a string value. The starting and ending single<br />
quotes will not be part of the resultant string. If quotes are desired in the resultant string, the<br />
input string should contain two quotes together. If the first character is a (#), the input string is<br />
read as a minor word code. If the first character is a letter, the input string is read as a minor<br />
word name.<br />
If the first character is a digit followed by alphanumeric characters containing at least one letter,<br />
the input string is read as a minor word name. If the first character is a plus or minus sign, the<br />
input string is read as a real value.<br />
144 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.2 Model Startup/Shutdown Macros<br />
Two model startup/shutdown macros are available:<br />
Startup Called when the model is loaded<br />
Shutdown Called at the end of the program<br />
4.4.2.1 The Model Startup Macro<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Model Startup/Shutdown Macros, The Model Startup Macro<br />
This macro is called at the start of processing, before any other startup macros associated with<br />
the post-processor or control emulator. You should use the model startup macro to declare any<br />
global variables you need to use in other model macros. The startup macro can also be used to<br />
setup additional channels, close doors, perform pallet changes, initialize tools into tool pockets,<br />
activate dialogs (by calling the $FDIALOG function), etc.<br />
There are no $P variables defined for the model startup macro.<br />
4.4.2.2 The Model Shutdown Macro<br />
This macro is called at the end of processing, after any other shutdown macros associated with<br />
the post-processor or control emulator.<br />
There are no $P variables defined for the model shutdown macro.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 145
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Model Event Macros, The Tape Event Macro (Gener only)<br />
4.4.3 Model Event Macros<br />
The following model event macros are available:<br />
Tape Event Called each time a block of tape is processed<br />
Motion Event Called at each motion<br />
Rapid Event Called when transitioning from feed to rapid<br />
Feed Event Called at each change of feed<br />
Load Tool Event Called at a tool change<br />
Each event macro by default contains a single OUTPUT command. This command indicates the<br />
point in the event macro where VM should process the event. If the event macro does not process<br />
the OUTPUT command, then the event will not be processed by VM.<br />
4.4.3.1 The Tape Event Macro (GENER only)<br />
This macro is called each time a block of NC code is output by the post-processor. Use a tape<br />
event macro to catch and process (for model purposes) NC instructions that cannot be easily<br />
caught using other methods. The tape macro has a single $P variable.<br />
$P1 Tape block string.<br />
The OUTPUT command in a tape macro is ignored.<br />
4.4.3.2 The Motion Event Macro<br />
This macro is called as each motion is processed by CERUN or GENER, before the Tape event<br />
macro. Use a motion event macro to handle any special requirements that are related to axis<br />
motion. The motion event macro has 8 $P variables.<br />
$P1 Motion type. Set this variable to 0 on exit to inhibit simulation of the motion. On input,<br />
the value is set as follows: 1=circle, 3=FROM, 5=GOTO, 9=spline.<br />
$P2 End position. This is a sequence variable with 6 positions representing up to 6 active<br />
axes. Use the $AXES system variable to determine which axes are active.<br />
$P3 Circle center. This is a sequence variable containing the circle center XYZ location.<br />
$P4 Circle plane vector. This is a sequence variable containing the circle axis IJK vector.<br />
$P5 3D circle midpoint. This is a sequence variable containing a mid-point location along<br />
the interpolated arc of the circle. Set for 3D circle only.<br />
$P6 Circle interpolation direction: 1=clw, 2=cclw.<br />
$P7 Circle plane: 0=3D, 1=XY, 2=ZX, 3=YZ.<br />
146 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Model Event Macros, The Rapid Event Macro<br />
$P8 Motion flags: These are integer flags indicating if the corresponding axis position as<br />
defined in $P2 requires a change in position of the axis. A value of “0” indicates that<br />
the axis is not moving and therefore the axis end-position should be ignored. A value<br />
of “1” indicates an actively moving axis.<br />
An OUTPUT command must be encountered during motion event processing in order for VM to<br />
move the model to the coordinates defined by that event.<br />
4.4.3.3 The Rapid Event Macro<br />
This macro is called each time motion processing switches from feed interpolation to rapid<br />
positioning. The rapid macro has no $P variables.<br />
An OUTPUT command must be encountered during raid event processing in order for VM to<br />
switch to rapid positioning.<br />
4.4.3.4 The Feed Event Macro<br />
This macro is called each time motion processing switches from rapid positioning to feed interpolation,<br />
or when the federate changes. The feed macro has a single $P variable.<br />
$P1 Velocity of the control point in model units per minute or per revolution.<br />
An OUTPUT command must be encountered during feed event processing in order for VM to<br />
switch to feed interpolation.<br />
4.4.3.5 The Load Tool Event Macro<br />
This macro is called each there is a tool related event. The load tool macro has 6 $P variables.<br />
$P1 Set to zero on return to have the simulation ignore the tool event. On input, the value<br />
is set as follows: 1=TOOLNO command, 2=tool change, 3=tool selection<br />
$P2 Type of change: 1=tool, 2=head<br />
$P3 Tool ID or head ID<br />
$P4 Pocket ID or station ID<br />
$P5 Tool index in $TLTAB or holder index in $HLDTAB (see $P3)<br />
$P6 Tool axis ID<br />
An OUTPUT command must be encountered during load tool event processing in order for VM<br />
to perform the tool change or selection operation.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 147
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Dialog Editor, Adding and Deleting Dialogs<br />
4.4.4 The Dialog Editor<br />
The Dialog editor is used to build dialog boxes, which are then used at run-time to query the NC<br />
programmer for any information that is necessary during simulation. You can create many<br />
different dialogs, each with a unique name, which are then activated through the $FDIALOG<br />
macro function call (see function description on page 201). A screen shot of the Dialog Editor<br />
facility is shown below.<br />
4.4.4.1 Adding and Deleting Dialogs<br />
Press the Add button to create a new dialog. You will be prompted for the dialog‟s name, which<br />
is how the dialog will be identified in the $FDIALOG function call. Spacing and letter-case are<br />
not significant in dialog names. Dialogs are listed alphabetically by name. For each dialog, the<br />
listing includes its name, the caption title that will appear at the top of the dialog window, and a<br />
list of all macro variables referenced by the dialog (dialogs operate by getting and setting macro<br />
variables). Note that a single dialog containing all user input requirements is generally preferable<br />
to the user (if properly constructed) than a series of smaller dialogs.<br />
Select an existing dialog from the list and press the Modify button (or double click on a list<br />
entry) to make changes to an existing dialog. Select one or more dialogs and press the Delete<br />
button to remove them from the model.<br />
There are also Load and Dump buttons that can be used to read and write dialog definitions<br />
from/to external files. Use this feature to copy dialogs from one model, control emulator or post-<br />
148 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Dialog Editor, The Dialog Template Editor<br />
processor to another, or to create “external” dialogs that can be accessed at run-time given a<br />
filename. We recommend that you never edit dialog definitions by hand.<br />
The Finder utility includes a “Dialogs” option to include dialog definitions when searching<br />
through a model for matching text. The Diff utility also checks for differences in dialogs when<br />
comparing models. Dialogs are listed in an XML format in the listing file, Finder and Diff<br />
windows.<br />
4.4.4.2 The Dialog Template Editor<br />
When a dialog is first created, it consists of a single window frame and two buttons: OK and<br />
Cancel. The screenshot below shows an example of the dialog template editor.<br />
The window frame can be resized by selecting it and then dragging (with the left-mouse button<br />
held down) one of the three resize points on the exterior of the window. You can also doubleclick<br />
on the window to edit the windows “Properties”, which include: its caption title, name, size<br />
in screen pixels, and margin (like the margins of a printed page). Similarly, the OK or Cancel<br />
button can be selected and resized using the mouse, or double-clicked on to edit its button<br />
properties. This behavior is true for all dialog “controls”.<br />
Dialogs can contain a number of different types of window controls, which can be selected from<br />
the Controls toolbar or from the Dialog»Controls menu bar. To create a new control, select the<br />
control type and then interactively place it on the window frame. After placing the control, you<br />
will be prompted for the control‟s properties. The following control types are available:<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 149
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Dialog Editor, The Dialog Template Editor<br />
� Text: Use the Text control to add text to your dialog. Properties include the position and<br />
the text itself. You can use line breaks in the text input field to show multi-line text in the<br />
dialog. The text control is automatically sized to the required text width and height, although<br />
you may have to adjust the underlying window frame to fully see the text.<br />
� Frame: Use the Frame control to visually group related dialog controls. Properties include<br />
the text label that appears at the top-left corner of the frame, and the position and<br />
size of the frame.<br />
� Button: Use the Button control to create buttons, such as the OK and Cancel buttons.<br />
Properties include the text label that appears inside the button, the type of button, and the<br />
position and size of the button. Buttons with an “OK” type cause the dialog to close<br />
when they are pressed, returning the button label text (e.g., “OK”) as the return value to<br />
the $FDIALOG function, and all dialog macro variables set as shown in the dialog. Buttons<br />
with a “Cancel” type cause the dialog to close, returning the button label text (e.g.,<br />
“Cancel”) and leaving all dialog macro variables unchanged (but initialized if necessary).<br />
Buttons with a “Reset” type do not close the dialog; instead, they reset all controls to<br />
their initial state. Buttons with a “Call Dialog” type activate the specified dialog when<br />
pressed. A dialog called in this manner must reside in the same model or external file as<br />
its caller. You can choose to display (and return) any text you want for a button.<br />
� Edit-box: Use the Edit-box control to create a field that will optionally accept user-typed<br />
input. Properties include the default value for the field, its associated macro variable, the<br />
position and size of the edit-box field, and an “editable” flag indicating if the field can be<br />
changed by the user. When the $FDIALOG function is called, the edit-box field will initially<br />
be set to the macro variable value. The edit-box field will instead initially be set to<br />
the default value if the macro variable does not exist, or is $NULL, or is an empty string.<br />
The macro variable will be set to the contents of the edit-box field when an OK type button<br />
is pressed.<br />
� Check-box: Use the Check box control to accept logical True/False type input from the<br />
user. Properties include an optional text label that will appear to the right of the check<br />
box, the default set/clear state for the check box, its associated macro variable, and the<br />
position of the check box control. When the $FDIALOG function is called, the check box<br />
field will initially be set if: the variable is logical and is true; or the variable is numeric<br />
and non-zero; or the variable is text and is $TRUE. The check box field will initially be<br />
cleared if: the variable is logical and is false; or the variable is numeric and zero; or the<br />
variable is text and is $FALSE. The check box field will instead initially be set to the default<br />
value if the macro variable does not match any of the preceding, or does not exist, or<br />
is $NULL. The macro variable will be set to one of the true/false conditions, based on the<br />
macro variable type, when an OK type button is pressed.<br />
� Radio-button: Use the Radio-button control to present the user with a series of exclusive<br />
choices. Properties include an optional text label that will appear to the right of the radiobutton,<br />
an optional alternate return value, an initial state setting, its associated macro variable,<br />
and the position of the radio-button control. When a radio button is selected, the<br />
macro variable will be set by default to the label text. You can choose to return something<br />
different for the variable by specifying an alternate return value (e.g., a number).<br />
You must have two or more radio button controls sharing the same macro variable, and<br />
you can choose which one is the default state (setting the default state in one control<br />
clears this flag in the others). When the $FDIALOG function is called, the radio-button<br />
150 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
The Dialog Editor, The Dialog Template Editor<br />
that first matches the current macro variable is the one that will be shown selected. The<br />
default radio button will be shown selected if no match was found. When an OK button is<br />
pressed, the macro variable will be set to the label text or alternate return value text of the<br />
selected radio button.<br />
� Combo-box: Use the Combo-box control to present the user with a number of listed<br />
choices, available in a drop-down menu. Properties include the list of valid choices<br />
and/or a macro variable that will define the acceptable choices, the default value for the<br />
combo-box, its associated macro variable, and the position and size of the combo-box<br />
field. If you choose to use a variable to define the list of choices, this variable must either<br />
be declared as an array or created as a sequence, and then initialized before calling the<br />
$FDIALOG function. The default value will be used if the macro variable does not match<br />
any of the choices. The macro variable will be set to the selected choice type when an OK<br />
button is pressed.<br />
� List-box: The List-box is similar to the combo-box, except that the choices are visible in<br />
a scrolling list.<br />
All dialog controls include a “Logical state expression” property, which can be used to enable or<br />
disable the control. The logical state expression can be any valid macro logical expression that<br />
evaluates to $TRUE or $FALSE. If an expression is present and it evaluates to false, the control<br />
will be disabled (i.e., not available for selection or modification), otherwise the control will be<br />
enabled.<br />
Controls are initially placed inside the dialog using the mouse. Once created, they can be repositioned,<br />
aligned and sized relative to other controls using the arrow keys and the functions available<br />
from the Utilities toolbar, or from the Dialog»Utilities menu. To align or size two or more<br />
controls, select each in turn with the left-mouse button while holding the Ctrl key. The last<br />
control selected is the “master”, to which the others will be aligned or sized.<br />
The Dialog»Tab Order menu function specifies the order in which controls are visited when you<br />
press the tab key. The Dialog»Test menu function can be used to try out how dialogs will behave<br />
when they are used at run-time.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 151
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Function Summary<br />
4.4.5 Simulation Macro Functions<br />
4.4.5.1 Function Summary<br />
The following function types are available for use in model macros:<br />
� Mathematical Functions<br />
$FACOS, $FASIN, $FATAN, $FATAN2, $FCOS, $FEXP, $FLN, $FLOG, $FSIN,<br />
$FSQRT, $FTAN<br />
� Numeric Functions<br />
$FABS, $FFRAC, $FINT, $FMAX, $FMIN, $FMOD, $FNINT, $FSIGN<br />
� Geometric Functions<br />
$FGLNXPL, $FGLSXSP, $FGPLPT3<br />
� Vector Functions<br />
$FVADD, $FVANG, $FVCROSS, $FVDOT, $FVLEN, $FVMULT, $FVNORM,<br />
$FVROTN, $FVSUB<br />
� Matrix Functions<br />
$FMX, $FMXINV, $FMXMULT, $FMXTRFP, $FMXTRFV, $FMXTRSP<br />
� Conversion Functions<br />
$FATOF, $FCVINT, $FCVREAL, $FMAJOR, $FMINOR<br />
� Conditional Functions<br />
$FCHOOSE, $FIF, $FISNUM, $FISSEQ, $FISSTR, $FISWRD, $FSWITCH<br />
� Character and Sequence Functions<br />
$FCHAR, $FEDIT, $FELEM, $FFIND, $FICHAR, $FINDEX, $FLEN, $FMATCH,<br />
$FSEQ, $FSUBSQ, $FSUBST, $FSWRIT, $FTOLOWR, $FTOUPER<br />
� Command Line Functions<br />
$FARGC, $FARGV, $FPNAME, $FPVALUE<br />
� File and Directory Functions<br />
$FACCESS, $FBASNAM, $FCTIME, $FDIRNAM, $FEOF, $FGETCWD,<br />
$FSETCWD, $FSTAT<br />
� <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
$FMSADPT, $FMSATA, $FMSBTC, $FMSCMRA, $FMSETC, $FMSGDCV,<br />
$FMSGFCV, $FMSGLCV, $FMSGOUG, $FMSID, $FMSIDN,$FMSIDT,<br />
$FMSLCS, $FMSMAX, $FMSMOVE, $FMSMSP, $FMSPCK, $FMSSDCV,<br />
$FMSSFCV, $FMSSLAV, $FMSSLCV, $FMSTRN<br />
� <strong>Virtual</strong> <strong>Machine</strong> Channel Functions<br />
$FMSACH, $FMSDCH, $FMSGAX, $FMSGCH, $FMSNCH, $FMSRAX,<br />
$FMSWCH<br />
� <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions<br />
$FMSCEZ, $FMSGCS, $FMSLSR, $FMSPDAT, $FMSPPOS, $FMSPRID,<br />
$FMSPROB, $FMSVCL<br />
� Other Functions<br />
$FDIALOG, $FDIST, $FDK, $FERSEV, $FERSTA, $FERTXT,<br />
$FGETDEF, $FGETENV, $FIK, $FPAUSE, $FSORT<br />
152 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.5.2 Mathematical Functions<br />
$FACOS Arc cosine (degrees)<br />
$FASIN Arc sine (degrees)<br />
$FATAN Arc tangent (degrees)<br />
$FATAN2 Arc tangent (degrees) given 2 arguments<br />
$FCOS Cosine (degrees)<br />
$FEXP Exponential<br />
$FLN Natural logarithm<br />
$FLOG Common logarithm<br />
$FSIN Sine (degrees)<br />
$FSQRT Square root<br />
$FTAN Tangent (degrees)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Mathematical Functions<br />
All mathematical functions return a numeric result and only accept numeric arguments.<br />
The $FACOS Function<br />
result=$FACOS(n)<br />
This function returns the arc cosine of the argument n. The resulting value is in degrees. The<br />
argument to $FACOS must be between -1 and 1 inclusive.<br />
The $FASIN Function<br />
result=$FASIN(n)<br />
This function returns the arc sine of the argument n. The resulting value is in degrees. The<br />
argument to $FASIN must be between -1 and 1 inclusive.<br />
The $FATAN Function<br />
result=$FATAN(n)<br />
This function returns the arc tangent of the argument n. The resulting value is in degrees.<br />
The $FATAN2 Function<br />
result=$FATAN2(n1,n2)<br />
This function returns the arc tangent of the expression n1/n2. The resulting value will be greater<br />
than -180 degrees and less than or equal to 180 degrees. If the value of n1 is positive, the result is<br />
positive. When the value of n1 is zero, the result will be zero if n2 is positive and 180 degrees if<br />
n2 is negative. If the value of n2 is zero, the absolute value of the result will be 90 degrees. Both<br />
n1 and n2 must not be zero.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 153
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Mathematical Functions<br />
The $FCOS Function<br />
result=$FACOS(n)<br />
This function returns the cosine of the argument n. The argument must be given in degrees.<br />
The $FEXP Function<br />
result=$FEXP(n)<br />
This function returns the exponential constant e raised to the power of the argument n.<br />
The $FLN Function<br />
result=$FLN(n)<br />
This function returns the natural logarithm (base e) of the argument n.<br />
The $FLOG Function<br />
result=$FLOG(n)<br />
This function returns the decimal logarithm (base 10) of the argument n.<br />
The $FSIN Function<br />
result=$FSIN(n)<br />
This function returns the sine of the argument n. The argument must be given in degrees.<br />
The $FSQRT Function<br />
result=$FSQRT(n)<br />
This function returns the square root of n. The argument to $FSQRT must be greater than or<br />
equal to zero.<br />
The $FTAN Function<br />
result=$FTAN(n)<br />
This function returns the tangent of the argument n. The argument must be given in degrees.<br />
154 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.5.3 Numerical Functions<br />
$FABS Absolute value<br />
$FFRAC Fractional portion<br />
$FINT Truncation to whole number<br />
$FMAX Largest value<br />
$FMIN Smallest value<br />
$FMOD Remainder<br />
$FNINT Nearest whole number<br />
$FSIGN Sign<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Numerical Functions<br />
All numeric functions return a numeric result and only accept numeric arguments.<br />
The $FABS Function<br />
result=$FABS(n)<br />
This function returns the absolute value of the argument n.<br />
The $FFRAC Function<br />
result=$FFRAC(n)<br />
This function returns the fractional portion of the argument n.<br />
The $FINT Function<br />
result=$FINT(n)<br />
This function returns the integer portion (whole number) of the argument n.<br />
The $FMAX Function<br />
result=$FMAX(n1[,n2[,…]])<br />
This function returns the argument having the largest value from the list of numeric arguments<br />
specified. At least two arguments should be specified.<br />
The $FMIN Function<br />
result=$FMIN(n1[,n2[,…]])<br />
This function returns the argument having the smallest value from the list of numeric arguments<br />
specified. At least two arguments should be specified.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 155
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Numerical Functions<br />
The $FMOD Function<br />
result=$FMOD(n1,n2)<br />
This function returns the remainder of the quotient n1/n2. $FMOD generates an error if n2 is<br />
zero.<br />
The $FNINT Function<br />
result=$FNINT(n)<br />
This function returns the nearest whole number of the argument n.<br />
The $FSIGN Function<br />
result=$FSIGN(n)<br />
This function returns -1 if n is negative, 0 (zero) if n is zero and +1 if n is positive.<br />
156 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.5.4 Geometric Functions<br />
$FGLNXPL Intersection point of line and plane<br />
$FGLSXSP Intersection point of line segment and sphere<br />
$FGPLPT3 Plane constructed from 3 points<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Geometric Functions<br />
Geometric functions accept and return sequences that define the canonical form of geometrical<br />
entities. The canonical forms currently in use are:<br />
� Point: {x,y,z} coordinates of the point<br />
� Line: {x,y,z,i,j,k} point on line and direction vector of the infinite line<br />
� Plane: {d,i,j,k} distance from origin and normal vector<br />
It is important to note that geometric functions work with sequences and not arrays. The input<br />
arguments to geometric functions can be constructed using the $FSEQ function or the { }<br />
sequence operators. For example, the following are equivalent:<br />
P1=$FSEQ(1,2,3)<br />
P1={1,2,3}<br />
Geometric functions will return a value of $NULL if the geometric entity cannot be created.<br />
The $FGLNXPL Function<br />
result=$FGLNXPL(line,plane)<br />
This function returns an {x,y,z} sequence defining the point at the intersection of an infinite line<br />
and plane. A value of $NULL is returned if the line does not intersect the plane.<br />
The $FGLSXSP Function<br />
result=$FGLSXSP(point1,point2,point3,radius)<br />
This function returns a sequence defining the point(s) of intersection between a line segment and<br />
sphere. The line segment is defined by the start and ending points: point1 and point2. The sphere<br />
is defined by its center point3 and radius. The return sequence has a length of 2, 5 or 8, with<br />
values as follows:<br />
1 Number of intersection points: 0, 1 or 2<br />
2 Segment location with respect to sphere:<br />
–1: Segment is entirely inside the sphere<br />
0: Segment intersects the sphere<br />
1: Segment is entirely outside the sphere<br />
3:5 First intersection point<br />
6:8 Second intersection point (furthest from start of line segment)<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 157
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Geometric Functions<br />
The $FGPLPT3 Function<br />
result=$FGPLPT3(point1,point2,point3)<br />
This function returns a {d,i,j,k} sequence defining a plane constructed from 3 points. A value of<br />
$NULL is returned if 2 or more of the points are coincident.<br />
158 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.5.5 Vector Functions<br />
$FVADD Vector addition<br />
$FVANG Angle (degrees) between two vectors<br />
$FVCROSS Vector cross product<br />
$FVDOT Vector dot product<br />
$FVLEN Vector length<br />
$FVMULT Vector multiplication<br />
$FVNORM Vector normalization<br />
$FVROTN Normalized vector rotation<br />
$FVSUB Vector subtraction<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Vector Functions<br />
All vector functions work with sequences of length 2 or 3 that typically define the XY or XYZ<br />
components (commonly referred to as the IJK components) of a vector. With the exception of the<br />
angle and cross product functions, vector functions can take vectors of any length. For those<br />
functions that take 2 input vectors, both vectors should have the same length. Vector functions<br />
that return a vector do so by returning a sequence with the same length as that of the shortest<br />
input vector.<br />
Vectors can be constructed using the $FSEQ function or the { } sequence operators. For example,<br />
the following are equivalent:<br />
V1=$FSEQ(0,0,1)<br />
V1={0,0,1}<br />
It is important to note that vectors are sequences and not arrays. Vector functions do not work<br />
with arrays.<br />
The $FVADD Function<br />
result=$FVADD(v1,v2)<br />
Returns: Sequence<br />
This function adds two arbitrarily long vector sequences v1 and v2, and returns the result as a<br />
vector sequence.<br />
The $FVANG Function<br />
result=$FVANG(v1,v2)<br />
Returns: Sequence or $NULL<br />
This function returns the angle in degrees between two vector sequences v1 and v2. The input<br />
vectors v1 and v2 must be sequences of length 2 or 3 only (a diagnostic is output and a value of<br />
$NULL is returned if the input vectors have less than 2 or more than 3 elements). They should<br />
also have a non-zero length to return a meaningful result.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 159
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Vector Functions<br />
For 3D vectors (i.e., vectors with 3 elements), the return angle ranges from 0 through 180.<br />
For 2D vectors, a signed angle is returned in the range -180
The $FVROTN Function<br />
result=$FVROTN(v1,v2,n)<br />
Returns: Sequence<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Vector Functions<br />
This function computes a vector at a normalized angular distance between two vectors v1 and v2.<br />
When n=0, vector v1 is returned; and when |n|=1, vector v2 is returned. For other values of n, the<br />
cross product of v1 and v2 defines the plane of rotation and n defines the normalized rotation<br />
distance calculated as the “desired rotation angle divided by the angle between vectors”.<br />
The results are undefined if v1 and v2 are opposite each other.<br />
The $FVSUB Function<br />
result=$FVSUB(v1,v2)<br />
Returns: Sequence<br />
This function subtracts one arbitrarily long vector sequence from another (i.e., v1–v2) and returns<br />
the result as a vector sequence.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 161
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Matrix Functions<br />
4.4.5.6 Matrix Functions<br />
$FMX Matrix creation<br />
$FMXINV Matrix inversion<br />
$FMXMULT Matrix multiplication<br />
$FMXTRFP Point transformation by matrix<br />
$FMXTRFV Vector transformation by matrix<br />
$FMXTRSP Matrix transposition<br />
Matrix functions work with sequences of length 12 that define the APT standard rotation and<br />
translation components of a matrix. For example:<br />
a1,a2,a3,a4<br />
a5,a6,a7,a8,<br />
a9,a10,a11,a12<br />
Matrix functions can also work with square matrices of any dimension, defined as a series of<br />
numbers that represent a matrix organized in row-column order. For example:<br />
a1,a2,a3<br />
a4,a5,a6<br />
a7,a8,a9<br />
Matrix functions that return a matrix, vector or point sequence, do so by returning a sequence<br />
with the same length as that of the input matrix, vector or point sequence.<br />
Matrices can be constructed using the $FSEQ function or the { } sequence operators. For<br />
example, the following are equivalent:<br />
M1=$FSEQ(1,0,0,0,0,1,0,0,0,0,1,0)<br />
M1={1,0,0,0,0,1,0,0,0,0,1,0}<br />
It is important to note that matrices are sequences and not arrays. Matrix functions do not work<br />
with arrays.<br />
The $FMX Function<br />
result=$FMX(…)<br />
Returns: Sequence<br />
This function returns a 12-element matrix sequence as defined by the standard CAM-<br />
POST post-processor command syntax listed below:<br />
[INVERS, ]<br />
�<br />
0:<br />
n<br />
�<br />
� �XYROT<br />
� �<br />
�[<br />
x,<br />
y [, z ]] �,<br />
�YZROT<br />
�,<br />
angle �<br />
�<br />
� � � �<br />
� �ZXROT<br />
� �<br />
�MSYS[,<br />
LAST ]<br />
�<br />
�<br />
�a1<br />
,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a<br />
12<br />
�<br />
�<br />
�<br />
�<br />
�<br />
�<br />
�<br />
�<br />
162 <strong>ICAM</strong> Technologies Corporation – Proprietary
The $FMXINV Function<br />
result=$FMXINV(m)<br />
Returns: Sequence<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Matrix Functions<br />
This function inverts the matrix sequence m, and returns the result as a matrix sequence.<br />
The $FMXMULT Function<br />
result=$FMXMULT(m1,m2)<br />
Returns: Sequence<br />
This function multiplies matrix m1 by m2, and returns the result as a matrix sequence. A diagnostic<br />
will be output and macro processing will fail if both matrices do not have the same<br />
dimensions.<br />
The $FMXTRFP Function<br />
result=$FMXTRFP(m,p)<br />
Returns: Sequence<br />
This function transforms a point p, defined as a sequence of arbitrary length, by the matrix m,<br />
and returns the translated and rotated result as a point sequence. This function only solves for the<br />
minimum number of common dimensions. Unsolved excess point dimensions are not transformed<br />
in the output point sequence.<br />
The $FMXTRFV Function<br />
result=$FMXTRFV(m,v)<br />
Returns: Sequence<br />
This function transforms a vector v, defined as a sequence of arbitrary length, by the matrix m,<br />
and returns the rotated result as a vector sequence. This function only solves for the minimum<br />
number of common dimensions. Unsolved excess vector dimensions are not transformed in the<br />
output vector sequence.<br />
The $FMXTRSP Function<br />
result=$FMXTRSP(m)<br />
Returns: Sequence<br />
This function transposes the matrix sequence m, and returns the result as a matrix sequence.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 163
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Conversion Functions<br />
4.4.5.7 Conversion Functions<br />
$FATOF Conversion string to real<br />
$FCVINT Conversion to whole number<br />
$FCVREAL Conversion to number<br />
$FMAJOR Conversion to major word (record)<br />
$FMINOR Conversion to minor word<br />
Conversion functions take arguments of one type and return arguments of a different type. String<br />
conversion functions are listed in the section following this one.<br />
The $FATOF Function<br />
result=$FATOF(s)<br />
Returns: Numeric<br />
This function converts a string s to a number. This can be useful, for example, when you wish to<br />
convert text in a NC block to a number that can be used in calculations.<br />
The $FCVINT Function<br />
result=$FCVINT(a)<br />
Returns: Numeric<br />
This function converts arguments of type LOGICAL, KEYWORD and REAL to a whole number.<br />
Logical arguments return a value of zero if $FALSE and a value of one if $TRUE. Minor<br />
words return a value equivalent to the integer code. Numeric variables are evaluated the same as<br />
with the $FINT function (i.e., the value is truncated to a whole number).<br />
The $FCVREAL Function<br />
result=$FCVREAL(a)<br />
Returns: Numeric<br />
This function converts arguments of type LOGICAL, KEYWORD and REAL to a number.<br />
Logical arguments return a value of zero if $FALSE and a value of one if $TRUE. Minor words<br />
return a value equivalent to the integer code. Numeric variables are returned as-is.<br />
The $FMAJOR Function<br />
result=$FMAJOR(class,subclass)<br />
Returns: Record<br />
This first form of the $FMAJOR function rounds the class and subclass numeric arguments to<br />
the nearest whole number and returns an argument of type RECORD. The “class subclass”<br />
combination need not exist as a known major word or record type.<br />
164 <strong>ICAM</strong> Technologies Corporation – Proprietary
esult=$FMAJOR(string)<br />
Returns: Record or $NULL<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Conversion Functions<br />
This second form of the $FMAJOR function performs a case insensitive search for the named<br />
major word and returns an argument of type RECORD if found. A value of $NULL is returned if<br />
the string does not define a known major word or record type.<br />
The $FMINOR Function<br />
result=$FMINOR(n)<br />
Returns: Keyword<br />
This first form of the $FMINOR function rounds the numeric argument n to the nearest whole<br />
number and returns an argument of type KEYWORD. The minor word need not exist as a known<br />
keyword.<br />
result=$FMINOR(string)<br />
Returns: Record or $NULL<br />
This second form of the $FMINOR function performs a case insensitive search for the named<br />
minor word and returns an argument of type KEYWORD if found. A value of $NULL is returned<br />
if the string does not define a known keyword.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 165
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Conditional Functions<br />
4.4.5.8 Conditional Functions<br />
$FCHOOSE Selects and returns a value from a list of arguments<br />
$FIF Returns argument based on logical expression<br />
$FISNUM Test if numeric<br />
$FISSEQ Test if sequence<br />
$FISSTR Test if string<br />
$FISWRD Test if keyword<br />
$FSWITCH Returns argument of first true logical expression<br />
Conditional functions return the $TRUE or $FALSE status of a conditional test, or the value of a<br />
function argument based on or associated with an expression.<br />
The $FCHOOSE Function<br />
result=$FCHOOSE(index,value1 [,value2 [,…] ] )<br />
Returns: Any or $NULL<br />
This function returns the n th value from a list of choices based on the value of index. If index is 1,<br />
$FCHOOSE returns value1 (i.e., the first choice in the list). If index is 2, it returns value2, and so<br />
on.<br />
The index value is rounded to the nearest whole number before being evaluated. The<br />
$FCHOOSE function returns a value of $NULL if index is less than 1 or greater than the number<br />
of values listed.<br />
$FCHOOSE evaluates all of the value expressions, even though it returns only one of them. For<br />
this reason, you should watch for undesirable side effects. For example, if the evaluation of any<br />
of the value expressions results in a division by zero error, an error occurs regardless of the value<br />
of index.<br />
The $FIF Function<br />
result=$FIF(expr,truearg,falsearg)<br />
Returns: Any<br />
This function evaluates the logical expression expr and returns the argument truearg if the<br />
logical expression is true, or the argument falsearg if the logical expression is false.<br />
$FIF always evaluates both truearg and falsearg, even though it returns only one of them.<br />
Because of this, you should watch for undesirable side effects. For example, if evaluating<br />
falsearg results in a division by zero error, an error occurs even if expr is true.<br />
166 <strong>ICAM</strong> Technologies Corporation – Proprietary
The $FISNUM Function<br />
result=$FISNUM(a)<br />
Returns: Logical<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Conditional Functions<br />
This function returns $TRUE if the argument a is a number. $FALSE is returned if the argument<br />
is any other type, including $NULL.<br />
The $FISSEQ Function<br />
result=$FISSEQ(a)<br />
Returns: Logical<br />
This function returns $TRUE if the argument a is a sequence. $FALSE is returned if the argument<br />
is any other type, including $NULL.<br />
The $FISSTR Function<br />
result=$FISSTR(a)<br />
Returns: Logical<br />
This function returns $TRUE if the argument a is a string or character. $FALSE is returned if the<br />
argument is any other type, including $NULL.<br />
The $FISWRD Function<br />
result=$FISWRD(a)<br />
Returns: Logical<br />
This function returns $TRUE if the argument a is a MINOR word. $FALSE is returned if the<br />
argument is any other type, including $NULL.<br />
The $FSWITCH Function<br />
result=$FSWITCH(expr1,value1 [,expr2,value2 [,…] ] )<br />
Returns: Any or $NULL<br />
This function‟s argument list consists of pairs of logical expressions and values. The logical<br />
expressions expr are evaluated from left to right, and the value associated with the first expression<br />
to evaluate to true is returned. For example, if expr1 is true, $FSWITCH returns value1. If<br />
expr1 is false, but expr2 is true, $FSWITCH returns value2, and so on.<br />
$FSWITCH returns a value of $NULL if none of the expressions are true. To return some other<br />
value if all expressions are false, use .TRUE. (or $TRUE) as a final expression paired with the<br />
required value. For example:<br />
$FSWITCH(…,.TRUE.,value)<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 167
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Conditional Functions<br />
$FSWITCH evaluates all of the expr and value expressions, even though it returns only one<br />
value. For this reason, you should watch for undesirable side effects. For example, if the evaluation<br />
of any expr or value expression results in a division by zero error, an error occurs regardless<br />
of the expr true/false conditions.<br />
168 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.5.9 Character and Sequence Functions<br />
$FCHAR Conversion to character<br />
$FEDIT Edit string<br />
$FELEM Element of sequence<br />
$FFIND Index of a value in an array or sequence<br />
$FICHAR Conversion from character<br />
$FINDEX Index of a substring<br />
$FLEN Length of string or sequence<br />
$FMATCH Match string<br />
$FSEQ Create a sequence<br />
$FSUBSQ Extract subsequence<br />
$FSUBST Extract substring<br />
$FSWRIT String formatting<br />
$FTOLOWR String conversion to lower case<br />
$FTOUPER String conversion to upper case<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Character and Sequence Functions<br />
Character functions deal with arguments of type STRING. Sequence functions deal with arguments<br />
matched using the $Pn* construct. In both cases, these arguments have a concept of<br />
length. The length of a string is the number of characters it contains. The length of a sequence is<br />
the number of elements (any combination of numbers, strings and keywords) it contains.<br />
The $FCHAR Function<br />
result=$FCHAR(n)<br />
Returns: String<br />
This function returns the ASCII character corresponding to the nearest whole value of n.<br />
The $FEDIT Function<br />
result=$FEDIT(s1,s2[,s3][,n])<br />
Returns: String<br />
This function searches for one or more occurrences of the search string s2 in string s1. For each<br />
occurrence, the matching portion is substituted by the contents of string s3, or if s3 is not specified,<br />
the matching portion is deleted. The default action is to replace all matching occurrences of<br />
s2 in s1 by s3. This can be changed by specifying n. If n is zero, then all matching occurrences<br />
are replaced (the default). If n is one (1), only the first match is replaced. Larger values of n<br />
cause the specified match number to be changed. If a match is not found, $FEDIT returns the<br />
string s1 unchanged.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 169
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Character and Sequence Functions<br />
The search string s2 can contain special characters in the form of a regular expression (RE)<br />
commonly found in UNIX search functions. The characters that form single character RE‟s are:<br />
Character Description<br />
c Any ordinary character not listed below. An ordinary character matches<br />
itself.<br />
\ Backslash. When followed by one of < > ( ) { } or a numeric digit,<br />
represents an operator in the RE. When followed by any other character,<br />
represents the character.<br />
. Dot. Matches any single character.<br />
^ Caret. As the left most character in the search string, it constrains the<br />
search to match the left most portion of the target string. The caret character<br />
loses its special meaning if it appears in any position other than the<br />
first in the search string.<br />
$ Dollar. As the right most character in the search string, it constrains the<br />
search to match the right most portion of the target string. The dollar<br />
character loses its special meaning if it appears in any position other than<br />
the last in the search string.<br />
\< The sequence \< constrains the next item in the search string to match<br />
something at the beginning of a “word”. That is, either at the beginning of<br />
the target string, or just before a letter, digit or underline and after a<br />
character not one of these.<br />
\> The sequence \> constrains the next item in the search string to match<br />
something at the end of a “word”.<br />
[c…] A non-empty string of characters enclosed in square brackets matches any<br />
single character in the string. If the first character following [ is ^ (caret),<br />
then the RE matches any character except those in the string. A caret in<br />
any other position is an ordinary character. To match a ] character, specify<br />
it first (after an initial ^, if any). A minus sign, between two characters,<br />
indicates a range of consecutive ASCII characters to match. To match a –<br />
character, specify it first (after an initial ^, if any) or last in the string.<br />
170 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Character and Sequence Functions<br />
The following rules and special characters allow for constructing RE‟s from single character<br />
RE‟s.<br />
Character Description<br />
* Asterisk. A single character RE, followed by an asterisk matches zero or<br />
more occurrences of the single character RE.<br />
\{m\}<br />
\{m,\}<br />
\{m,n\}<br />
A single character RE followed by one of these brace operators is an RE<br />
that matches a range of occurrences of the single character RE. The<br />
values of m and n must be integers in the range 0-255. \{m\} matches<br />
exactly m occurrences; \{m,\} matches at least m occurrences; \{m,n\}<br />
matches the largest number of occurrences between m and n.<br />
\(…\) An RE enclosed between the character sequence \( and \) matches whatever<br />
the unadorned RE matches, but saves the matched string in a numbered<br />
buffer. Up to 9 buffers are permitted, assigned sequentially.<br />
\n Match the contents of the n th substring buffer.<br />
The substitution string s3 in the $FEDIT function can reference matched text saved in numbered<br />
buffers using the \( and \) sequence. For example,<br />
$P3=$FEDIT($P3,'G44\(..*\)','\1G44')<br />
This searches for G44 followed by one or more characters (saved in buffer number one). The<br />
substitution string replaces the matched text by the contents of the saved buffer number 1 and the<br />
string G44. This has the effect of reversing the order of appearance of G44 in the string.<br />
The $FELEM Function<br />
result=$FELEM(q,n)<br />
Returns: Any<br />
This function provides an obsolete method of returning the value of element n in sequence q. It is<br />
used to extract the individual elements of sequence variables. The macro ( ) grouping operator<br />
should be used instead of $FELEM. For example, specify q(n) instead of $FELEM(q,n).<br />
The $FFIND Function<br />
result=$FFIND(a1,a2[,n])<br />
Returns: String<br />
This function finds the first occurrence of the value a2 in the array or sequence a1. The array<br />
must be specified with an index. If no match was found a value of zero is returned. Note that for<br />
arrays, the return value specifies the position found with respect to the array index. The maximum<br />
number of entries to search can be specified with n. If not specified, the search terminates<br />
at the end of the array or sequence.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 171
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Character and Sequence Functions<br />
The $FICHAR Function<br />
result=$FICHAR(s)<br />
Returns: Numeric<br />
This function returns the ASCII numeric representation of the character s. Only the first character<br />
of s is used by this function.<br />
The $FINDEX Function<br />
result=$FINDEX(s1,s2)<br />
Returns: Numeric<br />
This function returns the starting position of the string s2 within the string s1. If s2 is not contained<br />
in s1, the function will return 0.<br />
The $FLEN Function<br />
result=$FLEN(a)<br />
Returns: Numeric<br />
This function returns the length of the input string or sequence a. Note that the length may be<br />
zero if a is an empty string ('') or an empty sequence.<br />
The $FMATCH Function<br />
result=$FMATCH(s1,s2[,s3][,n])<br />
Returns: String<br />
This function searches for an occurrence of the search string s2 in string s1. If found, the<br />
matched portion of string s1 is returned, or if string s3 is specified, string s3 will be returned. The<br />
default action is to locate the first matching occurrence of s2 in s1. This can be changed by<br />
specifying n. If n is one (1), only the first match is returned (the default). Larger values of n<br />
cause the specified match number to be returned. If a match is not found, $FMATCH returns an<br />
empty string.<br />
The search string s2 can contain special characters in the form of a regular expression (RE)<br />
commonly found in UNIX search functions. See the $FEDIT function for a description of RE‟s.<br />
The substitution string s3 in the $FMATCH function can reference matched text saved in numbered<br />
buffers using the \( and \) sequence. For example,<br />
%L01=$FMATCH($P1,'N\([0-9][0-9]*\)','\1').<br />
This returns only the numeric portion of the matched text. If the third argument was omitted, the<br />
entire matched text would be returned.<br />
172 <strong>ICAM</strong> Technologies Corporation – Proprietary
The $FSEQ Function<br />
result=$FSEQ([a1[,a2[,…]])<br />
Returns: Sequence<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Character and Sequence Functions<br />
This function provides an obsolete method of constructing a sequence. The $FSEQ function<br />
returns a sequence equivalent to all the arguments it is called with. The macro { } sequence<br />
operator should be used instead of $FSEQ. For example, specify {a1,a2} instead of<br />
$FSEQ(a1,a2).<br />
The $FSUBSQ Function<br />
result=$FSUBSQ(q,n1,n2)<br />
Returns: Sequence<br />
This function provides an obsolete method of returning zero or more elements of a sequence<br />
variable. This function returns the portion of the sequence q starting at element number n1 and<br />
ending at element number n2. Both n1 and n2 must be positive non-zero values. If n2 is less than<br />
n1, a sequence of length zero is returned. The macro : (colon) operator should be used instead of<br />
$FSUBSQ. For example, specify q(n1:n2) instead of $FSUBSQ(q,n1,n2).<br />
The $FSUBST Function<br />
result=$FSUBST(a1,a2,a3)<br />
Returns: String<br />
This function provides an obsolete method of returning a portion of a string variable. This<br />
function returns the portion of the string a1 starting at character position a2 and ending at<br />
character position a3. Both a2 and a3 must be positive non-zero values. If a3 is less than a2, a<br />
blank string is returned. The macro : operator should be used instead of $FSUBST. For example,<br />
specify a1(a2:a3) instead of $FSUBST(a1,a2,a3).<br />
The $FSWRIT Function<br />
result=$FSWRIT(s[,a1[,a2[,…]]])<br />
Returns: String<br />
This function returns the string s into which the subsequent arguments a1, a2, etc, have been<br />
formatted. It effectively does an internal write of the arguments into the format string and returns<br />
the result. The returned string is produced by inserting the arguments into the string s wherever<br />
special format characters are found. More information on these formatting characters can be<br />
found in “Output String Format Specifications” on page 139.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 173
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Character and Sequence Functions<br />
The $FTOLOWR Function<br />
result=$FTOLOWR(s)<br />
Returns: String<br />
This function converts a string s to lowercase.<br />
The $FTOUPER Function<br />
result=$FTOUPER(s)<br />
Returns: String<br />
This function converts a string s to uppercase.<br />
174 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.5.10 Command Line Functions<br />
$FARGC Return count of arguments<br />
$FARGV Return argument value<br />
$FPNAME Return name portion of command line qualifier<br />
$FPVALUE Return value portion of command line qualifier<br />
The $FARGC Function<br />
result=$FARGC([s1[,s2]])<br />
Returns: Numeric<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Command Line Functions<br />
This function returns the number of arguments in the application command line, as stored in the<br />
$PARAM macro variable. If string s1 is given, the $FARGC function will return the number of<br />
arguments contained within the string s1. The optional separator string s2 contains the character<br />
used as separator. The default value for the separator is a blank.<br />
The $FARGV Function<br />
result=$FARGV(n[,s1[,s2]])<br />
Returns: String<br />
This function extracts the n th argument of the application command line, as stored in the<br />
$PARAM macro variable. If string s1 is given, the $FARGV function will extract the argument<br />
from this string. The optional separator string s2 contains the character used as separator. The<br />
default value for the separator is a blank.<br />
The $FPNAME and $FPVALUE Functions<br />
result=$FPNAME(s)<br />
result=$FPVALUE(s)<br />
Returns: String<br />
The $FPNAME function returns the parameter name portion of an O/S compatible shell command<br />
line qualifier stored in string s. The $FPVALUE function returns the parameter value<br />
portion. These functions are intended to work with the results of the $FARGV function described<br />
above. Qualifiers are processed depending on the actual O/S the software is running under.<br />
UNIX: -name=value<br />
Windows: /name=value<br />
For example, on a Windows system, calling $FPNAME('/ABC="D E F"') returns the string<br />
'ABC'. Calling $FPVALUE('/ABC="D E F"') returns the string 'D E F'. If the input string does<br />
not contain a – or / delimited qualifier (as appropriate), then a blank string is returned for the<br />
parameter name function, and the entire string is returned for the parameter value function.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 175
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, File and Directory Functions<br />
4.4.5.11 File and Directory Functions<br />
$FACCESS Get file access information<br />
$FBASNAM Return file name portion of path string<br />
$FCTIME Convert numeric value to date and time string<br />
$FDIRNAM Return directory portion of path string<br />
$FEOF Test for end-of-file<br />
$FGETCWD Return current working directory<br />
$FSETCWD Set current working directory<br />
$FSTAT Get file status information<br />
To access a file in the post-processor or control emulator internal File Storage, specify an absolute<br />
file path using an “//<strong>ICAM</strong>FS/” universal file descriptor (e.g., “//<strong>ICAM</strong>FS/toolno.dat”). Files<br />
in the internal File Storage area are read-only.<br />
The $FACCESS Function<br />
result=$FACCESS(s[,n])<br />
Returns: Logical<br />
This function returns $TRUE if the specified file or directory named identified by the string s can<br />
be accessed. By default the file is tested for both READ and WRITE access rights, but a specific<br />
access type can be checked by specifying an access mode value n. The $FACCESS function<br />
returns $FALSE if the specified name is invalid or does not exist, or the file does not support the<br />
access rights. The syntax is as follows.<br />
logical=$FACCESS(path_string [, mode])<br />
The following values are supported for mode n. Note that Windows file systems cannot differentiate<br />
the “run” mode type:<br />
0 File exists?<br />
1 File can be run?<br />
2 File can be written?<br />
3 File can be written or run?<br />
4 File can be read?<br />
5 File can be read or run?<br />
6 File can be written or read? (default)<br />
7 File can be written, read or run?<br />
176 <strong>ICAM</strong> Technologies Corporation – Proprietary
The $FBASNAM Function<br />
result=$FBASNAM(s1[,s2])<br />
Returns: String<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, File and Directory Functions<br />
This function extracts and returns the file name portion of a file path string s1, optionally removing<br />
any trailing portion s2 of the file name that matched the suffix string. The syntax is as<br />
follows:<br />
file_name_string=$FBASNAM(path_string [,suffix_string])<br />
For example, “test.cld” is the base portion of “C:\temp\test.cld”. When removing a trailing<br />
suffix, the $FBASNAM function looks for the last occurrence of the suffix in the file name, and<br />
then removes the remainder of the file name from the matched point onwards. Case is significant.<br />
Continuing the example, “test” would be returned if “.” (a decimal) is specified as a suffix.<br />
The $FCTIME Function<br />
result=$FCTIME(n)<br />
Returns: String<br />
This function returns the date and time in string format, given a real number n specifying the<br />
number of seconds since the operating system specific “epoch” time. This function can be used<br />
to convert time values from the $FSTAT function to a human readable format. The syntax is as<br />
follows:<br />
date_string=$FCTIME(real)<br />
The date string is output in the following format with a single blank between the date and time<br />
portions:<br />
dd-mm-yyyy hh:mm:ss<br />
The $FDIRNAM Function<br />
result=$FDIRNAM(s)<br />
Returns: String<br />
This function extracts and returns the directory name portion of a file path string a. The path<br />
string need not contain directory name information. The syntax is as follows:<br />
path_string=$FDIRNAM(path_string)<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 177
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, File and Directory Functions<br />
The $FEOF Function<br />
result=$FEOF(n)<br />
Returns: Logical<br />
This function returns the end-of-file status of unit n. A status of $TRUE is returned if the specified<br />
unit is at the end-of-file mark. $FEOF should be used to check the end-of-file status of a text<br />
file unit before reading from that file. If the unit specified has not been opened using the OPEN<br />
command, an error will be output.<br />
The $FGETCWD Function<br />
result=$FGETCWD( )<br />
Returns: String<br />
This function returns a string set to the current working directory name a. The current working<br />
directory is typically the directory from which the post-processor was run. File names that<br />
exclude a directory component are assumed to be located in the default (or current) working<br />
directory. The syntax is as follows.<br />
path_string=$FGETCWD()<br />
The $FSETCWD Function<br />
result=$FSETCWD(s)<br />
Returns: String<br />
This function changes the current working directory, and returns a string set to the new current<br />
working directory defined by string s. By default, file names that exclude a directory component<br />
are assumed to be in the default (or current) working directory. The syntax is as follows:<br />
path_string=$FSETCWD(path_string)<br />
The $FSTAT Function<br />
result=$FSTAT(s1,s2)<br />
Returns: Numeric<br />
This function returns various statistics about the specified file or directory defined by string s1.<br />
The syntax is as follows:<br />
real=$FSTAT(path_string, type_string)<br />
178 <strong>ICAM</strong> Technologies Corporation – Proprietary
The following values are supported for the type string s2:<br />
„size‟ File size in bytes<br />
„atime‟ Time of last file access<br />
„ctime‟ Time of last file status change (typically creation time)<br />
„mtime‟ Time of last file modification<br />
„mode‟ File mode (operating system specific)<br />
„owner‟ Numeric ID of owner<br />
„group‟ Numeric ID of file group<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, File and Directory Functions<br />
The type string s2 is case insignificant. Values can be abbreviated (although “m” will return the<br />
modification time, not the file mode). Dates are returned as the number of seconds since the<br />
“epoch” (an operating system dependent base value). The $FCTIME function can be used to<br />
convert numeric dates to a string format. Mode information is operating system specific – use the<br />
$FACCESS function to determine file access rights. Ownership information is not available for<br />
Windows file systems (a value of zero will be returned).<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 179
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
4.4.5.12 <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
$FMSADPT Manage <strong>Virtual</strong> <strong>Machine</strong> activation status<br />
$FMSATA Attach one component to another<br />
$FMSBTC Indicates the start of a tool change sequence<br />
$FMSCMRA Set predefined camera position<br />
$FMSETC Indicates the end of a tool change sequence<br />
$FMSGDCV Get machine simulation diameter compensation offset<br />
$FMSGFCV Get machine simulation fixture compensation offset<br />
$FMSGLCV Get machine simulation length compensation offset<br />
$FMSGOUG Manage gouge testing status<br />
$FMSID Get component ID of desired object<br />
$FMSIDN Get the name of a component, given its ID<br />
$FMSIDT Get the type of a component, given its ID<br />
$FMSLCS Establish or remove a local coordinate system<br />
$FMSMAX Map a model axis to a CERUN or GENER axis<br />
$FMSMOVE Move an model axis<br />
$FMSMSP Set master (i.e. active) spindle<br />
$FMSPCK Get pocket number associated with the tool<br />
$FMSSDCV Set diameter compensation values<br />
$FMSSFCV Set fixture compensation values<br />
$FMSSLAV Slave one axis to another<br />
$FMSSLCV Set length compensation values<br />
$FMSTRN Transfer stock/fixture/part between stock mount points<br />
<strong>Virtual</strong> <strong>Machine</strong> functions are easily identified by a three letter $FMS prefix. <strong>Virtual</strong> <strong>Machine</strong><br />
functions can be called from post processor and control emulator macros, however diagnostics<br />
will be generated if a model is not being used. Therefore, it is strongly recommended that <strong>Virtual</strong><br />
<strong>Machine</strong> functions only be used from within model macros.<br />
180 <strong>ICAM</strong> Technologies Corporation – Proprietary
The $FMSADPT Function<br />
result=$FMSADPT(ON|OFF)<br />
result=$FMSADPT(PROTCT,ON|OFF|SCAN|AVOID)<br />
Returns: Numeric (0:error, 1:success)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
The first form of the $FMSADPT function is used to enable or disable <strong>Virtual</strong> <strong>Machine</strong>. Specify<br />
ON to enable normal operation of the model (this is the default). Specify OFF to disable updates<br />
to the model. Once disabled, <strong>Virtual</strong> <strong>Machine</strong> will no longer update the model or use the model<br />
for collision avoidance and path planning purposes. You might consider disabling the model to<br />
improve look-ahead operations that are not affected by model collision information.<br />
The second form of the $FMSADPT function is available with GENER only. This function<br />
controls the automatic collision avoidance and path planning features available with graphical<br />
post processing. The function parameters are identical to those on the GENER ADAPTV post<br />
processor command.<br />
OFF Disables collision avoidance.<br />
ON Enables collision avoidance (this is the default at the start of processing).<br />
SCAN Enable reporting of collision and overtravel conditions, but do not take<br />
corrective actions.<br />
AVOID Enable reporting of collision and overtravel conditions and take corrective<br />
actions to avoid collisions if possible.<br />
The $FMSATA Function<br />
result=$FMSATA(child_id,parent_id)<br />
Returns: Numeric (always returns 1)<br />
Attaches the component identified by child_id to the component identified by parent_id. The<br />
concept of child and parent specifies the relationship after the attachment has completed, meaning<br />
that the first object (i.e., child_id) will be attached to the second (i.e., parent_id). This<br />
function can be used to attach a tool to a tool axis, or to move stock, fixtures and parts from one<br />
part of the model to another. Component ID‟s are obtained using the $FMSID function.<br />
Care must be taken to only attach tools and holders to spindle axes, and parts, stock and fixtures<br />
to stock axes.<br />
The $FMSBTC Function<br />
result=$FMSBTC( )<br />
Returns: Numeric (always returns 1)<br />
This function is used to indicate the beginning of a tool change. When in continuous animation<br />
mode and the “Motion step during Tool Change” setting is active, the animation mode will<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 181
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
switch to the Motion Step format. The animation mode will switch back to continuous when the<br />
$FMSETC function is later called to indicate the end of the tool change.<br />
The $FMSCMRA Function<br />
result=$FMSCMRA(n)<br />
Returns: Numeric (always returns 1)<br />
This macro function will position the camera to one of 10 predefined model camera positions.<br />
Specify the camera position using a whole number in the range 0-9. No action is taken when the<br />
selected position does not exist in the model.<br />
The $FMSETC Function<br />
result=$FMSETC( )<br />
Returns: Numeric (always returns 1)<br />
This function is used to indicate the end of a tool change. When in continuous animation mode,<br />
and the “Motion step during Tool Change” setting is active, the animation mode will switch to<br />
the Motion Step format when the $FMSBTC function is called. The animation mode will switch<br />
back to continuous when the $FMSETC function is later called to indicate the end of the tool<br />
change.<br />
The $FMSGDCV Function<br />
result=$FMSGDCV(n1,n2)<br />
Returns: Numeric<br />
This function returns tool diameter compensation amounts. There are two possible forms of<br />
referencing tool diameter compensation values. If the machine supports “offset unique by tool”<br />
compensation, then n1 specifies the tool number and n2 specifies the compensation switch<br />
number for that tool. Otherwise, the value of n1 is ignored and n2 specifies the diameter compensation<br />
offset switch number. Specify 0 (zero) for both n1 and n2 to return the base diameter<br />
compensation amount<br />
The return value is the diameter compensation offset amount. A value of zero is returned if the<br />
offset is not defined.<br />
The $FMSGFCV Function<br />
result=$FMSGFCV(n1,n2[,ALL])<br />
Returns: Sequence<br />
This form of the $FMSGFCV function returns the fixture compensation amounts associated with<br />
the fixture (or workpiece) compensation code n1. For example, on machines with a range of G<br />
codes, such as G54-G59, specify a number in the range 1-6 for n1; the value of n2 is ignored. On<br />
controllers that support an extended workpiece compensation range, n1 specifies the primary<br />
182 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
index and n2 specifies the secondary index. Specify 0 (zero) for both n1 and n2 to return the base<br />
fixture compensation amount.<br />
If the ALL keyword is specified, the return value is a sequence of length 16 containing the<br />
fixture compensation values for all possible axes for the specified compensation index. Otherwise,<br />
the return value is a sequence of length 6 containing the fixture compensation values for<br />
the active axes (as defined by the $AXES system variable). A sequence of zeros is returned if the<br />
compensation index is not defined.<br />
result=$FMSGFCV(n1,n2,index)<br />
result=$FMSGFCV(n1,n2,keyword)<br />
Returns: Numeric<br />
Similar to the above, this form of the $FMSGFCV function returns the fixture compensation<br />
amount for the specified axis, identified either by an index number, or by a keyword identifier. A<br />
value of zero is returned if the compensation index is not defined, or if axis is not defined in the<br />
post-processor or control emulator.<br />
index keyword Axis<br />
1 XAXIS Primary X axis<br />
2 YAXIS Primary Y axis<br />
3 ZAXIS Primary Z axis<br />
4 UAXIS Secondary X axis<br />
5 VAXIS Secondary Y axis<br />
6 WAXIS Secondary Z axis<br />
7 AAXIS,TABLE Rotary A axis table<br />
8 BAXIS,TABLE Rotary B axis table<br />
9 CAXIS,TABLE Rotary C axis table<br />
10 AAXIS Rotary A axis head<br />
11 BAXIS Rotary B axis head<br />
12 CAXIS Rotary C axis head<br />
13 QUILL Extending linear axis<br />
14 RAM[,1] Primary rotary on exchangeable head<br />
15 RAM,2 Secondary rotary on exchangeable head<br />
16 ORIENT Spindle orientation<br />
The $FMSGLCV Function<br />
result=$FMSGLCV(tool_id,n[,ALL])<br />
Returns: Sequence<br />
This function returns length compensation amounts. There are two possible forms of referencing<br />
tool length compensation values. If the machine supports “offset unique by tool” compensation,<br />
then n1 specifies the tool number and n2 specifies the compensation switch number for that tool.<br />
Otherwise, the value of n1 is ignored and n2 specifies the length compensation offset switch<br />
number. Specify 0 (zero) for both tool_id and n to return the base length compensation amount.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 183
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
If the ALL keyword is specified, the return value is a sequence of length 16 containing the length<br />
compensation values for all possible axes for the specified offset switch number. Otherwise, the<br />
return value is a sequence of length 6 containing the length compensation values for the active<br />
axes (as defined by the $AXES system variable). A sequence of zeros is returned if the offset<br />
switch number is not defined.<br />
result=$FMSGLCV(tool_id,n,index)<br />
result=$FMSGLCV(tool_id,n,keyword)<br />
Returns: Numeric<br />
Similar to the above, this form of the $FMSGLCV function returns the length compensation<br />
amount for the specified axis, identified either by an index number, or by a keyword identifier (a<br />
table of valid index numbers and keywords can be found on page 183). A value of zero is<br />
returned if the offset switch number is not defined, or if axis is not defined in the post-processor<br />
or control emulator.<br />
Note: Currently, length compensation is supported only for the XYZ linear axes and for the ABC<br />
rotary head axes, conditional upon these axes being defined in the post-processor or control<br />
emulator.<br />
The $FMSGOUG Function<br />
result=$FMSGOUG([n])<br />
Returns: Numeric<br />
This function returns the current gouge testing status between cutting portion of the tool and part.<br />
A value 0 (zero) indicates that gouge testing is disabled; a value of 1 (one) indicates that gouge<br />
testing is enabled. You can optionally set the gouge testing status by specifying n as a whole<br />
number in the range 0-1.<br />
The $FMSID Function<br />
There are a number of different forms of the $FMSID function, designed to return the component<br />
ID‟s of tools, parts and other named objects. This function can also be used to “walk” the component<br />
tree, by returning the parent or child ID of a specified ID. Each of these function call<br />
forms is described below:<br />
Named Component ID<br />
result=$FMSID(string)<br />
Returns: Numeric<br />
Returns the component ID of the first component found in the model with a name matching that<br />
defined by the string variable or constant.<br />
184 <strong>ICAM</strong> Technologies Corporation – Proprietary
Head Component ID<br />
result=$FMSID(HEAD,n1[,n2])<br />
Returns: Numeric<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
Returns the component ID of the first head found with head number n1. The n2 value can<br />
optionally be specified to return other information associated with the head, as follows:<br />
n2 Return value<br />
0 Return component id of head number n1 (default)<br />
1 Return component id of head axis n1<br />
2 Return component id of head attached to head axis n1<br />
3 Return component id of head axis of pocket n1<br />
4 Return component id of head attached to pocket n1<br />
Tool Component ID<br />
result=$FMSID(TOOL,n1[,n2])<br />
Returns: Numeric<br />
Returns the component ID of the first tool found with tool number n1. The n2 value can optionally<br />
be specified to return other information associated with the tool, as follows:<br />
n2 Return value<br />
0 Return component id of tool number n1 (default)<br />
1 Return component id of tool axis n1<br />
2 Return component id of tool attached to tool axis n1<br />
3 Return component id of tool axis of pocket n1<br />
4 Return component id of tool attached to pocket n1<br />
Stock Axis Component ID<br />
result=$FMSID(PART,n1,n2[,ALL])<br />
Returns: Numeric or Sequence<br />
Returns the component ID of objects associated with the stock axis identified by the number n1.<br />
The n2 value defines the information to return, as follows:<br />
n2 Return value<br />
1 Return component id of Stock axis number n1<br />
2 Return component id of the first component attached to the Stock axis number n1<br />
The ALL keyword can be specified to return all components (to a maximum of 1024) attached to<br />
the stock axis. In this case, the function returns a sequence of components, or it returns an empty<br />
sequence if no components are attached.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 185
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
Child Component ID<br />
result=$FMSID(ID,n1,n2[,ALL])<br />
Returns: Numeric or Sequence<br />
Returns the component ID of objects associated with the component identified by ID n1. The n2<br />
value defines the information to return, as follows:<br />
n2 Return value<br />
1 Return component id of Parent associated to component ID n1<br />
2 Return component id of the first Child associated to component ID n1<br />
The ALL keyword can be specified to return all child components (to a maximum of 1024)<br />
attached to the specified object. In this case, the function returns a sequence of components, or it<br />
returns an empty sequence if no components are attached.<br />
The $FMSIDN Function<br />
result=$FMSIDN(comp_id)<br />
Returns: String<br />
This function returns the name of the component identified by the component ID comp_id.<br />
Component ID‟s are obtained using the $FMSID function.<br />
The $FMSIDT Function<br />
result=$FMSIDT(comp_id)<br />
Returns: Numeric<br />
This function returns one of the following numeric code types that identify the component ID<br />
specified by comp_id. Component ID‟s are obtained using the $FMSID function.<br />
0: Unknown type<br />
1: World component<br />
2: <strong>Machine</strong> component<br />
3: Axis component<br />
4: Linear axis component<br />
5: Rotary axis component<br />
6: Curve axis component<br />
7: Stock axis component<br />
8: Stock component<br />
9: Fixture component<br />
10: Part component<br />
11: Tool axis component<br />
12: Tool component<br />
13: Head axis component<br />
14: Head component<br />
15: Geometric entity component<br />
186 <strong>ICAM</strong> Technologies Corporation – Proprietary
The $FMSLCS Function<br />
result=$FMSLCS([m])<br />
Returns: Numeric (always returns 1)<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
This function is used to setup a local coordinate system transformation on the simulation machine.<br />
The m argument is a sequence that must contain the 12 numeric elements of a matrix. See<br />
the Matrix functions on page 162 for more information on using matrices with the macro processor.<br />
Call the $FMSLCS function without the m matrix sequence to disable local coordinate processing<br />
and return to normal coordinate processing.<br />
The $FMSMAX Function<br />
result=$FMSMAX(channel, n,axis_id [,n2,axis_id2 [,…]])<br />
Returns: Numeric (always returns 1)<br />
This function maps a linear or rotary model axis, specified by its model axis component id, to<br />
one of the 15 standard CERUN or GENER axes being controlled by the specified channel. Great<br />
care must be taken when overriding the built-in functionality in order to map axes manually<br />
using this function.<br />
Specify 2 for the channel argument when mapping the Z and X axes for a merging lathe side<br />
turret. Otherwise, the channel should always be 1 (one).<br />
The CERUN or GENER axis identifier n is a whole number in the range 1-15, as follows:<br />
1-3 X-axis, Y-axis, Z-axis<br />
4-6 U-axis, V-axis, W-axis<br />
7-9 A-axis, B-axis, C-axis tables<br />
10-12 A-axis, B-axis, C-axis heads<br />
13 Extending axis (i.e., quill)<br />
14-15 Run-time attachable rotary heads<br />
The axis_id parameter is one of the models linear or rotary axes, identified by its component ID.<br />
Component ID‟s are obtained using the $FMSID function.<br />
The $FMSMOVE Function<br />
result=$FMSMOVE(axis_id,position,velocity[,NEXT|NOW])<br />
Returns: Numeric (always returns 1)<br />
This function moves the model axis identified by comp_id (component ID‟s are obtained using<br />
the $FMSID function), to the specified position in model axis units, at the specified velocity in<br />
model units per minute.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 187
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
If NEXT is specified, this axis motion will be deferred and included with the next model motion<br />
event. NOW (the default) causes the axis to move immediately. All pending NEXT motions can<br />
be processed by calling $FMSMOVE(0,0,0,NOW).<br />
The $FMSMSP Function<br />
result=$FMSMSP(n)<br />
Returns: Numeric (always returns 1)<br />
This function sets the master (or current) spindle by giving the spindle ID number n. Spindle ID<br />
numbers are set when creating model stock, tool and rotary axes that can also represent a spindle.<br />
The master spindle is the one that will be controlled by the built-in spindle processing of CERUN<br />
or GENER. Use this function if it is necessary to override the default assignment of master<br />
spindle.<br />
The $FMSPCK Function<br />
result=$FMSPCK(n)<br />
Returns: Numeric component ID or zero<br />
This function returns the component ID of the pocket associated with tool number n.<br />
The $FMSSDCV Function<br />
result=$FMSSDCV(n1,n2,n3)<br />
Returns: Numeric<br />
This function sets tool diameter compensation amounts. There are two possible forms of referencing<br />
tool diameter compensation values. If the machine supports “offset unique by tool”<br />
compensation, then n1 specifies the tool number and n2 specifies the compensation switch<br />
number for that tool. Otherwise, the value of n1 is ignored and n2 specifies the diameter compensation<br />
offset switch number. Specify 0 (zero) for both n1 and n2 to set the base diameter<br />
compensation value, which will be added to any diameter compensation offset in effect.<br />
This function sets the tool diameter compensation amount for the specified index to n3.<br />
A value of 1 is returned if the diameter compensation amount was successfully applied, otherwise<br />
a value of 0 (zero) is returned.<br />
The $FMSSFCV Function<br />
result=$FMSSFCV(n1,n2,q[,ALL])<br />
Returns: Numeric<br />
This form of the $FMSSFCV function sets the fixture compensation amounts to be associated<br />
with the fixture (or workpiece) compensation code n1. For example, on machines with a range of<br />
G codes, such as G54-G59, specify a number in the range 1-6 for n1; the value of n2 is ignored.<br />
On controllers that support an extended workpiece compensation range, n1 specifies the primary<br />
188 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
index and n2 specifies the secondary index. Specify 0 (zero) for both n1 and n2 to set the base<br />
fixture compensation values, which will be applied in addition to any fixture compensation<br />
amount in effect. Base compensation is applied even when fixture compensation is not active.<br />
Fixture compensation values are set for the specified index to the values defined by the sequence<br />
variable q. If the ALL keyword is specified, use a sequence of length 16 to define the fixture<br />
compensation values for all possible axes for the specified compensation index. Otherwise, use a<br />
sequence of length 6 to define the fixture compensation values for the active axes (as defined by<br />
the $AXES system variable). A value of 1 is returned if the fixture compensation amount was<br />
successfully applied, otherwise a value of 0 (zero) is returned.<br />
result=$FMSGFCV(n1,n2,index)<br />
result=$FMSGFCV(n1,n2,keyword)<br />
Returns: Numeric<br />
Similar to the above, this form of the $FMSSFCV function sets the fixture compensation amount<br />
for the specified axis, identified either by an index number, or by a keyword identifier (a table of<br />
valid index numbers and keywords can be found on page 183). A value of 1 is returned if the<br />
fixture compensation amount was successfully applied, otherwise a value of 0 (zero) is returned.<br />
The $FMSSLAV Function<br />
result=$FMSSLAV(slave_axis_id,master_axis_id[,factor])<br />
Returns: Numeric (always returns 1)<br />
This function slaves (or associates) the axis component identified by slave_axis_id to the axis<br />
component identified by master_axis_id. Component ID‟s are obtained using the $FMSID<br />
function. Once slaved, any motion of the master axis will automatically cause the slave axis to<br />
move by an identical amount. Specify an optional signed multiplication factor to adjust the ratio<br />
of slave axis motion to master axis motion.<br />
Specify 0 (zero) as the master_axis_id to sever the relationship with the slave_axis_id.<br />
The $FMSSLCV Function<br />
result=$FMSSLCV(tool_id,n,q[,ALL])<br />
result=$FMSSLCV(tool_id,n,[x,y,]z)<br />
Returns: Numeric<br />
This form of the $FMSSLCV function sets length compensation amounts. There are two possible<br />
forms of referencing tool length compensation values. If the machine supports “offset unique by<br />
tool” compensation, then tool_id specifies the tool number and n specifies the compensation<br />
switch number for that tool. Otherwise, the value of tool_id is ignored and n specifies the length<br />
compensation offset switch number. Specify 0 (zero) for both tool_id and n to set the base length<br />
compensation values, which will be added to any length compensation offset in effect.<br />
Length compensation values can be set for the specified offset switch number to the values<br />
defined by the sequence variable q. If the ALL keyword is specified, use a sequence of length 16<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 189
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> General Functions<br />
to define the length compensation values for all possible axes for the specified offset switch<br />
number. Otherwise, use a sequence of length 6 to define the length compensation values for the<br />
active axes (as defined by the $AXES system variable).<br />
Alternatively, the length compensation offsets can be specified for the XYZ axes using numeric<br />
variables or constants (if x,y is omitted they are set to zero).<br />
A value of 1 is returned if the length compensation amount was successfully applied, otherwise a<br />
value of 0 (zero) is returned.<br />
result=$FMSSLCV(tool_id,n,index,amount)<br />
result=$FMSSLCV(tool_id,n,keyword,amount)<br />
Returns: Numeric<br />
Similar to the above, this form of the $FMSSLCV function sets the length compensation amount<br />
for the specified axis, identified either by an index number, or by a keyword identifier (a table of<br />
valid index numbers and keywords can be found on page 183). A value of 1 is returned if the<br />
length compensation amount was successfully applied, otherwise a value of 0 (zero) is returned.<br />
Note: Currently, length compensation is supported only for the XYZ linear axes and for the ABC<br />
rotary head axes, conditional upon these axes being defined in the post-processor or control<br />
emulator.<br />
The $FMSTRN Function<br />
result=$FMSTRN(from_part_id,to_part_id [,space_type])<br />
Returns: Numeric (always returns 1)<br />
This function transfers part, stock or fixture components from the stock axis identified by<br />
from_part_id to the stock axis identified by to_part_id. Component ID‟s are obtained using the<br />
$FMSID function. The space_type flag defines how the stock is moved, as follows:<br />
0 Local space (default): Object‟s relationship to to_part_id will be the same as the object‟s<br />
original relationship to from_part_id. Object typically will move.<br />
1 Global space: Object will be transferred from from_part_id to to_part_id without physically<br />
moving<br />
190 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.5.13 <strong>Virtual</strong> <strong>Machine</strong> Channel Functions<br />
$FMSACH Activate or deactivate channel<br />
$FMSDCH Delete channel<br />
$FMSGAX Associate an axis to a channel<br />
$FMSGCH Get channel number<br />
$FMSNCH Create a new channel<br />
$FMSRAX Release an axis from a channel<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Channel Functions<br />
$FMSWCH Wait for mark number or channel synchronization<br />
<strong>Virtual</strong> <strong>Machine</strong> functions are easily identified by a three letter $FMS prefix. <strong>Virtual</strong> <strong>Machine</strong><br />
functions can be called from post processor and control emulator macros, however diagnostics<br />
will be generated if a model is not being used. Therefore, it is strongly recommended that <strong>Virtual</strong><br />
<strong>Machine</strong> functions only be used from within model macros.<br />
Channels are the mechanism that <strong>Virtual</strong> <strong>Machine</strong> uses to run different operations at the same<br />
time. <strong>Virtual</strong> <strong>Machine</strong> simulates CERUN and GENER main processing in channel number 1<br />
merging lathe side head processing in channel 2. Additional channels can be added under macro<br />
control to move other axes (such as doors or tool changers) at the same time as the normal axes.<br />
Note that a channel is only necessary to simultaneously move model axes that are not already<br />
under control by CERUN or GENER.<br />
The $FMSACH Function<br />
result=$FMSACH(channel,flag[,channel_2])<br />
Returns: Numeric (always returns 1)<br />
This function activates or deactivates a channel, based on the flag settings, as follows:<br />
0: Deactivate the channel.<br />
1: Activate channel with wait. Activate channel, stalling channel_2 if channel is busy.<br />
2: Activate channel without wait. Activate channel. If busy, add new actions to the queue<br />
of pending actions.<br />
3: Activate channel with truncation. Activate channel. If busy, delete all current and<br />
pending actions.<br />
A channel must be deactivated when there are no longer any additional actions to be processed.<br />
The deactivation only occurs after the channel has completed executing all pending actions.<br />
Leaving a channel active without sending any new actions to it will stall the simulation, since it<br />
will wait until it gets a new action for the inactive channel before continuing in parallel with any<br />
other channels<br />
A deactivated channel must be reactivated before attempting to send new actions. The channel<br />
being activated is specified as a numeric channel, and its clock is set based on the current clock<br />
time, or from channel_2 if specified. There are three methods of activating a channel. The<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 191
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Channel Functions<br />
method only makes a difference when the channel being reactivated is still busy processing<br />
queued up actions. For example, if “channel” controls a door, and you send an open door request<br />
while the door is currently closing:<br />
� Activate with wait: Channel_2 will stall until channel goes idle after processing all currently<br />
queued actions. New actions for both channels will be queued. For the example<br />
given, this will cause motion processing to halt until the door is completely closed, at<br />
which point motion processing and the door open processing will start together.<br />
� Activate without wait: Channel_2 is unaffected. New actions for channel will be added to<br />
the queue of actions. For the example given, motion processing continues uninterrupted,<br />
and the door open action will occur as soon as the door becomes closed.<br />
� Activate with truncation: Channel_2 is unaffected. The current action and any pending<br />
actions in the channel queue will be deleted. New actions for channel will be added to a<br />
new queue of actions. For the example given, motion processing continues uninterrupted,<br />
and the door open action occurs immediately, interrupting the close operation that was in<br />
progress.<br />
The $FMSDCH Function<br />
result=$FMSDCH(channel)<br />
Returns: Numeric (always returns 1)<br />
Deletes a channel identified by its channel number. The delete only occurs after the channel has<br />
completed executing all pending actions. Once a channel is deleted, it must not be referenced in<br />
any subsequent simulation functions. A channel should be deleted when you no longer have any<br />
long-term need for it. See the $FMSACH function (above) for channel activation/deactivation.<br />
The $FMSGAX Function<br />
result=$FMSGAX(channel,component_id)<br />
Returns: Numeric (always returns 1)<br />
Causes the specified linear, rotary or curve axis component to be controlled by the specified<br />
channel. The $FMSID function can be used to obtain the component ID of an axis. Connecting<br />
an axis to a channel means that motion of the axis occurs in the queue of actions for the specified<br />
channel.<br />
The $FMSGCH Function<br />
result=$FMSGCH('axis_name')<br />
result=$FMSGCH(MAIN)<br />
result=$FMSGCH(SIDE)<br />
Returns: Numeric channel ID<br />
Returns the channel ID that is currently in control of the linear, rotary or curve axis defined by<br />
the named axis component. A channel ID of zero is returned if the component name is unknown<br />
or has the wrong type.<br />
192 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Channel Functions<br />
The MAIN keyword argument returns the channel ID associated with the MAIN head on a<br />
merging lathe. The SIDE keyword argument returns the channel ID associated with the SIDE<br />
head on a merging lathe. A channel ID of zero is returned if the model is not a lathe type or when<br />
requesting a SIDE channel if not a merging lathe.<br />
The $FMSNCH Function<br />
result=$FMSNCH([channel])<br />
Returns: Numeric channel ID<br />
This function creates a new channel, returning the channel number of the channel just created.<br />
When a channel is created, it sets its “clock” to the current time. For a merging lathe, this will be<br />
the current time for the main or side head, depending on which is active. You can optionally<br />
specify a different channel, in which case the clock of the new channel is set to the same as that<br />
of the specified channel.<br />
The $FMSRAX Function<br />
result=$FMSRAX(channel,component_id)<br />
Returns: Numeric (always returns 1)<br />
Causes the specified linear, rotary or curve axis component to be released by the specified<br />
channel. The $FMSGID function can be used to obtain the component ID of an axis. Releasing<br />
an axis from a channel makes it available for control by a different channel.<br />
The $FMSWCH Function<br />
result=$FMSWCH(mark1,channel1[,mark2,channel2[,…]])<br />
Returns: Numeric (always returns 1)<br />
This function controls synchronization between channels. In its simplest form, it is used to send a<br />
mark (or signal) to a channel. If that channel is currently stalled waiting for the mark value, then<br />
it would begin processing again. Marks are integer values. Marks sent to a channel are remembered<br />
until the channel is deleted. The same mark value can be sent to different channels.<br />
When multiple sets of parameters are given, the first two parameters (mark1,channel1) specify a<br />
mark value to send (specify zero if a mark is not needed) and the channel that is to begin waiting.<br />
The remaining pairs of values (mark2,channel2…) specify the mark values and channels that the<br />
first channel is waiting for. For example, to have channel 2 wait for mark 7 on channel 3 and<br />
mark 7 on channel 4:<br />
status=$FMSWCH(0,2,7,3,7,4)<br />
If channels 3 and 4 had already received these mark values, then processing on channel 2 would<br />
continue uninterrupted. Otherwise, processing would stall until the following 2 function calls<br />
were made (in any order):<br />
status=$FMSWCH(7,3)<br />
status=$FMSWCH(7,4)<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 193
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions<br />
4.4.5.14 <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions<br />
$FMSCEZ Summary of collision/over-travel events<br />
$FMSGCS Get coordinate system information<br />
$FMSLSR Laser probing<br />
$FMSPDAT Details of probe/collision/over-travel events<br />
$FMSPPOS Axes positions at touch<br />
$FMSPRID Select the object to be used as a probe<br />
$FMSPROB Activate/deactivate probing<br />
$FMSVCL Enable/disable collision testing on objects<br />
The Probe and Collision Test functions can be used to simulate the actions of a touch or laser<br />
probe, and to check for collision and over-travel event information.<br />
The following steps are necessary for touch probing:<br />
1. Call the $FMSPRID function to designate an object that will be used for touch probing.<br />
2. Call the $FMSPROB function to enable probing (i.e., arm the probe).<br />
3. Move the model via GENER or CERUN motion processing, or via $FMSMOVE calls.<br />
4. Check for probe touch via the $VMPRCOD probe status variable.<br />
5. Retrieve basic touch information via the $VMXFER and $VMP* variables.<br />
6. Retrieve details via calls to the $FMSPDAT and $FMSPPOS functions.<br />
7. Optionally call $FMSVCL to disable further collision checking touching objects.<br />
8. Call the $FMSPROB function again to disable probing.<br />
9. Call the $FMSPRID function again to disable the probe object.<br />
The following steps are necessary for laser probing:<br />
1. Call $FMSGCS to obtain the coordinate frame in which the measurement will be taken.<br />
2. Call the $FMSLSR function with a point and vector that specifies the origin and direction<br />
of the light beam, and test the return value for measurement information.<br />
The following steps are necessary to check for collisions and over-travels:<br />
1. Optionally call $FMSVCL to enable/disable collision checking on specific objects.<br />
2. Move the model via GENER or CERUN motion processing, or via $FMSMOVE calls.<br />
3. Retrieve basic collision/over-travel event information via the $VMXFER variable.<br />
4. Call $FMSCEZ to obtain summary information concerning each event.<br />
5. Call $FMSPDAT to obtain details concerning each event.<br />
194 <strong>ICAM</strong> Technologies Corporation – Proprietary
The $FMSCEZ Function<br />
result=$FMSCEZ(n)<br />
Returns: Sequence<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions<br />
This function returns information about the n th collision or over-travel event that occurred on the<br />
last motion. A sequence of length 3 is returned, as follows:<br />
1 Time at start of event<br />
2 Time at end of event<br />
3 Count of interference pairs<br />
The $VMXFER(1) system variable contains the number of collision and/or over-travel events<br />
that occurred on the last motion. This is the upper limit for n.<br />
The count of interference pairs can be used when calling the $FMSPDAT function to get details<br />
of which axes over-traveled or which component pairs collided during the event.<br />
The $FMSGCS Function<br />
result=$FMSGCS(id[,mode[,time[,channel]]])<br />
Returns: Sequence<br />
This function returns the coordinate system information of an object, optionally at a specified<br />
moment in time and in a specified channel. The interpretation of the object id is dependent on the<br />
value of mode, as follows:<br />
mode = 1 (default)<br />
id = 0 returns the tool tip in RTCP frame<br />
id = 1 returns the machine origin frame<br />
mode = 2<br />
id = the component ID as obtained via the $FMSID function<br />
A sequence of length 16 is returned containing a 4x4 homogeneous matrix. This matrix can<br />
subsequently be used with the $FMSLSR function to convert laser range positions between<br />
various coordinate systems.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 195
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions<br />
The $FMSLSR Function<br />
result=$FMSLSR(point,vector[,options])<br />
Returns: Sequence<br />
This function projects a beam from a point in space along a specified vector, and returns a<br />
sequence of length 15 containing information about the first object that the beam intersects, as<br />
follows:<br />
1 Status:
The $FMSPDAT Function<br />
result=$FMSPDAT(n,p)<br />
Returns: Sequence<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions<br />
This function returns information about the p th interference pair of the n th collision/over-travel<br />
event that occurred on the last motion. A sequence of length 7 is returned, as follows:<br />
1 Event type. 1=over-travel, 2=collision, 3=measurement<br />
2 ID number of the first component<br />
3 Name of the first component<br />
4 ID number of the second component (0 if over-travel event)<br />
5 Name of the second component (blank if over-travel event)<br />
6 Time at start of event<br />
7 Time at end of event (same as start time for measurement event)<br />
The $VMXFER(1) system variable contains the number of collision and/or over-travel events<br />
that occurred on the last motion. This is the upper limit for n. The $FMSCEZ function can be<br />
called to get the count of interference pairs for each collision/over-travel event. This is the upper<br />
limit for p.<br />
For example, to list all collisions:<br />
DO/N=1,$VMXFER(1)<br />
CEZ=$FMSCEZ(N)<br />
DO/P=1,CEZ(3)<br />
R=$FMSPDAT(N,P)<br />
IF/R(1).EQ.2<br />
ERROR/8,'Collision detected between !(*) and !(*)',R(3),R(5)<br />
ENDOF/IF<br />
ENDOF/DO<br />
ENDOF/DO<br />
The $FMSPPOS Function<br />
result=$FMSPPOS( )<br />
Returns: Sequence<br />
This function returns the axes positions at the last point of probe contact for all moving axes. A<br />
variable length sequence is returned, as follows:<br />
1 Number of axes moved (0 if none)<br />
2:4 ID number, name and position of the first axis at the touch point<br />
5:7 ID, name and position of the second axis at the touch point<br />
… …<br />
To simplify processing, the $VMP* macro variables can also be used to obtain the XYZ linear<br />
axes positions at the start and end (i.e., trigger point) of the probe motion.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 197
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions<br />
The $FMSPRID Function<br />
result=$FMSPRID([id])<br />
Returns: Numeric<br />
This function sets the touch probe object to the specified component id, which can be any<br />
component in the world (excluding in-process stock) that has a physical representation. This<br />
function returns the previously active probe object id. Specify an object id of -1 to deactivate the<br />
current probe object without specifying another.<br />
The $FMSPRID function can be called without an argument to obtain the current probe component<br />
id.<br />
The $FMSPROB Function<br />
result=$FMSPROB([status])<br />
Returns: Numeric<br />
This function activates or deactivates probing, returning the previous probe activation status. The<br />
following values for status are permitted:<br />
0 Deactivate probing; contact with probe will cause a collision<br />
1 Activate probing; probe is armed<br />
2 Deactivate probing; ignore contact with probe<br />
The $FMSPROB function can be called without an argument to obtain the current probe component<br />
id.<br />
Once the probe is active, any motion that causes contact between the probe object (which must<br />
first be defined first using $FMSPRID) and another collision enabled object, will cause a probe<br />
event to be triggered. The model axes motion will be interrupted at the point of probe contact,<br />
and the probe status information will be returned in the $VMPRCOD system variable.<br />
The following example will close the chuck jaws so that they come into contact with the raw<br />
stock or part. This example assumes there is a chuck jaw identified as “JAW” and that it can be<br />
moved with an axis identified as “JAW-AXIS”. This code should be included in the model<br />
startup macro:<br />
JAW_ID=$FMSID('JAW')<br />
IF/JAW_ID.GT.0<br />
OK=$FMSPRID(JAW_ID) $$ set jaws as probe<br />
OK=$FMSPROB(1) $$ activate probing<br />
OK=$FMSMOVE($FMSID('JAW-AXIS'),0,1000) $$ close jaws<br />
CASE/$VMPRCOD<br />
WHEN/0<br />
ERROR/4,'No part in chuck'<br />
WHEN/1<br />
$$ get touched object and disable collision with jaw<br />
S=$FMSPDAT($VMXFER(6),$VMXFER(7))<br />
OK=$FMSVCL(JAW_ID,OFF,S(4))<br />
198 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions<br />
WHEN/OTHERS<br />
ERROR/8,'Jaws in contact with part at start'<br />
ENDOF/CASE<br />
OK=$FMSPROB(0) $$ deactivate probing<br />
OK=$FMSPRID(-1) $$ deactivate probe<br />
ENDOF/IF<br />
The $FMSVCL Function<br />
Single Component Collision Status<br />
result=$FMSVCL(id [,ON|OFF])<br />
Returns: Numeric<br />
This form of the $FMSVCL function activates, deactivates or reports on the collision testing<br />
property of the specified object id. If neither ON nor OFF is specified, then the collision property<br />
remains unchanged (i.e., the status is reported only). The function returns one of the following:<br />
–2 Not a physical object – collision testing is not applicable<br />
–1 A physical object, but collision testing is not available<br />
0 Collision testing has been deactivated<br />
1 Collision testing is enabled<br />
Only stock, fixture, parts and those model components that listed in the model “Collision Group”<br />
section can be enabled or disabled for collision testing.<br />
Aggregate Component Collision Status<br />
result=$FMSVCL([id,] [ON|OFF,] ALL)<br />
Returns: Sequence<br />
This form of the $FMSVCL function activates, deactivates or reports on the collision testing<br />
property of all collision enabled/disabled objects mounted at or below the specified component<br />
id (all objects in the World if id is not specified or is zero). If neither ON nor OFF is specified,<br />
then the collision property remains unchanged (i.e., the status is reported only). Collision properties<br />
are returned in a variable length sequence containing {component ID, status(0|1)} pairs,<br />
where the collision status value (0=off, 1=on) is reported before making any ON-OFF changes.<br />
The following macro shows how to save the collision testing state of the model and then later<br />
restore the original collision status:<br />
$$ Save collision state<br />
VCL=$FMSVCL(ALL)<br />
…<br />
$$ Restore collision state<br />
DO/I=1,$FLEN(VCL),2<br />
OK=$FMSVCL(VCL(I),$FIF(VLC(I+1).EQ.1,ON,OFF))<br />
ENDOF/DO<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 199
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, <strong>Virtual</strong> <strong>Machine</strong> Probe and Collision Test Functions<br />
Component Pair Collision Status<br />
result=$FMSVCL(id1,ON|OFF,id2)<br />
Returns: Numeric<br />
This form of the $FMSVCL function activates or deactivates collision testing between pairs of<br />
components as specified by their component ids. The function returns one of the following:<br />
–2 One or both objects are not physical bodies – collision testing is not available<br />
–1 Both are physical objects, but collision testing is not available for one or both objects<br />
0 Collision testing has been deactivated<br />
1 Collision testing is enabled<br />
Only stock, fixture, parts and those model components that listed in the model “Collision Group”<br />
section can be enabled or disabled for collision testing.<br />
200 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.5.15 Other Functions<br />
$FDIALOG Activate a dialog<br />
$FDIST Distance between points<br />
$FEOF Test for end-of-file<br />
$FERSEV Severity of error number<br />
$FERSTA Status of error number<br />
$FERTXT Text of error number<br />
$FGETDEF Get DEF file variable definition<br />
$FGETENV Get environment variable definition<br />
$FPAUSE Pause processing with optional message<br />
$FSORT Sort records from file or elements of sequence<br />
The $FDIALOG Function<br />
result=$FDIALOG(s1[,s2])<br />
Returns: String<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Other Functions<br />
This function can activate a dialog that has been defined inside the model, or one that has been<br />
saved to a file on disk. The first s1 parameter is a string specifying the name of the dialog. The<br />
second s2 parameter is optional, and if present specifies the name of the external file that contains<br />
the dialog. The $FDIALOG function returns a text string, which is the label of the button<br />
that was pressed to close the dialog (e.g., “OK”).<br />
Each “control” in the dialog (e.g., check box, combo-box, etc) is associated with a macro variable<br />
when the dialog is created in QUEST. When the dialog is activated at run-time, each dialog<br />
control is initialized to an appropriate state based on the current setting of its associated macro<br />
variable. If a dialog control references a variable that has not yet been defined, a local variable is<br />
created and set to the default value defined within the dialog. When the dialog exits, the macro<br />
variables associated with each control take on whatever value the user may have entered. In<br />
cases where the user value's type is ambiguous, the dialog processor will try to maintain the same<br />
variable type on exit as there was on input. Strongly typing variables with the DECLAR macro<br />
command will ensure the correct return value (the dialog processor will issue a diagnostic and<br />
keep the dialog active if the wrong type of data is entered, for example text in a numeric field).<br />
Combo-box and Drop-list controls can optionally have a second associated variable that defines<br />
the set of valid choices. These variables must be initialized as arrays or sequences, and be set to<br />
appropriate values, before calling the $FDIALOG function.<br />
There are three button types in a dialog: OK, Cancel and Reset. Buttons with OK and Cancel<br />
types cause the dialog processor to return control to the macro. Reset type buttons do not return<br />
control to the macro; they instead reset the dialog controls to their initial values and keep the<br />
dialog active. OK type buttons return control with macro variables updated; Cancel type buttons<br />
return control with macro variables unchanged (but initialized if necessary). The $FDIALOG<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 201
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Other Functions<br />
function returns the text string associated with the OK or Cancel type button that was pressed<br />
(buttons can be labeled with any text and there can be multiple buttons of the same type).<br />
The $FDIST Function<br />
result=$FDIST(x1,y1,z1,x2,y2,z2)<br />
Returns: Numeric<br />
This function returns the distance between two points defined by x1,y1,z1 and x2,y2,z2.<br />
The $FERSEV Function<br />
result=$FERSEV(n)<br />
Returns: Numeric<br />
This function returns the error severity of error number n. A severity of -1 (negative one) is<br />
returned if the error number is not known.<br />
The $FERSTA Function<br />
result=$FERSTA(n[,a])<br />
Returns: Logical<br />
This function returns the current state (enabled or disabled) of error number n. A status of<br />
$TRUE is returned if the error number is enabled for output. A status of $FALSE is returned if<br />
the error number is disabled (i.e., a diagnostic will not be output even if that specific error<br />
condition occurs). The current state can optionally be modified by specifying a second parameter<br />
a with a logical $TRUE or $FALSE value giving the required state.<br />
The $FERTXT Function<br />
result=$FERTXT(n)<br />
Returns: String<br />
This function returns the error text of error number n. A blank string is returned if the error<br />
number is not known.<br />
The $FGETDEF Function<br />
result=$FGETDEF(s)<br />
Returns: String or $NULL<br />
This function returns the value of the case insensitive DEF file variable identified by the string s.<br />
The variable name must be fully qualified with the names of all surrounding “begin” blocks in<br />
the DEF file (see the example below). The return value is a case sensitive string. $NULL is<br />
returned if the DEF file variable has not been defined or if some other error occurs while attempting<br />
to obtain the variable definition.<br />
202 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Other Functions<br />
The following example gets the value of the “interface_kit” DEF file symbol:<br />
%L01=$FGETDEF('campost.interface_kit')<br />
The $FGETENV Function<br />
result=$FGETENV(s)<br />
Returns: String or $NULL<br />
This function returns the value of a (potentially case sensitive) environment variable identified<br />
by the string s. $NULL is returned if the environment variable has not been defined or if some<br />
other error occurs while attempting to obtain the variable definition.<br />
The $FPAUSE Function<br />
result=$FPAUSE([string])<br />
Returns: Logical<br />
This function will pause GENER or CERUN processing and display a message-box with the<br />
specified or default string. The user will be given a choice to either pause or continue processing.<br />
When paused, the full GENER or CERUN interface is made active. Once processing resumes, this<br />
function will return a logical value of $TRUE if the user chose to pause processing, or $FALSE<br />
otherwise.<br />
The message-box will not be displayed when running in background mode. In this case, the<br />
$FPAUSE function immediately returns a value of $FALSE and processing continues uninterrupted.<br />
The $FSORT Function<br />
The $FSORT function can be used to sort the contents of a file or the contents of a sequence<br />
variable.<br />
result=$FSORT(infile,outfile [,delimiters] [,field,type,order [,…]])<br />
Returns: Numeric<br />
When sorting a file, the contents of the input file are first read into memory, sorted, and then<br />
written to the output file. The same file name can be specified for both input and output files.<br />
Sorting occurs on specific fields (or columns) of data in the file. By default, a run of spaces<br />
defines the boundary from one field to the next. Specify an optional delimiters string to define a<br />
different character or set of characters to be used as field separators (e.g., specify $FCHAR(10)<br />
to use a tab character as a delimiter). The default increasing ASCII text order of sorting can be<br />
changed by specifying a “field,type,order” sort key parameter, where field identifies a field<br />
number, type is a string 'N' or 'S' defining a numeric or string field type, and order is one of the<br />
keywords INCR or DECR. Additional sort keys can be specified to further sort records with<br />
matching sort key fields. If all sort keys are the same, then the original record order is maintained<br />
(i.e., a “stable” sort). The $FSORT function will return the number of records in the output file,<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 203
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Functions, Other Functions<br />
or -1 if the sort failed. The $ERRNO system variable will be set to a non-zero value if the sort<br />
failed.<br />
result=$FSORT(sequence [,fields [,field,order [,…]] ])<br />
Returns: Sequence<br />
When sorting a sequence, the input sequence is specified as the first parameter of the $FSORT<br />
function and the sorted result is returned as a sequence. If all elements of the sequence are the<br />
same type (e.g., all numbers or all strings), then $FSORT can be called with just the input<br />
sequence to sort the elements in increasing order. If the sequence represents a table (e.g., alternating<br />
pairs of number and string elements), then the fields parameter must be specified to tell<br />
the sort function the number of fields (or columns) that make up each record (or row) to be<br />
sorted in the sequence. The default increasing order of sorting can be changed by specifying a<br />
“field,order” sort key parameter, where field identifies a field number and order is one of the<br />
keywords INCR or DECR. Additional sort keys can be specified to sort records with identical<br />
sort key fields. If all sort keys are the same, then the original record order is maintained. If the<br />
sort fails, a null sequence (i.e., $NULL) will be returned and the $ERRNO system variable will<br />
be set to a non-zero value.<br />
204 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.6 Simulation Macro Variables<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Variable Summary<br />
Built-in variables, also known as system variables, are predefined by the macro processor. These<br />
variables can be distinguished from user-defined variables by their leading $ sign character.<br />
4.4.6.1 Variable Summary<br />
The following built-in variables are available for use in model macros:<br />
� Variables Defining Constants<br />
$FALSE, $NULL, $PI, $TRUE<br />
� <strong>Virtual</strong> <strong>Machine</strong> Variables<br />
$PART, $VMCHN, $VMP[L]{XYZ}M, $VMP[L]{XYZ}W, $VMPRCOD,<br />
$VMXFER<br />
� <strong>Machine</strong> & Workpiece Coordinate Variables<br />
$[L]{ABC}[TH]M, $[L]{ND}M, $[L]{XYZUVWE}M, $[L]{XYZUVWE}W<br />
� Motion-Related Variables<br />
$AXES, $F, $FMODE, $LCS, $PLMODE, $PNMODE, $RAPID, $TCP<br />
� Cutter Compensation Variables<br />
$DCOMP, $TCD, $TCF, $TCL, $TCLDIR<br />
� Tooling Variables<br />
$T, $TS<br />
� MCD/Tape Variables<br />
$LMCD, $MCD, $SEQNO, $TAPEN<br />
� Error Message Variables<br />
$ERRMSG, $ERRNO, $ERR08, $FTL16, $MSG00, $WRN04<br />
� Miscellaneous Variables<br />
$BACK, $DATE, $PARAM, $PLEV, $PVER, $UPARAM<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 205
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Variables Defining Constants<br />
4.4.6.2 Variables Defining Constants<br />
$FALSE False logical constant value<br />
Type: Logical, Read-only<br />
This variable stores the logical constant representing false. This is identical to the .FALSE.<br />
compiler constant.<br />
$NULL “Not Used”, “Not Available” constant value<br />
Type: Null, Read-only<br />
This variable has a special fixed value, which is used to indicate not used or not available.<br />
$NULL has a value with a null data type: it is not a number, string, minor word or sequence.<br />
$NULL is therefore not equal to any number, string, minor word or sequence.<br />
$P variables and some macro system variables will be set to $NULL to indicate that a value is<br />
not available or has yet to be specified.<br />
$PI PI Trigonometric constant value<br />
Type: Numeric, Read-only<br />
This variable stores the PI trigonometric constant.<br />
$TRUE True logical constant value<br />
Type: Logical, Read-only<br />
This variable stores the logical constant representing true. This is identical to the .TRUE. compiler<br />
constant.<br />
206 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.6.3 <strong>Virtual</strong> <strong>Machine</strong> Variables<br />
$PART Current active part<br />
Type: Numeric, Read/Write<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, <strong>Virtual</strong> <strong>Machine</strong> Variables<br />
This variable indicates from which stock axis subsequent tool axis traces should be attached (the<br />
tool path trace moves as the indicated stock axis moves). The part identification is a numeric<br />
value matching the “part ID” specified with a stock axis.<br />
$VMCHN Current active channel<br />
Type: Numeric, Read/Write<br />
This variable sets the current active channel number. By default, a merging lathe side head is<br />
controlled by channel 2; the main head (and all other machine types) by channel 1. This default<br />
channel assignment can be changed by setting $VMCHN.<br />
$VMP[L]{XYZ}M Current and last X, Y, and Z probe axes position<br />
Type: Numeric, Read-only<br />
These variables contain the machine X, Y and Z axes values at the start and end of a probing<br />
motion (i.e. when $FMSPROB is active and $VMPRCOD>0). $VMPXM, $VMPYM and<br />
$VMPZM refer to the linear machine axes positions when the probe was triggered. $VMPLXM,<br />
$VMPLYM and $VMPLZM refer to the linear machine axes positions at the start of the probe<br />
motion.<br />
$VMP[L]{XYZ}W Current and last LCS X, Y, and Z probe axes position<br />
Type: Numeric, Read-only<br />
These variables contain the local coordinate system (LCS) X, Y and Z axes values at the start<br />
and end of a probing motion (i.e. when $FMSPROB is active and $VMPRCOD>0). If a local<br />
coordinate frame is not active then these variables return the probe start and end machine linear<br />
axes instead (e.g., $VMPZW returns $VMPZM when a local coordinate frame is not active).<br />
$VMPXW, $VMPYW and $VMPZW refer to the linear LCS axes positions when the probe was<br />
triggered. $VMPLXW, $VMPLYW and $VMPLZW refer to the linear LCS axes positions at the<br />
start of the probe motion.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 207
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, <strong>Virtual</strong> <strong>Machine</strong> Variables<br />
$VMPRCOD Probe cycle return code<br />
Type: Numeric, Read/Write<br />
When probing is active (set using the $FMSPROB function) the $VMPRCOD variable will be<br />
updated at the end of each model motion to indicate the status of the probe device (set using the<br />
$FMSPRID function). The following states are defined:<br />
–1 The probe device was already in a triggered state (i.e., already colliding) at the start of<br />
the motion. No probing data has been returned.<br />
0 The probe device was not triggered (i.e., did not collide) during the last motion. No<br />
probing data has been returned.<br />
1 The probe device was triggered (i.e., collided) during the last motion. $VMXFER<br />
contains collision status information.<br />
2 Same as #1 except that the probe device was triggered against 2 or more objects<br />
simultaneously.<br />
$VMXFER Collision/over-travel return code<br />
Type: Numeric, Read/Write<br />
This variable contains collision and over-travel event information resulting from the last model<br />
motion, including collision information resulting from a probe trigger event. $VMXFER is a<br />
sequence of length 7 as follows:<br />
1 The number of separate collision and/or over-travel events that occurred on the last<br />
motion. Zero if there were no collisions or over-travel events.<br />
2 The time at the start of the motion.<br />
3 The time at the end of the motion.<br />
4 The time at which the first collision or over-travel event occurred during the current<br />
motion. If $VMXFER(1)=0, then $VMXFER(4)=$VMXFER(3).<br />
5 The current feed rate in model units per minute or units per revolution. Zero if the motion<br />
was at rapid.<br />
6 The collision event number of a probe trigger, otherwise -1.<br />
7 The collision pair number of a probe trigger, otherwise -1.<br />
When probing is active (set using the $FMSPROB function), and the probe was triggered (i.e.,<br />
$VMPRCOD>0), then information about the object that was touched by the probe can be obtained<br />
by calling:<br />
$FMSPDAT($VMXFER(6),$VMXFER(7))<br />
208 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.6.4 <strong>Machine</strong> & Workpiece Coordinate Variables<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, <strong>Machine</strong> & Workpiece Coordinate Variables<br />
$[L]{ABC}[TH]M Current and last machine A, B and C rotary positions<br />
Type: Numeric, Read-only<br />
These variables hold machine A, B and C rotary axis positions.<br />
$AM, $BM and $CM refer to the current A, B and C rotary head or table axis positions. In the<br />
case where the machine has two rotary axes with the same letter address, use $AHM, $BHM and<br />
$CHM to refer to the rotary head axes and $ATM, $BTM and $CTM to refer to the rotary table<br />
axes. $LAM, $LAHM, $LATM, $LBM, $LBHM, $LBTM, $LCM, $LCHM and $LCTM hold<br />
the rotary axis positions at the start of the last motion.<br />
If the machine does not have one of the named axes, the corresponding value will be zero (0).<br />
$[L]{ND}M Current and last machine attachable rotary head positions<br />
Type: Numeric, Read-only<br />
These variables hold machine primary and secondary attachable rotary head axis positions.<br />
$NM holds the primary attachable rotary head position and $DM holds the secondary attachable<br />
rotary head position. $LNM and $LDM hold the attachable rotary head positions at the start of<br />
the last motion.<br />
If the machine does not have one of the named axes, the corresponding value will be zero (0).<br />
$[L]{XYZUVWE}M Current and last machine X, Y, Z, U, V, W and E positions<br />
Type: Numeric, Read-only<br />
These variables hold the machine X, Y, Z, U, V, W and Extending (E) axis positions.<br />
$XM, $YM, $ZM, $UM, $VM, $WM and $EM represent the current axes positions. $LXM,<br />
$LYM, $LZM, $LUM, $LVM, $LWM and $LEM represent the axis positions at the start of the<br />
last motion.<br />
If the machine does not have one of the named axes, the corresponding value will be zero (0).<br />
$[L]{XYZIJK}W Current and last LCS X, Y, Z, I, J, K coordinates<br />
Type: Numeric, Read/Write<br />
These variables contain the local coordinate system (LCS) X, Y and Z coordinates of the tool tip<br />
and the I, J and K cosine vectors of the tool axis when a local coordinate frame is active. If a<br />
local coordinate frame is not active then these variables return machine coordinates instead (e.g.,<br />
$ZW returns $ZM when a local coordinate frame is not active). $XW, $YW, $ZW, $IW, $JW<br />
and $KW refer to the current position. $LXW, $LYW, $LZW, $LIW, $LJW and $LKW represent<br />
the position at the start of the last motion.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 209
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Motion-Related Variables<br />
4.4.6.5 Motion-Related Variables<br />
$AXES String showing active axes<br />
Type: String, Read-only<br />
This variable displays the currently active axes in the form of a character string containing 6<br />
characters. At any one time, CERUN or GENER will allow a maximum of 3 linear X, Y and Z<br />
axes, 2 rotary axes, and the extending linear axis to be controlled. Therefore, the maximum<br />
number of active axes is 6.<br />
The characters displayed in the $AXES string are one letter abbreviations representing the axis<br />
names. The abbreviations are as follows:<br />
Character Axis name<br />
X X-axis (primary X-axis)<br />
Y Y-axis (primary Y-axis)<br />
Z Z-axis (primary Z-axis)<br />
U U-axis (secondary X-axis)<br />
V V-axis (secondary Y-axis)<br />
W W-axis (secondary Z-axis)<br />
a A'-axis table<br />
b B'-axis table<br />
c C'-axis table (or C-axis on lathe)<br />
A A-axis head<br />
B B-axis head<br />
C C-axis head<br />
E Extending axis<br />
N Primary nutating axis<br />
n Secondary nutating axis<br />
The first three characters of $AXES display active linear axes (note that these may be primary or<br />
secondary linear axes). The fourth and fifth characters display active rotary axes (including the<br />
nutating axis). The sixth location is reserved for the extending axis. For any $AXES location for<br />
which there is no corresponding active axis, a * will be shown. For example, the value of $AXES<br />
for a 3-axis mill will be “XYZ***” because the machine has neither rotary nor extending axes.<br />
On machines where axes will be activated and deactivated, the $AXES string can be used in the<br />
motion event macro to determine the content of the $P2 machine coordinate sequence variable.<br />
This is because the $P2 variable contains machine coordinates for active axes only.<br />
210 <strong>ICAM</strong> Technologies Corporation – Proprietary
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Motion-Related Variables<br />
For example, to determine if a B'-axis table is active or not, the following could be coded in a<br />
macro:<br />
%L01=$FINDEX($AXES,'b') $$ Get index of B table axis<br />
IF/%L01.GT.0 $$ is it active?<br />
%L02=$P2(%L01) $$ yes, extract value from $P2 sequence<br />
ENDOF/IF<br />
If the $FINDEX function returns 0, the axis for which the index was requested is not active, and<br />
therefore it‟s value will not be found in the $P2 sequence. For the case above, the $BTM macro<br />
system variable could be used to determine the current position of the B'-axis.<br />
$F Current feed rate in the current mode<br />
Type: Numeric, Read/Write<br />
This variable contains the current feed rate in the current mode (i.e., $FMODE) of operation.<br />
$FMODE Feed rate mode. (-1:? 0:uPM 1:uPR 2:inverse time)<br />
Type: Numeric, Read/Write<br />
This variable contains the current feed rate mode. If the value is -1 then the mode is currently<br />
unknown.<br />
$LCS Local coordinate system status ($TRUE or $FALSE)<br />
Type: Logical, Read/Write<br />
This variable will be set $TRUE when LCS (Local Coordinate System) transformation is activated<br />
in the program and $FALSE when LCS is deactivated in the program. The $LCS variable can<br />
be set from within a macro to change the mode.<br />
$PLMODE Plane mode. (
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Motion-Related Variables<br />
$TCP RTCP status ($TRUE or $FALSE)<br />
Type: Logical, Read/Write<br />
This variable will be set $TRUE when RTCP (Rotating Tool Center-point Programming) is<br />
activated and $FALSE when RTCP is deactivated. The $TCP variable can be set from within a<br />
macro to change the mode.<br />
212 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.6.6 Cutter Compensation Variables<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Cutter Compensation Variables<br />
$DCOMP Current diameter compensation (-1:LEFT, 1:RIGHT, 0:OFF)<br />
Type: Numeric, Read/Write<br />
This variable contains the current tool diameter compensation in effect.<br />
$TCD Current tool diameter compensation value (
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Tooling Variables<br />
4.4.6.7 Tooling Variables<br />
$T Current tool loaded (
4.4.6.8 MCD/Tape Variables<br />
$LMCD Last MCD block processed<br />
Type: String, Read-only<br />
This variable holds the last block of MCD processed.<br />
$MCD Current MCD block processed<br />
Type: String, Read-only<br />
This variable holds the current block of MCD being processed.<br />
$SEQNO Current sequence number<br />
Type: Numeric, Read/Write<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, MCD/Tape Variables<br />
This variable contains the sequence number (e.g., N register value) of the current block.<br />
$TAPEN Number of fatal error diagnostics<br />
Type: String, Read-only<br />
This variable contains the primary tape file name as specified on the GENER or CERUN command<br />
line.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 215
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Error Message Variables<br />
4.4.6.9 Error Message Variables<br />
$ERRMSG Error message on indicator<br />
Type: Logical, Read/Write<br />
This variable indicates if error messages are to be output or not. Error messages may be disabled<br />
by setting $ERRMSG to $FALSE. Set $ERRMSG to $TRUE to once again enable error message<br />
output. Error message output is enabled by default at the start of processing.<br />
$ERRNO Last I/O status<br />
Type: Numeric, Read-only<br />
I/O status code returned by the system following the last SYSTEM, OPEN, READ, WRITE or<br />
CLOSE command. I/O status codes are system specific, but most systems use a status of zero for<br />
success, negative for warning (like end-of-file) and positive for errors.<br />
$ERR08 Number of error diagnostics<br />
Type: Numeric, Read/Write<br />
Current number of diagnostics at severity levels 8 through 15.<br />
$FTL16 Number of fatal error diagnostics<br />
Type: Numeric, Read/Write<br />
Current number of diagnostics at severity level 16 or higher.<br />
$MSG00 Number of informational diagnostics<br />
Type: Numeric, Read/Write<br />
Current number of diagnostics at severity levels 0 through 3.<br />
$WRN04 Number of warning diagnostics<br />
Type: Numeric, Read/Write<br />
Current number of diagnostics at severity levels 4 through 7.<br />
216 <strong>ICAM</strong> Technologies Corporation – Proprietary
4.4.6.10 Miscellaneous Variables<br />
$BACK Background processing flag<br />
Type: Logical, Read-only<br />
<strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Miscellaneous Variables<br />
This variable will be set $TRUE if the -back UNIX /back Windows command line qualifier was<br />
specified when the CERUN or GENER application was started. The purpose of this variable is to<br />
advise macros that the process is running in a state where user interaction is not possible (e.g., as<br />
a UNIX background process). It is the responsibility of the model writer to test this variable<br />
before calling the $FDIALOG function or performing I/O to the STDIN and STDOUT devices.<br />
$DATE Current date and time<br />
Type: String, Read-only<br />
This variable contains the current date and time. The character string returned by $DATE is<br />
formatted as “dd-mmm-yyyy hh:mm:ss.ss”.<br />
$PARAM Current date and time<br />
Type: String, Read-only<br />
This variable contains the command line that initiated CERUN or GENER. It will list all of the run<br />
time options selected by the user at the start of processing. See $UPARAM (below) for information<br />
concerning user defined parameters.<br />
$PLEV Product level<br />
Type: Numeric, Read-only<br />
This variable contains the release level number of <strong>Virtual</strong> <strong>Machine</strong>, as a whole number in the<br />
form “yyww”: where “yy” are the last two digits of the year, and “ww” is the week number of<br />
the year in the range 01-52.<br />
$PVER Product version<br />
Type: Numeric, Read-only<br />
This variable contains the release version number of <strong>Virtual</strong> <strong>Machine</strong> (e.g., 19 for <strong>V19</strong>).<br />
$UPARAM CERUN or GENER user defined command line parameters<br />
Type: String, Read/Write<br />
The $UPARAM macro system variable is similar to the $PARAM macro system variable.<br />
$UPARAM is a string containing the user defined parameters from the CERUN or GENER command<br />
line following the -u UNIX or /u Windows options. The $PARAM string on the other hand lists<br />
all command line parameters, including the user defined ones. See the $FARGC and $FARGV<br />
functions for information on how to extract general and user defined parameters.<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 217
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® <strong>Virtual</strong> <strong>Machine</strong> Reference, Model Customization<br />
Simulation Macro Variables, Miscellaneous Variables<br />
218 <strong>ICAM</strong> Technologies Corporation – Proprietary
$<br />
$ macro continuation, 124<br />
$$ macro comment, 124<br />
$AHM macro variable, 209<br />
$AM macro variable, 209<br />
$ATM macro variable, 209<br />
$AXES macro variable, 210<br />
$BACK macro variable, 217<br />
$BHM macro variable, 209<br />
$BM macro variable, 209<br />
$BTM macro variable, 209<br />
$CHM macro variable, 209<br />
$CM macro variable, 209<br />
$CTM macro variable, 209<br />
$DATE macro variable, 217<br />
$DCOMP macro variable, 213<br />
$DM macro variable, 209<br />
$EM macro variable, 209<br />
$ERR08 macro variable, 216<br />
$ERRMSG macro variable, 216<br />
$ERRNO macro variable, 216<br />
$ERRNO system variable, 138<br />
$F macro variable, 211<br />
$FALSE macro variable, 206<br />
$FMODE macro variable, 211<br />
$FTL16 macro variable, 216<br />
$IW macro variable, 209<br />
$JW macro variable, 209<br />
$KW macro variable, 209<br />
$LAHM macro variable, 209<br />
$LAM macro variable, 209<br />
$LATM macro variable, 209<br />
$LBHM macro variable, 209<br />
$LBM macro variable, 209<br />
$LBTM macro variable, 209<br />
$LCHM macro variable, 209<br />
$LCM macro variable, 209<br />
$LCS macro variable, 211<br />
Index<br />
$LCTM macro variable, 209<br />
$LDM macro variable, 209<br />
$LEM macro variable, 209<br />
$LIW macro variable, 209<br />
$LJW macro variable, 209<br />
$LKW macro variable, 209<br />
$LMCD macro variable, 215<br />
$LNM macro variable, 209<br />
$LUM macro variable, 209<br />
$LVM macro variable, 209<br />
$LWM macro variable, 209<br />
$LXM macro variable, 209<br />
$LXW macro variable, 209<br />
$LYM macro variable, 209<br />
$LYW macro variable, 209<br />
$LZM macro variable, 209<br />
$LZW macro variable, 209<br />
$MCD macro variable, 215<br />
$MSG00 macro variable, 216<br />
$NM macro variable, 209<br />
$NULL macro variable, 125, 206<br />
$P variables, 126<br />
$PARAM macro variable, 217<br />
$PART macro variable, 207<br />
$PI macro variable, 206<br />
$PLEV macro variable, 217<br />
$PLMODE macro variable, 211<br />
$PNMODE macro variable, 211<br />
$PVER macro variable, 217<br />
$RAPID macro variable, 211<br />
$SEQNO macro variable, 215<br />
$T macro variable, 214<br />
$TAPEN macro variable, 215<br />
$TCD macro variable, 213<br />
$TCF macro variable, 213<br />
$TCL macro variable, 213<br />
$TCLDIR macro variable, 213<br />
$TCP macro variable, 212<br />
Index<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 219
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Index<br />
$TRUE macro variable, 206<br />
$TS macro variable, 214<br />
$UM macro variable, 209<br />
$UPARAM macro variable, 217<br />
$VM macro variable, 209<br />
$VMCHN macro variable, 207<br />
$VMPLXM macro variable, 207<br />
$VMPLXW macro variable, 207<br />
$VMPLYM macro variable, 207<br />
$VMPLYW macro variable, 207<br />
$VMPLZM macro variable, 207<br />
$VMPLZW macro variable, 207<br />
$VMPRCOD macro variable, 208<br />
$VMPXM macro variable, 207<br />
$VMPXW macro variable, 207<br />
$VMPYM macro variable, 207<br />
$VMPYW macro variable, 207<br />
$VMPZM macro variable, 207<br />
$VMPZW macro variable, 207<br />
$VMXFER macro variable, 208<br />
$WM macro variable, 209<br />
$WRN04 macro variable, 216<br />
$XM macro variable, 209<br />
$XW macro variable, 209<br />
$YM macro variable, 209<br />
$YW macro variable, 209<br />
$ZM macro variable, 209<br />
$ZW macro variable, 209<br />
.<br />
.AND. operator, 130<br />
.EQ. operator, 130<br />
.GE. operator, 130<br />
.GT. operator, 130<br />
.LE. operator, 130<br />
.LT. operator, 130<br />
.NE. operator, 130<br />
.NOT. operator, 130<br />
.OR. operator, 130<br />
220 <strong>ICAM</strong> Technologies Corporation – Proprietary<br />
A<br />
ADAPTV post-processor command, 9, 10,<br />
11, 181<br />
Addition operator, 129<br />
Animation speed, 30, 31, 72, 118<br />
ASCII output formatting, 142<br />
Attach camera, 15, 103<br />
Axes, 42<br />
Axes markers, 70, 108<br />
Axes tab, 36, 48, 75, 76, 77, 109<br />
Axis<br />
mapping, 42, 45<br />
slave, 43, 96<br />
B<br />
Back view, 71, 104<br />
Backface drawing option, 119<br />
Background color, 119<br />
Bitmap entity, 46, 68, 95<br />
Bottom view, 71, 104<br />
Build tab, 36<br />
C<br />
Camera<br />
aperture angle, 65, 105<br />
attachment, 103<br />
center object in view, 103<br />
load predefined view, 16, 65, 105<br />
mode, 13, 14, 15, 66, 78, 112, 120<br />
pan speed, 14, 16, 65, 104<br />
panning, 65, 66<br />
reset predefined views, 105<br />
roll, 13, 15, 65, 66<br />
save predefined view, 16, 65, 105<br />
CAMERA post-processor command, 11,<br />
120<br />
CASE macro command, 133<br />
Center object in view, 14, 33, 65, 103<br />
Channel functions, 191–93<br />
Character functions, 169–74<br />
CLDATA file, 2, 7, 30, 123, 125, 135<br />
CLOSE macro command, 136
Collision<br />
avoidance, 1, 10, 181<br />
detection, 1, 3, 6, 8, 9, 18, 19, 32, 35, 38,<br />
46, 49, 50, 51, 70, 79, 80, 90, 91, 194,<br />
199, 200<br />
exclusion groups, 50, 51, 52<br />
highlight, 50<br />
intersection line, 50, 109, 120<br />
viewing, 33<br />
Collision Test Functions, 194–200<br />
Colorized MRS diff:, 34, 107<br />
Command line functions, 175<br />
Comments section, 40<br />
Concatenation operator, 129<br />
Conditional functions, 166–68<br />
Cone entity, 68, 92<br />
Continuous animation, 31, 72, 118<br />
Controller windows, 23, 29, 30, 33, 74<br />
Conversion functions, 164–65<br />
Cube entity, 47, 68, 92<br />
Curve axis, 68, 98<br />
CUTTER command, 2, 26, 81, 82, 85<br />
Cylinder entity, 68, 92<br />
D<br />
Database, 2, 6, 7, 8, 36, 37, 39, 40, 41, 55,<br />
95, 137<br />
DECLAR macro command, 127, 131<br />
Dialog editor, 148<br />
Diameter compensation<br />
getting from macro, 182<br />
setting from macro, 188<br />
Diffs tab, 36<br />
Display speed, 31, 118<br />
Division operator, 129<br />
DO macro command, 134<br />
E<br />
ELSE macro command, 132<br />
ELSEIF macro command, 132<br />
ENDMAC macro command, 135<br />
ENDOF macro command, 133, 134<br />
Equality operator, 130<br />
ERROR macro command, 138<br />
EXIT macro command, 134<br />
Exponentiation operator, 129<br />
Export button, 18<br />
External functions, 131<br />
Extruded entity, 68, 94<br />
Index<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 221<br />
F<br />
Feed event macro, 147<br />
File and directory functions, 176–79<br />
Finder tab, 36<br />
Fit object in view, 14, 33, 65, 71, 103<br />
Fixture, 2, 3, 5, 18, 19, 20, 23, 37, 65, 75,<br />
76, 79, 80, 100, 116, 186, 189<br />
compensation, 2, 3, 5, 23, 67, 74, 75, 76,<br />
180, 182, 183, 188, 189, 213<br />
create, 20<br />
machinable, 19, 22, 24, 26, 81<br />
setup, 18, 34, 79, 100, 107, 117<br />
show/hide, 107<br />
Fixture compensation<br />
getting from macro, 182<br />
setting from macro, 188<br />
Front view, 71, 104<br />
Function<br />
$FABS, 155<br />
$FACCESS, 176<br />
$FACOS, 153<br />
$FARGC, 175<br />
$FARGV, 175<br />
$FASIN, 153<br />
$FATAN, 153<br />
$FATAN2, 153<br />
$FATOF, 164<br />
$FBASNAM, 177<br />
$FCHAR, 169<br />
$FCHOOSE, 166<br />
$FCOS, 154<br />
$FCTIME, 177<br />
$FCVINT, 164<br />
$FCVREAL, 164<br />
$FDIALOG, 148, 201<br />
$FDIRNAM, 177<br />
$FDIST, 202
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Index<br />
$FEDIT, 169<br />
$FEOF, 178<br />
$FERSEV, 202<br />
$FERSTA, 202<br />
$FERTXT, 202<br />
$FEXP, 154<br />
$FFIND, 171<br />
$FFRAC, 155<br />
$FGETCWD, 178<br />
$FGETENV, 203<br />
$FGLNXPL, 157<br />
$FGLSXSP, 157<br />
$FGPLPT3, 158<br />
$FICHAR, 172<br />
$FIF, 166<br />
$FINDEX, 172<br />
$FINT, 155<br />
$FISNUM, 167<br />
$FISSEQ, 167<br />
$FISWRD, 167<br />
$FLEN, 172<br />
$FLN, 154<br />
$FLOG, 154<br />
$FMAC, 155<br />
$FMAJOR, 164, 165<br />
$FMATCH, 172<br />
$FMIN, 155<br />
$FMINOR, 165<br />
$FMOD, 156<br />
$FMSACH, 191<br />
$FMSADPT, 181<br />
$FMSATA, 181<br />
$FMSBTC, 181<br />
$FMSCEZ, 195<br />
$FMSCMRA, 182<br />
$FMSDCH, 192<br />
$FMSETC, 182<br />
$FMSGAX, 192<br />
$FMSGCH, 192<br />
$FMSGCS, 195<br />
$FMSGDCV, 182<br />
$FMSGFCV, 182<br />
$FMSGLCV, 183<br />
$FMSGOUG, 184<br />
$FMSID, 184<br />
$FMSIDN, 186<br />
$FMSIDT, 186<br />
$FMSLCS, 187<br />
$FMSLSR, 196<br />
$FMSMAX, 187<br />
$FMSMOVE, 187<br />
$FMSMSP, 188<br />
$FMSNCH, 193<br />
$FMSPCK, 188<br />
$FMSPDAT, 197<br />
$FMSPPOS, 197<br />
$FMSPRID, 198<br />
$FMSPROB, 198<br />
$FMSRAX, 193<br />
$FMSSDCV, 188<br />
$FMSSFCV, 188<br />
$FMSSLAV, 189<br />
$FMSSLCV, 189<br />
$FMSTRN, 190<br />
$FMSVCL, 200<br />
$FMSWCH, 193<br />
$FMX, 162<br />
$FMXINV, 163<br />
$FMXTRFP, 163<br />
$FMXTRFV, 163<br />
$FMXTRSP, 163<br />
$FNINT, 156<br />
$FPAUSE, 203<br />
$FPNAME, 175<br />
$FPVALUE, 175<br />
$FSEQ, 173<br />
$FSIGN, 156<br />
$FSIN, 154<br />
$FSORT, 203<br />
$FSQRT, 154<br />
$FSTAT, 178<br />
$FSUBSQ, 173<br />
$FSUBST, 173<br />
$FSWITCH, 167<br />
$FSWRIT, 139, 173<br />
$FTAN, 154<br />
$FTOLOWR, 174<br />
$FTOUPER, 174<br />
$FVADD, 159<br />
$FVANG, 159<br />
$FVCROSS, 160<br />
$FVDOT, 160<br />
$FVLEN, 160<br />
$FVMULT, 160<br />
222 <strong>ICAM</strong> Technologies Corporation – Proprietary
G<br />
$FVNORM, 160<br />
$FVROTN, 161<br />
$FVSUB, 161<br />
Geometric functions, 157–58<br />
GETDEF, 202<br />
Global variables, 126<br />
pre-defined, 126<br />
Gouge tolerance, 3, 18, 19, 26, 79, 82, 120<br />
Greater than operator, 130<br />
Greater than or equal operator, 130<br />
Grid display, 17, 40, 41, 70, 81, 108<br />
Grouping operator, 129<br />
Groups<br />
collision, 50<br />
exclusion, 51, 52<br />
selection, 53, 67, 111<br />
H<br />
Head, 24, 28, 50, 81, 90, 101<br />
component ID, 185<br />
setup, 24, 28, 81, 90, 99, 107<br />
Head axis, 69, 90, 101<br />
Help tab, 36<br />
Holder, 87<br />
generic holder, 27, 89<br />
profile holders, 88<br />
setup, 24, 81, 99, 107<br />
HUD display, 30, 31, 65, 69, 109<br />
I<br />
icam_dbf environment variable, 7<br />
IF macro command, 132<br />
Import button, 18, 82, 87, 89, 94<br />
Information window, 36<br />
J<br />
JUMPTO macro command, 134<br />
K<br />
KEYWORD data type, 125<br />
Index<br />
Kinematics, 1, 12, 35, 37, 38, 42, 44, 46, 70,<br />
90, 97, 98, 100, 101, 106, 108, 109<br />
Kinematics markers, 70, 108<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 223<br />
L<br />
Launch panel, 6, 7, 12, 34, 55<br />
Left view, 71, 104<br />
Length compensation<br />
getting from macro, 183<br />
setting from macro, 189<br />
Less than operator, 130<br />
Less than or equal operator, 130<br />
Lighting setup, 17, 22, 33, 41, 80, 108, 109,<br />
114, 115, 194, 196<br />
Linear axis, 44, 68, 97<br />
Load predefined view, 16, 65, 105<br />
Load tool event macro, 147<br />
Local coordinates, 67, 75, 109, 111, 205,<br />
207, 209, 211<br />
Local variables<br />
pre-defined, 126<br />
Logical<br />
input formatting, 143<br />
output formatting, 141<br />
Logical and operator, 130<br />
LOGICAL data type, 124<br />
Logical not operator, 130<br />
Logical or operator, 130<br />
Look-ahead, 1, 9, 10, 30, 181<br />
M<br />
Macro<br />
comment, 124<br />
continuation, 124<br />
Macro functions, 131<br />
Macro language, 54, 122, 123, 124, 125,<br />
126, 129, 130, 131, 136<br />
Main window, 36<br />
Manufacturing extractors, 3, 23, 24, 29, 81,<br />
82<br />
Material removal simulation. See MRS<br />
Mathematical functions, 153–54<br />
Matrix functions \r, 162
<strong>ICAM</strong> <strong>Virtual</strong> <strong>Machine</strong> ® Version 19.0 Index<br />
MCD, 1, 2, 7, 9, 54, 123, 205, 215<br />
Measurement, 13, 30, 65, 66, 69, 73, 78, 79,<br />
110, 117, 194, 196, 197<br />
Mesh entity, 68, 94<br />
Minor word<br />
output formatting, 141<br />
Miscellaneous setup, 119<br />
Model<br />
automatic selection, 7<br />
naming, 8, 39, 55<br />
selection, 6<br />
show/hide, 107<br />
testing, 55<br />
units, 39, 43, 147, 187, 208<br />
Motion event macro, 146<br />
Motion step animation, 31, 72, 118, 182<br />
MRS, 6, 8, 18, 19, 22, 24, 30, 33, 34, 71, 72,<br />
79, 81, 82, 83, 84, 85, 107, 117, 120<br />
colorized diff:, 34, 107<br />
overcut, 107<br />
undercut, 34, 107, 117<br />
Multiplication operator, 129<br />
N<br />
Navigator window, 36, 37, 40<br />
Non equality operator, 130<br />
Numeric<br />
input formatting, 142<br />
output formatting, 139<br />
Numeric functions, 155–56<br />
O<br />
OPEN macro command, 136<br />
Orthogonal view, 71, 104<br />
Other functions, 201–4<br />
OUTPUT macro command, 136<br />
Overcut MRS, 107<br />
Over-travel, 33<br />
P<br />
Part, 2, 18, 19, 71, 72<br />
component ID, 185<br />
setup, 18, 34, 79, 100, 107, 117<br />
show/hide, 107<br />
Path planning, 1, 10, 181<br />
Perspective view, 13, 71, 104, 105<br />
Picture entity, 95<br />
Pivot center for camera, 14, 41, 65, 78, 103<br />
Post-processor commands, 5, 123, 162<br />
Probe Functions, 194–200<br />
224 <strong>ICAM</strong> Technologies Corporation – Proprietary<br />
R<br />
Rapid event macro, 147<br />
READ macro command<br />
from file, 137<br />
from string, 137<br />
REAL data type, 124<br />
RECORD data type, 125<br />
Reference axis creation, 69, 102<br />
REPEAT macro command, 133<br />
RESERV macro command, 128<br />
Reset predefined views, 16, 105<br />
Revolved entity, 27, 68, 93<br />
Right view, 71, 104<br />
Rotary axis, 44, 68, 97<br />
S<br />
Safety region, 50, 70, 91, 109<br />
Save predefined view, 16, 65, 105<br />
Selection mode, 13, 66, 78, 120<br />
Sequence data type, 126<br />
Sequence functions, 169<br />
Sequence operator, 129<br />
Shareable library, 131<br />
Shutdown macro, 145<br />
Simulation<br />
enable, 9<br />
Slaved axis, 43, 96<br />
Solid view format, 12, 17, 24, 36, 69, 75, 81,<br />
87, 90, 106, 114, 119<br />
Sphere entity, 68, 93<br />
Spindle, 19, 25, 26, 27, 32, 36, 38, 42, 45,<br />
75, 81, 82, 86, 87, 88, 89, 91, 98, 99, 100,<br />
101, 107, 116, 118, 180, 181, 183, 188<br />
Startup macro, 145
STL, 1, 2, 3, 18, 25, 27, 38, 46, 68, 80, 83,<br />
84, 87, 89, 94<br />
Stock, 1, 2, 3, 5, 18, 30, 34, 79<br />
in-process, 3, 6, 8, 10, 12, 18, 19, 24, 30,<br />
33, 34, 49, 71, 73, 78, 82, 83, 85, 107,<br />
110, 117, 120, 198<br />
show/hide, 107<br />
setup, 18, 34, 79, 100, 107, 117<br />
show/hide, 107<br />
Stock axis, 69, 100<br />
String<br />
input formatting, 143<br />
output formatting, 140<br />
STRING data type, 125<br />
Sub-sequence operator, 129<br />
Sub-string operator, 129<br />
Subtraction operator, 129<br />
Swept volume, 38, 75, 91<br />
Synchronize, 30, 33, 107<br />
SYSTEM macro command, 138<br />
System variables, 126<br />
T<br />
Tape event macro, 146<br />
TDM System, 2<br />
TERMAC macro command, 135<br />
Testing, 55<br />
Time interval animation, 31, 72, 118<br />
Timeline, 19, 30, 33, 77, 103, 107, 120<br />
Tool<br />
compensation, 1, 2, 5, 11, 23, 29, 74, 76,<br />
77, 116, 182, 188, 213<br />
diameter, 29, 37, 77, 180, 182, 188, 213<br />
length, 11, 29, 180, 183, 184, 189, 190,<br />
213<br />
component ID, 185<br />
lathe tools, 83<br />
milling tools, 85<br />
setup, 24, 81, 99, 107, 118<br />
show/hide, 107<br />
tolerance, 24, 82, 83, 85, 120<br />
trace<br />
Index<br />
show/hide, 30, 32, 65, 69, 70, 106, 107<br />
tracing, 32, 106<br />
Tool axis, 69, 99<br />
Tools<br />
milling, 2, 85, 86<br />
Preferences<br />
Macro Editor, 124<br />
turning, 2, 98<br />
Top view, 71, 104<br />
Tracing of tool path, 32, 106<br />
<strong>ICAM</strong> Technologies Corporation – Proprietary 225<br />
U<br />
Undercut MRS, 34, 107, 117<br />
Units, 39, 83, 85, 88, 89, 91, 96<br />
UNTIL macro command, 134<br />
User variables, 126<br />
V<br />
Vector functions, 159–61<br />
Verification setup, 2, 3, 6, 7, 8, 18<br />
View<br />
camera, 9, 11, 13, 14, 15, 16, 33, 41, 65,<br />
66, 69, 71, 78, 103, 104, 105, 112, 120<br />
default, 16<br />
pan, 13, 14, 66<br />
predefined, 15<br />
rotation, 13<br />
<strong>Virtual</strong> <strong>Machine</strong> functions, 180–90<br />
W<br />
WHEN macro command, 133<br />
WHILE macro command, 133<br />
Wildcard<br />
input formatting, 144<br />
output formatting, 141<br />
Wireframe view format, 12, 69, 106, 119<br />
Work piece. See Fixture<br />
World coordinates, 67, 91, 96, 111<br />
WRITE macro command, 137