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:

pchuck$ no program number....


Recommended Posts

We own a Doosan 2600SYII Dual Spindle lathe here, and Long story short the first operation after a Manual entry is a Lathe Chuck operation. We are repositioning the sub so that we may use it as a Tailstock. In doing so...I'm noticing the NCI is not outputting a value for progno$ (NCI Line 1001) for this operation. pchuck$->pheader$->progno$......no value for progno$ to pull from....has anyone ran into this? any solutions i can explore?

Link to comment
Share on other sites
12 minutes ago, Nickjones818 said:

has anyone ran into this? any solutions i can explore?

What post are you using? Many of the lathe misc. functions (pass over, tailstock etc.) are not enabled out of the box. This is because machines handle these functions differently even within models depending on how they are set up.

If you have the MT environment you will have to talk to your reseller.

If it is an MP post is it for single or twin turret?

 

Link to comment
Share on other sites

This is an MP Post, it's for a single turret lathe with live tooling and sub-spindle. We purchased from our reseller with a foundation for our specific machine, but have added a lot of functionality to fine-tune to our needs. The Chuck operations function very well and as intended when placed below a general lathe or mill toolpath.....but if you place a part handling toolpath first, the path still functions as intended, but you're left with a header that doesn't output the intended program number, its left null, I believe do to the NCI not outputting a 1001 line.

 

I could place a point toolpath first, just to reposition the machine as sort of a dummy operation that will output what my post looks like it will need to assign the attended value to progno$.... and fix this issue like that, but I'm curious to know more about this, or if there is a workaround that can be explored? 

Link to comment
Share on other sites
14 minutes ago, Nickjones818 said:

This is an MP Post, it's for a single turret lathe with live tooling and sub-spindle. We purchased from our reseller with a foundation for our specific machine, but have added a lot of functionality to fine-tune to our needs. The Chuck operations function very well and as intended when placed below a general lathe or mill toolpath.....but if you place a part handling toolpath first, the path still functions as intended, but you're left with a header that doesn't output the intended program number, its left null, I believe do to the NCI not outputting a 1001 line.

Since you are using the MP Post > Query Parameter # 10042. This should hold the Program Number, and is available in 'pwrttparams$' or in 'pparameter$', depending on "where" in the calling sequence you need this information.

First, initialize a new variable to hold this data. I'm doing it here with a 'Format Assignment', which allows initialization & formatting in one step. (Be careful, if your Program Number is "0000", in Mastercam, you would not get Program # output, unless you "force" the data out. This is due to modality. [Variable is initialized as "0", current value is "0", so no output unless forced.])

fmt "O" 4 prm_prog          #Get Program Number from pwrttparams

Next, add a line of code to 'pwrttparams$' and 'pparameter$':

pwrttparam$      #Information from parameters
      #"pwrttparam", ~prmcode$, ~sparameter$, e$
      if prmcode$ = 10042, prm_prog = rpar(sparameter$, 1) #Get Program Number

pparameter$      #Information from parameters
      #"pwrttparam", ~prmcode$, ~sparameter$, e$
      if prmcode$ = 10042, prm_prog = rpar(sparameter$, 1) #Get Program Number

Now, 'prm_prog' should hold the correct value.

If it doesn't, if the data is "empty" during your reading of 'pchuck$', then add the following code, "just before you need the data":

pchuck$          #NCI code = 903 available variables:
                #clmp_spindle, clmp_op,  stck_chuk_st_z,
                #stck_chuk_st_x, stck_chuk_end_z, stck_chuk_end_x
                
                rd_prm_op_no$ = op_id$ #May have to use "-1" to get all OP Params
                rd_params$

NOTE: you may need to try a value of "-1" for rd_prm_op_no$.

Link to comment
Share on other sites
1 minute ago, nickbe10 said:

Any idea which one it is based on? mplmaster or one of the cnc posts?

Im not 100 Percent sure exactly which one this is based on....

 

1 hour ago, Colin Gilchrist said:

Since you are using the MP Post > Query Parameter # 10042. This should hold the Program Number, and is available in 'pwrttparams$' or in 'pparameter$', depending on "where" in the calling sequence you need this information.

First, initialize a new variable to hold this data. I'm doing it here with a 'Format Assignment', which allows initialization & formatting in one step. (Be careful, if your Program Number is "0000", in Mastercam, you would not get Program # output, unless you "force" the data out. This is due to modality. [Variable is initialized as "0", current value is "0", so no output unless forced.])


fmt "O" 4 prm_prog          #Get Program Number from pwrttparams

Next, add a line of code to 'pwrttparams$' and 'pparameter$':


pwrttparam$      #Information from parameters
      #"pwrttparam", ~prmcode$, ~sparameter$, e$
      if prmcode$ = 10042, prm_prog = rpar(sparameter$, 1) #Get Program Number


