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:

Adding programmer name to post?


Recommended Posts

You can create a Prompt question, by adding a 'fq' statement to format the question, and then using the command 'q1' to call the question. This is explained pretty well in the MP Documentation Portfolio.

 

Are you sure you want to prompt the user? You can use the 'sysinfo' function to get the Windows User Name for whoever is logged into the computer. That way you aren't interrupted with a prompt question, and the user can't enter the wrong information.

 

Try doing a search for 'sysinfo' in the Post development forum and you should get some pretty good info about using it.

 

Hope that helps,

 

Colin

  • Like 1
Link to comment
Share on other sites
  • 3 weeks later...

I did it, I think your post should look like this and it works.

 

-------------------------

 

# --------------------------------------------------------------------------

# Misc strings

# --------------------------------------------------------------------------

snull : "" # Null character string

sdot : "." # dot string

stilde : "~" # Tidle string

slbracket : "("

srbracket : ")"

sslash : "/"

ssemicolon : ";"

snocomm : "DEFINE TOOL NAMES"

stoper : "" # String for tool notes

spostname : "S56 Makino" # Post name

snullop : "UNDEFINED OPERATION"

slicense : "CalMax Technology Inc."

scomm_sav : ""

scomm_str : "("

scomm_end : ")"

slockcomm : "LOCK"

sunlockcomm : "UNLOCK"

sconstplname : "" #20010 - Construction Plane Name

sconstplcomm : "" #20011 - Construction Plane Comment

stoolplname : "" #20012 - Tool Plane Name

stoolplcomm : "" #20013 - Tool Plane Comment

swcsplname : "" #20014 - WCS Plane Name

swcsplcomm : "" #20015 - WCS Plane Comment

smatlname1 : "" #20016 - Material Comment

smatlname2 : "" #20017 - Material Comment

stpgrpname : "" #20018 - Toolpath Group Name (name of operations Parent TP Group)

sindividualoperation ""

stotaloperation ""

scustomername ""

spartname ""

spartnumber ""

spartrevision ""

sprogrammer ""

setupby ""

 

 

# --------------------------------------------------------------------------

# Question format statements

# --------------------------------------------------------------------------

fq 1 stock_typ "Predator Stock [0=Box,1=Cylindrical]"

fq 2 cyl_typ "Cylindrical Stock Axis [1=X,2=Y,3=Z]"

fq 3 sindividualoperation What Op Number Is This?

fq 4 stotaloperation How Many Ops Do You Have?

fq 5 scustomername Customer Name?

fq 6 spartname Part Name?

fq 7 spartnumber Part Number?

fq 8 spartrevision Part Revision?

fq 9 sprogrammer Programer Name?

fq 10 setupby Who Sets This Job?

 

 

pheader$ #Call before start of file

hour = int(time$)

min = int((time$ - hour)* 100)

if hour > 12, hour = hour - 12

if hour = 0, hour = 12

year$ = year$ + 2000

"%", e$

spaces$=0

*progno$, " ", scomm_str, snamenc$, sextnc$, scomm_end, e$

#scomm_str, spathnc$, scomm_end, e$

#*e$

scomm_str, "SOURCE FILE= ", smcname$, smcext$, scomm_end, e$

########## Posted Date & Time ##########

"(POSTED ON ", *smonth, ".", *day$, ".", *year$ # MON-DD-YYYY

" AT ", time$,")", e$ # 24 hour

#scomm_str, smcpath$, scomm_end, e$

if spostname_sav = snull, spostname_sav = spostname

scomm_str, snamepst$, scomm_end, e$

*e$

q3

"(OPERATION # ", sindividualoperation,"",

q4

" OF ", stotaloperation,")", e$

"(CUSTOMER NAME= "

q5

"", scustomername,")", e$

q6

"(PART NAME= ", spartname,")", e$

q7

"(PART#= ", spartnumber,"",

q8

" REV.", spartrevision,")", e$

q9

"(PROGRAMMER= ", sprogrammer,")", e$

q10

"(SETUP BY= ", setupby,")", e$

*e$

  • Thanks 1
Link to comment
Share on other sites
  • 2 months later...

You can create a Prompt question, by adding a 'fq' statement to format the question, and then using the command 'q1' to call the question. This is explained pretty well in the MP Documentation Portfolio.

 

Are you sure you want to prompt the user? You can use the 'sysinfo' function to get the Windows User Name for whoever is logged into the computer. That way you aren't interrupted with a prompt question, and the user can't enter the wrong information.

 

Try doing a search for 'sysinfo' in the Post development forum and you should get some pretty good info about using it.

 

Hope that helps,

 

Colin

 

