Hi All,

I'm trying to build a custom post processor to use with BobCad V30 for a machine that uses it's own g-code format. I'm having trouble getting some variables to output in the correct format.

I need to output the variables in x.xxxx format, but the post processor keeps dropping the zeros and even the decimal point if the value is a whole number.

Code:
53. Line feed move XY.
   n," ",feed_move," XB",prev_x,"A"," YB",prev_y,"A"," ZR",zr,"A"," ZB",z_f,"A"," XE",x_f,"A"," YE",y_f,"A"," ZE",z_f,"A"," ",g_code_cc,cc," F",feed_rate," ",z_feed_rate," D",tool_diameter," ",t,program_block_8

64. Arc move XY.
    n," ",g_arc_move,program_block_9," ZR",zr,"A"," ZB",z_f,"A"," XE",x_f,"A"," YE",y_f,"A"," ZE",z_f,"A"" ",xcenter,"A ",ycenter,"A ",zcenter,"I ",g_code_cc,cc," F",feed_rate," ",z_feed_rate," D",tool_diameter," ",t

2008. Program Block 8. store x y end values from g101 moves
    xb = MILL_GetXFeed()
    
    yb = MILL_GetYFeed()

2009. Program Block 9. Fix start of arc xy
    MILL_SetReturnString (" XB" & xb & "A" & " YB" & yb & "A")
So the problem is actually line 64. I intended to use "prev_x" & "prev_y" instead of "program_block_9" (similar to line 53), but the output on arc moves was some insane value that made no sense (I assume background computations that overwrite the "prev" values). so I grab the x/y values from the last linear feed modes using program block 8 and output them in line 64 using program block 9.

output needs to be
Code:
N5 G101 XB-0.5000A YB+1.0100A ZR+0.1000A ZB-0.5000A XE+0.5000A YE+1.0100A ZE-0.5000A TC2 F45.0 FZ22.5 D0.5000 T01;

N6 G102 XB+0.5000A YB+1.0100A ZR+0.1000A ZB-0.5000A XE+0.5100A YE+1.0000A ZE-0.5000A XC+0.5000A YC+1.0000A ZC+0.0000I  F45.0 FZ22.5 D0.5000 T01;
instead I get
Code:
N5 G101 XB-0.5000A YB+1.0100A ZR+0.1000A ZB-0.5000A XE+0.5000A YE+1.0100A ZE-0.5000A TC2 F45.0 FZ22.5 D0.5000 T01;

N6 G102 XB0.5A YB1.01A ZR+0.1000A ZB-0.5000A XE+0.5100A YE+1.0000A ZE-0.5000A XC+0.5000A YC+1.0000A ZC+0.0000I  F45.0 FZ22.5 D0.5000 T01;
which I think the control will accept, but when the variable equals a whole number I get
Code:
N30 G101 XB+1.0000A YB+0.5000A ZR+0.1000A ZB-0.5000A XE+1.0000A YE-0.7500A ZE-0.5000A TC2 F27.0 FZ13.5 D0.5000 T01;

N31 G102 XB1A YB-0.75A ZR+0.1000A ZB-0.5000A XE+0.7500A YE-1.0000A ZE-0.5000A XC+0.7500A YC-0.7500A ZC+0.0000I  F27.0 FZ13.5 D0.5000 T01;
which the control will not accept.

Code:
xb = MILL_GetXFeed()
xb = round(xb,4)
does nothing to help.

Post processor attached.

Can anyone help me figure this out? Also, Bobcad had a scripting "bible" they put out years ago, but I can't find any sign of it. Can anyone point me to any good resources that will help me better understand bobcad scripting.

Thanks