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:

Tool manufacturers code output to G code


Recommended Posts

Hey Team, 

I am trying to output the Tool manufacturers code from the tool settings into the G code. I have it working when the tool code is numerical but when the tool code has letters in the code it stops outputting after the Tool manufacturers code after the first letter is hit. 

 

ex. 78987t8987    post will output 78987 and stop. 

pardon the bad coding I am hacking and learning as I go.

Thanks in advance.  

fmt  "TC=" 25 groupcom     # out put the tool_op$ Manufactuers code
if prmcode$ = 20002, groupcom = rpar(sparameter$, 50)

(Pheader)

sopen_prn, *groupcom, sclose_prn, e$

 

 

Link to comment
Share on other sites
1 hour ago, mustardcam said:

 

 

Hey Team, 

I am trying to output the Tool manufacturers code from the tool settings into the G code. I have it working when the tool code is numerical but when the tool code has letters in the code it stops outputting after the Tool manufacturers code after the first letter is hit. 

 

ex. 78987t8987    post will output 78987 and stop. 

pardon the bad coding I am hacking and learning as I go.

Thanks in advance.  




 

if prmcode$ = 20002, groupcom = rpar(sparameter$, 50)

(Pheader)


sopen_prn, *groupcom, sclose_prn, e$

 

 

You are defining groupcom as a numeric variable with this

fmt "TC=" 25 groupcom # out put the tool_op$ Manufactuers code

 

Try like this instead to define it as a string

groupcom    :   "  "  # out put the tool_op$ Manufactuers code

 

 

You are defining the t

Link to comment
Share on other sites

MP has two data types, string and numeric.  Strings always start with 's' and are initialized with quote characters (single or double).  The data coming from the 20002 is a string, so try this....

s_group_com : ""

pparameter$
    if prmcode$ = 20002, s_group_com = sparameter$

 If you'd like the "TC=" prefix you can build a string with a global formula as shown below

s_group_com_out = "TC=" + s_group_com
  
ptlchg$
  s_group_com_out, e$

 

  • Like 2
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...