Colin,

 

Sorry for bombing this thread. I have a POST question and cannot send you a PM message.

I would like to have two-line operation comments, I am currently able to write them in the operation window by holding Ctrl+Tab and get to the bottom of my original comment. This however does not do well with the posted output. Can you help please.

 

GM

Link to comment
Share on other sites

I believe the comment you enter in the dialog only gets loaded into a single string variable: 'scomm$'. So if you wanted multi-line output, you would need to add some logic in the 'pcomment2' section of the post to handle breaking the sting, and outputting it as multiple output lines.

 

To break the string, I would suggest adding some sort of Keyword to your comment string. Something easy to identify like 'BRK', or some other non-standard ASCII Character that you wouldn't normally use in the comment. For example, you could use a Tilde: '~', and search the comment string for that character. If found, you could use the 'brksps' function to break the string into multiple lines.

 

That should be fairly simple to do. Can you post up an example of the comment string(s) you would like to output? By the way, what is the reason you need multiple lines for the comment, is it a character limit on the control?

 

Thanks,

 

Colin

  • Like 1
Link to comment
Share on other sites

No character limit. While spotting for example on top I describe the feature and on the bottom I could write a diameter to hold for an edge break. It can also be used for threaded holes in order to communicate to the operator what diameter to hold for a lead in thread. All of this of course if it is not already called out on the print. Thanks !

 

GM

Link to comment
Share on other sites

Colin,

 

If you notice that above is a tungaloy facemill, its a facing cycle which has no cutter comp. Is there a way for the post not to output this when it is either a drilling tool or facing tool, or better yet if there is no cutter comp?. Wait that may be answer...jejeje

 

Edit:

I tried using the comp as a trigget, however the variable is initialized as comp_type : 0. Can this be safely changed to zero since each tool will change it as needed ? Below is my logic:

 

if gcode$ = 1008,
 if comp_type <> 0,
 [
 sopen_prn, scomm$, sclose_prn, e$		 #Operation comment &
 pcutinfo			 #Stock and Comp comment
 ]
 else,
sopen_prn, scomm$, sclose_prn, e$			 #Operation comment Only

 

pcutinfo #Stock and Comp output
[if comp_type > 0 & comp_type < 4, sopen_prn, *tloffno$, sdash, *scomp_type, sclose_prn],
 [if xy_stock <> 0 | z_stock <> 0, sopen_prn, *xy_stock, sdash, *z_stock, sclose_prn], e$

 

I modified the original code that went into the tool table to create the block for pcutinfo.

Link to comment
Share on other sites

Can you put up some sample output?

Colin,

 

Is there any other way of getting your input on some POST mods?

 

I am getting an error or so I think. I am outputting a modified tool table, for some reason when I use a No. Drill, the string is blank. What is this due to, all I modified was a few extra strings I didnt want. See my code below :

pcutinfo #Stock and Comp output
[if comp_type > 0 & comp_type < 4, sopen_prn, *tloffno$, sdash, *scomp_type, sclose_prn],
 [if xy_stock <> 0 | z_stock <> 0, sopen_prn, *xy_stock, sdash, *z_stock, sclose_prn], e$
ptooltable	 #Tooltable output
 sopen_prn, *t$, sdash, pstrtool,
 #[if comp_type > 0 & comp_type < 4, sdelimiter, *tloffno$, sdelimiter, *scomp_type, sdelimiter, *tldia$],
 #[if xy_stock <> 0 | z_stock <> 0, sdelimiter, *xy_stock, sdelimiter, *z_stock],
 sclose_prn, e$
pstrtool	 #Comment for tool
 if strtool$ <> sblank,
 [
 strtool$ = ucase(strtool$)
 *strtool$
 ]

Link to comment
Share on other sites

I believe the comment you enter in the dialog only gets loaded into a single string variable: 'scomm$'. So if you wanted multi-line output, you would need to add some logic in the 'pcomment2' section of the post to handle breaking the sting, and outputting it as multiple output lines.

 

To break the string, I would suggest adding some sort of Keyword to your comment string. Something easy to identify like 'BRK', or some other non-standard ASCII Character that you wouldn't normally use in the comment. For example, you could use a Tilde: '~', and search the comment string for that character. If found, you could use the 'brksps' function to break the string into multiple lines.

 

That should be fairly simple to do. Can you post up an example of the comment string(s) you would like to output? By the way, what is the reason you need multiple lines for the comment, is it a character limit on the control?

 

Thanks,

 

Colin

 

How do I search the comment string ?

Link to comment
Share on other sites

Colin,

 

Is there any other way of getting your input on some POST mods?

 

