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:

inserting a comment?


flippinjig
 Share

Recommended Posts

I want to insert a comment into my program after a rapid move. This is what I have tried:

 

_________________________________________________

prapidout #Output to NC of linear movement - 2D rapid

pcantxt1, pbld, n, sgabsinc, pccomp, sg20code, pwtcode,

pxout, pyout, pzout, pwtout, strcantext, e

n, "G92", e #added

n, "M98 P5001 K", *********, e #added to put in value for scaling

pwtoutaft

_________________________________________________

 

Output wanted:

_________________________________________________

O0100 ( TESTHOLES )

G0 G90

G92 X0. Y0.

X1.771 Y-1.601

G92

M98 P5001 K********

X-1.289 (how to force "Y" value?)

G92

M98 P5001 K********

X1.295 (how to force "Y" value?)

G92

M98 P5001 K********

M30

%

_________________________________________________

 

On the wire parameters page I entered in the comment box the text I want to appear where the ********* is . Also how can I force "Y" positions in the rapid line?

 

Thanks,

Mark

 

_________________________

Wire 8.1.1

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

Look in the prapid post block and change pxout, and pyout to pfxout and pfyout. This will force out X and Y in rapid moves ALWAYS.

 

As always back up your post before making any modifications.

Link to comment
Share on other sites

Thanks James and Ashan, works great.

Roger, actually I have already tried:

_________________________________________________

n, "M98 P5001 K", scomm, e #added to put in value for scaling

_________________________________________________

 

Output:

_________________

M98 P5001 K (blank,it isn't passing text that I entered in the comment box on my wire parameters page???)

_________________

 

What is a 'Manual Entry' string?

Link to comment
Share on other sites

scomm is “blank”

 

I would assume that the Operation Comment is being output by your PST in the startup of the NC file. After scomm is output, it is cleared. If you really want to use the Operation Comment later, you’ll need to snag a copy.

 

code:

 

scomm_saved "" # Holds our copy of the Operation Comment

pcomment2 #Comment from manual entry

# Capture the Operation Comment

if gcode = 1008, scomm_saved = scomm

scomm = ucase (scomm)

if gcode = 1007, "(", scomm, ")"

else, "(", scomm, ")", e

This sample shows the ‘Operation Comment’ is output a the top of the file,

Once output, the scomm string variable is cleared. You can see that when referenced later (in plinout in the example) it is “blank”.

But, we can use our saved copy to do whatever we wish…

I also tossed in a comment using ‘Manual Entry’.

Maybe inserting a string into your NC using this method would be preferable?

 

O0100

( MY OPERATION COMMENT )

N100 G0 G20 G90

N102 G92 X0. Y0. I1. J0.

N104 G0 X0. Y0.

N106 M60

N108 M83

N110 M81

N112 S101 D1

N114 G41 G1 X-.86478

scomm ->

scomm_saved -> My Operation Comment

N116 Y-1.04741

scomm ->

scomm_saved -> My Operation Comment

N118 X1.62214

scomm ->

scomm_saved -> My Operation Comment

N120 Y.97758

scomm ->

scomm_saved -> My Operation Comment

( MY MANUAL ENTRY )

N122 X-.86478

scomm ->

scomm_saved -> My Operation Comment

N124 Y0.

scomm ->

scomm_saved -> My Operation Comment

N126 G40 X0.

scomm ->

scomm_saved -> My Operation Comment

N128 M50

N130 M30

%

 

quote:

What is a 'Manual Entry' string?

‘Manual Entry’ functionality is accessed via the ‘Change at Point’ dialog.

You can access the Chain at Point dialog ways…

Right after you exit the Contour parameters you have the ‘endpoint to change’ option.

or

Highlight the chain in the Chain Manager and the right-click menu has a ‘Change at Point’ option

Link to comment
Share on other sites

Roger,

I am not getting anything at beginning either.

 

this is only place scomm is in my code:

_________________________________________________

pcomment2 #Comment from manual entry

scomm = ucase (scomm)

if gcode = 1007, "(", scomm, ")"

else, "(", scomm, ")", e

 

 

&

 

 

prapidout #Output to NC of linear movement - 2D rapid

pcantxt1, pbld, n, sgabsinc, pccomp, sg20code, pwtcode,

pfxout, pfyout, pzout, pwtout, strcantext, e

n, "G92", e #added

n, "M98 P5001 K", scomm, e #added to put in value for scaling

pwtoutaft

_________________________________________________

 

 

headscratch.gif

 

Thanks, Mark

Link to comment
Share on other sites

my code:

_________________________________________________

psof #Start of file for non-zero tool number

pcuttype

g20code = zero

cc_pos = zero

prv_xia = vequ(startx)

prv_uia = vequ(startx)

*progno,"( ", progname, ")", e #*added to put name at beginning

comment

pbld, n, *sg20code, *smetric, *sgabsinc, [if feed_out, "G94"], e

"M23", e#***************************added

"M24", e#***************************added

"M27", e#***************************added

"M28", e#***************************added

"D0", e#****************************added

if strtflag = one, ptlch_strt

else,

[

prv_g20code = -1

prv_xabs = c9k

prv_yabs = c9k

ptlch_nstrt

]

pbld, n, pconchg, e

motst = one

sof = zero

_________________________________________________

 

Does this help??

 

Thanks,

Mark

Link to comment
Share on other sites

That the only place that scomm appears is in the pcomment2 postblock is fine. There must be a pcomment postblock that calls this pcomment2 postblock.

It is the comment command in your psof that should be triggering a call to pcomment.

 

Note that you can get ‘comments’ to do a lot, but there are “special” in how they are processed, so they can be a bit tricky to work with.

comment is an MP command, which if there are any comment strings currently in MP’s comment buffer will cause a call to the pcomment postblock. Now the pcomment postblock is also kind of “special”. That is why you’ll see the vast majority of posts just call the pcomment2 postblock that does the actual output of what is in the (predefined) string variable scomm.

Got that ? confused.gif

 

Anyway with what I'm seeing I cannot tell for sure why you're not getting anything.

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