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:

Pre-read tool parameters into buffer


Recommended Posts

Hi guys,

I have been working with Mastercam posts for about 10 years, and this one stumps me. I must be missing something simple here. What I am trying to do is read the variable "tool_width" into a buffer file. I want the data so that I can alter the output of a tool, based on and prior to the next tool running. I have tried many things, and this is a sample of what some of the code looks like. Anything I'm missing?

 

 

 

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

# Buffer definitions

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

#Buffer 1, toolchange information

wc1 : 1 #Initial count for write buffer 1

rc1 : 1 #Initial count for read buffer 1

nc1 : 2 #Initial count for read buffer 1 into next record

size1 : 0 #Buffer 1 size

# Current tool information

c1_gcode : 0 #Buffer 1

c1_xh : 0 #Buffer 1

c1_yh : 0 #Buffer 1

c1_zh : 0 #Buffer 1

c1_tox : 0 #Buffer 1

c1_toy : 0 #Buffer 1

c1_toz : 0 #Buffer 1

c1_cc_pos : 0 #Buffer 1

c1_tool : 0 #Buffer 1

c1_tloffno : 0 #Buffer 1

c1_maxss : 0 #Buffer 1

c1_ss : 0 #Buffer 1

c1_spdir : 0 #Buffer 1

c1_css_actv : 0 #Buffer 1

c1_fr_pos : 0 #Buffer 1

c1_ipr_actv : 0 #Buffer 1

c1_coolant : 0 #Buffer 1

c1_nextdc : 0 #Buffer 1

c1_posttype : 0 #Buffer 1

c1_cuttype : 0 #Buffer 1

c1_lathtype : 0 #Buffer 1

c1_gcodecc : 0 #Buffer 1

c1_lathecc : 0 #Buffer 1

c1_millcc : 0 #Buffer 1

c1_y_axis : 0 #Buffer 1

c1_x_min : 0 #Buffer 1

c1_x_max : 0 #Buffer 1

c1_tool_width : 0 #Buffer 1

# Next tool information

n1_gcode : 0 #Buffer 1

n1_xh : 0 #Buffer 1

n1_yh : 0 #Buffer 1

n1_zh : 0 #Buffer 1

n1_tox : 0 #Buffer 1

n1_toy : 0 #Buffer 1

n1_toz : 0 #Buffer 1

n1_cc_pos : 0 #Buffer 1

n1_tool : 0 #Buffer 1

n1_tloffno : 0 #Buffer 1

n1_maxss : 0 #Buffer 1

n1_ss : 0 #Buffer 1

n1_spdir : 0 #Buffer 1

n1_css_actv : 0 #Buffer 1

n1_fr_pos : 0 #Buffer 1

n1_ipr_actv : 0 #Buffer 1

n1_coolant : 0 #Buffer 1

n1_nextdc : 0 #Buffer 1

n1_posttype : 0 #Buffer 1

n1_cuttype : 0 #Buffer 1

n1_lathtype : 0 #Buffer 1

n1_gcodecc : 0 #Buffer 1

n1_lathecc : 0 #Buffer 1

n1_millcc : 0 #Buffer 1

n1_y_axis : 0 #Buffer 1

n1_x_min : 0 #Buffer 1

n1_x_max : 0 #Buffer 1

n1_tool_width : 0 #Buffer 1

fbuf 1 0 28 0 0 #Buffer 1

 

 

fmt 2 tool_width

 

pparameter$ #Information from parameters

if prmcode$ = 20103, stinsert2 = sparameter$

result = fprm (abs(lathecc))

if prmcode$ = 20102, tool_orien = rparsngl(sparameter$, 1)

if prmcode$ = 20102, tool_width = rparsngl(sparameter$, 4)

 

pwrttparam$ #Information from parameters

if opcode$ = 104, result = fprm (opcode$)

if prmcode$ = 20102, tool_width = rparsngl(sparameter$, 4)

Link to comment
Share on other sites

No is not a good enough sample. Calling method is only part of the process. Where do you do the preread and prewrite process from and to?

 

What do you do for the pcur_recd section for that those variables? You replaced the c1_spinlde_no in mplmaster with tool_width where do you make them equal to use it?

 

Shot an email to your dealer or put a .z2g and I will be glad to help you out.

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