Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Cantext Question: Long Post Thanks for Reading


crazy^millman
 Share

Recommended Posts

Ok everyone cantext question and post question as well. I am building my logic for wait codes using the Cantext option. I think this will work better since I am wanting precise control over where they are put in the posted code. I have built my strings and have 400 places as a start if I need more I will add to it. Here is my thought process so those that know please help here if I am heading down the wrong path.

 

Step one I have a String set-up like so:

code:

sp10     P10    #P wait code

sp20 P20 #P wait code

sp30 P30 #P wait code

sp40 P40 #P wait code

sp50 P50 #P wait code

............

............

sp10 P370 #P wait code

sp10 P380 #P wait code

sp10 P390 #P wait code

sp10 P400 #P wait code

swcode #Target for string

 

fstrsel sp10 pwcode swcode 40 -1

Ok now in my pcant_out I am going to have it like so:

code:

#CanText 11 P wait codes defualt to run operations in Squence operations as programmed in Mastercam   

if cant_pos = 11, #P wait code output Start at P10 Increments by 10 and is placed by default at the Home positions.

[

if cantext$ = 11, pwcodes + 10

rslt_upd = updstr (swcode)

strcantext = strcantext + swcode

]

Ok have not tried this but feel ok with it now the big problem. I want control in between then 10 blocks, but do not want to resort to having 400 strings for my wait codes which will then make P10, P11, P12, P13 and so forth. I really want the P10, P20, P30, and so forth, then when I want precise control I will pick up the P amount from Cantext 11 and use it if I write logic for Cantext 12 to do the wait code 1 to 9 in between the 10 increments of the wait codes. headscratch.gifheadscratch.gifheadscratch.gif

 

I have seen this :

code:

         if cantext$ = 7 | cantext$ = 8,

[

if cantext$ = 7, chute = zero

else, chute = one

rslt_upd = updstr (schute)

strcantext = strcantext + schute

]

I am wondering if I can make some logic here to take the value from cantext 11 and then if I use cantext 12 it takes the last value and uses it as the base and then assigns a value to look back in the P string for the in between P codes to work from.

 

I think i am going to be less picky about my codes and deal with either P11, P12, .... or have my P10,P20 ........ go to P1000.

 

What are some others thoughts on this. Any suggestions or help is greatly appericated.

Link to comment
Share on other sites

Ok well scratch above looks heading in the wrong direction seems as though trying to do math in a Cantext does not work very well since it operations driven. So I guess the next course of action is the wonderful world of buffers. mad.gifmad.gifcurse.gifcurse.gif So I will see how far I can get with this and post up help when I get stuck since I know I will.

Link to comment
Share on other sites

Just thinking out;

 

How about just using the canned text for signalling a pwait postblock;

 

code:

     if cant_pos = 11, pwait_10 #P wait code output Start at P10 Increments by 10 and is placed by default at the Home positions.

if cant_pos = 12, pwait_1 #P wait code output Start at pwait10 and Increments by 1 and is placed by default at the Home positions.

code:

pwait_10

if pwcodes <> sav_pwcodes, pwcodes = sav_pwcodes

pwcodes = pwcodes + 10

sav_pwcodes = pwcodes

pbld, n$, pwcodes, e$

code:

pwait_1

pwcodes = pwcodes + 1

pbld, n$, pwcodes, e$

Link to comment
Share on other sites

Tim no dice for some reason it does not want to seem to do the math correctly inside the post when using the cantext. I think it is a matter of approach. I got this to work:

 

code:

ltlchg$          #Toolchange, lathe

toolchng = one

gcode$ = zero

copy_x = vequ(x$)

pcc_capture #Capture LCC ends, stop output RLCC

c_rcc_setup$ #Save original in sav_xa and shift copy_x for LCC comp.

pcom_moveb #Get machine position, set inc. from c1_xh

c_mmlt$ #Position multi-tool sub, sets inc. current if G54...

