PDA

View Full Version : Passing variables using the FP command



briankorsedal
08-20-2008, 09:45 PM
Hello, I recently joined a group called FabLab in San Diego ( http://en.wikipedia.org/wiki/Fab_lab ). They have a shop bot. I downloaded the manual for the shopbot language.

What I want to do is write a file full of subroutines for doing some highly complex, interlocking edges. The eventual goal is to be able to design a 3-d surface in Blender and have the shop bot automatically cut the polygons out of plywood with the edges calculated perfectly to slide all the polygons together and form a large 3-d shape.

Is there a way to pass variables from one file to another?

I want to write a file with some subroutines which would act as a 'driver' to produce the interlocking edges. A .spb program would call something like:

FP edges.spb &end_point, &material, &cutter, &edge_type, &angle

All these variables would be passes to the edges.spb file.

Any easy way to do this?

harryball
08-20-2008, 10:40 PM
When you define a variable in one file that calls another file, the variable is available in all called files... consider all variables GLOBAL so be careful.

/RB

beacon14
08-21-2008, 01:10 AM
Robert mentions probably the easiest way to do what you want. Once you define the variable it will persist until it is re-defined, cleared from within the [U]tilities [V]alues screen, or the session is ended.

It is also possible to write values to a text file and/or read them from a text file from within a .sbp file. For details look for the "SbW_ShopBotProgrammingStatements.txt" file in the Program Files\ShopBot\Developer Tools\Docs folder.

bill.young
08-21-2008, 04:05 PM
Hi Brian,

There's a file installed in the "C:\sbparts\custom" folder named "my_variables.sbc" that works just the way that Robert and David describe. It's full of variables that are specific to your ShopBot and is called with an FP command when the XYzero or Zzero routines are run, so that things like the X and Y prox switch offsets and Z-zero plate thickness are loaded into memory.

I think David meant the [UL] command..it lets you check the value of all the variables in memory, delete variables, and write all the current variables and their values to a file.

Bill

beacon14
08-21-2008, 11:37 PM
Whoops, good catch Bill.