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:

incremental numeral output with indexer rotation


Recommended Posts

Hi everyone,  

  Sorry if this is long.To start with, I really don't know what I'm doing but I can usually fumble through and meet my needs without causing too much damage. This seems like it should be easy but I'm not sure how to start. I have a vertical with a Hass indexer with it's own controller. An M45 fires the relay that tells the indexer to perform it's next step. I've always programmed all sides from the top plane and used a manual entry when indexing was necessary. I proved my toolpaths using STL's and rotating them to use as my next stock model. Well, I don't have xform STL anymore so I'm trying to program using planes. I wanted to output my "A" values incrementally because my indexer is not capable of absolute and I give my set up guys a spreadsheet with their step numbers and index values, I thought it would be good to have the correct value actually in the program. So I added / rearranged the ptlchg_com, and ptlchg0$ sections as follows.....

 

          scomm_str, scomm_end, e$
          scomm_str, "INDEX", cinc, "DEGREES" scomm_end, e$
          scomm_str, "ABS VALUE =", pfcout, scomm_end, e$
          if cinc <> zero, pbld, n$, sm45, e$
          scomm_str, scomm_end, e$

 

Which outputs this.....I added the absolute value because........well, I don't know, so I could more easily make sure it was posting the incremental numbers correctly ???

 

( )
( INDEX A-90. DEGREES )
( ABS VALUE = A-270. )
N85 M45
( )

 

   in my G code..........    which is all good.......... I only want the M45 when my indexer actually moves.....for instance, when there is no incremental movement, my post still outputs an "A" value...

 

( )
( INDEX DEGREES )
( ABS VALUE = A0. )
( )

 

....I put the line, if cinc <> zero, plbd, n$, sm45, e$  ...................I don't know if that's how I should have done this but it seems to work. ..................My question though is this.....In the first line, scomm_str, scomm_end ......... I would like to be able to output the step numbers for the indexer controller............so, starting with the first M45 output I would like to have the numeral "1" output in that comment with the numeral increasing by "1" for each subsequent M45 output.....as in (1) , (2), (3) etc. etc...........so my G-code would read like this

 

( 1 )                 <--------------------------------------------  first M45, ( 2 ) for the next index, etc.
( INDEX A-90. DEGREES )
( ABS VALUE = A-270. )
N85 M45
( )

 

BTW......this is an MPMASTER post to start with....

 

 So, I'm not sure how to go about this, any help would be greatly appreciated. Thank you in advance for even reading through all this. ....

 

Mike

  • Like 1
Link to comment
Share on other sites

Hi everyone,  

  Sorry if this is long.To start with, I really don't know what I'm doing but I can usually fumble through and meet my needs without causing too much damage. This seems like it should be easy but I'm not sure how to start. I have a vertical with a Hass indexer with it's own controller. An M45 fires the relay that tells the indexer to perform it's next step. I've always programmed all sides from the top plane and used a manual entry when indexing was necessary. I proved my toolpaths using STL's and rotating them to use as my next stock model. Well, I don't have xform STL anymore so I'm trying to program using planes. I wanted to output my "A" values incrementally because my indexer is not capable of absolute and I give my set up guys a spreadsheet with their step numbers and index values, I thought it would be good to have the correct value actually in the program. So I added / rearranged the ptlchg_com, and ptlchg0$ sections as follows.....

 

          scomm_str, scomm_end, e$

          scomm_str, "INDEX", cinc, "DEGREES" scomm_end, e$

          scomm_str, "ABS VALUE =", pfcout, scomm_end, e$

          if cinc <> zero, pbld, n$, sm45, e$

          scomm_str, scomm_end, e$

 

Which outputs this.....I added the absolute value because........well, I don't know, so I could more easily make sure it was posting the incremental numbers correctly ???

 

( )

( INDEX A-90. DEGREES )

( ABS VALUE = A-270. )

N85 M45

( )

 

   in my G code..........    which is all good.......... I only want the M45 when my indexer actually moves.....for instance, when there is no incremental movement, my post still outputs an "A" value...

 

( )

( INDEX DEGREES )

( ABS VALUE = A0. )

( )

 

....I put the line, if cinc <> zero, plbd, n$, sm45, e$  ...................I don't know if that's how I should have done this but it seems to work. ..................My question though is this.....In the first line, scomm_str, scomm_end ......... I would like to be able to output the step numbers for the indexer controller............so, starting with the first M45 output I would like to have the numeral "1" output in that comment with the numeral increasing by "1" for each subsequent M45 output.....as in (1) , (2), (3) etc. etc...........so my G-code would read like this

 

