PDA

View Full Version : Need some expert help



doglaw
02-24-2007, 09:49 AM
I wrote a part file to help me machine the bottom plates for violins. I designed the bottom plates to be cut on material 16 x 8.594 x .625. However, I want to be able to cut the file on different material sizes so I wrote the part file to allow me to specify the material size and if figures out the placement.

Here's the problem. I have two custom files that I call. C2 is the zzero routine and C4 is my 'find home' routine. I put a conditional statement before my calls to C2 and C4 that prevents them being called if I am in preview mode. In preview mode, my part file runs the way I expect. However, when in move/cut mode - things don't work quite the way I expect. It runs fine up until the first C2 call. It executes the C2 call - but on return, program control ends up in the wrong place. It acts as if the stack is getting corrupted somehow. Any thoughts?
my part file

3812 (6.4 k)
C2 file

3813 (0.2 k)
c4 file

3814 (5.1 k)

richards
02-24-2007, 12:46 PM
Douglas,

You've done a nice job programming!

I think that you're correct about the stack. Remember that when you run FP, you're not running a subroutine but starting a completely new program - which most probably has its own stack.

Have you thought about writing your own Z-zero and alignment routines and then calling them as subroutines that are part of your test.sbp program?

doglaw
02-24-2007, 03:24 PM
Mike:

Thanks for the reply. No - I hadn't thought about making the custom calls a subroutine - but it is really a good idea. One that I am going to try. Thank you much for the suggestion.

Doug