585,883 active members*
4,674 visitors online*
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2007
    Posts
    93

    Easiest way to make button run VB script

    Hi,

    I have a VB script that I copied form http://cockrum.net/cnc.html .

    Im using the touchplate code to auto-zero my axes.

    Currently in Mach3 I have to go to Operator->VB Script Editor then run the VB script from there, but it would be less hassle if i could assign the code to the standard "zero x", "zero y" and "zero z" buttons on the existing Mach3 screen.

    It would also be nice to make a button that homes all three axes.

    I can't seem to find how to do this in the Mach3 settings.

    Any help is greatly appreciated

    Adam

  2. #2
    Join Date
    Feb 2008
    Posts
    482
    rename it for example m2000
    save it in your current macro file. (my computer, mach3,macros, my mill etc?)

    just type into mdi m2000

    if you want to add a button to a screen download machscreen. very easy to use after about 10 mins youl be able to do anything with the mach screens!
    so much to learn, so much to pass on.

  3. #3
    Join Date
    Feb 2008
    Posts
    482
    or you can use operator, edit button code
    if the button you want flashes you can edit it, otherwise download mach screen and add a button to the page you want
    so much to learn, so much to pass on.

  4. #4
    Join Date
    Dec 2007
    Posts
    93
    Thanks for that.

    I did have a look at machscreen yesterday, but thought I'd have to make an entire new interface from scratch.

    Can I use machscreen to add a single button to the screen I already have?

  5. #5
    Join Date
    Feb 2008
    Posts
    482
    yes. just open the page you want in machscreen
    in the smaller box you will see add and a drop down list
    select button
    cursor on screen where you want it and click
    then edit the button in the properties box

    save the screen set as a different name if you want when your done.
    in mach select view, loadscreens and select the new name
    save settings under view tab
    (ive had to add 100 leds, 18 buttons to one of my screens)
    so much to learn, so much to pass on.

  6. #6
    Join Date
    Dec 2007
    Posts
    93
    Very Nice.

    Im at work now, but will try to do something tonight

    Thanks Again
    Adam

  7. #7
    Join Date
    Dec 2007
    Posts
    93
    Thanks,

    That went smoother than I expected!
    Can I please ask what Gcode I would use to set the x,y or z coorinate to a defined number?

    This is my current Z-axis zeroing code:

    Message( "Auto Zeroing..." )
    If IsSuchSignal (22) Then
    code "G31 Z-3 F20"
    While IsMoving()
    Wend
    Call SetDRO( 2, .060 )
    code "G1 Z1"
    End If



    Trouble is, if by some freak instance the z-coordinate is less than -3, it will actually move upwards rather than downwards when I press the auto-zero button.

    If I could set Z to something like 10 inches before the G31 command in the code, this problem would be resolved.

  8. #8
    Join Date
    Mar 2003
    Posts
    35538
    Can I please ask what Gcode I would use to set the x,y or z coorinate to a defined number?
    You're already using it - SetDRO(2,.060) sets the Z DRO to .060.

    However
    , SetDRO is from older versions of mach3. You should be using SetOEMDRO instead, SetOEMDRO(802,10) should set the Z DRO to 10.

    A list of the OEM DRO numbers is here.
    http://www.machsupport.com/MachCusto...title=OEM_DROs
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  9. #9
    Join Date
    Mar 2003
    Posts
    35538
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  10. #10
    Join Date
    Feb 2008
    Posts
    482
    sort your button?
    so much to learn, so much to pass on.

Similar Threads

  1. Easiest way to learn Surfcam?
    By rbest27 in forum Surfcam
    Replies: 25
    Last Post: 04-16-2011, 02:28 AM
  2. Easiest CAM - Ultimax interface?
    By parkerbender in forum HURCO
    Replies: 2
    Last Post: 01-30-2010, 02:50 AM
  3. Easiest tool path for this?
    By Hoverflyer.mk2 in forum Mastercam
    Replies: 1
    Last Post: 05-25-2009, 03:02 AM
  4. What is the easiest software out there
    By reeftoker75 in forum Uncategorised CAM Discussion
    Replies: 9
    Last Post: 04-08-2009, 05:47 PM
  5. Easiest 3D drawing program
    By NeoMiller in forum Autodesk
    Replies: 1
    Last Post: 10-23-2003, 11:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •