Go Back to handibot.com
sign up or log-in


Macro Docs

Posted by Zeeri 
Macro Docs
August 22, 2017 06:03PM
Can someone point me to a guide/docs for writing macros? I have built a custom Z centering device and am modifying a copy of the corresponding macro (#2). Unfortunately I am not getting the correct result (z is 1.6 inches above the work piece when fabmo says it should be 2"). I need documentation that will explain the various commands. Thank you.
Re: Macro Docs
August 22, 2017 07:29PM
I just switched to metric from imperial and tried to re-run the macro. Interestingly it did not appear to be moving the router along the z-axis toward my grounding plate. Instead it was making a growling noise. Upon closer inspection it appears that it is in fact lowering, but so slowly you can barely see it. My guess (without docs on the macro language and commands) is that the macro is not setup to handle being in Metric mode and the speed value assumes inches! Whoops. Hopefully when I get my hands on the docs I can find a way to detect the measurement mode and adjust the speed value accordingly (if my assumption is correct).

My macro is just the standard z-zeroing macro (2) minus the x/y movement, checking for clip, and some of the extra height added to the resulting zero value when finished.

All I am doing is using a circuit board bit wired to the frame where the old zeroing plate was (it bent a long time ago due to the darn clip not being in place). I place the circuit board on my work piece and let it go.
Re: Macro Docs
August 22, 2017 10:54PM
Take a look at this doc: [www.shopbottools.com]

Those danged plates! We should make them outta spring steel! (actually not joking...will look into this)
Re: Macro Docs
August 23, 2017 12:19PM

That document covers 80% of what I need to write a functional macro.

As I examine macro #2 (the original Z zeroing macro), I am seeing commands like `VA,,,-.25,,,,,,-.25`. Where can I find the parameter lists and detailed function descriptions for routines like this one? They appear to be GCode commands, but I am having some difficulty finding a proper documentation of all GCode commands and their parameters (or at least those used by the Handibot). Would you point me toward such a document please?

Thank you.
Re: Macro Docs
August 23, 2017 12:32PM
You know--strangely enough--the way that I look up what each field means when I'm writing a macro is to open the old shopbot control software (available for free on the shopbottools.com). When you type in a command on the main screen (like VA) an fill-in sheet automatically pops up with the fields labelled. If you fill in the fields to do what you want and then hit Enter--it will send that command...then you can simply copy and paste it into your code. Some of these old commands have so many fields that it gets pretty tedious to count commas when trying to change something that is way down the list on the fill-in sheet. I find that working through the shopbot software keeps my errors to a minimum. There definitely should be a doc for this--but up until recently, everyone was working in the shopbot software already so the fill in sheets were very convenient for this type of thing.
Re: Macro Docs
August 23, 2017 01:31PM
I found the shopbot control software page and downloaded what appears to be the latest version (3.8.42 6/27/16). I had to go to the help button (?) and tell it to get out of simple mode (forgot the exact wording) in order to see the command console. It is now performing as you described. Thank you!
Re: Macro Docs
August 23, 2017 01:36PM
Agh! The simple mode! If anyone here is a shopbot user as well as a handibot user...switch out of simple mode asap! I haven't used simple mode since the first day that I worked at ShopBot and I always forget that it is the default--so when I start giving tech support to someone using SB3 I'm always telling them to hit buttons that aren't there on their version and it takes me 5 minutes to remember to tell them to switch to full mode!
Re: Macro Docs
August 24, 2017 11:20AM
One followup question:

I am trying to get the macro to output some system variables so I can debug what is happening. I'd like them to be messages in a dialog, similar to the comment/pause pattern for displaying a message and waiting before continuing the script. The docs you directed me to indicate there are several ways to do this, but none appear to work (they are all marked red in the macro editor indicating an error, and they generate an odd error when run).

Here is what I have tried (mostly cut and pasted from the docs):
INPUT "You Entered - " & &variable & " Is this Correct? Y or N"; &test
MSGBOX ( "Do you want to open the keypad?", YesNo, "Start Keypad?")
PRINT "Hello"

The error is: "Expected "*", "+", ",", "-", "/", [\t], [^,\n"] or end of input but "\"" found.

Removing the quotes on PRINT "Hello" to PRINT Hello does get rid of that error (commented other tests), but the code doesn't do anything (Hello message not actually displayed).

Are these not supported? What is supported that would do what I want? Can I add variables to my comment somehow?

I also tried this (didn't work):
'This is a test: %(25)
Re: Macro Docs
August 24, 2017 02:55PM
I'm checking with the guys who ported the shopbot language to fabmo to see how they handled that.

As you get more advanced in what you want to do--you may want to try writing an app for your routines. An app will allow much more flexibility and a visual interface. You could have check boxes for the different configurations and offsets, fields to enter part size and messages that display more detailed information.

In an app, you can create a file on the fly and run it from the app. The way that I do this is to create a variable called SBP--for each line of your routine just add to that variable:
SBP+= "C6" + "\n"
SBP+= "MZ, 0.5" + "\n"
SBP+= "MX," + (machinesizex - bitdiameter) + "\n"
SBP+= "machine size x = " + machinesizex + "bit diameter = " + bitdiameter + "\n"
SBP+= "PAUSE" + "\n"

where \n signals a line break in the machine code.
Re: Macro Docs
August 24, 2017 03:02PM
The "Example App" has some good examples of code to create an interface. You can "inspect" it in the browser to see how it was written.
Sorry, only registered users may post in this forum.