Customizing Mach2

Customizing Mach2

Mach2 Customisation Guide All queries, comments and suggestions welcomed via [email protected] Mach Developers Network (MachDN) is currently hosted at: http://groups.yahoo.com/group/mach1mach2cnc/files/ © 2003/4 Art Fenerty and John Prentice Front cover: Brown & Sharpe Universal mill 1862 (with some "artistic" liberties) Back cover (if present): The old, gear, way of co-ordinating motion on mill table and a rotary axis For Mach2 Release 6.11 Manual Revision 6.11-A6 Contents Contents 1. Preface.............................................................................................1-1 2. Communication routes...................................................................2-1 2.1 Electrical connections.....................................................................................................2-1 2.2 Keystroke connections....................................................................................................2-1 2.2.1 Keystrokes........................................................................................................................2-1 2.2.2 Keystrokes and Shortcuts (Hotkeys)..................................................................................2-3 2.3 The KeyGrabber and profilers.......................................................................................2-3 2.4 VB Script connections.....................................................................................................2-4 2.4.1 VB Script program............................................................................................................2-4 2.4.2 Mach2 macro....................................................................................................................2-4 2.5 Windows' control............................................................................................................2-5 2.6 Other customisation........................................................................................................2-5 2.6.1 Global hotkeys..................................................................................................................2-5 3. Screen Designer..............................................................................3-1 3.1 Screen Designer basics....................................................................................................3-1 3.2 Try out the Designer.......................................................................................................3-1 3.3 Making the controls work...............................................................................................3-2 3.3.1 Key scan codes.................................................................................................................3-2 3.3.2 Defining function by G-code or VB Script.........................................................................3-3 3.3.3 Defining function by name................................................................................................3-4 3.3.4 Defining buttons by OEM code.........................................................................................3-4 3.4 Getting a tidy visual effect..............................................................................................3-4 3.4.1 Alignment icons................................................................................................................3-5 3.4.2 Sizing icons......................................................................................................................3-5 3.4.3 Spacing controls uniformly...............................................................................................3-5 3.5 Properties of other types of control................................................................................3-6 3.5.1 User LEDs and DROs.......................................................................................................3-6 3.5.2 Properties of Intelligent Labels..........................................................................................3-6 3.5.2.1 System labels.........................................................................................................3-6 3.5.2.2 User Labels/Tickers...............................................................................................3-6 3.5.3 DRO groups......................................................................................................................3-6 3.5.4 Use of Bitmaps.................................................................................................................3-7 3.5.4.1 Bitmap buttons.......................................................................................................3-7 3.5.4.2 Visual grouping with bitmaps.................................................................................3-7 3.5.4.3 Identifying controls by the background bitmap.......................................................3-7 3.5.4.4 Dynamic changes with bitmaps..............................................................................3-8 3.6 Advanced features for setting up controls......................................................................3-8 3.7 Colors..............................................................................................................................3-9 3.8 Implementing two levels of screen complexity................................................................3-9 4. Coding VB Script programs...........................................................4-1 4.1 A simple button script.....................................................................................................4-1 4.2 Sample macros................................................................................................................4-2 4.2.1 A simple macro.................................................................................................................4-2 4.2.2 More complex macro........................................................................................................4-2 Mach2 Customisation Guide ii Rev 6.11-A6 Contents 4.3 A common confusion with VB Script and a hint............................................................4-3 4.4 The Mach2 VB Script functions and subroutines...........................................................4-4 4.4.1 To execute G or M-codes from a script..............................................................................4-4 4.4.2 For accessing the screen controls.......................................................................................4-4 4.4.3 Interrogating Mach2 internal variable................................................................................4-6 4.4.4 Access to the machine G-code parameter block.................................................................4-6 4.4.5 Arguments of macro call...................................................................................................4-7 4.4.6 Information to and from the user.......................................................................................4-7 4.4.7 Handling files of Part Programs.........................................................................................4-8 4.4.8 Screen handling routines for wizards etc............................................................................4-9 4.4.9 Input/Output signals, a serial port and "foreign" ports........................................................4-9 4.4.10 Serial port.......................................................................................................................4-10 4.4.11 Foreign ports...................................................................................................................4-10 4.4.12 Waiting and system features............................................................................................4-10 4.4.13 A more complicated macro example................................................................................4-11 4.5 Script Snags and Hints..................................................................................................4-12 4.5.1 What Windows/Mach2 does with your macro..................................................................4-12 4.5.2 Script error reporting.......................................................................................................4-12 4.5.3 Stuck in a rut?.................................................................................................................4-13 4.5.4 Reporting errors to users.................................................................................................4-13 4.6 Legacy/System VB Script Functions.............................................................................4-14 5. Designing wizards...........................................................................5-1 5.1 What is a wizard?...........................................................................................................5-1 5.2 A wizard's working in a nutshell....................................................................................5-1 5.3 Worked example – the Digitize wizard explained..........................................................5-1 5.3.1 The first step.....................................................................................................................5-2 5.3.2 Making the wizard work...................................................................................................5-3 5.3.3 Making the wizard write a part program............................................................................5-4

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    86 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us