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

Ahoy!,

One last post tweak before I am off to UG land.

 

On our makinos I would like to use a # variable for the D number when using compensation. The reasons for this are many and varied wink.gif

 

This is what I need:

 

code:

 G41 D#101 Y-48.8 F3400.  

From the post:

 

code:

 pccdia          #Cutter Compensation

#Force Dxx#

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

sccomp

if cc_pos$, tloffno$

Any help appreciated.

 

Bruce

Link to comment
Share on other sites

Bruce something like

 

format this

 

comp_off : 0

code:

pccdia          #Cutter Compensation

#Force Dxx#

comp_off = tloffno$ +100

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

sccomp

if cc_pos$, "D", no_spc$, 35, no_spc$, comp_off, e$

That should comp number in the 100 series variable always related to the tool # + 100, You'll have to test it.

Link to comment
Share on other sites

John,

I am actually trying to hardcode a #101, but your method got me going in the right direction. I now have the following:

 

Post:

code:

 pccdia          #Cutter Compensation

#Force Dxx#

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

sccomp

#if cc_pos$, tloffno$

if cc_pos$, "D", no_spc$, 35, no_spc$, "101", comp_off, e$

Code:

 

code:

 M11 B67. M10

M98 P

G0 G90 X-127.992 Y-40.

G43 H#100 Z129.69

G1 Z128.69 F2000.

G41 D#101

Y-48.8 F3400.

G3 D#101

X-119.192 Y-40. R8.8

G1 D#101

Y40.

G3 D#101

X-127.992 Y48.8 R8.8

G1 G40 Y40.

Z129.69 F10000.

M319

G91 G28 Z0.

G90

M01

M99

How can I get rid of the extra #101's?

 

Thanks

 

Bruce

Link to comment
Share on other sites

Bruce,

 

Add it here

 

scc1 G41 D#101 #Cutter compensation left

scc2 G42 D#101 #Cutter compensation right

 

Add Change this

 

pccdia

 

#Cutter Compensation

#Force Dxx#

sccomp

 

 

And since you are heading of to UG land I thought I would give you a very small preview

 

set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR]

 

 

if { ![info exists mom_sys_post_initialized] } {

 

source ${cam_post_dir}ugpost_base.tcl

 

proc MOM_before_each_add_var {} {}

proc MOM_before_each_event {} {}

 

# set cam_debug_dir [MOM_ask_env_var UGII_CAM_DEBUG_DIR]

# source ${cam_debug_dir}mom_review.tcl

 

MOM_set_debug_mode OFF

 

 

#### Listing File variables

set mom_sys_list_output "OFF"

set mom_sys_header_output "OFF"

set mom_sys_list_file_rows "40"

set mom_sys_list_file_columns "30"

set mom_sys_warning_output "ON"

set mom_sys_group_output "OFF"

set mom_sys_list_file_suffix "lpt"

set mom_sys_output_file_suffix "nc"

set mom_sys_commentary_output "ON"

set mom_sys_commentary_list "x y z 4axis 5axis feed speed"

 

set mom_sys_control_out "("

set mom_sys_control_in ")"

 

set mom_sys_post_initialized 1

}

Link to comment
Share on other sites

Original code ->

code:

pccdia          #Cutter Compensation

#Force Dxx#

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

sccomp

if cc_pos$, tloffno$

Your code ->

code:

pccdia          #Cutter Compensation

#Force Dxx#

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

sccomp

#if cc_pos$, tloffno$

if cc_pos$, "D", no_spc$, 35, no_spc$, "101", comp_off, e$

Your issue of repeating output is due to the fact that the conditional logic has been “broken”. The ‘if cc_pos$’ worked before because ‘tloffno$’ variable is formatted for modal output. So even though ‘if cc_pos$’ is repeatedly TRUE, ‘tloffno$’ is output only when its value has changed. In your new code, after the ‘if cc_pos$’ is “literal” output, so you’ll get it output againhttp://www.emastercam.com/ubb/ultimatebb.php

eMastercam.com Forums and again…

 

Try this…

 

Change ->

if cc_pos$, "D", no_spc$, 35, no_spc$, "101", comp_off, e$

 

