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:

Post help - Need to use variable for D# in comp.


Bruce Caulley
 Share

Recommended Posts

After reading all the info in this post, I got my mpmaster to spit out D#3026 and h#3026 just fine. Last night I was posting a 5axis curve toolpath with comp off and this is what I get.

Anyone know what might be causing it?

 

Thanks, Damian

 

(.03 CORNER RAD)

(WCS NAME - TOP)

(TOOLPLANE NAME - OP3 HORIZ)

(CPLANE NAME - OP3 HORIZ)

(TOOLPATH GROUP - TOOLPATH GROUP-1)

(COMPENSATION TYPE - WEAR COMP)

T4 M06 ( .031"C/R, 1/8" SHK 2F CARBIDE CORNER-ROUNDING TOOL .036"LOC,. 75" PROJ.)

G90G10L12P#3026R0

M11 (UNLOCK)

G00 G17 G90 G54 A3.641 X0. Y-1.161 S8100 M03

G43 H#3026 Z3.0312 T5

D#3026 Z1.1312

G94 G01 D#3026 Z1.0312 F6.

G93 D#3026 A1.975 F200.05

D#3026 A.308 F200.06

D#3026 A-1.36 F199.77

D#3026 A-3.028 F199.87

D#3026 A-4.696 F199.97

D#3026 A-6.362 F200.11

D#3026 Z1.0311 A-8.03 F199.84

D#3026 A-9.699 F199.69

D#3026 A-11.366 F200.01

D#3026 Z1.0312 A-13.032 F200.13

D#3026 A-14.699 F200.08

D#3026 A-16.365 F200.09

D#3026 A-18.029 F200.29

D#3026 A-19.697 F199.96

Link to comment
Share on other sites

code:

 

if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k

This logic seems wrong, I can't put my finger on it, but something seems off here. I think where you do the cc_pos$ you have it doing nothing really it would have to equal something or be greater than or something the statement will always be what it is thus the output will always be true with no way to be false.

 

HTH

Link to comment
Share on other sites

sorry about that. here is the rest of the code.

i tried # on the line mentioned and it still output wrong. I also failed to mention that if i post this toolpath only the code is good when i post the whole prog i get the D on every line of one tool only.

 

pccdia #Cutter Compensation

 

#if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k

sccomp

if prv_tloffno$ > 1,

[

if prv_tloffno$ <> tloffno$, "D", no_spc$, 35, no_spc$, "3026"

]

if cc_pos$, !tloffno$

Link to comment
Share on other sites

Hey Tim,

 

We program with resident tool's 1-83. the rest are open for special tools. the d#3026

and h#3026 just helps the operator from making

any mistake by editing the wrong info. all h and t #'s come from the actual tool in the spindal. we also use it in a g10 call before and

after each tool to adjust the comp for specific

parts instead of for all job that might be running. ( G90G10L12P#3026R0 )

 

i did find one thing out, if i imput the tool info like this it will work.

t1

h3026

d3026

 

t2

h3026

d3026

 

ect

 

prev was

t1

h1

d1

 

t2

h2

d2

 

and i never had a problem. seems weird for it to act up all of a sudden.

 

thanks again for your help, Damian

Link to comment
Share on other sites

FINISH CORNERS AND .03 RAD IN POCKETS)

(WCS NAME - TOP)

(TOOLPLANE NAME - OP3 HORIZ)

(CPLANE NAME - OP3 HORIZ)

(TOOLPATH GROUP - TOOLPATH GROUP-1)

(COMPENSATION TYPE - WEAR COMP)

T3 M06 (DEFINE TOOL NAMES)

G90G10L12P#3026R0

M11 (UNLOCK)

G00 G17 G90 G54 A0. X1.0513 Y-1.2763 S9000 M03

M10 (LOCK)

G43 H#3026 Z2. T4

D#3026 Z1.13

G94 G01 D#3026 Z.9257 F6.

G41 D#3026 Y-1.2563 F9.

G03 X1.0313 Y-1.2363 I-.02 J0.

G02 X.9013 Y-1.1063 I0. J.13

G01 Y-1.0938

X.9008

X.4388

X.4387 Y-1.0942

Y-1.1063

G02 X.3088 Y-1.2363 I-.13 J0.

