Hello Guest it is April 27, 2024, 12:37:18 AM

Author Topic: Hello world example?  (Read 3332 times)

0 Members and 1 Guest are viewing this topic.

Hello world example?
« on: December 06, 2014, 08:13:08 AM »
I'm beginning to look at macro/programming options available in Mach3.

Is there more than one programming "interface" available?  I hear/see terms like Macro, BAISC, Cypress BASIC, etc., not sure what options are available.

As a start I thought I'd convert my LazyCam Z-Optimizer (removes redundant Z up/down created by LazyCam) and I've found the Cypress manual it seems like it would have everything I need.

If there was a page where it shows how to get Mach3 to run some very simply code to display "Hello world" or something on the screen or anything, that would be helpful to get me started.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Hello world example?
« Reply #1 on: December 06, 2014, 01:12:50 PM »

Is there more than one programming "interface" available?  I hear/see terms like Macro, BAISC, Cypress BASIC, etc., not sure what options are available.


All are basically the same thing. Mach3 uses Cypress Basic, which is nearly identical to Visual Basic Scripting.

Go the the Mach support website to get all the docs you need.

The Mach2 Customization guide covers the development of wizards.
There's a Mach3 programmer's reference as well.

For creating wizards, you'll need to use a screen designer. Either Screen 4, or Machscreen.

You can assign a script to a button in Mach3, using Operator > Edit Button Script, but you have to designate the button as a VB button in the screen designer to be able to do this.

You can also save your script and call it as an M code in your g-code by saving it as M*********.m1s, in your Mach3\macros\yourprofile\ folder.Only use M codes greater than 100, ie, M101, M650, ...

Code: [Select]
Msgbox "Hello World"
will get you a message box with your message.

Code: [Select]
Message "Hello World" will put your message in Mach3's Status bar.

Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Hello world example?
« Reply #2 on: December 06, 2014, 10:11:13 PM »
Thanks a ton Gerry.  I was able to give that a shot so now I'll work through the reference manuals and see what I can do.
Re: Hello world example?
« Reply #3 on: December 07, 2014, 09:56:21 AM »
Wow that is slick, I was able to produce a working Lazycam Z-Optimizer in just a few minutes.