To ->

if prv_tloffno$ <> tloffno$, "D", no_spc$, 35, no_spc$, "101", comp_off, e$

Link to comment
Share on other sites

can you edit the toolchange macro to do this? I have done this on a Matsuura MAM72-63V with a 30i controller. in the program itself there are no "H" or "D" codes...just a G43 and D41's.

 

at the end of the macro these lines were added

 

H#518

D#517

 

This sets both the H and the D for whatever tool is in the spindle.

 

this was done for tool life management and using backup tools.

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

That's Matsuura's TLM. It only works for Matsuura.

 

But using variables for H & D is really the way to go because it makes absolutely sure you'll not get errant offsets and you can do other things on the control side with that information as well.

 

JM2C

Link to comment
Share on other sites

Thanks fellas. I have changed the post to this:

 

code:

pccdia          #Cutter Compensation

#Force Dxx#

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

sccomp

#if cc_pos$, tloffno$

#if cc_pos$, "D", no_spc$, 35, no_spc$, "101", comp_off, e$

if prv_tloffno$ <> tloffno$, "D", no_spc$, 35, no_spc$, "101" #, comp_off, e$

And now get this:

 

code:

 G0 G90 X-127.992 Y-40.                  ptlchg0$ p__5:869 620.

G43 H#100 Z129.69 ptlchg0$ p__5:869 620.

D#101 ptlchg0$ prapidout 620.

G1 D#101 Z128.69 F2000. plin$ plinout 622.

G41 D#101 Y-48.8 F3400. plin$ plinout 624.

G3 D#101 X-119.192 Y-40. R8.8 pcir$ pcirout 626.

G1 D#101 Y40. plin$ plinout 628.

G3 D#101 X-127.992 Y48.8 R8.8 pcir$ pcirout 630.

G1 G40 D#101 Y40. plin$ plinout 632.

D#101 Z129.69 F10000. plin$ plinout 636.

M319 peof$ peof$ 638.

G91 G28 Z0. peof$ peof$ 638.

G90 peof$ peof$ 638.

M01 peof$ peof$ 638.

M99 peof$

headscratch.gif

 

Bruce

Link to comment
Share on other sites
  • 1 year later...

Ahoy!,

I need to resurrect this as I am tweaking a post for my new machine.

 

I have changed the post as I thought I had done the previous Makino, but I am getting an extra D in the output. I know it is simple and is staring me in the face, but it is amazing how much stuff you forget when you haven't been using it for a while!!!!!

 

code:

 Z10.

G1 Z0. F1.5

G41 D#501 D215 Y25.933 <================ Don't need D215!!!!!

G3 X-6.711 Y19.933 R6.

G1 X21.771

G2 X24.771 Y16.933 R3.

G1 Y-8.974

G2 X21.771 Y-11.974 R3.

G1 X-35.192

G2 X-38.192 Y-8.974 R3.

G1 Y16.933

G2 X-35.192 Y19.933 R3.

G1 X-6.711

G3 X-.711 Y25.933 R6.

G1 G40 Y31.933

Z10.

G0 Z50.

M9

M5

 


code:

 

 

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

sccomp

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

if cc_pos$, tloffno$

 


thanks

 

Bruce

Link to comment
Share on other sites

code:

if prv_tloffno$ <> tloffno$, "D", no_spc$, 35, no_spc$, "501", "PROBLEM"  

Add this word problem and repost and see if that is the line that causing you the problem. I still think the tloffno$ on the second line needs to come out completely, but do this and lets see what happens.

 

HTH

Link to comment
Share on other sites

That is the line that is outputting. I have put a ! in front of the second tloffno$ to stop it from outputting when using wear or control. If I remove the line completely I get D# on every line regardless.

 

I am thinking I may need to add some logic to the motion output sections ? headscratch.gif

 

I'll z2g a dummy file and send it your way Ron.

 

thanks

 

Bruce

Link to comment
Share on other sites

Bruce here you go sir:

 

code:

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$, "501"

]

if cc_pos$, !tloffno$

I tried it on all 3 methods and it posted like it should.

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