G03 X.2888 Y-1.2563 I0. J-.02

G01 G40 Y-1.2763

X1.0513

Z.8214 F6.

G41 D#3026 Y-1.2563 F9.

G03 X1.0313 Y-1.2363 I-.02 J0.

G02 X.9013 Y-1.1063 I0. J.13

G01 Y-3.3388

X.4338

Y-3.8112

X.9063

Y-3.575

G03 X.8862 Y-3.555 I-.02 J0.

G01 G40 X.8662

Y-3.595

Z.1695 F6.

G41 D#3026 X.8862 F9.

G03 X.9063 Y-3.575 I0. J.02

G01 Y-3.3388

X.4338

Y-3.8112

X.9063

Y-3.575

G03 X.8862 Y-3.555 I-.02 J0.

G01 G40 X.8662

Z.2695 F24.

G00 Z2.

ROUGH GROOVES)

M11 (UNLOCK)

G00 G90 A3.641 X0. Y-1.325

G43 H#3026 Z2.9368

M11 (UNLOCK)

Z1.0368

G01 Z.9368

G93 A1.593 F1000.

Z.9367 A-.453 F1000.

A-2.501 F1000.

Z.9366 A-4.549 F1000.

Z.9365 A-6.599 F1000.

A-8.646 F1000.

Z.9364 A-10.697 F1000.

A-12.749 F1000.

A-14.798 F1000.

A-16.846 F1000.

A-18.898 F1000.

A-20.949 F1000.

Z.9365 A-22.999 F1000.

A-25.048 F1000.

Z.9366 A-27.097 F1000.

Z.9367 A-29.145 F1000.

A-31.193 F1000.

Z.9368 A-33.239 F1000.

A-35.289 F1000.

A-37.336 F1000.

Z.9367 A-39.386 F1000.

A-41.437 F1000.

Z.9366 A-43.486 F1000.

Z.9365 A-45.537 F1000.

A-47.586 F1000.

Z.9364 A-49.633 F1000.

A-51.681 F1000.

A-53.731 F1000.

A-55.778 F1000.

A-57.827 F1000.

A-59.873 F1000.

Z.9365 A-61.923 F1000.

A-63.973 F1000.

Z.9366 A-66.02 F1000.

Z.9367 A-68.068 F1000.

Z.9368 A-70.116 F1000.

A-72.168 F1000.

A-74.218 F1000.

A-76.27 F1000.

Z.9367 A-78.321 F1000.

A-80.372 F1000.

Z.9366 A-82.418 F1000.

Z.9365 A-84.469 F1000.

A-86.52 F1000.

Z.9364 A-88.57 F1000.

A-90.617 F1000.

A-92.67 F1000.

A-94.718 F1000.

A-96.764 F1000.

A-98.811 F1000.

Z.9365 A-100.859 F1000.

 

 

EDIT

 

M01

(.03 CORNER RAD)

(WCS NAME - TOP)

(TOOLPLANE NAME - OP3 HORIZ)

(CPLANE NAME - OP3 HORIZ)

(TOOLPATH GROUP - TOOLPATH GROUP-1)

(COMPENSATION TYPE - WEAR COMP)

T4 M06 ( .031"C/R, 1/8" SHK 2F CARBIDE CORNER-ROUNDING TOOL .036"LOC,. 75" PROJ.)

G90G10L12P#3026R0

M11 (UNLOCK)

G00 G17 G90 G54 A3.641 X0. Y-1.161 S8100 M03

G43 H#3026 Z3.0312 T5

D#3026 Z1.1312

G94 G01 D#3026 Z1.0312 F6.

G93 D#3026 A1.975 F200.05

D#3026 A.308 F200.06

D#3026 A-1.36 F199.77

D#3026 A-3.028 F199.87

D#3026 A-4.696 F199.97

D#3026 A-6.362 F200.11

D#3026 Z1.0311 A-8.03 F199.84

D#3026 A-9.699 F199.69

D#3026 A-11.366 F200.01

D#3026 Z1.0312 A-13.032 F200.13

D#3026 A-14.699 F200.08

D#3026 A-16.365 F200.09

D#3026 A-18.029 F200.29

D#3026 A-19.697 F199.96

 

EDIT

 

D#3026 A-12.082 F200.11

