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:

Print cotation mark character


Recommended Posts

Hi everyone!

I'm a newbe in Mastercam and this is my first post here.

 

I need a post processor for a Sinumerik and so I'm editing a mpmaster post for me. It has been fun, I learned a lot with this (now I know what's a nci file!), but is difficult because I use to program gcode, java and C and this is a strange language...

 

for now I have one question that really bothers me:

 

- I want to print a special charater, the cotation mark " but I can't find enougth documentation on the web.

I need to print the tool name instead of the tool number, but the name must be inside cottation marks

example: 

T1 M06; CENTERDRILL

must be:

T "CENTERDRILL" M06

 

in java or C is printf("T\""%s"\"", toolName);

 

btw... for now I have made the header and footer, tool change and CYCLE81 drill cycle

 

where can I find documentation? this is not easy and without documentation is really hard core...

 

many thanx in advance and congrats for your forum =D

  • Like 2
Link to comment
Share on other sites

my CYCLE81 (so far...)MCALL CYCLE81(50.,0.,3.,-20.)X9.634 Y14.106X32.685 Y-22.708X-11.526 Y-31.825X-14.794 Y20.815X-23.912 Y34.061X-78.272 Y29.073MCALL

CYCLE81 (RTP, RFP, SDIS, DP, DPR)

 

RTP – Return plane or Retraction plane (absolute)

RFP – Reference plane (absolute)

SDIS – Safety distance (enter without sign)

DP – Final drilling depth (absolute)

DPR – Final drilling depth relative to reference plane (enter without sign)

 

this is different from fanuc's G81... in reallity there's no G98/99 option in nci code, you must check if the last Z pos and retract value are the same to set the G98/G99 option in G81 cycle. 

 

my RTP equals to initht$ (cleance or last Z)

my RFP equals to drl_sel_tos$ (top of stock)

my SDIS equals to abs(drl_sel_tos$-drl_sel_ref$)

my DP equals to depth$

you don't need the DPR since you have the DP.

 

I'm not use to work with SINUMERIK, I'm learning this also =D

Link to comment
Share on other sites

ok problem solved.

 

use the number 34 for " output.

 

my result:

pbld, *n$, "T-"spaces$ = 034,*strtool$,34spaces$ = sav_spc"M06", ptoolcomm, e$

output:

N100 T-"CENTERDRILL 12" M06 ;CENTERDRILL 12

note: sav_spc is used to store de default spaces$, defined in the control file. in this case I need two formatations, one space and no spaces between words. Because mastercam uses this variable(spaces$) to compose lines with words, if space$=0, the code will come out with no spaces. The "T" statment and 34 statment are treated as words, so if spaces$=1 the result is T- " toolName " instead of T-"toolName".

If spaces$=0 the whole line will be N100T-"CENTERDRILL 12"M06;CENTERDRILL 12 and could be different from the rest of the code, deppending of the spaces definition on control file.

To avoid this you can set the sapce$ to zero, use your code and then reset the spaces$ to default, and then the rest of the code.

 

 

any doubt or error found tell me please =D

Link to comment
Share on other sites

The MP language has been enhanced over the years, so that using the ASCII Literal "34" is no longer necessary.

 

To output a double quote character, you now enclose the string in "single quote characters".

 

smy_string : 'This string contains "double quote" characters.'

 

That will let you use double quotes for string output.

 

Another trick; instead of continually manipulating the 'spaces$' variable to control spacing, leave "spaces$ = 1", and use the 'no_spc$' parameter to delete the individual spaces between "parameters" on the output line.

 

Also, note that because 'strtool$' is a string variable, there is no need to "force" output with the asterisk (*) character. It will always be forced. Only numeric variables respond to the (*) character...

     '"', no_spc$, strtool$, no_spc$, '"', e$
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...