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:

Capturing the Stock Type from Stock Setup


Recommended Posts

Hi Posts people,

 

I am trying to add the stock values for 3D simulation on the OSP control to the attached Okuma post. But I must be missing something and I am hoping that somebody there can give me a few minutes of their time.

My problem is that the Shape parameters do not seem to want to work for me

 

stock.jpg

 

From the docs I can see that this is stored in 19133

parameters.jpg

 

So I have added the following to the post, I have called my string - ospstk

 

ospstk : -1 # OSP 3D Simulation stock - 0=square, 1=cylinder, 2=solid, 3=STL

pparameter$ # Run parameter table

 

if prmcode$ = 19133, ospstk = rpar(sparameter$, 1)

 

pwrttparam$ #Information from parameters

 

if prmcode$ = 19133, ospstk = rpar(sparameter$, 1)

 

This should capture the value of the string to ospstk – (I think)

Then I want to use ospstk to out some code to the nc file, Basically if we have 19133 = 0 (Rect) do something if 19133 = 1 do something else

 

if ospstk = 0,

BLAH BLAH

OR

 

if ospstk = 1,

BLAH BLAH

 

And so on as I can see that the are 4 values that can be returned 0,1,2,3

I Also added this little line just as a check to see what value ospstk is

 

pbld, n$, " ", *ospstk, e$

 

The nc file always shows -1 which is what I set as a start value so I must be doing something wrong as all 4 options from the shape type return a value of -1

 

(DATE - 04-MAY-11)

(TIME - 16:36)

(8 | 10. BULL ENDMILL 0.5 RAD | H8 | D8 | D10.0000mm | R0.5000 | )

ospstk -1.

G00 G17 G21 G40 G80 G90

G30 P32

 

Any help will be appreciated

Link to comment
Share on other sites

The fix is below, Thanks to Min

 

You need to use ‘rd_tlpathgrp$’ command in ‘psof$’ to enable to call to post block ‘pmachineinfo$’, in ‘pmachineinfo’ you can then put the code to capture the toolpath group parameters.

 

 

pmachineinfo$ #Machine information parameters postblock

if prmcode$ = 19133, ospstk = rpar(sparameter$, 1)

 

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

# Start of File and Toolchange Setup

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

psof0$ #Start of file for tool zero

psof$

 

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

rd_tlpathgrp$

 

……

 

 

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

Hi Greg,

 

I also found an answer to the WCS Origin issue with the Stock Origin. I believe you mentioned (in an email) that you needed to get the WCS Origin values for X,Y,Z so you could compare them to the Stock Origin values. The WCS Origin values are loaded into the pre-defined variables: t_orgin_x$, t_orgin_y$, and t_orgin_z$. No need to extract them from Parameter read routines.

 

The only thing I'm extracting from the Parameter read right now is the value of 19133 (for Stock Type), and 19137, for the name of the STL file (if that is what is selected in Stock Setup), I get everything else I need from pre-defined variables. These are loaded from the NCI 1020 line (stock parameters) and NCI 1027 (WCS parameters).

 

Hope that helps. I'm actually doing something very similar to what you are doing now, I'm adding Stock Comment and Okuma Graphics codes to our Okuma OEM Post Processors. Would you be interested in helping me test them out? Please send me a PM if you are interested.

 

Thanks,

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