PDA

View Full Version : Advnced Programing Question



jve
03-05-2007, 10:36 AM
We would like to know how to write a program for drilling holes for drawer slides. We have a hole pattern *.sbp file written in part wizard and we know how to write a custom cut file in ShopBot that includes that hole pattern in it, but what we want to do is this: We want to be able to enter a "X-Axis" value to tell the comuter where we want the hole pattern to be drilled along that axis. Then have a prompt pop up asking to "exit?" or "cut again at 'X'" where "X" is another value we could enter at that time. This process to be repeated as many times as needed. we know it's possible but need some programing help. thanks.

paco
03-05-2007, 11:30 AM
I think that could be a start:

quote:INPUT "Name of the file?(Copy and paste the name)" &file_name

'Turning router ON
SO,1,1
PAUSE,2

LOOP:
INPUT "X position?" &x_position

INPUT "Y position?" &y_position

JZ,%(28) 'That refer to VC Safe Z

J2,&x_position,&y_position

JZ,0.04 'Quick plunge above the material

FP,&file_name,,,,,2 'Make sure the call up file behave as intended...

INPUT "Again? (Y or N)" &again

IF &again = Y THEN GOTO LOOP
IF & again = N THEN GOTO END

END:
'Turning router OFF
SO,1,0
'Congratulations for all those holes!
PAUSE
JH
END
...may require some tweaks for your particular application.

paco
03-05-2007, 11:32 AM
Sorry, I put an Y position variable when you only wanted the X one...

jve
03-05-2007, 03:49 PM
thanks paco, i'll give that a try.

jve
03-05-2007, 05:02 PM
Hey Paco,
that program wasn't exactly what we were looking for BUT it did point us in the right direction so that with a few edits to your program and the sub program in it we were able to get the results we were looking for! thank you so much! here's how our program ended up looking:

LOOP:
INPUT "Starting X Position?" &x_position

JZ,%(28) 'That refer to VC Safe Z

JX,&x_position,

FP, <OUR FILE>

INPUT "Again? (Y or N)" &again

IF &again = Y THEN GOTO LOOP
IF & again = N THEN GOTO END

END:
'Turning router OFF
SO,1,0

we had to get rid of your comands for the 'y' axis and then go into our sub program and get rid of all the 'x' axis inputs that were in it so that all the 'x' coordinates were given in the prompt. we have not yet actually tried a dry run on the machine yet, but in preview mode all looks good. thanks again!

paco
03-05-2007, 06:25 PM
Glad it help.

Don't forget about the 2D offset on your file call up.

srwtlc
05-16-2007, 07:41 PM
I'm making a custom cut file and have a GOSUB that calls up the Zzero file (C2) and then is supposed to RETURN. I'm finding that it won't return to where it branched off from. It seems to want to return to around line 119 all the time, which is somewhere way down from where it GOSUB'd

Any ideas?

paco
05-16-2007, 08:26 PM
Hmmm...

So you have a SUB that call (FP,...) C2 and end with RETURN?

If the rest work fine (without the SUB) then you might want to sort out what's wrong with the SUB. Is it the SUB itself; try changing the code to something silly but simple like PAUSE then RETURN. If it then work, the problem would be with the the SUB content, maybe the C2 routine...

If you cannot sort out the problem, we'll (at least I) need the codes to have a look at.

bjw
05-16-2007, 10:36 PM
Hi Scott,

Here is most of a section of a program I wrote to do bit changes Safely. I may have some extra stuff in it that's not necessary (it ain't pretty) but it works. The return takes you back to the last INPUT statement that took you to the subroutine.

'**********************************************
SA, 'SET TO ABSOLUTE CO-ORDINATES
&ZUP=0.2500
JS,10,4

WAIT1:
&ANSWER=""
INPUT "WAITING! WHEN READY TO CONTINUE TYPE 'RUN' OR TYPE 'END'TO QUIT, THEN HIT ENTER(RUN/END)?" &ANSWER
&ANSWER="&ANSWER"
IF &ANSWER="RUN" THEN GOTO CONTINUE1
IF &ANSWER="END" THEN END
GOTO WAIT1

srwtlc
05-16-2007, 11:31 PM
I worked on this a bit last week and revisited it again today for awhile.

I think that I tried just some dummy code in the sub then and it returned fine. I didn't call up the Zzero file by a FP, just C2. I don't know if that would make a difference, but should try it too.

It does seem to be the C2 (Zzero.sbp) that causes the problem though.

Here's what I'm doing. Nothing too tough, just a time saver for the thousands of plaques and other items that I do that need hangslots on the back of them. It's not finished yet, hence the blank sections. I probably don't need that part in the file, just thought it would be nice to have the option.

Hmmm...tried to paste it here, but the forum doesn't like some of the words/formatting I guess. File attached instead.
Hangslotter

4632 (4.7 k)

srwtlc
05-16-2007, 11:39 PM
BJ,

You snuck in there while I was typing and having some Rhubarb pie.
4633

Maybe I should try a PAUSE for a few seconds and see if that helps.

bjw
05-17-2007, 12:19 AM
Had some home made Strawberry Rhubarb pie last Sunday at the in-laws! Great stuff!