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:

Pquestions in MCX posts.


monty
 Share

Recommended Posts

I am using Pquestions to put information like job name, Drawing No and Issue No, in nc output.

Is it possible that I can have a external file(same name as mcx file created by VB)and insted of asking questions post looks into this file and outputs in nc output.

headscratch.gif

Link to comment
Share on other sites

Yes I can use a manual entry but output comes after first toolchange and I want it in the header because I have lot of information on top of file coming from pheader, pwrrt and Ptooltable. I also use psof for bar pull and stockfeed routines.

Link to comment
Share on other sites

Don't know about the whole VB thing, but here is an example of how I'm pulling the "programmer name " from a text file that follows the user (as a network resource)

 

It prompts the programmer with a post question & gives them the opportunity to override it - but defaults to the value in the text file.

 

Below are all the strings, the buffer, post questions & logic (plus the text file example at the end) that Ive added in my post to make this happen.

 

Hope it helps - Jason

 

 

sbufname5$ "g:mcuser.txt" #File Path, Programmer name file, for header

 

 

sauthname "" # User input Q1-7

 

 

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

# Buffer 5 - Holds Username from File 'sauthname'

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

fbuf 5 0 80 1 1

 

 

fq 1 sauthname "Programmer is //sauthname//. [Enter] to Accept or Type New Value."

fq 2 sauthname "Enter Programmer Name. [ENTER] = None"

 

 

pheader$ #Call before start of file

if fexist(sbufname5$),

[

sauthname = rbuf(5,1)

q1

]

else,

q2

if sauthname = "", sauthname = "********"

 

 

 

if progno$ > 0, "O", *progno$, "(", sprogdesc, ")", e$

"(MACHINE - ", *smachine, " ", *scontrol, ")",e$

"(PROGRAM - ", *sprogname$, *sextnc$, ")", e$

"(DATE - ", month$ , "-", day$ , "-", year$ , ")", e$ #" )" 30 char wide

"(TIME - ", ptime, ")", e$

"(---------------)", e$

"(", *smcname$, *smcext$, ")", e$ #smcpath - full file path

"(PROGRAMMER - ", *sauthname, ")", e$

"(POST NAME - ", *snamepst$, ")", e$

"(MASTERCAM - ", "V", *vers_no$, *m_vers_no$, ")", e$

pspace,e$

 

 

g:mcuser.txt (below is what is in this text file)

 

J Tollefsen

(LEAVE THIS LINE AFTER NAME)

Link to comment
Share on other sites

Hi Jason,

Thanks for reply.

I tried similler thing a few months ago,

Here was my code.

 

fq 1 sfilename "Enter path, name and extension of the file to merge" #Define prompt for file to merge

 

sfilenotfound "File not found... Redo or Cancel file merge?" #Define error message to display if file not found

sstring1 #Record string for output

sfilename #Path, filename and extension of file to merge

 

rc1 : 1 #Initialize read counter for buffer 1

size1 : 0 #Initialize variable to hold buffer size

fbuf 1 0 80 1 1 #Declare buffer 1

 

It worked allright only thing I could not link it to looking for file I had to manually enter the path.

Link to comment
Share on other sites

Yea,

 

As you see, I've got mine as a static value in the post. It works for my application because this drive letter is associated with each users space on the network as they log in, so it always pulls from the same location - but yeilds the current user.

 

All I can think of would be if you were able to define the file in the root of the current directory (maybe "file.txt") and then keep your projects in individual directory's. Always calling the same text-file name (at the root of the current directory.) - but that might be a stretch.

 

Good luck.

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