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:

Parameter 17435?


Recommended Posts

So i found param 17435 in the mp documentation. It's the one I want, but just to double check I dumped my parameters and looked for it... Couldn't find it. So I figured I would just try it out. 

 

if prmcode$ = 17435, stck_sol = rpar(sparameter$, 1)

 

But I didn't get what I wanted... I didn't get anything actually. Debug said stck_sol was 0 the whole time.

 

stck_sol     :     0   #initialize for stock stick out.

 

What am I doing wrong?

Link to comment
Share on other sites

Lol. Sorry, I just have to chuckle at your last statement. You do realize that the advice I give is free, and I do it out of the kindness of my heart right?

 

While many of the guys here are perfectly capable of answering basic post questions, there aren't as many guys that are well versed in the "inner workings" of the MP Language, or have knowledge of advanced topics like buffers and Parameters.

 

You aren't blacklisted. Take a look at the number of "views" on your topic. People have seen it, they just don't have an answer to your question.

 

Parameters are read "auto-magically" in the 'pparameter$' and 'pwrttparams$' post blocks. There are two different post blocks for capturing parameters, because MP makes two processing loops over the NCI file. The first loop is the "Pre-Read" loop (calls 'pwrttparams$'), and is used to build the Tool Table (among other things). 'pparameter$' is called before the start of each Operation in the NCI file.

 

But...

 

This is only used to capture operation parameters. (10,000 - 16,000). There is a note directly in the NCI and Parameter Reference Guide that explains this. It also goes over how to capture Operation Parameters, and Machine Definition and Control Definition Parameters.

 

Because you want a Machine Definition Parameter, you have to use the MD capture techniques. The "base" post you are starting with uses a post block named 'pset_mach'. In this post block, we set some parameters to '0', then set 'rd_mch_ent_no$ to 'syncaxis$' (gets current Axis Combination values) then we call 'rd_md$'

 

The command variable 'rd_md$' is used to call 'pmachineinfo$'.

 

Look at the 'pmachineinfo$' post block. Here, there is additional logic to capture machine and control parameters. Inside the 'pmachineinfo$' post block, you should be able to just write your 'if prmcode$ = 17xxx, my_var = rpar(sparameter$, 1)' line.

 

But...

 

For the Machine Definition parameters (17,000-17,999), CNC Software decided the easiest way to get values would be to create a Parameter Table. This "Parameter Table" is used to capture parameter numbers, and load the values into variables. It is easier to use, because the table lets you use both numeric and string values. Normally 'sparameter$' is a string, and you must extract and convert the string value to a numeric value. The parameter table takes care of this for you auto-magically by converting numeric values to numbers, and copying strings to the string variables.

 

There are two columns, the first lists the 'parameter number' to search for, the second column is the name of a numeric variable you want to load with the value.

 

All you need to do is add the parameter number you want to the list, provide a numeric or string variable to capture the value, and update the number of entries in the 'fprmtbl' line.

  • Like 1
Link to comment
Share on other sites

:laughing: Okay, I got it!

 

Wait...

 

*reads it for a third time*

 

okay, yeah I got it. 

 

Lots to learn. Didn't really think I was black listed. Okay, maybe a little. I just ask for so much help I worry that one day you guys are going to push me out of the nest and get me to fly on my own kinda thing. I truly appreciate the help and know I don't give back even 10% of what I learn from this forum. I have been working on learning buffers and have been taking lots of notes. I am going to post all of my notes and links, maybe it will save some one some time down the road.

Link to comment
Share on other sites

Okay, so in theory;

fprmtbl 17000   8   #Table Number, Size - Machine Definition parameter table
        17391   axis_label   #Axis label - 1=X,2=Y,3=Z
        17402   rot_dir      #Rotary direction
        17408   rot_index    #Index or continuous
        17409   rot_angle    #Index step
        17410   rot_type     #Rotary type
        17101   all_cool_off #First coolant off command shuts off ALL coolant options
        17102   v9_coolant   #Use V9 coolant option
        17435   stck_sol     #Stock stick out length

pmachineinfo$   #Machine information parameters postblock
      #rd_mach is used to call pmachineinfo postblock and read the parameters of the selected axis
      #combination machine entity set in rd_mch_ent_no.
      #rd_cd is used to call pmachineinfo postblock and read the active control definition parameters
      #rd_tlpathgrp is used to call pmachineinfo postblock and read the active toolpath group parameters
      #"-->pmachineinfo", ~prmcode$, "  ", ~sparameter$, e$  #Do not uncomment if being called from pprep$ - see pprep comment

      #Read parameter lookup tables - 
      if prmcode$ >= 17000 & prmcode$ < 18000, result = fprm(17000) #Run the parameter table for Machine Definition Parameters
      #Leave lines below commented until you enter values in related lookup tables
      #if prmcode$ >= 18000 & prmcode$ < 19000, result = fprm(18000) #Run the parameter table for Control Definition Parameters
      #if prmcode$ >= 19000 & prmcode$ < 19900, result = fprm(19000) #Run the parameter table for Toolpath Group Parameters
      if prmcode$ = 17435, stck_sol = rpar(sparameter$, 1)  
fmt "STOCK SOL - "  11  stck_sol            #Sets fmt for stock stick out

pheader$
sopen_prn, stck_sol, sclose_prn, e$

Should give me stck_sol = prm 17435, right? I am doing something wrong. stck_sol is zero on the debug watch.

This may also be an issue.

      rd_mch_ent_no$ = 0

Just read the part about the rd_mch_ent_no$, looks like I want a -1. How does reading everything affect my post? are there errors I should watch for that might not have a warning?

Edited by ahaslam
Link to comment
Share on other sites

Setting that value to '-1' will not cause a single problem. The reason it isn't set to '-1' by default is purely for speeding up performance. If you are processing a Mill-Turn type file, with hundreds of operations, then setting 'rd_mch_ent_no$' to the value of the Axis combination (instead of the entire MD) probably saves a second or two. Unless you are crunching toolpaths on a 386 processor, you won't be able to detect the slowdown in performance. (Does .1 vs .01 of a second really matter?) Even using '-1' causes a 10x increase in processing time, the posting time is practically negligible, because it happens so quickly.

Link to comment
Share on other sites

*looks at processor* Oh no, I'm good. This baby has a Pentium 2.

 

Okay, -1 every thing looks great. I'll go check out and see what the lathe guy thinks.

 

Thanks.

 

side note, my computer is pretty old, i7 at 3.4gh and only 8gb of ram :vava:  a hand-me-down from my boss. "worked great with surfcam"... sub text: in 2008

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