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:

Format Output to use Columns or Tabs?


Recommended Posts

Is there a way to add tabs to the line output or set the specific location, column, of a string so it is offset from the rest of the line.  in the example belwo, the comment onthe line is just added as text in the tool call section like 

T$, "M03     (Tool Call)",e$

What I get is 

"T1 M03     (Tool Call)

T111 M03     (Tool Call)"

 

What I want is 

"T1 M03        (Tool Call)

T111 M03     (Tool Call)"

Something like 

T$, "M03", someway to call a tab, "(Tool Call)", e$

Does that make sense???

Link to comment
Share on other sites

You can pad spaces...one way is

"          ", t$, "M6", e$

and other way is to define a variable with a set number of spaces

s20space     : "                    "    #padded 20 space

and then use the s20space variable where necessary

  • Like 1
Link to comment
Share on other sites

Right now I do pad spaces where I can but in the instance of the tool post line, I can't because the tool call could be 1, 2 , or 3 characters long which would move it to 3 different locations depending on the tool number.  I can write a postblock to read the current string's length and then calculate the number of spaces needed but I was hoping there would be a super secret variable that's the opposite of no_spc$ that would move it to a specific column or by a specific number of tab keystrokes. 

Link to comment
Share on other sites

What you want to setup is some logic that reads the value of "t$", and then outputs a different "block" of spaces, based on the knowledge of "how many digits is the numeric variable". This would be for "numeric variables only".

For Strings, you can use the "String Length" function, to get the number of characters in the string, and then "append" (concatenate) additional space characters, to create output that maintains your "column spacing". Unfortunately, there is no way to control "starting column", as lines of G-Code are assembled, and "things added" to the string line (strings or numeric variables, with their associated prefix strings), one-at-a-time, until the line is forced out with the end-of-line variable (e$).

ptspc    #Post Block to pad Tool Variable Space Characters

      if t$ < 10, "   "

      if t$ > 9 & t$ < 100, "  "

      if t$ > 99, " "

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