Hello Guest it is November 08, 2024, 04:09:14 PM

Author Topic: Draft Mach3 v3.x Programmers Reference Manual  (Read 30790 times)

0 Members and 1 Guest are viewing this topic.

Draft Mach3 v3.x Programmers Reference Manual
« on: October 01, 2009, 11:01:54 AM »
All,

Below is the first draft of the Programmers Reference Manuals for Mach3 v3.x posted for user comment.  This manual documents almost all of the existing Mach-specific VB functions for Mach3 v3.x.  The Modbus and Serial chapters are still in-process, and will be posted in an updated version shortly.  Everything here has been tested against Mach3 v3.042.020, so, as pointed out in the introduction, you may find some differences with other, particularly earlier, versions.

Brian and I have had a significant shift of focus since this project began a few months ago.  Our original intent was to thoroughly document the existing interface in a Programmer Reference, and add to that a detailed step-by-step tutorial manual, aimed at making it possible for almost anyone to learn to write Mach macros.  However, as we started working on the documentation, we realized the interface itself, as a result of its rather "organic" growth, actually made learning to write Mach macros much more difficult than it needed to be - there were missing functions, duplicated functions, and the function naming and argument conventions had little consistency.  For example, Feedrate() returns the current feedrate in units/minute, while SetFeedRate() sets the new feedrate in units/second.  GetRPM() and SetRPM() don't actually Get and Set RPM, but the S-word value.  In addition, there is the need to insert delays in certain operations, in order to get the result you expect.

As a result, we made the decision that Mach3 v4, while it would continue to support the v3 interface, would also begin the shift to a completely new VB interface with very regular naming and argument conventions, and a GREAT deal more functionality.  This new interface will make it far easier to write well-documented macros, to do more with less code, and to make maintenance and updates of the underlying code far easier.  It will greatly simplify macro writing, and enable you to do many things that are difficult, if not impossible, with the current interface.  And, it will be much easier to learn and use, with far fewer of the quirks that those of us who've done a lot of macro programming have torn our hair out over.

This manual is being published to document what is there now, primarily so that existing macro code can be more easily maintained and, if necessary, extended.  But development on this interface will eseentially cease.  So, what you see is what you get, and there will likely be no further updates or bug fixes to this code.  Instead, all efforts will be focused on the new v4 interface going forward.  The v3 interface will continue to be supported, and you will be able to enable the "legacy mode" on a script-by-script basis.  Once Mach3 v4 is released, it is *strongly* recommended that all new code be written using the new v4 VB interface.

A v4 Programmers Reference will be published in the near future, as a preview of the great things to come.

So, happy reading, and comment away!

Regards,
Ray L.
Regards,
Ray L.

Offline Dan13

*
  •  1,208 1,208
    • DY Engineering
Re: Draft Mach3 v3.x Programmers Reference Manual
« Reply #1 on: October 01, 2009, 01:27:31 PM »
Hi Ray,

It is a great job you did there! It looks very comprehensive and I hope I finally will be able to write my own macros ;)

One thing I noted at first glance was the examples for FeedRate and SetFeedRate - looks like the first FeedRate in the examples has to be replaced with SetFeedRate.

Just curious, what happens if instead of 60 you put another number, will the feedrate change accordingly?

Also, will you make the content linked to the corresponding pages?

Thank you for a great document,

Daniel

Offline Velly

*
  •  11 11
Re: Draft Mach3 v3.x Programmers Reference Manual
« Reply #2 on: October 01, 2009, 02:51:50 PM »
Great Mach3 interface demistifying job, Ray!
Can't wait for the Modbus chapter, dreaming about a Brain one ;-)
Cheers and keep moving!
Velly 
Re: Draft Mach3 v3.x Programmers Reference Manual
« Reply #3 on: October 01, 2009, 06:04:48 PM »
New version of the document below:

Fixed the first round of bonehead errors and typos.
Added headers and page numbers

Regards,
Ray L.
Regards,
Ray L.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: Draft Mach3 v3.x Programmers Reference Manual
« Reply #4 on: October 01, 2009, 06:40:54 PM »
Nice work Ray :)

Hood

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
Re: Draft Mach3 v3.x Programmers Reference Manual
« Reply #5 on: October 01, 2009, 08:37:23 PM »
Looks very good Ray.  ;)

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline RICH

*
  • *
  •  7,427 7,427
Re: Draft Mach3 v3.x Programmers Reference Manual
« Reply #6 on: October 02, 2009, 12:25:05 AM »
Appreciate the effort Ray.
RICH
Re: Draft Mach3 v3.x Programmers Reference Manual
« Reply #7 on: October 02, 2009, 12:51:47 AM »
I only took a quick peek but it looks just like what i have been wanting !
Great Job !
CRUISER
  Don
Re: Draft Mach3 v3.x Programmers Reference Manual
« Reply #8 on: October 03, 2009, 02:06:53 PM »
Latest version below.

Regards,
Ray L.
Regards,
Ray L.
Re: Draft Mach3 v3.x Programmers Reference Manual
« Reply #9 on: October 03, 2009, 10:03:04 PM »
Many Thanks Ray. Great job.

Ed
Ed VanEss