( 1 )                 <--------------------------------------------  first M45, ( 2 ) for the next index, etc.

( INDEX A-90. DEGREES )

( ABS VALUE = A-270. )

N85 M45

( )

 

BTW......this is an MPMASTER post to start with....

 

 So, I'm not sure how to go about this, any help would be greatly appreciated. Thank you in advance for even reading through all this. ....

 

Mike

 

Mike I read this a few times and I am sure others did. I think you need to create a variable. Then that variable will need to have math logic applied to it. When it is done then you will want to make sure you have a reset, though may not be needed if you really want 500 for a number if you have 500 indexes. You got this far like most of us by trial and error. I am not the best post guy, but can stumble my way through stuff when I have the time. We have found it best to just hire the professionals and let them do the post work while we focus on Manufacturing solutions.

 

Best of luck in your process and hopefully someone with more experience will chime in.

Link to comment
Share on other sites

Hi Ron,

 

 Thank you for the reply... ..I actually enjoy trying to figure this stuff out, some kind of "character flaw" I suppose.......I'm used to working 50 / 60 hours a week and our shop is on 40 right now ( hopefully not for too long )...so I'm kinda' bored....but having time when I get home gives me the opportunity to mess with stuff I usually don't have time for, plus I find it interesting....... This isn't a major issue but would be nice if I could make it work.

 

  I'm not looking for anyone to do this for me just a "nudge" in the right direction.......For instance, can this be done without using a buffer ? ....If I need to use a buffer...well, that's out of my league and without serious help I can probably stop right now.....or not :-)

 

 Good to hear from you Ron, hope all is well.

 

Mike

Link to comment
Share on other sites

Looks like your "if cinc <> zero" is working to output the M45 where you want it, only when the incremental distance has changed. So that's good.

 

You can use the same logic to output the "1", "2", "3", between the comment start and comment end blocks.

 

Here is what I would do:

 

First, add a new post block call between the comment start and end:

scomm_str, pindex_track, scomm_end, e$

Then, in another area of the post (either directly in front of, or behind, the current block), create a new post block. ("p" must start in first column!)



ptlchg$   #Tool change



         .
         .
         .
          scomm_str, scomm_end, e$
          scomm_str, "INDEX", cinc, "DEGREES" scomm_end, e$
          scomm_str, "ABS VALUE =", pfcout, scomm_end, e$
          if cinc <> zero, pbld, n$, sm45, e$
          scomm_str, scomm_end, e$
         .
         .
         .


pindex_track   #Keep track of Index "M45" output

      if cinc <> zero,
        [
        *my_counter #This will output the integer value between the comments
        my_counter = my_counter + one #Increment counter for next loop output
        ]

You will need to initialize a variable. Start by initializing it to '1', so that it outputs '1' on the first call. Then it gets incremented for each additional time it is output.

my_counter : 1

Also, above in the variable section, you will need to create a Format Assignment to give the variable it's formatted output:

fmt  ""  4  my_counter  #use Integer formatting

Hope that helps,

 

Colin

  • Like 1
Link to comment
Share on other sites

Hi Colin,

 

 That's awesome.... thank you so much. I will give this a go in the morning. I really appreciate you taking the time to explain what I need to do and why.....that helps me a lot. ......I'll never be a post writer and this is why....I did try to create a post block, and I was trying to use the "if cinc <> zero" to force the output, but I was trying to store the values in string variables that I created and that wasn't working so well.....when I wasn't getting errors I was either outputting all one's or only getting output for the first M45.........I was afraid I was going to have to learn about using buffers and like I said, I'll never be a post writer......this is really great, thank you again.

 

Mike

Link to comment
Share on other sites

Hi Colin,

 

  This worked beautifully, I can't thank you enough....I feel bad that you did all the work for me though. What am I gonna' do with my free time tonight ?  I'm gonna' have to spend time with the wife now or somethin'.....or, I can take my dogs to the woods......hmmmmmm......

 

Thanks again.

 

Mike

Link to comment
Share on other sites

Hi Colin,

 

  This worked beautifully, I can't thank you enough....I feel bad that you did all the work for me though. What am I gonna' do with my free time tonight ?  I'm gonna' have to spend time with the wife now or somethin'.....or, I can take my dogs to the woods......hmmmmmm......

 

Thanks again.

 

Mike

 

I'm glad that worked for you Mike. No worries on the time. That was about 3 minutes worth of work...  :cheers: :cheers:

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