Hello Guest it is April 16, 2024, 09:49:22 AM

Author Topic: Programming in Mach3  (Read 15525 times)

0 Members and 1 Guest are viewing this topic.

Programming in Mach3
« on: August 18, 2009, 03:27:51 AM »
I'm interested in learning how to program screens, wizards and other such things in Mach3.  The programming doesn't scare me.  I've been a professional programmer for most of my career.  Furthermore, it appears to me that Mach3 is designed to have its interface modified by its users.  What I'm hoping is that someone can point out to me the tools, hooks, starting points and such that have already been provided to make these things as easy as possible.

It looks like the language to use if Visual Basic.  Will I have to go out and buy a copy of Microsoft's VB in order to work on this software?  What other tools will I need? 

Could someone act as a mentor for a moment or two and get me pointed in the right direction?

Thanks,
Mark

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Programming in Mach3
« Reply #1 on: August 18, 2009, 03:34:11 AM »
To alter or make screens you can use Screen4, available from the downloads page. To do macros use the editor built into Mach, its accessed from the operator menu. You can make buttons into VB buttons in screen4 and that is usually how the wizards work. If when in a wizard you click operator menu then edit button script you will see the VB button flashing, clcik on it and the editor will open showing the VB in that button.
Hood
Re: Programming in Mach3
« Reply #2 on: August 18, 2009, 10:16:39 PM »
Mach3 macros are written in a VB script language called Cypress Enable.  If you Google "Cypress Enable", you'll find the Cypress website, and can download a PDF of the language reference manual.  The Mach3-specific function calls and variables are (sort of....) defined in the Wiki on the Artsoft website, and various places on this forum.  Learning to write Mach3 macros can cause you to tear your hair out, but it is doable.  The available information is spotty, and some is just plain wrong.  But, there are people here who have learned the hard way, so if you get stuck, just ask.

Mach3 plug-ins are written in C++, using a now very outdated version of VisualStudio.  I forget what version is required, but that too is documented in the Plug-In programmers guide on the ArtSoft website.  You cannot use newer versions - the plug-ins will compile, but they won't work....

Screensets can be created using a variety of tools.  Screen4, is probably the most common, though I'd suggest you instead try MachScreen, which seems MUCH more stable, and easier to learn.  Screen4 works, but it is riddled with quirks, and crashes periodically, often trashing your screenset in the process.  If you use it, make *frequent* backups.  Screen4 can be downloaded from the ArtSoft website.  I think you can download MachScreen from somewhere on this site, but I'm not sure.  Do some Googling and you'll find it.  It was written by a Mach3 user, and is a nice piece of work. 

Regards,
Ray L.
Regards,
Ray L.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Programming in Mach3
« Reply #3 on: August 18, 2009, 10:21:38 PM »
The Mach2 customization guide has good info on creating wizards, as well as the other stuff. May be a bit outdated, though.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Programming in Mach3
« Reply #4 on: August 20, 2009, 02:58:37 AM »
Thanks.  Now, a couple of very basic questions:  what are Mach3 macros (I know what a macro is in general, but what is one specifically for Mach3) and how and where are they used?  What are Mach3 plug-ins and how and where are they used?  I'm pretty sure I know what a screenset is.  It would seem to me that a screenset is the biggest and most difficult thing to create for Mach3, correct?  Answering these simple questions could save me a lot of time.
Once again, thanks,
Mark

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Programming in Mach3
« Reply #5 on: August 20, 2009, 03:42:36 AM »
Macros can do many things for example you can have a macro that will simply switch on an output from Mach. You can for example modify the M6Start macro to operate a toolchanger so that when you ask for a toolchange Mach will perform whatever is in the macro. You can also have custom macros to do certain tasks and you can call them from m codes in your g code file. As an example on the coil winder I have a macro I have named m222.m1s , it automatically zeros the work offset coordinates of an axis so that the axis doesnt manually have to be reset or rewound. To call that all I need to do is ensure that my g code has M222 in it.

Plugins are mainly used to integrate external hardware such as the SmoothStepper, X Box 360 controller etc but can also be used to add features such as Scott S has done with the MachMad plugin.

Screensets are easy enough to do in screen4, it does have its problems but I think in the majority of cases the problem is after people have added a DRO or button or whatever they forget to click the "None" icon and inadvertantly add DROs or buttons etc on every mouse click. Often the DRO or whatever may not be seen as it has been inadvertanly placed offscreen so they dont know its there. This brings another point to mind, always have your computers screen resolution bigger than the screen size you are designing when using screen 4 as it helps avoid the aforementioned problem.

Hood

Offline Jeff_Birt

*
  •  1,107 1,107
    • View Profile
    • Soigeneris
Re: Programming in Mach3
« Reply #6 on: August 20, 2009, 03:22:10 PM »
Take a look at the video tutorials. They are a good way to get a basic understanding of the various aspects of mach. The new mach manunal is also a good read.
Happy machining , Jeff Birt