I am getting an error or so I think. I am outputting a modified tool table, for some reason when I use a No. Drill, the string is blank. What is this due to, all I modified was a few extra strings I didnt want. See my code below :

pcutinfo #Stock and Comp output
[if comp_type > 0 & comp_type < 4, sopen_prn, *tloffno$, sdash, *scomp_type, sclose_prn],
 [if xy_stock <> 0 | z_stock <> 0, sopen_prn, *xy_stock, sdash, *z_stock, sclose_prn], e$
ptooltable	 #Tooltable output
 sopen_prn, *t$, sdash, pstrtool,
 #[if comp_type > 0 & comp_type < 4, sdelimiter, *tloffno$, sdelimiter, *scomp_type, sdelimiter, *tldia$],
 #[if xy_stock <> 0 | z_stock <> 0, sdelimiter, *xy_stock, sdelimiter, *z_stock],
 sclose_prn, e$
pstrtool	 #Comment for tool
 if strtool$ <> sblank,
 [
 strtool$ = ucase(strtool$)
 *strtool$
 ]

 

Are you sure there is a string in the tool definition? Your code for the tool comment looks good. There is a post block call to 'pstrtool', and in that post block, we check to see if the 'strtool$' variable is blank, or if it has some string characters. If characters are found, we use the 'ucase' function to convert any of the Alpha characters to Upper Case.

 

So first, I would check your tool definition to make sure there is a string present in the tool name.

Link to comment
Share on other sites

Are you sure there is a string in the tool definition? Your code for the tool comment looks good. There is a post block call to 'pstrtool', and in that post block, we check to see if the 'strtool$' variable is blank, or if it has some string characters. If characters are found, we use the 'ucase' function to convert any of the Alpha characters to Upper Case.

 

So first, I would check your tool definition to make sure there is a string present in the tool name.

There is a string in the tool definition, for some reason it wasnt being output. I changed it to something else and all of the sudden we get the output to what it was before I changed it; weird. Can you please take a look at the following code: I cannot get brksps to work properly, I know im missing something.

pstrtool	 #Comment for tool
if strtool$ <> sblank,
 [
 strtool$ = ucase(strtool$)
 if strtool$ = sstar,
	 [
	 brksps = 1
	 *strtool$, sclose_prn,e$
	 sopen_prn, *strtool$
	 ]
 else, *strtool$	
 ]

I tried brksps$ but that did not work either.

Link to comment
Share on other sites

I've seen it before where you edit the 'tool name' and making only this edit to the tool does not require a regeneration. Because the path isn't regenerated, the NCI does not contain the new 'tool name' string, so the data never gets passed to the post.

 

Here is some sample code that will test the Operation Comment string (scomm$) for a Tilde character (~) and will break the string into two separate comment strings, then output them. (It also removes the Tilde from output by breaking it into a temporary string and then flushing that string at the end of the implied post block.)

 

pcomment$	 #Comment from manual entry (must call pcomment2)
 pcomment2 #Required if doing boolean 'if' logic testing!

strtilde	 : "~" #String for Tilde character "~"
strtemp    : ""   #String for comment break
str1	      : ""   #Output string for broken comment (pcomment2)


pcomment2	 #Output Comment from manual entry
 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$ = 1008,
 [
 if strstr(strtilde, scomm$) > zero, #Search 'scomm$' for the tilde character
	 [
	 strtemp = brksps(st_str_ix$, scomm$) #Break string at Tilde character
	 str1 = brksps(two, strtemp)		 #Use brksps with an index of '1' to remove Tilde
	 #scomm$ now holds the portion of the string before the Tilde, and str1 now holds the
	 # portion of the string after the Tilde. The Tilde now resides in strtemp, which can
	 # just be cleared.
	 sopen_prn, no_spc$, scomm$, no_spc$, sclose_prn, e$ #Operation comment
	 sopen_prn, no_spc$, str1, no_spc$ sclose_prn, e$ #Operation comment
	 str1 = sblank, strtemp = sblank #Clear temp strings(scomm$ gets reset by MP automatically)
	 ]
 else, sopen_prn, scomm$, sclose_prn, e$ #Operation comment
 ]
 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
# --------------------------------------------------------------------------
# Start of File and Toolchange Setup
# --------------------------------------------------------------------------

 

Hope that helps,

 

Colin

Link to comment
Share on other sites

Please note that I just initialized three string variables before the 'pcomment2' post block. Normally you should put those variables with the rest of the miscellaneous string variables at the top of the post...

 

The functions I used 'strstr' and 'brksps' are well documented in the MP Documentation Portfolio. Please check with your Reseller to obtain a copy.

 

Thanks,

 

Colin

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