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:

comment separation


Recommended Posts

Hello everyone,
   I think it is the hardest thing is to write BUFFER and separation of the COMMENT$.  

 

Like... COMMENT$ we have OPERATION COMMENT, AS CODE, AS COMMENT, MACHINE GROUP, TOOL GROUP...  Is there a better way to separate them with out hassle?  

I have spent a lot of time to find out which way is good in this section and honestly I have no luck.  Would you guys please direct me to right right path? 
 

PS= See image  below.


Thank you so much.

=======================
 

pcomment$       #Output Comments
      scomm$ = ucase (scomm$)
      if gcode$ = 1008, no_spc$, sopen_prn, no_spc$, scomm$, no_spc$, sclose_prn, e$  #Operation comment

pcomment0$
      scomm$ = ucase (scomm$)
      if gcode$ = 1005, sopen_prn, scomm$, sclose_prn, e$  #Manual entry - as comment
      if gcode$ = 1006, scomm$, e$                         #Manual entry - as code
      if gcode$ = 1007, sopen_prn, scomm$, sclose_prn      #Manual entry - as comment with move NO e$
      if gcode$ = 1026, scomm$                             #Manual entry - as code with move NO e$
      if gcode$ = 1051, sopen_prn, scomm$, sclose_prn, e$  #Machine name
      if gcode$ = 1052, sopen_prn, scomm$, sclose_prn, e$  #Group comment
      if gcode$ = 1053, sopen_prn, scomm$, sclose_prn, e$  #Group name
      if gcode$ = 1054, sopen_prn, scomm$, sclose_prn, e$  #File Descriptor

pmanualentrycomment
      if gcode$ = 1005, sopen_prn, scomm$, sclose_prn, e$  #Manual entry - as comment
      if gcode$ = 1006, scomm$, e$                         #Manual entry - as code
      if gcode$ = 1007, sopen_prn, scomm$, sclose_prn      #Manual entry - as comment with move NO e$
      if gcode$ = 1026, scomm$                


============================= Post outcome=========================
O1234(T.NC)
(SOURCE FILE= T.MCAM)
(POSTED ON NOV. 05 2018 AT 10:12)
(*)
(TOOLS LIST)
(T1 |TDIA. - .625 5/8 SPOTTER|H1)
(OPERATION COMMENT HERE, FIRST TIME HERE)
(*)
N1( OPERATION COMMENT HERE, FIRST TIME HERE ) ================> RIGHT PLACE
G0 G17 G40 G49 G80 G90 M19
G91 G28 Z0.
T1 M6( 5/8 SPOTTER)
G0 G90 G54 X-1.7079 Y.7486 S2139 M3
G43 H1 Z2.
M8 G98 G81 Z-.125 R.1 F1.03
X-1.0577 Y.7166
X-.6777 Y.9821
X-1.6392 Y-.5563
X-3.228 Y-.071
X-1.2179 Y-1.4125
X1.424 Y-1.962
X2.2207 Y-.7532
X1.7399 Y1.353
X.989 Y1.8475
G80(OPERATION COMMENT HERE, SECOND TIME HERE AS WELL) ================> WRONG PLACE
M9
G91 G28 Z0.
M01
(*)
(AS CODE HERE)================> RIGHT PLACE
N102( OPERATION COMMENT HERE, SECOND TIME HERE AS WELL )================> RIGHT PLACE
G0 G17 G40 G49 G80 G90 M19
G91 G28 Z0.
T1 M6( 5/8 SPOTTER)
G0 G90 G54 X-1.7079 Y.7486 S3500 M3
G43 H1 Z2.
M8 G98 G81 Z-.125 R.1 F10.
X-1.0577 Y.7166
X-.6777 Y.9821
X-1.6392 Y-.5563
X-3.228 Y-.071
X-1.2179 Y-1.4125
X1.424 Y-1.962
X2.2207 Y-.7532
X1.7399 Y1.353
X.989 Y1.8475
G80 M9
G91 G28 Z0.
G28 Y0. M5
M30
%

Capture.PNG

Link to comment
Share on other sites

Steven,

The Comment Strings are already stored by MP, in an Internal String Buffer. This is done automatically for you, by MP.DLL.

Comments are "written to the Comment Buffer", and are basically "stored for you", until MP encounters 'comment$', as a "command variable". This means that there is a single line of code in a Post Block, with only the command variable 'comment$'.

When the 'comment$' variable is read on a line by itself, MP will then process every string that is stored in this internal buffer, by passing each string to the 'pcomment$' Post Block. Each comment string sets the NCI Variable 'gcode$' to indicate what "type" of comment is being processed.

MP will always dump all of the stored comment strings, so your logic must account for that.

  • Thanks 1
Link to comment
Share on other sites
On 11/5/2018 at 10:50 AM, Colin Gilchrist said:

Steven,

The Comment Strings are already stored by MP, in an Internal String Buffer. This is done automatically for you, by MP.DLL.

Comments are "written to the Comment Buffer", and are basically "stored for you", until MP encounters 'comment$', as a "command variable". This means that there is a single line of code in a Post Block, with only the command variable 'comment$'.

When the 'comment$' variable is read on a line by itself, MP will then process every string that is stored in this internal buffer, by passing each string to the 'pcomment$' Post Block. Each comment string sets the NCI Variable 'gcode$' to indicate what "type" of comment is being processed.

MP will always dump all of the stored comment strings, so your logic must account for that.

 

Hi Colin,
   Thank you for sharing since your time is very valuable.  Is there any tricks to separate them individually?  I recall back 3 year ago, you trained me on the COMMENT$ separation.  Is there any link that can guide me so I can separate them? into individually?


Thank you Colin.

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