View Full Version : mathematical functions supported by Open SBP Programming Extension

07-21-2012, 01:02 PM
Hi, y'all!

I have been using Excel to generate some fairly simple 3D cutting instructions. But I'm quickly getting to the point where I need to start programming nested loops and that's just not something Excel is terribly good at. (The reason I'm generating cutting paths directly rather than using a tool is that I need to/want to calculate them based on parameters.)

Rather than switching to a real programming language, I thought I'd try skipping the middle man and program directly in Open SBP. However, the SB programming manual is a bit sparse on information regarding support for mathematical functions. It just says "most mathematical functions are supported" and goes on to suggest I just try it in the calculator. Surely somewhere there's a list of the supported functions and how they're implemented in SBP?

I've found that trigonometric functions (at least sine) are supported. That's great. Unfortunately they take radians as an argument and I can't figure out a function to convert from degrees to radians or a function or system parameter for 'pi'. (I'm also just pig-headed enough not to just set &pi=3.14159265. Why? Because I shouldn't have to!)

So, if you're still with me, you will be my hero if you can tell me:
a) Where are the supported math functions documented?
b) Specifically, what is the function to convert degrees to radians? Or, how do you get SBP to spit out the number 'pi'?

Thanks for reading!

07-21-2012, 01:18 PM
a) The programming handbook is it.
b) set &pi=3.14159265 :p;)

As a programming language SBP is very clunky, as a control language I find it great compared to the alternatives I've used.

I find I can do most things I want in it but when I can't I use a "proper" programming language and write the SBP file out from that with all the numbers calculated and in place already.

07-21-2012, 01:31 PM

The available functions are documented in "Calculated_Functions.pdf" that's installed in the C:\Program Files\ShopBot\ShopBot 3\Help folder

Every time the ShopBot software is started, a variable for pi is loaded into memory and available for your use. It's &_PI

07-21-2012, 01:35 PM
Adrian - It's supposedly loosely based on BASIC, so clunky is a given. And, no, you don't get to be my hero for giving snarky answers. ;)

Bill - You, on the other hand, are absolutely my hero! Thank you!

07-21-2012, 03:48 PM
Oh well, looks like I only think I know everything. :D