prdbturret, e$

ptoolcomment

comment$

if home_type < two, #Toolchange G50/home/reference position

[

sav_xh = vequ(copy_x)

sav_absinc = absinc$

absinc$ = zero

start_xh = vequ(xh$)

pmap_home #Get home position, xabs

ps_inc_calc #Set start position, not incremental

#Toolchange home position

if home_type = one,

pbld, n$, *sgcode, pfxout, pfzout, pwait_10, e$ #<---- Added wait code

 

mtlchg$ #Toolchange, mill

toolchng = one

gcode$ = zero

copy_x = vequ(x$)

pcom_moveb #Get machine position, set inc. from c1_xh

c_mmlt$ #Position multi-tool sub, sets inc. current if G54...

prdbturret, e$

ptoolcomment

comment$

if home_type < two, #Toolchange G50/home/reference position

[

sav_xh = vequ(copy_x)

sav_absinc = absinc$

absinc$ = zero

start_xh = vequ(xh$)

pmap_home #Get home position, xabs

ps_inc_calc #Set start position, not incremental

#Toolchange home position

if home_type = one,

pbld, n$, *sgcode, pfxout, pfzout, pwait_10, e$ # <----- Added Wait Codes

 

pl_retract #Retract tool based on next tool gcode, lathe (see ptoolend)

cc_pos$ = zero

if home_type = one,

[

xh$ = vequ(start_xh)

pmap_home #Get home position, xabs

ps_inc_calc #Set inc.

pbld, n$, psccomp, e$

#if css_actv$ & css_end_rpm & not(lathe_stop | synch_flg | n1_gcode = 1003 | n1_posttype <> posttype$ | n1_spindle_no <> spindle_no$),

#[

#pspindle

#prpm

#]

pcan1, pbld, n$, *sgcode, pfxout, pfzout, [if drop_offset, *toolno], pwait_10, e$ #<--- Added Wait Codes

 

Then for the logic:

pwait_10 # Added thanks to Tim Johnson

if mi10$ = 1,

[

if pwcodes = sav_pwcodes,

pwcodes = pwcodes + 1

#sav_pwcodes = pwcodes

pbld, n$, *swcode, "(MODIFY AS NEEDED)", e$

]

else,

[

if pwcodes <> sav_pwcodes, pwcodes = sav_pwcode

pwcodes = pwcodes + 1

sav_pwcodes = pwcodes

pbld, n$, *swcode, e$

]

The mi10$ gives me sync operation control to another operation then I have 9 places to sync code in that operation manually.

 

So now to the root of Cantext and see if you get the same thing out of this that I do:

code:

        if cantext$ = 5 | cantext$ = 6,

[

if cantext$ = 5, tlstk = zero

else, tlstk = one

rslt_upd = updstr (stlstk)

strcantext = strcantext + stlstk

]

if cantext$ = 5 | cantext$ = 6, with this statement the post sees if you are using cantext5 or cantext 6 to use the condition statement below this.

if cantext$ = 5, tlstk = zero so with this statement it looks to the string where the tailstock codes are and since sm26 is the default it knows to insert M26 into the posted code when it is selected at the stlstk. With that the else is skipped and it continues.

else, tlstk = one Where as if the cantext6$ is used then the tlstk is given a value of one. This then triggers the string again to look to the next value which is sm25 then output the M25 code at the stlstk. I understand this and it makes sense. Now is where I am getting a little lost.

rslt_upd = updstr (stlstk). I see where it goes in the post to apply the string varaibles. It then makes it equal to the varaible updstr. Then this has (swstr) which goes to another string where the Planes selection code output is. This is where I wonder what is going on you are are using a tailstock what does it matter what plane you are in?

strcantext = strcantext + stlstk here it takes the place holder in the posted code for it from above and then added the stlstk value established above in the logic to then output the desired value.

 

What I get out this is that cantext is a simple variable driven method to get values and if I am trying to use it for my wait codes I need to have what I think is a good number of wait codes in my string defintion. I then need to expand my cantext selection ability by that number then write the logic accordingly so that is I want P121 I have to go in the operation select cantext 1121 then it will go back to my logic in the cantext see I am wanting P121 using the same logic above and output it. I have tried using Tim's method above and a lot of different ones to do wait codes using math and it is just not doing what I want.

 

So my question am I out in left field with my approach? I have something that gets me by and using it. I want to get it better and hoping I have not go to write logic to support 400 string variables as well as expand the cantext as well to accomplish this. Are there limits on the amount of cantext numbers? Are there limits on the string variables I can use?

 

If you got this far thanks for reading and any thoughts or help is greatly appreciated.

Link to comment
Share on other sites

Ron,

 

In canned text you are only allowed 100 entires (0-99). So if you need more than 100 wait codes, you got some work to do. If 100 will suffice, then simply use the mechanism where the cantext value selected outputs the P code with the cantext value (IE p10, P11, P12, etc). This is the default output for selecting a cantext value not supported in the post (Ie cantext 80 will output an M80). If you need more that 100 P codes, then you got plenty of work to do.

 

Now the problem with canned text is that it is not available everywhere. for example. canned text is available at the toolchange, good for going op to op syncing, but if you are looking for more detailed control and trying to add syncs inside the toolpath motion for example, well you need to use the canned text in the change at point menu and the problem with this is dealing with depth cuts and what points in a toolpath are actually selectable based on the toolpath type. I can provide some additional info on this if needed.

 

Hope this helps.

Link to comment
Share on other sites

Jim Thank you cheers.gifcheers.gif and yes the specific control is what I am really looking for. I really want my basic wait codes to go by 10. I am thinking 10 places will be enough to sync inside an operation to an other operation, but if not the cantext way to me really is the answer that way I have now traps me to 10 and if I need 20 places to sync 2 operation to each other that in turn becomes the problem. If you can send me additional information I would appericate it and plan on sharing my efforts with IN-House and as well back to CNC so that it may help others who may not go up to X3 and are stuck using older versions of Mastercam to accomplish these same tasks.

 

One thought I had was being able to use my method with the cantext so I get the best of both worlds. I get it at the home position moves, by increments then when I want to be specific I use the cantext to get my control, because like you said cantext has it limits and by using both I could overcome it if I could figure out how to do it. I will say I have learned a ton about posts and strings and such. I think if it is possible the only way I would accomplish the above task would be to tackle buffers. I then could get what I am after, but now this give me another problem my head hurts. biggrin.gifbiggrin.gif

Link to comment
Share on other sites

I'm at home with no post to look at so what I type may not be exactly accurate but here was my idea...

 

Actually my idea with the canned cycles were to remove the cycles you're going to use from the (comments) and use them the same way as you would a mi/mr.

code:

     if cantext$ < 5 | cantext$ > 9, comment$

I don't know if this would work but it should. I'll be finding out in a month or two myself since I'm out of mi/mr room.

 

Using the mi10$ would be much easier to use for total control but you would need a cheat sheet for the options. Using the cannedtext$ (if possible) you would be limited to one variable for each entry, but the (text) shown will have the process info and the variable value. You also would have the benefit of three choices as to where it would be added.

 

I haven't programmed a mill/turn (yet) bit if I'm understanding you correctly;

 

You want to either add 0,1 or 10 to your wait codes. If thats the case you would need three text entries. You also need one entry to turn off the wait codes?

 

Everytime you reset your wait codes you want it to start in a multiple of 10 and then you either want to use the same wait code for simultaneous work or add 1 for the next segment.

 

Here's a modified idea assuming;

canned text 5 = reset and add 10 to the wait codes

canned text 6 = add 1 to the wait codes

canned text 7 = simultaneous work

canned text 8 = wait code end

code:

     if cantext$ < 5 | cantext$ > 8, comment$

if cantext$ > 4 & cantext$ < 9, pwait #put wherever you need it...

code:

pwait

if cantext$ = 5, #reset and add 10 to the wait codes

[

pwcodes = sav_pwcodes #resetting to the previous multiple of ten

pwcodes = pwcodes + 10

sav_pwcodes = pwcodes

pbld, n$, *swcode, pwcodes, e$

]

if cantext$ = 6, #add 1 to the wait codes

[

pwcodes = pwcodes + 1

pbld, n$, *swcode, pwcodes, e$

]

if cantext$ = 7, #simultaneous work

[

pbld, n$, *swcode, *pwcodes, e$

]

if cantext$ = 8, #wait code end

[

pbld, n$, *swcode, e$

]

You would need to fix swcode for your wait codes start/end switch or use your tailstock code.

 

I'm not sure if this will work but it seems logical enough.

 

[ 09-01-2007, 12:45 AM: Message edited by: Tim Johnson ]

Link to comment
Share on other sites
  • 3 weeks later...

quote:

Well Tim is looking at this now anyone else had luck with this stuff??

I do not even understand what the heck you guy's are talking about headscratch.gif

 

I picked up "Wait" and "Tailstock", I am figuring it is for a lathe, Ron would you mind explaining in short what "crazy" road you are heading down biggrin.gif

This stuff is way over my head, but it got me curios

 

Thanks

Lars

Link to comment
Share on other sites

Ok let see if I can share my experience on this.

 

With a machine with dual turrets you can use both turrets to do cutting at the same time. The problem you run into with Mastercam is that you can not write an operation to use 2 tools and do 2 things at the same time you have to write the operations as separate operations in order to do something like this. Well that is where the problem is. How do you know where the other turret is and what it is doing to prevent crashes? Answer is you do not unless you have verification software or someone else's software that has this already built into it.(BTW been around for over 7 years that I know of)So how do you control 2 turrets coming at each others and keeping them from crashing well every machine I have run from Swiss to Dual turret use wait codes to limits or control where and how something does what. So if you want to drill with the upper turret and the turn with the lower turret you need to know where when and how each is going to get to those point and also which is going to drive the operation so to speak. Some people call the Master/Slave others call this Parent/Child. What ever the relationship the Drill needs to be the driving spindle speed for the operation since ramping up as you get smaller in Diameter is going to cause all typesw of problems for the drill.

 

Now some people look at this and say why not just wait well if you are doing 1000 parts and can cut 35 seconds out of a part by cutting the outside diameter while drilling a hole that is over 500 minutes saved. If you can do the same thing with a roughing and finishing operation where when you take your last rough cut with the lower turret and you then follow with the finish tool in the upper turret. You might could shave another 20 seconds off the run time again saving 333 minutes of the run time. Now on one part you just saved almost 850 minutes and at out shop rate that would be $1200 profit over a standard single turret lathe. Now you see some advantage here now lets get back to the problem at hand wait codes.

 

You want to control everything down to where point A to Z is why I do not recommend Canned cycles when doing synchronization cutting inside of Mastercam you lose that control. So you know a drill is going to take 35 secondS to drill and the roughing operation is going to take 1:30 seconds now it becomes a matter of chance. So I would sync my toolpaths like in the code below:

 

code:

G13

(UPPER TURRET)

(TOOL - 4 OFFSET - 4)

(DRILL 1.680 DIA.)

G0 X20. Z20. P10 <--- TAKE BOTH TURRETS HOME AT THE SAME TIME

N4 T0404

G18 G95

G97 S200 M03

G0 X0. Z.25 P20 <--- ALIGN TURRETS TO EACH START POINT

G83 Z-4.33 R.25 F.01

G80 P30 <--- FINISH DRILL CYCLE

G1 Z.25 P40 <--- MOVE TO CLEARANCE PLANE

G0 X20. Z20. P50 <--- MOVE HOME

G14

(LOWER TURRET)

(OD ROUGH RIGHT - 80 DEG. INSERT - CNMG-432)

G0 X20. Z20. P10 <--- TAKE BOTH TURRETS HOME AT THE SAME TIME

N1 T0101

G18 G95

M109

G97 S450 M03

G0 X3.3454 Z.1183 P20 <--- ALIGN TURRETS TO EACH START POINT

G50 S3000

G1 G42 Z-4.555 F.01

X3.5454

G40 X3.6868 Z-4.4843

G0 Z.1183

X3.1454

G1 G42 Z-4.4966

G2 X3.24 Z-4.555 I-.0139 K-.0597

G1 X3.3454

G40 X3.4868 Z-4.4843

G0 Z.1183

X2.9454

G1 G42 Z-4.495

X3.1175

G2 X3.1454 Z-4.4966 K-.0613

G1 G40 X3.2868 Z-4.4259

G0 Z.1183

X2.7454

G1 G42 Z-4.4948

G3 X2.759 Z-4.495 I.0068 K.1235

G1 X2.9454

G40 X3.0868 Z-4.4243 P31 <--- MAKE SURE DRILL HAS FINISHED CYCLE

G0 Z.1183 P41 <--- ALLOW DRILL TO GO TO Z.25

X2.5454 P49 <--- ALLOW UPPER TURRET TO GO HOME

S350G111 P51 <--- TAKE BACK CONTROL OF SURFACE SPEED FROM UPPER TURRET

G1 G42 Z-4.4338

G3 X2.7454 Z-4.4948 I.1068 K.0625

G1 G40 X2.8868 Z-4.4241

G0 Z.1183

X2.5115

G1 G42 Z-4.3712

G3 X2.5454 Z-4.4338 I.1238

G1 G40 X2.6868 Z-4.3631

G0 Z.1183

X2.475

G1 G42 Z-2.3854

X2.5115 Z-2.8554

G40 X2.6529 Z-2.7847

G0 Z.1183

X2.275

G1 G42 Z-.3872

G3 X2.4045 Z-.4455 I.0763 K.0197

G2 X2.475 Z-.4863 I-.006 K-.0408

G1 G40 X2.6164 Z-.4155

G0 Z.1183

X2.27

G1 G42 Z-.3675

G3 X2.275 Z-.3872 I.0788

G1 G40 X2.4164 Z-.3165

G0 Z.1183

X2.23

G1 G42 Z-.006

G2 X2.27 Z-.0512 I-.0413 K-.0453

G1 G40 X2.4114 Z.0195

G0 X3.7204

G0 X20. Z20. P100 <--- MOVE HOME


I hope this example is clear enough. This is where Mastercam falls very short with dual turret machines and though In-House has a good post it is suppose to be obsolete when the next release comes out so hard to justify the cost of the post when it will only be used for 6 months. So that lead me down the path with trying to make the post do what I want. I seen that In-house uses mr's to control this but it will only come out random not specifically where I want which is why I had the idea with Cantext then see I need 999 places for can text and will have to go P1,P2,P3,....,P999 was hoping to have P10,P20 for standard output the when I want P21,P22,P23 control for specific operations though this is a lot harder than it looks and a lot more involved.

 

Hope that has cleared some things up for you.

Link to comment
Share on other sites
  • 3 months later...

Follow up to this problem. I got Cantext to work with SYNC codes. I can post a program from Mastercam and have my SYNC codes come out where I want them and have it run perfect on the machine. Problem now is MPLMASTER uses cantext for Coolant and coolant is all jacked up. How hard is it to Change the post to the Default Generic Post method of doing Coolant output?

Link to comment
Share on other sites

Ron,

 

It's not hard, I believe it is still coded into the post, you'll just need to swap over your coolant choice method.

 

I am still scratching my head as to WHY they decided to tie coolant into canned text which is "eh" at best with how it currently works

Link to comment
Share on other sites

Ron, we are at the same point here. We just took delivery last month of a new Star swiss type and have one more coming in a few months. We don't want to buy the inhouse post that will be no good when x3 comes out, but we need to get this machine running efficiently. For now we will have to use Vericut to hand edit in the wait/stop codes.

 

Anxiously awaiting X3 biggrin.gif

Link to comment
Share on other sites

I will check it out James.

 

Here is some posted code unedited:

 

code:

$K95790.MIN%

G14

(LOWER TURRET)

(MACHINE - OKUMA LU-15)

(CUSTOMER - CUSTOMER XXXXX)

(PART # - 901-036-216-1 REV - )

(PROGRAMMER - RON
B)

(PROGRAM NAME - K95790.MIN)

(DATE - JAN. 04 2008)

(TIME - 1:57 PM)

(PROGRAM REV - N/C )

(TOOL - 1 - OD ROUGH RIGHT - 80 DEG.)

(TOOL - 3 - OD ROUGH RIGHT - 80 DEG.)

G13

(UPPER TURRET)

(TOOL - 1 OFFSET - 1)

(OD ROUGH RIGHT - 80 DEG. INSERT - CNMG-432)

G0 X20. Z20. P10

N1 T0101

G18 G95

G50 S1500

G97 S500 M03 P20

G0 X3.0667 Z.2224

G96 S320 G111 P30

G1 Z.1724 F.016

Z-17.25

X3.45

X3.5914 Z-17.1793

P40

G0 Z.2224

X2.6833

G1 Z.1724

Z-17.25

X3.0867

X3.2281 Z-17.1793

P50

G0 Z.2224

X2.3

G1 Z.1724

Z-17.25

X2.7033

X2.8448 Z-17.1793

P60

G0 Z.2224

X1.9167

G1 Z.1724

Z-17.2422

G2 X2.0875 Z-17.25 L.4687

G1 X2.32

X2.4614 Z-17.1793

P70

G0 Z.2224

X1.5333

G1 Z.1724

Z-17.1593

G2 X1.9367 Z-17.2439 L.4688

G1 X2.0781 Z-17.1732

P80

G0 Z.2224

X1.15

G1 Z.1724

Z-16.7813

G2 X1.5533 Z-17.1665 L.4688

G1 X1.6948 Z-17.0958

P90

G0 X3.55

G0 X20. Z20. P100

M05

M01

G14

(LOWER TURRET)

(TOOL - 3 OFFSET - 3)

(DCGNR-164D - CNMG-432 INSERT - CNMG-432)

G0 X20. Z20. P10

N3 T0303

G18 G95

G50 S1500

G97 S500 M03 P20

G0 X2.8583 Z.2724

G96 S320 G111 P30

G1 Z.1724 F.016

Z-17.25

X3.21

X3.3514 Z-17.1793

P40

G0 Z.2724

X2.5067

G1 Z.1724

Z-17.25

X2.8783

X3.0198 Z-17.1793

P50

G0 Z.2724

X2.155

G1 Z.1724

Z-17.25

X2.5267

X2.6681 Z-17.1793

P60

G0 Z.2724

X1.8033

G1 Z.1724

Z-17.2351

G2 X2.0375 Z-17.25 L.4688

G1 X2.175

X2.3164 Z-17.1793

P70

G0 Z.2724

X1.4517

G1 Z.1724

Z-17.1472

G2 X1.8233 Z-17.2376 L.4687

G1 X1.9648 Z-17.1669

P80

G0 Z.2724

X1.1

G1 Z.1724

Z-16.7813

G2 X1.4717 Z-17.155 L.4688

G1 X1.6131 Z-17.0843

P90

G0 X3.435

G0 X20. Z20. P100

M05

M02

%


Doug send me a .z2g of a part and I will fix a post for you to work with this version.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...