D#3026 Z1.0311 A-10.413 F199.84

D#3026 A-8.744 F199.69

D#3026 A-7.077 F200.01

D#3026 Z1.0312 A-5.411 F200.13

D#3026 A-3.745 F200.08

D#3026 A-2.078 F200.09

D#3026 A-.414 F200.29

D#3026 A1.253 F199.96

D#3026 A3.641 F139.61

G00 D#3026 Z1.1312

D#3026 Z3.0312

G91 G28 Z0.

(.03 RAD)

M11 (UNLOCK)

G00 G90 A3.641 X.3237 Y-1.211

M10 (LOCK)

G43 H#3026 Z2.

M10 (LOCK)

D#3026

D#3026 Z1.1625

G94 G01 D#3026 Z1.0313 F6.

G41 D#3026 Y-1.191

G03 X.2938 Y-1.161 I-.03 J0.

G01 X.2437

X0.

X-.05

G03 X-.08 Y-1.191 I0. J-.03

G01 G40 Y-1.211

Z1.1313

G00 Z1.25

Y-1.439

Z1.1625

G01 Z1.0313

G41 D#3026 Y-1.459

G03 X-.05 Y-1.489 I.03 J0.

G01 X0.

X.2437

X.2937

 

EDIT

 

Z1.1625

G01 Z1.0312

G41 D#3026 Y-3.709

G03 X-.901 Y-3.739 Z1.0313 I.03 J0.

G01 X-.801 Z1.0312

X0.

X.1

G03 X.13 Y-3.709 Z1.0313 I0. J.03

G01 G40 Y-3.689 Z1.0312

Z1.1312

G00 Z2.

M05

G91 G28 Z0.

G90G10L12P#3026R0

M01

Link to comment
Share on other sites
Guest CNC Apps Guy 1

You gotta do it in two parts;

 

Do this in pheader AFTER everything;

code:

    strtlmd = strtlmd + no2asc(35)

result = nwadrs(strtlmd,tloffno$)

Then this in pccdia;

code:

pccdia          #Cutter Compensation

#Force Dxx#

 

if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k

sccomp

tloffno$ = 518

 

if cc_pos$, tloffno$

That should do it.

 

HTH

Link to comment
Share on other sites

So close James, but you didn't mention declaration of strtlmd string needs to be a D.

 

 

code:

Declaration:

 

strtlmd "D"

 

 

Concatenate D + # and reassign addr to tloffno$:

 

(at end of pheader)

 

 

strtlmd = strtlmd + no2asc(35)

result = nwadrs(strtlmd,tloffno$)

 

 

Assign parameter # to tloffno$:

 

pccdia #Cutter Compensation

#Force Dxx#

 

if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k

sccomp

tloffno$ = 3026

if cc_pos$, tloffno$

biggrin.gif

Link to comment
Share on other sites

In the string/variable declaration section, before any postblocks.

 

 

code:

# --------------------------------------------------------------------------

# Misc strings

# --------------------------------------------------------------------------

snull "" # Null character string

sdot "." # dot string

stest1 "" # Test string 1

stilde "~" # Tidle string

snocomm "DEFINE TOOL NAMES"

stoper "" # String for tool notes

spostname "" # Post name

snullop "UNDEFINED OPERATION"

slicense "IN-HOUSE SOLUTIONS"

scomment_holder ""

srev ""

 

strtlmd "D" #<--------------------------------------------

Then in pheader postblock.

 

 

code:

pheader$         #Call before start of file                         

if met_tool$ = one, #Metric constants and variable adjustments

[

ltol$ = ltol_m

vtol$ = vtol_m

mtol$ = mtol_m

maxfeedpm = maxfeedpm_m

]

result = nwadrs(srotary, cabs)

result = nwadrs(srotary, cinc)

result = nwadrs(srotary, indx_out)

 

pgetprogname

"%", e$

spaces$=0

sprog_ext = progno$

sav_progno2 = progno$

*progno$, " (", sprogname$, sprog_ext, "..MP", ")", e$

"(REV ", *srev, ")", e$

#*progno, " (", sprogname, "..MP", ")", e

spathnc$ = ucase(spathnc$)

smcname$ = ucase(smcname$)

#"(PROGRAM NAME - ", sprogname, ")", e

