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:

Posting of Stock Size


TeccBoxx
 Share

Recommended Posts

I was wondering is it thier a way to post the stock size and stock origin that are set in the job setup?

 

Reason new management are doing away with printers as they do not want any paper laying around about the jobs we are running so setup sheets are a no no now and we need to put all the information directly in the posted files.

 

I am currently using a modified mpmaster post.

Link to comment
Share on other sites

Take a look in the documentation folder for Mastercam. There is a file called Mastercam X Post Reference Guide. According to the guide, the parameters you will need to capture are:

 

Stock Origin values-

X - 19128

Y - 19129

Y - 19130

 

Stock size values -

 

X length - 19125

Y Length - 19126

Z Length - 19127

 

Start reading on page 30 of the post reference guide. There is a whole section on capturing operation parameters.

Link to comment
Share on other sites

Thanks for the quick reply Colin, I should have mentioned that I am still stuck with V9.1 frown.gif

 

I was thinking is thier a way to have question fields pop up, when it goes to post where I can enter information in them??

That might make it alot easier for a couple of the smaller items I needed.

Link to comment
Share on other sites

From the V9.1 Post Guide, Chapter 18, Prompt Questions:

 

quote:

 

February 2004 Mastercam Version 9.1 MP Post Processor Reference Guide 18-1

18 How Prompt Questions Work

Overview

 

You can allow the operator to set or change variable values or strings during the posting operation by using prompt questions. Prompt questions are post questions that cause the post processor to display a screen prompt during the posting process. The questions may be used to prompt the user to enter in data, and can store that data into a variable in the post for use in post calculations or output.

 

Defining a prompt question is a two-step process:

 

1. Define up to 20 prompt questions using the fq function. Each question can contain a maximum

of 80 characters, including the question number, and may also contain variables.

 

2. Insert a call to a specific question (that is, ask the question) in the post by inserting the question name (q1, q2, q3, etc.) on a postline at the point where you would like the question to be asked.

 

When the post is run and a question is encountered, the question is output to the screen and the post waits for a numeric or string reply. The reply will then be stored in a variable.

 

Note: The result numeric variable or string variable must be defined before the question is defined.

 

 

Format of a prompt question in the post-

 

fq 1 seqno Enter starting sequence number.

 

Where:

 

fq 1 = Question number (FQ [space] number)

seqno = Variable that holds the response to the question

Enter starting sequence number = Question string

 

A post variable can be used in the question itself if the variable is enclosed in double slashes

(//variable//).

 

For example:

 

fq 1 ofs Enter tool //t// offset:

 

If t = 3, the above code would display on the Mastercam prompt area when post processing:

 

“Enter tool 3 offset:”

 

and pass the response entered in the user-defined variable ofs.

 

Note: The variable in the question is formatted according to the assigned format statement.

 

Question definition for a numeric response-

 

thdtype : 0 # Declare a numeric variable to hold response to question 1

 

fq 1 thdtype Thread Type (0=simple G32, 1=complex G76, 3=box G92)

 

 

Question definition for string response-

 

sextaux # Declare a string variable to hold response to question 1

 

fq 1 sextaux Aux file name extension = # Override Aux file extension

 

Note: The result target variable must be defined before the question.

 

 

Inserting a question into a postline-

 

fq 1 seqno Enter starting sequence number # Define the prompt question

 

psof # Start of file for postblock

pinit

!opcode, !coolant

q1 # Ask the question defined by the ‘fq 1’ statement

if tcnt = 1, stagetool = 2

"%”, e

 

 

The q1 command calls the question defined by fq 1.

 

Example-

 

The following example shows adding a prompt question to a post. This example prompts the user to enter a part number, and then outputs the part number at the start of the NC output file.

 

 

1. Define a string variable (spartno) to store the part number retrieved through the post question.

 

spartno #Define empty string

 

2. Add the question definition to the post processor. The fq function must begin in column 1.

 

fq 1 spartno Enter the part number

 

3. Add the question call to post. (This depends on where you wish the question to be asked.) In this example, it is added to the pheader postblock

 

pheader #Header postblock

 

“%”, e

q1 # Question ‘Enter the part number’ is asked here…

 

4. Add a postline to output part number information to the NC output file.

 

psof #Start of file

pinit

progno

spartno = ucase (spartno) # Make it all UPPERCASE (optional)

“(Part Number: “, spartno, “)” # Output the part number that was entered at the question prompt

 

 

Merging files through prompt questions-

 

 

You can also use prompt questions to merge external ASCII files identified by the user into the NC program. In this example, the user will be prompted to enter the name of a file to merge into the NC output file. The predefined string scopyfile is provided to hold the contents of an external file. The mergeext function performs the merge operation by writing that external file’s contents to the NC file.

 

For example:

# Definition using ‘scopyfile’ as the target variable

 

fq 2 scopyfile Enter name of file to merge # Define prompt question 2

pheader # Header postblock

q2 # Display “Enter external file name” and read contents of response file into scopyfile.

mergeext # Merge contents of file ‘scopyfile’ to NC file.

 


HTH and happy post hacking wink.gif ,

Link to comment
Share on other sites

Tazzer,

 

Subject: Job Setup Stock Information...

 

I suggest taking a look at how this data is captured and output in the (v9) MILL.SET Setup Sheet generator.

 

No involved 'pre-read' needed to get this info.

 

*Ask a bunch of questions at posting time = YUCK!

Yes, this works, but I (my opinion here) would never use them - unless there is no other way to do it. I'm in a hurry and punching in numbers for the 3rd (!@%&!) question and I transpose a couple of them and... you can guess the rest. ;(

*Manual Entry data is OK when you enter it, but if the stock settings in Job Setup change it is now incorrect!

 

Sample of stock data(from Job Setup data) that is output by MILL.SET -->

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

PROGRAM NAME = STOCK_TEST

DATE PROCESSED = Feb-01-07

 

MATERIAL TYPE = ALUMINUM inch - 2024

 

STOCK SIZE = X5.0000 Y4.0000 Z1.7500

STOCK ORIGIN = X1. Y2. Z3.

(At Center, Z at Top)

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

You could do the same in your post processor.

 

These are pre-defined post variables ->

 

fmt X 7 stck_ht # X - Stock Height

fmt Y 7 stck_wdth # Y - Stock Width

fmt Z 7 stck_thck # Z - Stock Thickness

fmt X 2 stck_x # X origin of block

fmt Y 2 stck_y # Y origin of block

fmt Z 2 stck_z # Z origin of block

fmt 2 stck_crnr # Origin corner of stock

 

With these variables (formatted as desired) in your PST, you just call the pstock_info post block that you've copied out of the MILL.SET.

Just call pstock_info from the psof postblock like MILL.SET does and you done. wink.gif

 

*Note that pstock_info also outputs 'stknote' using a String Lookup Table.

So if you want that data you'll also need to copy this String Table from MILL.SET

 

#Select stock orientation note

stk0 "At Center, Z at Top"

stk1 "Upper Left corner, Z at Top"

stk2 "Upper Right corner, Z at Top"

stk3 "Lower Right corner, Z at Top"

stk4 "Lower Left corner, Z at Top"

stk5 "Upper Left corner, Z at Bottom"

stk6 "Upper Right corner, Z at Bottom"

stk7 "Lower Right corner, Z at Bottom"

stk8 "Lower Left corner, Z at Bottom"

stknote

 

fstrsel stk0 stck_crnr stknote

 

[ 02-01-2007, 08:14 AM: Message edited by: Roger Martin from CNC Software ]

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