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:

ASCII code for Carriage return in Manual Entry?


Bill Craven
 Share

Recommended Posts

I thought I had this written down, but can't find it.

When entering lines in Manual Entry as Code, I sometimes want to creata a couple of blank lines before or after a comment to the operator.

I can do this by adding () parenthesis, but the parenthesis are displayed.

 

The goal is to have the Operator comment standing alone so that they can easily see it.

 

Thanks,

 

Bill

Link to comment
Share on other sites

Just use the [Enter] key, to add multiple blank lines.

I just created a test Manual Entry with the following 6 lines:

M00

(COMMENT)


(LINE-BREAKS)

and got this in my NC Code:

O0000 (T3)
(CYCLETIME MINS)
M00

(COMMENT)


(LINE-BREAKS)
(T20  - DIAL INDICATOR       - H20  - D20  - D0.2362")

So, the line-breaks will show up as blank-lines in the NC File...

I hope that helps...

  • Like 1
Link to comment
Share on other sites

Hi colin,

That didn't work for me.  (I am still on 2021, I don't know if that makes any difference)

This is what I put in the manual Entry (As Code)

()

M00
(Adjust Offset to Hold )
(3.426 +/-.001)

()

 

This is what I am getting.

()
M00
(ADJUST OFFSET TO HOLD )
(3.426 +/-.001)
()

 

I'll bet I have something in the post that is stripping blanks. 

 

Yeah,  I just ran it through several posts and most of them wouldn't post the empty lines.  (Lathe post, by the way)

One of the posts that I have did work as you suggested, which I like because I won't  have to remember Ascii codes.

 

I'll have to dig into the post.  I can figure that out.

Thanks for your help

 

 

 

 

 

 

Link to comment
Share on other sites

I found that the Manual Entry gcode "as code" is 1006.

the NCI file was outputting blank lines, but the post (MPLMaster) would not post blank lines.

Under  Pcomment2 the original line was:

      if gcode$ = 1006, scomm$,  e$                        #Manual entry - as code

I changed it to:

      if gcode$ = 1006, scomm$, " ", e$                        #Manual entry - as code
By adding a space, the post now posts the blank lines.  If there is real data from the Manual entry, there will be one extra space at the end of the line which no one will see.

This modification is: Adequate, not elegant.

 

  • Like 2
Link to comment
Share on other sites

Hi Bill,

I'm not sure why MPLMaster isn't outputting a blank line for a 1006 comment. The blank lines are being written to the NCI File, so there is some magic going on, underneath the hood here, to prevent the Comment Post Block from outputting a blank line.

I tried messing with 'comm_filter$' and 'commvar$', to see if either of those could be messing with the output, but no luck there.

Fortunately, we can test the 'scomm$' variable, and account for this condition by doing the following:

      if gcode$ = 1006,
        [
        if scomm$ = sblank, *e$
        else, scomm$, e$                        #Manual entry - as code
        ]

I modified the 'if gcode$ = 1006' line, to have two possible conditions "if blank, force out a blank line", and "if not-blank, just output the comment like normal".

  • Thanks 1
  • Like 2
Link to comment
Share on other sites
16 hours ago, Bill Craven said:

Hi Matthew,

This problem is solved.

I was looking for a way to enter an ASCII code for the end of block, but there may not be a way to do that in Manual Entry.

Modifying the post is easier.

 

21 hours ago, Matthew Hajicek - Conventus said:

Are you looking for the end of block character?  ";"

 

Hi Matt,

The real issue here is that MP.DLL is stripping out the "blank lines" from a Manual Entry Operation. I am guessing there is some mechanism at play here, which is causing those empty 'Comment Strings' to get skipped.

Typically, the End of Block characters are ASCII 10 + ASCII 13. There is a function inside MP for turning an Integer into any of the ASCII Characters for output. (no2asc)

Using the 'no2asc(13)' function, we can output any Ascii characters, or add them to a String Variable for output.

In this case, the problem is not related to an EOB character issue.

Also, the Control Definition File has a field where you can enter an Alternate EOB Character, so MP will kick out whatever is needed, if you have a machine that requires special characters. 

 

Link to comment
Share on other sites
2 minutes ago, Colin Gilchrist said:

The real issue here is that MP.DLL is stripping out the "blank lines" from a Manual Entry Operation. I am guessing there is some mechanism at play here, which is causing those empty 'Comment Strings' to get skipped.

I know that I had to modify most of my posts, developed from Mpmaster, because the pcomment2 postblock has this line in it:

if gcode$ = 1006, n$, pspc, scomm$, e$

I changed it to this:

if gcode$ = 1006, n$, pspc, scomm$,"", e$

I realize I could probably just remove the "pspc" but at the time I wasn't sure if that would cause any other issues.

  • Like 1
Link to comment
Share on other sites
3 minutes ago, Colin Gilchrist said:

Using the 'no2asc(13)' function, we can output any Ascii characters, or add them to a String Variable for output.

But this function does not work from inside of Manual Entry.   (That is what I was originally trying to do)

If i add noasc(13) to a Manual Entry Operation, it outputs NOASC(13) to the NC code.

 

Modyfing the post is a much better solution.  

Link to comment
Share on other sites

Yes, correct Bill. That function only works from within the Post. You cannot "pass" it through Manual Entry as part of an existing Comment String (1005 or 1006, NCI G-Codes).

Modifying the 'if gcode$ = 1006' line, was the easiest way to detect a "blank comment string", and then force out the "empty line", with [  *e$  ].

 

 

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