pparameter$      #Information from parameters
      #"pwrttparam", ~prmcode$, ~sparameter$, e$
      if prmcode$ = 10042, prm_prog = rpar(sparameter$, 1) #Get Program Number

Now, 'prm_prog' should hold the correct value.

If it doesn't, if the data is "empty" during your reading of 'pchuck$', then add the following code, "just before you need the data":


pchuck$          #NCI code = 903 available variables:
                #clmp_spindle, clmp_op,  stck_chuk_st_z,
                #stck_chuk_st_x, stck_chuk_end_z, stck_chuk_end_x
                
                rd_prm_op_no$ = op_id$ #May have to use "-1" to get all OP Params
                rd_params$

NOTE: you may need to try a value of "-1" for rd_prm_op_no$.

Thank you, Collin, 

 

             I'm still pretty new at all this, and I could not get this method to work. I don't have those specific post blocks in my post. I have prwttparm_custom and pparamter_custom. not sure if that makes a difference. (Are those blocks encrypted in the .psb file perhaps??)

 

Anyhow, After combing through the MP reference guide once more I was able to use Opinfo(10042,0) This allowed the program number I assigned to be posted into the header of the program regardless of the toolpath operation I chose to start with. (which was my issue)

 

pheader_custom  #Customizable portion of header
      hour = int(time$)
      min = int((time$ - hour)* 100)
      if hour > 12, hour = hour - 12
      if hour = 0, hour = 12
      if year$ < 2000, year$ = year$ + 2000
      prm_prog = opinfo(10042, 0) #Prog Number Lookup

      "%", pe
      spaces$ = 0
      sprogname$ = ucase(sprogname$)
      *prm_prog, pspc1, scomm_str, sprogname$, scomm_end, pe #Was progno$, pspc1, scomm_str, sprogname$  <----
      spathnc$ = ucase(spathnc$)
      smcname$ = ucase(smcname$)
      sextpst$ = ucase(sextpst$)

 

I went ahead and kept the formatted variable, however, I imagine I could have just updated progno$. Does this approach present any issues? I can't seem to find any at the moment, but that doesn't mean they are not there. 

 

Link to comment
Share on other sites
16 minutes ago, nickbe10 said:

Any idea which one it is based on? mplmaster or one of the cnc posts?

If it has 'pchuck$', it is likely either MPLMaster, or the Generic Fanuc 4X MT_Lathe Post. Either way, they should function in a very similar way. All the NCI 900-905 codes will call the corresponding 'Misc_ops' Post block.

There are pre-defined variables, that get "filled out", based on the data passed with the '90x' line. These are movement data related, so position and feed info. Then, there are 'common flag variables', that change for each '90x' Operation. (this way you can 'trigger events' in a sequential order, by staging multiple "chuck" operations.)

In addition, there are 'miscops_mi1-10$' and 'miscops_mr1-10$' values. These Misc Op MI/MR Values, give you 10 unique MI/MR Values, which only apply to the NCI 900-905 G-Codes. This allows you to pass data (MR  = Signed Decimal Numbers) and trigger events (MI = Signed Integers).

1 minute ago, Nickjones818 said:

Im not 100 Percent sure exactly which one this is based on....

 

Thank you, Collin, 

 

             I'm still pretty new at all this, and I could not get this method to work. I don't have those specific post blocks in my post. I have prwttparm_custom and pparamter_custom. not sure if that makes a difference. (Are those blocks encrypted in the .psb file perhaps??)

 

Anyhow, After combing through the MP reference guide once more I was able to use Opinfo(10042,0) This allowed the program number I assigned to be posted into the header of the program regardless of the toolpath operation I chose to start with. (which was my issue)

 


pheader_custom  #Customizable portion of header
      hour = int(time$)
      min = int((time$ - hour)* 100)
      if hour > 12, hour = hour - 12
      if hour = 0, hour = 12
      if year$ < 2000, year$ = year$ + 2000
      prm_prog = opinfo(10042, 0) #Prog Number Lookup

      "%", pe
      spaces$ = 0
      sprogname$ = ucase(sprogname$)
      *prm_prog, pspc1, scomm_str, sprogname$, scomm_end, pe #Was progno$, pspc1, scomm_str, sprogname$  <----
      spathnc$ = ucase(spathnc$)
      smcname$ = ucase(smcname$)
      sextpst$ = ucase(sextpst$)

 

I went ahead and kept the formatted variable, however, I imagine I could have just updated progno$. Does this approach present any issues? I can't seem to find any at the moment, but that doesn't mean they are not there. 

 

Using opinfo is a much better method. It is also a newer method, so I tend to tell people the "old fashioned" way, as it works in most Posts.

Since you've got "custom" Post Blocks, this means those sections are indeed encrypted inside the PSB file. By using opinfo, you don't need to mess with the parameter read Post Blocks at all.

 

 

  • Like 1
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...