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:

Attach a file to Post.


Recommended Posts

Can anyone tell me how to add a file to the X2 Post? I would like to attach the .set setup sheet file to the post so I can output it as text along with the Code for the machines.

I can do this by text editing but I would like to do this in the post file if I can. Any help?

Thanks in advance...I have learned a lot about Mcam and posts just from this Forum... Great work! cool.gif

Link to comment
Share on other sites

Thanks Roger,

Yes, I want to run them at the same time and also add the .set Setup file into the Post so when I process it and post it out the setup sheet will be in the .nc file output.

The reason is so I only have one file to DNC to the machine-the .NC file. The operator will print out a hard copy of the file (setup sheet included with CNC program) but the setup sheet will be ignored by the machine control.

We already do this currently with SmartCam....Old version.... but we are changing everything over to MasterCam X2.

Link to comment
Share on other sites

Art,

 

There is a way.

It is a bit of a kludge, but it can be done.

 

1> The NC is posted as normal.

2> Now using the 'dll' command available in the MP language you can then execute the MP.DLL (the bit that does the post processing) again to create the DOC (Setup sheet file).

3> Now the NC file is closed, so you cannot 'merge' these files (reasonably) using any internal PST commands, so...

You can use a VB Script to do this. The VB Script is fired off from within the PST (using the 'runvbs' command), so this entire process happens automagically when you post process your toolpaths using a PST customized with this "special" code combined with this 'concatenate files' VB Script.

 

I'm not a VB Script guru by any means, but I've got all this working and will get it out to you tomorrow.

Link to comment
Share on other sites
  • 5 weeks later...

On the forum FTP site, in the "Text_&_post_files_&_misc" folder you'll find MP_SS.ZIP

 

The MP-SS.PST is an updated (from v9.1) sample I did several years ago, that demonstrated how to run a SET type (SetupSheet) generator immediately after creating the NC file. Also a couple years ago I did an example of running a VBScript from a PST.

 

I combined these 2 concepts to accomplish the task at hand.

 

1> Create the NC file.

2> Create the .DOC (SetupSheet) file.

3> Combine these two files.

 

See the code in the example PST, between these markers ->

# ADDED CODE (START)

..see code here..

# ADDED CODE (END)

 

You probably will need to change at least this definition in this section, to define the 'base" folder of your X installation ->

 

sMCAMX "c:mcamx2-mr1" # Mastercam X 'base' folder

-----

At the end of the PST run (creating the NC output file) it has commands to re-run the toolpaths thru the specified .SET (Setup Sheet) generator.

Note that when this occurs the NC file is already closed.

So I don’t believe you can (reasonably) use a MP “Buffer Merge” type command to combine the NC & DOC into a single file, but...

 

You can do this “file concatenation” using a VB Script which you can call from within the PST after the SetupSheet has run. (In the ppost$ postblock).

 

Since there is no way to “directly” pass parameters to a VBScript, we need another method to pass the names of the 2 files we wish to concatenate.

We can do this via a file. The PST creates a file (Concatenate_params.tmp) that contains the 2 filenames.

The Concatenate_files.VBS then reads this file and does its concatenation process.

 

code:

ppost$ # This postblock is called AFTER all the files from the (main) PST run are closed! 

 

# Call the MP.DLL (the Post Processing DLL) with the parameter line

# to process the toolpath data thru the specified .SET file.

 

sDLL = SMCAMX + sDLL # Add the ‘base’ path

result = dll (sDLL, sPARAMS)

 

#Run the VBS script (FULL Path/Name is required !)

 

sVBS = SMCAMX + sVBS # Add the ‘base’ path

result = runvbs(sVBS)

Link to comment
Share on other sites

Roger and Others,

It did work just fine Roger, Thanks again.

I did have to add this to every post I have and then debug each, but it was worth it. Now I only have one file to keep track of, update, send to Machine control etc...

 

You guys are GREAT.

Thanks for TEACHING me to FISH.....

 

Art Bailey

"Tarheel"

Dayton, Ohio idea.gifidea.gifidea.gifidea.gif

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