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:

Want the post to Prompt me...


Dustin S.
 Share

Recommended Posts

We have 2 programmers here and we usually initial our programs just so we know who programmed it and I read a post on here before that had to do with just that Prompting for programmer

 

Ive gotten my post to prompt me for the 1=DAS 2=JW but then it doesn't put that information in the program.

code:

programmer : 0      #Prompts for programmers name 1=Dustin 2=Joe    DAS


code:

 fq 3 programmer "Enter Programmer's Number [1=Dustin,2=Joe]" 

code:

 pcollect   # Collect info         

while programmer < 1 | programmer > 2, q3 #force programmer to enter a 1 or 2

if programmer = 1,

[

sprogrammer = "Dustin"

]

else,

[

sprogrammer = "Joe"

]

code:

 scomm_str,  *month$, "/", *day$, "/", year$, " ", *hour, ":", *min, [if time$ < 12, "AM"], [if time$ >= 12, " PM"] " EC-400 ", *sprogrammer, scomm_end, e$ 

The only part Im not sure is where to put the pcollect i have it under the "Start of File and Toolchange Setup" portion of the post?

 

any help would be great

 

Thanks guys

Link to comment
Share on other sites

I would put the call to the pcollect in top of the pheader$ postblock.

code:

psof$            #Start of file for non-zero tool number  

pcollect # Get programmer info

...rest of postblock...

Where (which postblock) is this code located? ->

code:

 scomm_str,  *month$, "/", *day$, "/", year$, " ", *hour, ":", *min, [if time$ < 12, "AM"], [if time$ >= 12, " PM"] " EC-400 ", *sprogrammer, scomm_end, e$

Link to comment
Share on other sites

the pcollect is the first thing after the pheader line

 

moved pcollect and post block to psof$

 

That line is located in my pheader its my date,time,machine,programmer line.

 

also if i change the *sprogrammer to programmer within my pheader line it will out put the word programmer along with my selection number in the program "programmer 1."

Link to comment
Share on other sites

pheader$ is called before psof$ so basically you are posting the info before you prompt for it. Move the pcollect call to the top of pheader$.

 

Personally, I wouldn't put the logic into a separate postblock at all, I'd just put the logic right at the top of pheader$ itself. I limit separate postblocks to code that I need to re-use in other areas.

 

[ 09-10-2008, 11:52 AM: Message edited by: Paul Decelles from CNC Software ]

Link to comment
Share on other sites

pcollect has a post block that i have put under the psof$

 

pcollect also has a call block located right after my pheader

 

so pheader is read it calls pcollect and ask for data? pcollect isn't collecting data... So where can i move the pcollect post block to collect data before pheader calls for it?

 

also i think my problem is within the pcollect post block

 

here it is again along with locations:

 

This piece is located within "Common User-defined Variable Initializations (not switches!)"

code:

 programmer : 0      #Prompts for programmers name 1=Dustin 2=Joe    DAS 

This piece is under "Question format statements"

code:

 fq 3 pick "Enter Programmer's Number [1=Dustin,2=Joe]" 

This is in psof$

code:

 psof$            #Start of file for non-zero tool number

pcollect # Collect info

while programmer < 1| programmer > 2, q3 #force programmer to enter a 1 or 2

if programmer = 1,

[

sprogrammer = "Dustin"

]

else,

[

sprogrammer = "Joe"

]


The callout to pcollect is with pheader

code:

 pheader$         #Call before start of file 

pcollect

This is my Date/Time/Machine/Programmer line within my pheader

code:

 scomm_str,  *month$, "/", *day$, "/", year$, " ", *hour, ":", *min, [if time$ < 12, "AM"], [if time$ >= 12, " PM"] " EC-400 ", *sprogrammer, scomm_end, e$ 

keep it comen im sooo close

Link to comment
Share on other sites

Yes sir. All user defined variables (string or numeric) must be initialized before they can be used. I guess I assumed that he had initialized the variable, thanks for pointing out the omission.

 

A quick look in the error log or posting through the debugger (X3) will help in figuring out when variables are not initialized.

 

 

Edit -

 

I just spotted another thing that may be causing a problem. In the initial post you had the fq setup as:

 

code:

fq 3 programmer "Enter Programmer's Number [1=Dustin,2=Joe]" 

Later you have it as:

 

code:

 fq 3 pick "Enter Programmer's Number [1=Dustin,2=Joe]"

It was correct the first time...

Link to comment
Share on other sites

Since someone previously mentioned a string selector, I thought I'd throw an example of that out there as well...

 

code:

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

programmer : 0

fq 3 programmer "Enter Programmer's Number [1=Dustin,2=Joe]"

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

# Programmer Name Selector

sprog0 #Leave blank

sprog1 "DUSTIN"

sprog2 "JOE"

sprogrammer

 

fstrsel sprog0 programmer sprogrammer 3 -1

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

pheader$ #Call before start of file

while programmer < 1 | programmer > 2, q3 #force programmer to enter a 1 or 2

scomm_str, *month$, "/", *day$, "/", year$, " ", *hour, ":", *min, [if time$ < 12, "AM"], [if time$ >= 12, " PM"] " EC-400 ", *sprogrammer, scomm_end, e$

While a string selector will work, it really does not make much sense to use it in this situation. The point of a string selector is to allow for modal output of strings. Obviously this string is only going to be output once so this mechanism really is not necessary.

Link to comment
Share on other sites

How do I initializing the string variable 'sprogrammer'? Not sure what you guys mean by that?

 

All the code is matched up correctly I think. I was changing things to see if I had messed up code. programmer is the variable and used to callout my format statement. the sprogrammer is used as my string variable?

 

This is my first time tryen this usually Im a cut the code not working paste the code that does work.

 

How do I initialize my string variable "sprogrammer" Is my current question

Link to comment
Share on other sites

For refrence in the future and because it took me 2 days to get it here is what it took in the end:

 

code:

programmer : 0      #Prompts for programmers name 1=Dustin 2=Joe    DAS  

code:

 fq 3 programmer "Enter Programmer's Number [1=Dustin,2=Joe]" 

code:

 sprogrammer  # Initialize a string variable

# Line MUST start in the first column!

# And NOT be 'inside' a postblock.

 

pcollect # Collect info

while programmer < 1 | programmer > 2, q3 #force programmer to enter a 1 or 2

if programmer = 1,

[

sprogrammer = "Dustin"

]

else,

[

sprogrammer = "Joe"

]

code:

 pheader$         #Call before start of file 

pcollect

code:

 scomm_str,  *month$, "/", *day$, "/", year$, " ", *hour, ":", *min, [if time$ < 12, "AM"], [if time$ >= 12, " PM"] " EC-400 ", *sprogrammer, scomm_end, e$ 

and it looks like this when done:

(09/11/2008 9:31AM EC-400 Dustin)

 

I took the idea from code_breaker as seen in the link in my initial post.

Link to comment
Share on other sites

We have our post fill in this info for us using the nci file placement. My config files save the NCI to a Dummy directory named KARL the other guy writes to the dummy file TOM..... then the post can determine who is posting and just fill it in. If the directory in not correct it will prompt for the programmer name. This is in ver. 9 but same logic should work for X.

 

Karl

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