Sequence Numbers in Canned cycles
Posted 01 May 2012 - 02:22 PM
the canned cycle would be...
G71 P11 Q12 U.02 W.01 F.02
right now i have it posting...
G71 P21 Q22 U.02 W.01 F.02
how do i get it to reand the same sequence number as the block its posting for?
I have been messing with this for a while, thought its about time to ask the pros.
Thanks for any and all help
Posted 01 May 2012 - 03:25 PM
G97 S164 M03
G0 X10. Z.5 M8
G71 U.5 R.1
G71 P11 Q12 U.02 W.01 F.02
N11 G0 X7.744 S430
G3 X7.874 Z-.0462 R.0462
G0 G53 X0. Z-45.
(TOOL - 12 OFFSET - 12)
(4" CORE BORE)
G97 S150 M03
G0 X0. Z.25 M8
G83 Z-9. R-.15 F.01
G0 G53 X0. Z-45.
how do i get the next block to be 20? this is how my sequence numbers are setup now.
pheader$ #Start of file
if tseqno = 1 & omitseq$ = 1,
seqno$ = 10
seqinc$ = 1
n$ = seqno$
Posted 01 May 2012 - 03:53 PM
Though if your not outputting them on each line you will need to create a counter type thingamabob to get it.
What do you want the N # to match? Is it the Q# ?
Use the debugger to find the line that outputs the Q, then at the beginning of that line in the post you need to call your new counter variable (which needs to be defined before you can use it).
And just before you output it, you need to say (new counter variable) = (Q's variable).
Hope I'll be here to help tomorrow, just put 85" dia. 410 SS part on the machine & it's like .800 outta flat... ugggghhhhh
BTW, just looking at the bit you posted at the end.... seqno I would assume to be the starting value for your N#'s, seqinc I would assume to be the increment at which it increases.
Posted 01 May 2012 - 04:51 PM
i am trying to get the n number to post out in increments of 10. and the canned cycles to follow in increments of 1. like the canned cycle i posted. excpet instead of n20 t1212 posting out it gave me n100 t1212. i'll keep messing with it and post any results.
good luck with your part, thanks for the help.
Posted 02 May 2012 - 06:56 AM
If you can pin down where your N numbers are coming from (may be different for 1st toolpath in file)
Then put this in a line above it.
seqno$ = seqno$ +1
then directly below the output line
seqno$ =seqno$ -1
You may have to put it inside a conditional statement if that same output line is used for other situations (non-canned cycle paths).
if opcode$ = (canned cycle), [ seqno$ = seqno$ +1 ]
same thing with the -1 after the output line.
if opcode$ = (canned cycle), [ seqno$ = seqno$ +1 ]
Let me know what you run into!!! I can help you find the opcodes or whatever else you can think of that would be unique to the path (your trigger for the conditional statement) that you want the special sequence number for.
Posted 02 May 2012 - 08:38 AM
if omitseq$ = one,
ng70s = n$
ng70e = n$ + 1
ng70s is for the p value and ng70e is for the q value. that part seems to be working.
its number the other - non canned cycle toolpaths that are giving me grief. i will keep trying new things but i thought maybe that would help you understand whats going on.
Posted 02 May 2012 - 08:57 AM
Try setting up a new variable for the canned cycle sequence numbers (i.e. ncan$)
Just search for and find all the formatting/initializing for the n$ variable & copy it right below but replace n$ with ncan$
Then change all the calls for n$ (only for the canned cycles) to your new variable.
Something like this I would generally send to whomever did the original post mods.
You never know what kinda stuff they did and where it all is.
Posted 02 May 2012 - 09:23 AM
Posted 02 May 2012 - 09:42 AM
I was also scared, then I grew some ......
J/K, Good luck & let me know if I can help.
Posted 07 May 2012 - 06:07 AM
I have done this. I have my post outputting a block number at the start of every tool change sequence increasing by +1, then changed the sequence Numbers to start with N1000 and start to increase +1 on every can-cycle I produce then going back to the original sequence. You will need to create a new variable to accomplish this. The trick to this is create a new variable to store the current n$, that will allow you to maniplulate the n$ to what you desire, then recall the new variable to reastablish the n$ to the original value. What I used as a variable was "sav_numb". If you like more info on this just asked.
Posted 09 May 2012 - 09:48 AM
First make sure you
omit.gif 83.18K 51 downloads
click on image to enlarge
Then start at the list at General user variables list this should be at line 482 in your post (+/- dependending if you have other modification within your post, just look for the comment line). At the end of this list add the variable you wish to use (use something that makes sense, like “sav_numb”). Now if you like to use N1000 and so on for can-cycles and keep that number increasing each time you do another roughing operation insert two variables. Remember variables are case sensitive. After I set a variable search the entire post to see if that variable is being used (use the find case sensitive). If you only find it once you are alset to continue.
#General user variables xia : 0 #Formated absolute value for X yia : 0 #Formated absolute value for Y zia : 0 #Formated absolute value for Z cia : 0 #Formated absolute value for C “ “ “ #Formated “ “ “ #Formated “ “ “ #Formated “ “ “ #Formated rslt_plc : 0 #Return value from plcval rslt_upd : 0 #Return value from updstr sav_numb : 0 #Used to save number sequence before can-cycle pnumb : 0 #Used to save can-cycle number
Ok after that search the program down around line 3884 for prcc_call_end$ add the lines marked >>>
prcc_call_end$ #Rough canned cycle end # Restore cc_1013 to the value it held prior to the rough # 1/17/03 # groove canned cycle. cc_1013 was changed in ptoolend. # 1/17/03 if tool_op$ = 208 | tool_op$ = 62, cc_1013$ = sav_cc_1013 # 1/17/03 if tool_op$ <> 208, [ omitseq$ = sav_omitsq if omitseq$ = no$ & cc_seqno, n$ = sav_cc_st_seq #reset start of canned cycle sequence number #Close the ext file result = fclose (sbufname3$) #Open the ext file as a buffer #Use the size to determine the start and end sequence subout$ = sav_subout size3 = rbuf(three, zero) if omitseq$ = one, [ >>>> sav_numb = n$ >>>> if pnumb = 0, pnumb = 1000 #This set-up the first block number of a can cycle to N1000 >>>> n$ = pnumb ng70s = n$ ng70e = n$ + 1 ] else, [ if old_new_sw = zero, ng70s = n$ + seqinc$ else, ng70s = n$ + (seqinc$ * two) ng70e = ng70s + (seqinc$ * (size3 - one)) ] pwrite_g70 ] #Setup the stock and clearance directions g73x = vsub (lcc_xcst,lcc_xcend) if old_new_sw = zero, g73x = g73x * pl_ax_m0x else, g73x = g73x * dia_mult g73z = g73z * pl_ax_m0z xstckcc = xstckcc * dia_mult * lccdirx zstckcc = zstckcc * lccdirz * pl_ax_m0z clearcc = clearcc * lccdirz * pl_ax_m0z #Write the cycle definition sav_feed = feed sav_ipr = ipr_actv$ feed = sav_feedcc ipr_actv$ = sav_iprcc if lathecc = three, [ #Setup the previous position for inc. in G74/G75 cycle sav_xa = vequ(xabs) #Save the cycle end copy_x = vequ(lcc_xcst) #The cycle start raw pshft_map_xa pxyzcout ##The cycle start in machine terms ps_inc_calc #Recalculate incremental pe_inc_calc #Update previous at start xabs = vequ(sav_xa) #Restore the cycle end ps_inc_calc #Recalculate incremental ] if old_new_sw = zero, [ if gcodecc < three, pg71old if gcodecc = three, pg73old if gcodecc > three, pg74old ] else, [ if gcodecc < three, pg71new if gcodecc = three, pg73new if gcodecc > three, pg74new ] if lathecc = three, [ #Set the cycle end position at the original start copy_x = vequ(lcc_xcst) #The cycle start raw pshft_map_xa pxyzcout ##The cycle start in machine terms ps_inc_calc #Position at start pe_inc_calc #Update previous ps_inc_calc #Recalculate incremental ] feed = sav_feed ipr_actv$ = sav_ipr if tool_op$ <> 208, [ #Bug2 is off to prevent execution crashes with long strings bug2$ = zero #Write the cycle profile, sequence are written now rc3 = one while rc3 <= size3, [ sav_eob = eob$ #save out eob character as it's getting lost eob$ = 32 #save out eob character as it's getting lost prv_eob$ = 32 #save out eob character as it's getting lost #Write the lathe canned cycle profile string3 = rbuf (three, rc3) if rc3 = two, [ #Add the finish spindle speed to the first move speed = n1_ss #Mastercam is reporting 0 and 2 backwards for parameter 10124 #Note that G71 type 1 and 3 are never allowed (can't change Z dir) if g71type = 2 | g71type = 3, pbld, *n$, *string3, *speed, e$ if g71type = 1 | g71type = 0, pbld, *n$, *string3, *speed, "W0.", e$ ] else, [ if omitseq$ = one & rc3 = size3 + one, pbld, *n$, *string3, e$ else, pbld, n$, *string3, e$ ] eob$ = sav_eob #save out eob character as it's getting lost canneddone = one ] #Close the buffer result = fclose (three) #Remove the ext file result = remove (sbufname3$) bug2$ = sav_bug2 ] sav_seq = n$ >>> if omitseq$ = one, >>> [ >>> pnumb =n$ + 1 >>> if sav_numb > 0, n$ = sav_numb >>> ]
now your first can cycle number will be P1000 to Q1001 the next can cyle will be P1002 Q1003
PS if you have any trouble or need more info just ask.
Posted 09 May 2012 - 03:43 PM
Do you omit sequance numbering, meaning you only post block numbers at the start of every tool change not on every line?
Posted 15 June 2012 - 12:28 AM
if g71type = 2 | g71type = 3, pbld, *n$, *string3, *speed, e$ if g71type = 1 | g71type = 0, pbld, *n$, *string3, *speed, "W0.", e$ ] else, [
if omitseq$ = one & rc3 = size3 + one, pbld, *n$, *string3, e$ else, pbld, n$, *string3, e$
I remove the (multiply) *n$ to-----> n$ (in these three strings)
And she goes.....
I really miss being a full time programmer.....