code wizard

52
Code Wizard

Upload: odil-elizandro-baldiati

Post on 13-Oct-2015

1.104 views

Category:

Documents


136 download

TRANSCRIPT

  • Code Wizard

  • Code Wizard

    Page 2 of 52 Rev 5.0 Planit Software Ltd

    Copyright Copyright 2010 Planit Software Ltd. All rights reserved. Any copyright or other intellectual property right of whatever nature which subsists or may subsist in the presentation and/or content of the programs (including without limitation its look, feel, visual or other non-literal elements) remains the property of Planit Software Ltd or its licensor(s) absolutely. No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system or translated into any language, in any form or by any means, electronic, mechanical, optical, chemical, manual or otherwise, without the express written permission of Planit Software Ltd. Unauthorised reproduction or distribution of these programs or any part thereof is unlawful and may result in civil or criminal penalties. Edgecam and the Edgecam Logo are trademarks of Planit Software Ltd. Windows is a trademark of Microsoft Corporation. All product names mentioned in this publication, and not listed above, are acknowledged as the trademarks of the respective manufacturers and producers of such products. Planit Software Ltd makes no representations or warranties with respect to the contents hereof and specifically disclaim any implied warranties of satisfactory quality or fitness for any particular purpose. Further, Planit Software Ltd reserves the right to revise this publication and to make changes in the contents hereof without obligation to notify any person of such changes or revisions. The information contained within this document is subject to change without notice and does not represent a commitment on the part of the vendor. The software described in this document is furnished under a licence agreement and may be used or copied only in accordance with the terms of the agreement.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 3 of 52

    Contents Conventions Used in This Guide .............................................................................................4Recommended Operating Systems and Hardware for Edgecam ...........................................5

    Supported Operating Systems ........................................................................................................ 5Minimum Specifications .................................................................................................................. 6

    License Restrictions ......................................................................................................................................7Example Part Files ........................................................................................................................................7

    What is Code Wizard? ............................................................................................................9The CAD/CAM Life Cycle .......................................................................................................9Postprocessor Construction .................................................................................................. 10

    Writing Postprocessors without Code Wizard ............................................................................................ 10Writing Postprocessors with Code Wizard ................................................................................................. 10

    Code Wizard Process ........................................................................................................... 12Creating a New Document .................................................................................................... 13

    Exercise 1 Starting a New Document ........................................................................................ 13Exercise 2 Defining Machine Tool Parameters .......................................................................... 16Exercise 3 Format Table Define Word Addresses .................................................................. 19

    Format Table .............................................................................................................................................. 19Exercise 4 - NC Styles G-Codes and Modality ............................................................................. 22

    NC Debug ................................................................................................................................................... 29Exercise 5 Code Constructors ................................................................................................... 30Exercise 6 M-Functions ............................................................................................................. 33Exercise 7 Testing & Editing the Code Wizard ........................................................................... 34

    What is Edgecam Machine Simulator? ................................................................................. 36Exercise 7 Configuring Machine Tool Graphics ......................................................................... 38Exercise 8 Appling the 3-Axis Postprocessor............................................................................. 42Exercise 9 Including Custom Graphics ...................................................................................... 44

    Frequently Asked Questions ................................................................................................. 48Index ..................................................................................................................................... 51

    Revision Control ......................................................................................................................................... 52

  • Code Wizard

    Page 4 of 52 Rev 5.0 Planit Software Ltd

    Conventions Used in This Guide To enable you to use the information in this guide effectively, you need to understand the used in the guide to represent different types of information. Buttons on the screen are represented as the button text in square brackets.

    For example: Click on [OK]. Keys on the keyboard are represented as bold lettering in between characters.

    For example: Press Menu options are represented as a path with the main menu in Bold UPPER case with sub

    menus Capitalised and separated with a vertical bar For example: Select FILE | Open

    Field names are represented as bold text. And the value to be entered will be represented by Narrow Bold Text. For example: Enter the value 50 in the Offset field. Or When prompted for the X, Y or Z values type X100,Y50,Z0

    Denotes a Left Mouse Button Click Denotes a Right Mouse Button Click

    This is a note. It contains useful or additional information.

    This is a reference. It directs you to another part of the user guide.

    This is a thought box. It is generally used in exercises and contains a question for you to consider.

    This is a warning, it contains information that you must not ignore. This is a tip. It is generally used in exercises and offers further advice.

    1. This is the first line of a number list item 2. This is the second item of the numbered instructions, which you must 3. Follow in sequence. This is a list of items, in which The order is not important.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 5 of 52

    Recommended Operating Systems and Hardware for Edgecam Supported Operating Systems Microsoft Windows XP Professional (SP3 required) Microsoft Windows Vista Business* Microsoft Windows Vista Enterprise* Microsoft Windows Vista Ultimate* *Installations on Windows Vista require SP1; but we recommend you install the latest service pack. Microsoft Windows 7 Professional Microsoft Windows 7 Enterprise Microsoft Windows 7 Ultimate We recommend that you update to the latest security key drivers (if a security key is fitted).

    Full details are provided in the Installation Guide. You may experience problems with the driver supplied by your graphics card manufacturer -

    check for the latest driver updates on the web site for your card. We recommend that you update to the latest security key drivers (if a security key is fitted). Full details are provided in the Installation Guide. You may experience problems with the driver supplied by your graphics card manufacturer - check for the latest driver updates on the web site for your card. Notes Only install Part Modeler after you have installed Edgecam (if installing both). Edgecam will install and run on 64-bit versions of these operating systems, where applicable (note however that Edgecam is a 32-bit application). Edgecam and Edgecam Part Modeler will install and run on the 'home' editions of these operating systems. However this is not recommended and we cannot guarantee to fix any Edgecam or Edgecam Part Modeler issues specifically related to these operating systems. The Sentinel RMS license server runs as a system service on Windows 2000, XP, Vista, Server 2003, Server 2008 and Windows 7. Sentinel RMS network licenses can be installed on virtual servers provided that they are locked to a Safenet Computer ID USB key. Standalone (single seat) Sentinel RMS licenses cannot be locked against the new keys for use on a virtual server. It is not recommended to have multiple Edgecam versions installed on the same computer when the user has limited rights or UAC is ON as this may potentially cause problems with Simulator.

  • Code Wizard

    Page 6 of 52 Rev 5.0 Planit Software Ltd

    Minimum Specifications 32 or 64-bit Intel Pentium 4 processor (2 GHz or faster), Intel Xeon, Intel Core, AMD Athlon 64, AMD Opteron, AMD Phemnom or later, in single, dual or quad core versions 1 GB RAM for Windows XP, 2 GB for Windows Vista/Windows 7 and 4GB for 64-bit operating systems To make the most of background processing and multi-threading, we recommend a 64-bit operating system and 2GB RAM for each processor as a minimum. 10 GB free disk space for the Edgecam installation Graphics card OpenGL compliant Minimum 128 MB memory for wireframe systems Minimum 256 MB memory for solid model systems For the latest information on recommended graphics cards please refer to the Support page of the Edgecam web site 17" Colour monitor (1280 x 1024 screen resolution) Mouse including wheel (Intellimouse) SpaceMouse/SpaceBall (optional) Network card Internet Explorer 6 or above Internet connection for license activation/updates USB port for the Edgecam security key (unless using keyless licensing) The Edgecam installer will install the following items if they are not already present on your system: .NET Framework version 1.1 and version 2.0 Microsoft SQL Server Express 2005 (for Edgecam ToolStore) Microsoft Visual C++ 2005 Redistributable Setup Microsoft Visual C++ 2008 Redistributable Setup Microsoft XML 6.0

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 7 of 52

    License Restrictions You may discover that you are unable to work with some of the exercises due to license restrictions. In order to remove any license restrictions, you can set Edgecam to run in Student Edition. To activate Student Edition, Right hand mouse key click over the CLS in the windows task bar notification area, and select the option from the menu.

    Student Edition mode allows you to experience all available licenses in Edgecam. This feature runs for 999 days and will allow you to save files. The file extension is not astandard .PPF extension but is an .EPF. You will not be able to re-load an .EPF file into a licensed version of Edgecam.

    You cannot generate CNC data from an .EPF File. Example Part Files

    There is a number of sample part files mentioned within this training guide. This data can be accessed either from a Training CD or specified folder.

  • Code Wizard

    Page 8 of 52 Rev 5.0 Planit Software Ltd

    Trainee Notes

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 9 of 52

    What is Code Wizard?

    A standard installation of Edgecam offers the ability to create a postprocessor. The Postprocessor is the probably the most important section of the software as it converts CAM data into CNC output. The Code Wizard creates the Postprocessor. Due to the variety and complexity of Machine Tools available in todays market, and the individual idiosyncrasies of each programmer, the user must be able to influence the CNC output. Therefore Edgecam allows the user to customise the postprocessors by way of the Code Wizard. In the past, programmers have been forced to either use MDI techniques or Text Editors to hand-code each CNC program. This is only made possible because the programmer possessed the correct level of experience and knowledge. However, by employing this method a programmer increases the risk of errors either due to syntax errors or, in the integrity of the coding. Furthermore, where more than one programmer is employed, the consistency of the code cannot be guaranteed. The CAD/CAM Life Cycle Lets remind ourselves how the Edgecam process works, and where a postprocessor is involved.

    Having created geometry entities (CAD), the user creates CAM instructions in the Edgecam Manufacturing environment. The Machining Instructions are passed through a postprocessor, and the result is a CNC program. The CNC program can be written in a variety of languages Fanuc, Deckel, Heidenhain etc

  • Code Wizard

    Page 10 of 52 Rev 5.0 Planit Software Ltd

    Postprocessor Construction Writing Postprocessors without Code Wizard Before Code Wizard, source files had to be hand-coded for a particular machine tool. This can proved to be a long and expensive process. The user had two options to create the source code: - Purchase a postprocessor involves cost and removes the users ability to control the

    development of the file. Write their own file, by learning the programming language of postprocessors time,

    resource and money. As the base language of a postprocessor is quite complex, a high level of skill is required from the author of a postprocessor, who would normally possess a strong aptitude for basic software writing. In order to gain a clear understanding of the language of a postprocessor, using the Text Editor, open any.*XT file in the Edgecam MACHDEF folder. Typical installation locations are C:\Documents and Settings\sblakey\My Documents\Planit\2010.20\Edgecam\cam\Machdef Or C:\Program Files\Edgecam\Cam\Machdef, for installations prior to V2010 R2 Writing Postprocessors with Code Wizard In software terms, a WIZARD is an application that will prompt the user for information. (E.g. in the case of the Code Wizard, How do you do a Tool Change? Do you support Block Numbering?) The application will construct the software to align to the users requirement. The Code Wizard assists you in quickly configuring a Code Generator file ready for use with a particular machine tool. This file allows the Edgecam Code Generator to produce correctly formatted NC files for the appropriate machine tool. Code Wizard helps you through the configuration session in a similar way to the wizards found in many Microsoft products. The Code Wizard application lets you configure a standard Code Generator template using graphical tools. Several standard Code Generator Template (*.CGT) files are provided with Code Wizard. At any stage in the Wizard process, you can save the modified template you are working on as a Code Generator Document (*.CGD) file. You can configure the Document to your own working requirements as well as to the settings required by your machine tool. When you finish configuring the Document, you invoke the Code Generator Compiler application to compile the Document into a Code Generator File (*.*CP). Note that this must be done through the Code Wizard, as the Code Generator Compiler does not accept *.CGD files directly.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 11 of 52

    The end result of a configuration work session is a binary file. This text file can be recalled for further configuration as required. If saved under a different filename, the file can act as a template to configure similar machines. Further manual edits may be applied to generate a truly custom Code Generator Document. This Code Generator Document is compiled automatically when the Code Generator is first used to produce NC code. To ensure integrity of the resultant Code Generator, the source and compiled files are bound together with a facility to extract the source file as an ASCII text file for further manual edits or configuration if required. You can accidentally introduce integrity errors when manually editing a file. Make

    sure you have made a backup copy of the file before making any manual edits

    Errors can be tracked by viewing the file ERROR.MPP, found in Edgecams MACHDEF folder.

  • Code Wizard

    Page 12 of 52 Rev 5.0 Planit Software Ltd

    Code Wizard Process The basic workflow is: Open a supplied template Enter your machine configuration Save to a CGD Compile.

    The whole Code Wizard process is one of providing answers to a pre-defined set of questions. The structure of the question is designed to enable the user to easily understand what information is required. If you are unable to provide a response to a question posed by the code Wizard, this will be due to one of two reasons. You do not know the answer. In this instance check with the controller manual or the machine

    tool manufacture. You do not understand the question - In this instance there are a number of solutions. The

    Code Wizard has not only standard Help pages, but also Tutorials and in certain instances Context sensitive help.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 13 of 52

    Creating a New Document Exercise 1 Starting a New Document This exercise is based on a Fanuc Type control on a Vertical Mill. 4. Open the Code Wizard. If its the first time that the Wizard has been

    activated, you will encounter the following dialog box:-

    5. Dismiss the dialog box by selecting Cancel. 6. Activate the Toolbars menu by positioning the cursor at the top of the Code Wizard

    screen (see illustration below) Right Click and the drop-down menu will appear. 7. Ensure all windows are active by using Left click to select.

    If solid machine graphics are not required, only the Code Generator window needs to be active.

    8. Select FILE | Open. You will now start a new work session, where you are initially invited to select a .cgt file (Code Wizard Template).

  • Code Wizard

    Page 14 of 52 Rev 5.0 Planit Software Ltd

    9. Begin by deciding which machine tool you wish to create a postprocessor for. Select either Lathe or Mill.

    10. You are now offered a number of machine tool choices. (based on the most popular machine tool controllers) Essentially, you are now selecting a .cgt (Template) file. Select the options and adaptive-mill-iso.cgt file as shown.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 15 of 52

    Machine Graphics will allow the user to create a model of the machine tool for simulation purposes (this includes fixtures & guards)

    Configuration of Machine Tool graphics will be covered in a later exercise in the manual.

    11. Having selected the Template you will automatically be guided thorough the five stages of creating a Code Wizard document. The name you choose will be used for the .cgd file; .MCP and .MXT files. Enter a Name in the field provided and select the Save button, check the file is save in the Machdef folder.

    If you cannot find a template that corresponds to your controller, select one that you believe to be the closest match.

    12. Left Click on [Save] and save to the Machdef folder. 13. Select [Next>] to progress to the first stage.

  • Code Wizard

    Page 16 of 52 Rev 5.0 Planit Software Ltd

    Exercise 2 Defining Machine Tool Parameters 1. Enter a name in the Machine Name field. This could be the name of either the NC

    System or the machine Tool Builder.

    2. Set Arc Planes to XY+ZX+ZY to ensure you postprocessor can support Arc Plane command (G17/G18/G19)

    3. Rapid Rate - set to the correct value according to your machine tool builders specification.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 17 of 52

    4. Enter a value into Radius Compensation Edgecam can automatically apply a Lead in and Lead Out moves when Radius compensation is activated. This specifies the length of the 90-degree cutter compensation move in multiples of the tool radius. Specify a value if required. If NOT required, specify zero.

    You can also activate the LEAD parameters whilst using the Edgecam Profiling cycles.

    5. Resolved Rapids select only if you wish to force the Rapid move to be represented as a straight-line movement. Otherwise the Rapid move will be displayed as a Dog-Leg.

    6. Set the Helical Arc Capability to Single Turn this affects the CNC output when the user activates Helical in the Approach Type of the Roughing Cycle. If set to Not Supported the CNC output will be linear movements, thus resulting in excessive code.

    7. Select [Next] and move to the next page Turret - Set the Tool Home and Tool Change positions. Furthermore set the Number of Stations to reflect the maximum of positions on the Turret.

  • Code Wizard

    Page 18 of 52 Rev 5.0 Planit Software Ltd

    8. Select [Next] you will now move to the Spindle Stage. This stage can be ignored. Select [Next], where you will move on to the final stage of the Machine Parameters, called Gears.

    9. If you have to include program codes in order to enable the machine tool to switch gears, then you must add/remove Gears. Oppositely, if you do not need to include program codes, delete the gears leaving only Gear Number 1 present. Set the minimum and maximum values for the spindle RPMs

    10. A common mistake is to forget to insert the correct Maximum RPM figure. The result will be incorrect Speed values, i.e. in your Edgecam manufacturing instructions, you typed 3500, but the NC program reports S2000.the speed value is obeying the rule set up in the Maximum RPM therefore the speed can never exceed this value.

    11. As this is the final stage, in the Machine Parameters (Step1), select [Finish].

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 19 of 52

    Exercise 3 Format Table Define Word Addresses Format Table The format Table governs how each individual character appears within the NC program. For instance a move of 2mm in the X-axis may be written in various ways: - X2 X+2 X00200 X+2.0 X2, 0

  • Code Wizard

    Page 20 of 52 Rev 5.0 Planit Software Ltd

    1. Select [Next] to continue onto Step 2. 2. Select a word in the Letter Description list and decide on its numerical precision. (Trail

    zeros, Lead zeros). Select the appropriate settings in the Format Control table. 3. To test the output, place a value in the Test Value field, in the Sample Output area.

    Code Wizard will display the value in the Result windows.

    4. You will observe in the two lower Result fields, the output for a metric program & the output in an imperial program.

    5. If you disagree with the result, either alter the Numerical Precision area or Format Control area.

    6. You may perform a global change by holding down the key and selecting multiple various letter addresses.

    Remember to select Apply before moving on to another Letter Address. 7. A typical setting is the Main NC Program Number. Most controllers use a numerical

    value to express the programs identity. The number itself usually requires a prefix - an example being :O

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 21 of 52

    During the initial creation of the Code wizard document, test the main letter addresses only. You may alter the not so frequently used letters, at a later stage.

    The Heidenhain templates omit the actual letter in the letter address box. Typically examples are Feed & Speed. This is because the letter output is handled in a different manner. See Stage Four - Code Constructors.

    Turners may find that they have to alter the Letter Address setting when using G71/G72 Canned cycles.

    A common mistake is to incorrectly set numerical precision for speed output. If a User intended to achieve a speed output of S13000, and actually receives S9999, this means the numerical precision is too low.

  • Code Wizard

    Page 22 of 52 Rev 5.0 Planit Software Ltd

    Exercise 4 - NC Styles G-Codes and Modality This section is relatively straightforward. You are requested to set all general parameters connected with the CNC system. It should be a case of supplying data to the various questions. Whilst in the G-Codes area, remember you only need to supply the figure; you do not need to type how the figure would appear in the program. I.e. for a RAPID MOVE the figure would be 0 (zero) Do not Type 00. The format table will alter the output i.e. G00 (introduce a lead zero).

    If you are not familiar with some of the modifiers because you do not adopt them in your style of program, do not blank the value. Accept what is ever is already in the setting.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 23 of 52

    1. Coolant M-Codes - on this occasion, Flood is set to 7. Many controllers will only accept an 8. Switch the values in Flood=8 and Mist=7 coolant.

    2. Under the Coolant Control area you will find that you have the ability to automatically activate the coolant condition. Set this to the desired parameter. Using the command will mean that you do not have to set these M-Functions in the CAM instructions.

    3. Some machine controls support Extended Datum Offsets i.e. G54.1, G54.2, G54.3 etc. This can be reproduced in the Datum Setting tab using the Number of first absolute datum and the datum increment.

  • Code Wizard

    Page 24 of 52 Rev 5.0 Planit Software Ltd

    You may need to change the format table for the Datum Setting, the default output is G54P

    4. If using Max Program size; ensure a realistic value is used. Otherwise, Edgecam will split the program into many smaller files.

    5. On some controllers Text Case Output can only be output in a specific format such as Upper case only, for example.

    6. When outputting your code it is possible to output a set up sheet either as a separate file or with the NC file.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 25 of 52

    7. Block Numbers can be switched On/Off independently of the Code Constructors. These can either be on every line of code, Output Block Numbers or on Safe/Toolchange only if, Output Block Numbers and Output Safe/Toolchange Block numbers only checked.

  • Code Wizard

    Page 26 of 52 Rev 5.0 Planit Software Ltd

    8. Feed Moves

    9. Rapid Moves

    10. Ensure that Circular Interpolation has been set correctly. Where R letters are not used, ensure that you set the Arc Centre argument. Feedrate adjustment around arcs can also be set, ensure checkbox is ticked to utilise maximum and minimum values.

    11. The Cutter Compensation tab allows the user to set the CRC Register Number and TLO Register Number, relative, for example to the turret position. A warning can also be output using the checkboxes to inform the operator that CRC has been applied and to enter the relevant data at the machine tool.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 27 of 52

    12. Hole Cycle Options

    13. Thread Mill Cycle Options

  • Code Wizard

    Page 28 of 52 Rev 5.0 Planit Software Ltd

    14. You can specify the number of the sub program. In this instance, when the modifiers are left blank the first sub program will be one value greater than the main program i.e. Main Program=90 Sub Program=91. If you were to place a value in the Start subroutine Program Number, say 10, the first sub program will again, be one increment higher than this value, first sub will be 11.

    15. Tool Change options. It is advisable to have a warning output to your code if you try and change the Tool without taking the tool away from the part first. When applying a spindle stopped warning it would be quite acceptable to rapid the tool without the spindle moving, change this to Feed Moves only.

    16. Workplane Definition.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 29 of 52

    17. The Code Wizard allows you to invoke modality rules. Typical examples are X Y & Z values output the X Word, ONLY when the value changes. To make a Letter address modal, simply click the check box, for that item.

    NC Debug 18. Within this area you will find a most useful tool. You will eventually need to de-bug the

    program. Imagine looking through your finished code and having to make an alteration which part of the Wizard is responsible for the problem? It may appear to you to be a search for a needle in a haystack!

    19. Activating Generate Code Constructor Trace, you will be able to track down each section of output.

    20. Do not initially activate the trace mode. Make this your first edit. 21. Select Finish at the end of this session.

  • Code Wizard

    Page 30 of 52 Rev 5.0 Planit Software Ltd

    Exercise 5 Code Constructors This is the most important section of the Code Wizard. The Code Constructor stage of the Code Wizard consists of many identical dialogs. Each of these dialogs defines an individual NC sequence. One or more of these sequences are required for each particular machining event. For example, to cater for a Toolchange, three sequences need to be defined: First Toolchange, General Toolchange and Last Toolchange

    Therefore, you are allowed to control the output for each section. The Code Constructor dictates the order in which each word address is outputted, and how many lines of program are generated. Here is a typical example, Program Start

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 31 of 52

    Sequences are constructed from code elements called Tokens (variables, for example [DELETE][SPEED] etc.) and Literals (hard-coded text, for example G28X0Y0). These code elements are displayed in the Output window. Valid Tokens These are variables that represent the individual items of program code.

    Output Whatever is written inside this window appears as program output.

    Below is the resultant output created by this Code Constructor

  • Code Wizard

    Page 32 of 52 Rev 5.0 Planit Software Ltd

    The output area of the Code Constructor can be manipulated similar to the Text Editor. You will find Cut, Copy & Paste facility under Edit Menu. To position a Token on the Output area, firstly position the cursor in the desired place on the output line, then double left click the required token in the Valid Token area. To remove a token, select it and press the key. You are allowed to add rules to individual tokens. Specifically, influence the sign (+/-) or reverse the modality rule. Place the cursor over any token in the output area, click the Right click.

    Force Output Now Forces output of the Token regardless of Modality. Force Output Later Forces output the next time the Token is used. Force Positive Forces the Tokens output to be positive. Force Negative Forces the Tokens output to be negative. Reverse Sign Forces the Tokens output to be positive instead of negative and vice versa.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 33 of 52

    Exercise 6 M-Functions The final stage of Code Wizard allows the user to create one or more machine tool-specific functions. You may re-call, when in Manufacture mode in Edgecam, you have a specific menu dedicated to M-Functions. You may add further options to this menu.

    In the M-Code area, you are not restricted to just specifying the new M-Codes- say M18 You may also type hard code text i.e. G90 G80 G30 M74 Therefore the option will output M18 G90 G80 G30 M74 If you require extra lines of code, then select the Construct Tab, and type more data. You may find that if you add extra M-CODES or amend the title of existing M-Codes , the

    alteration may not take immediate effect. To test thoroughly, delete the postprocessor .MNU file, which can be found in the EDGECAM\LANGUAGE Folder.

  • Code Wizard

    Page 34 of 52 Rev 5.0 Planit Software Ltd

    Exercise 7 Testing & Editing the Code Wizard Now that you have completed the final stage of the code wizard process make sure you have saved your file. It is not important which folder you save it in. Edgecam will automatically assign the file extension - .CGD. At this stage you do not have a postprocessor you must compile in order to gain the postprocessor. Once you have selected Compile, both the source code and the postprocessor are created.

    You should now test your postprocessor by creating a CADCAM file. You should also open the resultant .NC file in your text editor in order to view the code. The first manipulation of the Code Wizard document is to activate the Code Constructor Trace, in order to ascertain which parts of the Wizard are responsible for the code produced in the Editor.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 35 of 52

    Once this command is activated and you have re-compiled your code wizard document, your NC File should look similar to this:-

    You MUST re-compile the Code Wizard Document after any alterations in the .CGD So that you can quickly assess the effects of your changes in Code Wizard on generated code, there is a button that simultaneously re-compiles the code generator and regenerates CNC code from the last code generated. This saves going back to Edgecam each time.

    To confirm that you are correctly adhering to the testing procedure, Edgecam will advise you that the .NC file has altered within the Editor

  • Code Wizard

    Page 36 of 52 Rev 5.0 Planit Software Ltd

    What is Edgecam Machine Simulator? Edgecam Simulator offers full simulation of the machine tool and machining process for lathes and milling machines. This enables you to visualize the interaction between the various elements of the machine tool helping to avoid expensive collisions, optimise the cutting process and reduce cycle time. Simplified block graphics are created for you by default and their dimensions can be parametrically adjusted to suit your machine tool configuration. Optionally, you can substitute the parametric graphics with your own fully detailed graphics by modeling the machine tool in a solid modeler such as Part Modeler. Elements of the machine tool such as heads and turrets are represented as graphics. The Machine tree provides an easy-to-use method of controlling the display and kinematics of each machine tool component. The graphics are positioned in an axis configuration built into the Machine Tree (such as upper ATC on the B Axis, B Axis on the Y Axis and so on, or Table on the C Axis, C Axis on the A Axis and so on). There are also graphics for fixtures, such as tool mounting blocks, and chucks, that you can store in a library for use in the machine tool simulation. The Machine Simulation setup is contained in the code generator; as created in Code Wizard. For correct simulation you need to specify details such as the axis configuration and the Home positions. Edgecam Simulator only checks for collisions between Chucks, Holders (excluding

    index turret mounting blocks) & Tools.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 37 of 52

  • Code Wizard

    Page 38 of 52 Rev 5.0 Planit Software Ltd

    Exercise 7 Configuring Machine Tool Graphics The diagram below illustrates the relevance of the Tool Z Gauge.

    1. Ensuring that the Machine Setup and Properties Windows are active; inspect the content of each item. You should be able to recognise each item by observing the machine tool graphic.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 39 of 52

    2. Click on any one of the following settings, inspect the parameters in the Properties window.

    Base Head Axis Mount Table

    3. The origin for the machine graphics is at the centre of the spindle. If you adjusted the Spindle Location for example, the spindle would stay in the same place, and the rest of the head would move around it.

    4. Change the Colour settings for each item. Experiment with the Width, Height, etc parameters and observe the influence they have on the Graphics

  • Code Wizard

    Page 40 of 52 Rev 5.0 Planit Software Ltd

    5. From the Machine Elements window, activate the Table command Change the dimensions and Colour. You may use the ones below for reference:

    Length: 1200 Width: 450 Height: 150 Lead: 100 Angle: 45 Type: Rectangular 6. Activate the Base Change the dimensions and colour/Translucency. You may use the

    ones below for reference: Length: 1400 Width: 2000 Height: 1925 Thickness: 600 7. Activate the Head Change the dimensions and colour/Translucency. Length: 400 Depth: 850 Height: 375 Spindle Location: 625 8. From the Machine Element window, activate the Primary Location command. This

    value determines the separation from the Machine Tool Datum and the Setting Datum found on the Machine Tool Table. In this instance the values shall be:

    X: 0.0 Y: -550.0 Z: -650.0 Notice the relationship between the Table Height setting and the Z Axis Primary

    Component Location.

    You cannot delete this branch type. With parametric graphics, this branch is automatically inserted into a milling Machine Tree to represent the part mounting position within the machine graphics. The location is given by the branch's Location (X, Y Z coordinate) properties relative to the Graphics Datum.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 41 of 52

    When creating a sequence within Edgecam, Primary Component Location is one of the choices for Mating Location, that relatively positions the part and machine graphics.

    9. Investigate the influence of the values. When creating User Defined Machine Tool Graphics, these values are very important.

    10. Save the file as Simple 3 Axis Mill.cgd and Compile the document

  • Code Wizard

    Page 42 of 52 Rev 5.0 Planit Software Ltd

    Exercise 8 Appling the 3-Axis Postprocessor Now you have compiled the Code Wizard document the postprocessor can be selected from the Machine Tool list in a Machining Sequence. The following exercise will demonstrate how to use the Mating Offsets in the component and machine tool set-up.

    1. Open the part file called 8 - 3 Axis Mill.ppf Inspect the part file. Measure and verify the dimensions around the part. Inspect the positions of the Top CPL in particular the distance to the vice base.

    2. The solid model representing the vice has already been declared as a Fixture. 3. Ensuring Edgecam is in Manufacture Mode edit the Sequence, select the new Machine

    Tool postprocessor and also ensure the correct Mating Location and CPL are selected. Machine Tool: Simple 3 Axis Mill.mcp Mating Location: Primary Component Location Mating CPL: Top

    The Z Mating Offset has been set to -130 from the previous Machine Tool setup.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 43 of 52

    The position between the component and the machine tool can be retrospectively altered. Investigate the Mating Location Offsets, found in the machine parameters area.

    4. Observe how the Machine graphic is loaded, the position and location of the Fixtures and Component should be correct.

    5. Experiment further with the X & Y Mating Offsets to understand the effects.

    6. Launch Simulate Machining and review the toolpaths. Check for any possible collisions.

    7. Save part file as 8 - Completed 3 Axis Mill.ppf.

  • Code Wizard

    Page 44 of 52 Rev 5.0 Planit Software Ltd

    Exercise 9 Including Custom Graphics Creating a solid model representation of the machine tool is an optional step in the overall machine simulation setup process. You could instead use the basic block parametric graphics that are created automatically as previously demonstrated. The basic process of creating the solid model is the same whether you use Part Modeler or another solid modelling package. Here are some hints and tips (see also the illustration below): Keep the model as simple as possible, excluding unnecessary detail for fast simulation. Use a separate body for each part of the machine; table, heads, rotary axes and so on. Place all the movable elements at their home positions. For the orientation, align the spindle axis along the Z Axis of the world co-ordinates (CPL

    Top). Set the part units to the units you will be using to define the machine in Code Wizard. Position the model so that the spindle nose is at the World origin (see the illustrations below).

    In Code Wizard, this will be the 'Graphics Datum' (positions such as the rotary axis origins are specified relative to this point).

    Note critical measurements of the model that will be required for later entry in Code Wizard; for example the position of the Machine Datum (the intersection of the rotary axes for example - do not confuse this with the Graphics Datum).

    1. Open the part file 9 - Mill Machine Table.ppf. Inspect the solid file, paying particular

    attention to the position of the Top CPL.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 45 of 52

    2. From the Features Window; Right Click the name of the solid file and select Output Model from the dropdown menu.

    3. Open the Code Wizard Document Simple 3 Axis Mill.cgd.4. From within the Machine Elements table, pre-digitise X Axis Right Click and select

    Paste Model from the drop-down menu.

    5. Observe how the new Graphic image has been inputted. 6. You may now delete the original image of the table; Right Click and select Delete from

    the drop-down menu

  • Code Wizard

    Page 46 of 52 Rev 5.0 Planit Software Ltd

    7. Ensure that the new table graphic is part of the X Axis, Select table graphics element with a Left Click and in the Properties window rename the table graphics element to My Machine Table.

    8. As the Table is thinner, edit the Axis Mount to make this thicker. Height: 150

    9. Re-Save the .CGD file and Compile.10. Open the part filed completed in the previous example 8 - Completed 3 Axis

    Mill.ppf.11. Move into Manufacturing Mode. Observe how the original Table image is still being

    using. 12. From the Machine Elements window; Left Click the Machine entry. From the drop-

    down menu, select Reload Machine.

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 47 of 52

    13. Observe how the new Table Image is now being used.

    14. Re-Save the file as 9 - Completed 3 Axis Mill Reload.ppf.

  • Code Wizard

    Page 48 of 52 Rev 5.0 Planit Software Ltd

    Frequently Asked Questions Herewith a number of common queries and questions experience by new users of Code Wizard. Q. Why doesnt the G71 code; appear on the second line of the Turning Canned Cycle. A. Force output Now, Right click over the token.

    Q. Why cant I control the M-Functions in the code? There are too many/few M04, M13 & M08 codes. A. If an Operation has been used to create the CAM instructions, check the Operations Preferences Also, check the Program Defaults; Check the M-functions are correct.

    Q. When using CRC, I want the offset number to be different from the Tool No.? A. Check the Max number of tools. Check Cutter Compensation setting in NC Style G Codes & Modality.

    Q. In Heidenhain, the set-up value in the drill cycle should be negative? A. Right click over the token Force Negative. Q. Ive changed the Toolchange & Home positions and compiled. But, the values of the Toolchange have not been altered in my CADCAM file? A. Close & then re-open the CADCAM file. For good measure -delete the .MNU file found in the Language area. (The file will have the same name as you Code Wizard Document).

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 49 of 52

    Q. I have re-formatted the R word for cycle retract values. Now the R word for G02/03 is wrong. A. There is an independent R word for drill cycles in the Format table.

    Q. My code constructor trace tells me to look at G28 Z Block but the code that I am wishing to alter is not there. A. TOOLCHANGE is a Secondary Code Constructor. In other words, it acts like a sub-routine, it is called out from Core Code Constructor. Look at Core Code Constructor for the answer.

  • Code Wizard

    Page 50 of 52 Rev 5.0 Planit Software Ltd

    Q. I want to use the Safe Block number technique. The number of the block is correct I have used the SafeBlockNum token but, the letter in front of the number is wrong, it should be O. A. Go to the format table & change the letter on the Safe/ Tool Block no.

    Q. My feedrate is wrong when using circular interpolation. It should be same as the linear feedrate. A. Dismiss the Adjust feedrate to Side of tool found in Circular Interpolation (NC style G Codes & Modality).

  • Code Wizard

    Version 2010 R2 Rev 5.0 Page 51 of 52

    Index ActivatingActivatingActivatingActivating ............................................................ 29 AngleAngleAngleAngle ................................................................... 40 ArcArcArcArc ............................................................ 16, 17, 26 AxisAxisAxisAxis ............ 3, 36, 39, 40, 41, 42, 43, 44, 45, 46, 47 ButtonsButtonsButtonsButtons .................................................................. 4 CADCADCADCAD ................................................................... 3, 9 Canned cyclesCanned cyclesCanned cyclesCanned cycles ................................................... 21 CNC codeCNC codeCNC codeCNC code ........................................................... 35 ColourColourColourColour ........................................................ 6, 39, 40 ConfiguringConfiguringConfiguringConfiguring ..................................................... 3, 38 CPLCPLCPLCPL ................................................................ 42, 44 CreatingCreatingCreatingCreating .................................................... 3, 13, 44 CycleCycleCycleCycle ................................................ 3, 9, 17, 27, 48 DatumDatumDatumDatum ................................................ 23, 24, 40, 44 DefaultsDefaultsDefaultsDefaults ............................................................... 48 DefinedDefinedDefinedDefined ................................................................ 41 DefiningDefiningDefiningDefining ........................................................... 3, 16 DefinitionDefinitionDefinitionDefinition ............................................................. 28 DepthDepthDepthDepth ................................................................... 40 EdgecamEdgecamEdgecamEdgecam 2, 3, 5, 6, 7, 9, 10, 11, 17, 18, 24, 33, 34,

    35, 36, 41, 42 Edgecam Part ModelerEdgecam Part ModelerEdgecam Part ModelerEdgecam Part Modeler ....................................... 5 EdEdEdEditingitingitingiting ............................................................. 3, 34 ErrorsErrorsErrorsErrors ................................................................... 11 ExampleExampleExampleExample ............................................................ 3, 7 Features WindowFeatures WindowFeatures WindowFeatures Window ............................................... 45 FeedrateFeedrateFeedrateFeedrate .............................................................. 26 FixturesFixturesFixturesFixtures ............................................................... 43 Hole CycleHole CycleHole CycleHole Cycle .......................................................... 27 Home positionHome positionHome positionHome position .............................................. 36, 48 InstructionsInstructionsInstructionsInstructions ........................................................... 9 LocationLocationLocationLocation ...................................... 39, 40, 41, 42, 43

    Machine SimulationMachine SimulationMachine SimulationMachine Simulation ...........................................36 MachiningMachiningMachiningMachining .................................................. 9, 42, 43 MMMM----functionsfunctionsfunctionsfunctions .........................................................48 ModalityModalityModalityModality ......................................... 3, 22, 32, 48, 50 NumberingNumberingNumberingNumbering ..........................................................10 OpeOpeOpeOperationsrationsrationsrations ..........................................................48 partpartpartpart .........................................................................2 PartPartPartPart ..................................................... 3, 5, 7, 36, 44 Part ModelerPart ModelerPart ModelerPart Modeler ............................................. 5, 36, 44 Profiling cycleProfiling cycleProfiling cycleProfiling cycle .....................................................17 PropertiesPropertiesPropertiesProperties ................................................ 38, 39, 46 Radius compensationRadius compensationRadius compensationRadius compensation ........................................17 Rapid moveRapid moveRapid moveRapid move .........................................................17 RoughingRoughingRoughingRoughing .............................................................17 SequencesSequencesSequencesSequences ..........................................................31 SettingSettingSettingSetting ..................................................... 23, 24, 40 SpeedSpeedSpeedSpeed ............................................................ 18, 21 SpindleSpindleSpindleSpindle ..................................................... 18, 39, 40 StartingStartingStartingStarting ............................................................ 3, 13 TemplateTemplateTemplateTemplate ..................................... 10, 13, 14, 15, 52 TextTextTextText .................................................. 4, 9, 10, 24, 32 ThreadThreadThreadThread .................................................................27 ToolToolToolTool 3, 10, 15, 16, 17, 28, 38, 40, 41, 42, 48, 50, 52 Tool graphicsTool graphicsTool graphicsTool graphics ......................................................15 ToolbarsToolbarsToolbarsToolbars ..............................................................13 ToolchangeToolchangeToolchangeToolchange ............................................. 25, 30, 48 ToolsToolsToolsTools ................................................................ 9, 36 ToolStoreToolStoreToolStoreToolStore ...............................................................6 TurningTurningTurningTurning ................................................................48 TurretTurretTurretTurret ...................................................................17 VerticalVerticalVerticalVertical .................................................................13 WindowsWindowsWindowsWindows .................................................. 2, 5, 6, 38

  • Code Wizard

    Page 52 of 52 Rev 5.0 Planit Software Ltd

    Revision Control Rev 2.0 November 2005 General re-write Rev 3.0 June 2006 updated to include Machine Tool simulator notes Rev 4.0 March 2007 general update for Version 11.5 Rev 5.0 July 2010 Re-written in line with current Planit Template and V2010 R2. Too many

    changes to list. SBL.