Post Processors - in depth (If statements?)

This section is for useful tips and tricks for Aspire

Post Processors - in depth (If statements?)

Postby frare bear » Wed Feb 01, 2017 10:56 pm

Hello again :)

I've had good success modifying my post processors to move spindle 1 or spindle 2 (spindle one runs of x,y,z signals, and spindle two runs of x,a,b signals).

However, now I'd like to streamline things and get one post processor that can determine which spindle it needs to move, and output the appropriate code. Essentially I just need an "If" statement within the post processor... If tool one is equipped, output x,y,z and if tool two is equipped, output x,a,b

Does anyone have any experience with something like this? I feel like it might be somewhat similar to tool change programs, so I'm about to dive into those and see what I find.

Is there a specific language it's written in? Lua?

Thanks for any feedback!
frare bear
 
Posts: 4
Joined: Mon Jan 30, 2017 12:42 am
Model of CNC Machine: Shopbot Alpha 4848/Homebuilt 2475router

Re: Post Processors - in depth (If statements?)

Postby Adrian » Thu Feb 02, 2017 9:42 am

It's the language that your machine uses rather than the post processor code in this case. From your profile it looks like you have a ShopBot in which case it's very easy. You can call ShopBot routines directly from the Post Processor and embed any SBP programming code directly into it as well.

This the header from my own customised ShopBot PP which has a couple of IF statements in it. The SBP language is pretty primitive when it comes to control flow but you can get by with it. Note that the [34] is the ascii code for double quotes as the SBP language needs the quotes but they have to be embedded within quotes for the PP language.

Code: Select all
"Print [34][TIME] - [DATE] - [ZLENGTH]mm[34]"
"Print [34]Z Origin  = [Z_ORIGIN][34]"
"IF %(25)=0 THEN GOTO UNIT_ERROR   'check to see software is set to standard"
"IF [XLENGTH] > [YLENGTH] THEN GOTO XDOM"
"Print [34]Short edge on long axis.[34]"
"GOTO YDOM"
"XDOM:"
"Print [34]Long edge on long axis.[34]"
"YDOM:"
"SA                                'Set program to absolute coordinate mode"
"CN, 90"
"Print [34]Toolpath Name  = [TOOLPATH_NAME][34]"
"&PWZorigin = [Z_ORIGIN]"
"&PWMaterial = [ZLENGTH]"
"&ToolName = [34][TOOLNAME][34]"
"&Tool = [T]"
"C9"
"TR,[S],1"
"C6"
"MS,[FC],[FP]"
"JZ,%(28)"
User avatar
Adrian
Vectric Archimage
 
Posts: 9214
Joined: Thu Nov 23, 2006 2:19 pm
Location: Surrey, UK
Model of CNC Machine: ShopBot PRS Alpha 96x48


Return to Aspire - Tips and Tricks

Who is online

Users browsing this forum: No registered users and 4 guests