#"(DATE=DD-MM-YY - ", date, " TIME=HH:MM - ", time, ")", e

#"(MASTERCAM - V", *vers_no, ")", e

#"(MC9 FILE - ", smcpath, smcname, smcext, ")", e

#"(POST - ", spostname, ")", e

#"(MP - V", *dll_vers, ")", e

stck_matl$ = ucase(stck_matl$)

#"(MATERIAL - ", stck_matl, ")", e

#"(PROGRAM - ", sprogname, sextnc, ")", e

#"(DATE - ", *smonth, "-", *day, "-", *year, ")", e

"(", *smonth, "-", day$ , "-", year$ , ")", e$

#"(TIME - ", *time, ")", e

#"(POST DEV - ", *slicense, ")", e

spaces$=sav_spc

 

if seqno$ = 0, omitseq$ = yes$

sav_rot_on_x = rot_on_x

rot_on_x = 0

sav_progno = progno$

 

#seqno = 10

#seqinc = 10

#n = seqno

 

strtlmd = strtlmd + no2asc(35) #<-----------------------------------

result = nwadrs(strtlmd,tloffno$)


Finally, in pccdia postblock.

 

code:

pccdia          #Cutter Compensation

#Force Dxx#

if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k

sccomp

tloffno$ = 3026 #<-------------------------------------

if cc_pos$, tloffno$


Link to comment
Share on other sites

Yup. I agree 100%. James is under the impression that a # character can't be used in fmt statements.

 

quote:

you can't use the "#" in a post. You have to use the ACSII equivalent. (i.e. 035 ). MC sees that as a comment and ignores everything after it.


I'm just making his method work. LOL Interesting, albeit unnecessary.

Link to comment
Share on other sites

i added Guru's info and it had an error.

im sure im just doing somthing wrong.

so i started over and just used Guru's

pccdia block and everything post ok, just missing the # on every d call. i tried adding the line of code for paul and it erored out

again. i think im pretty close if i can get

pauls fmt to work.

 

i am always impressed at the amount of knowlage on this board and the many different ways to do things.

 

fmt "D#" 4 tloffno$ #Diameter offset number

Link to comment
Share on other sites

Damian - All that really needed to be done here is this:

 

1)modify the fmt for tloffno$

 

2)Assign a value to tloffno$

 

Don't add in the fmt line it's already there.

 

Your error is probably a duplicate fmt line.

 

code:

# --------------------------------------------------------------------------

# Toolchange / NC output Variable Formats

# --------------------------------------------------------------------------

fmt T 4 t$ #Tool No

fmt T 4 first_tool$ #First Tool Used

fmt T 4 next_tool$ #Next Tool Used

#fmt D 4 tloffno$ #Diameter Offset No #<----Original fmt

fmt "D#" 4 tloffno$ #Diameter Offset No#<--Modified

fmt H 4 tlngno$ #Length Offset No

fmt G 4 g_wcs #WCS G address

fmt P 4 p_wcs #WCS P address

fmt S 4 speed #Spindle Speed

fmt M 4 gear #Gear range

code:

pccdia          #Cutter Compensation

#Force Dxx#

if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k

sccomp

tloffno$ = 3026#<------

if cc_pos$, tloffno$

Link to comment
Share on other sites
  • 14 years later...

Bringing this old thread back to life.  My old handle was @dforsythe and i no longer have that email to retrieve it.  so I'm now @riverhunter some 15 years later and am now back on mastercam so I'm trying to duplicate something i did back in 2009.  looks like @Rob @ Target Machinehasnt been around lately so ill ask the rest of the group.

 

the code below works great for getting the code D#517.  my question is how do i do this for  tlngno$ so i can get G43 H#517.  the tlngno$ is buirred in the ptlchg_com so im not sure how to approch it.

 

#pbld, n$, "G43", *tlngno$, pfzout, scoolant, e$
pbld, n$, "G43", "H#517", pfzout, scoolant, e$  This forced it, but throws an exception error.  

 

On 12/4/2009 at 4:11 AM, Rob @ Target Machine said:
code:

pccdia          #Cutter Compensation

 

#Force Dxx#

 

if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k

 

sccomp

 

tloffno$ = 3026#<------

 

if cc_pos$, tloffno$

 

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...