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:

Adding a check to the post for indexing a 4th axis


?Mark
 Share

Recommended Posts

Hi all,

All our hmc and vmc machines are full 4th axis except the newest (shipped from a sister company).

This nh5000 is indexing only with 1.0 deg resolution

How can I add a check to the post, that when reposting it will trigger an error everytime there is an angle other than a whole number and prevent it from posting?

 

TIA

Link to comment
Share on other sites

Sure could, but if you set up the machine definition for it I think you would not have to do anything.

 

cabs if not equal a number could trigger an alarm, but might be some work. Maybe something where you check for a decimal value? Other thing is if someone programs a full 4 axis cut then you would want to error trap on certain operations for that machine. Again I think if the machine definition was setup correctly it would do all of that for you.

 

HTH

Link to comment
Share on other sites
      
      if frac(c$) > .001,
        [
        result = mprint("A Toolplane angle was detected that is not a 1.0 degree index move.")
        result = mprint("The next value is the fractional index value.")
        ang_frac = frac(c$)
        result = mprint(ang_frac)
        result = mprint("The next value displayed is the operation number where the error occured.")
        result = mprint(op_num)
        #Print Error to the NC file
        "***** ERROR: INDEX MOVE OUTPUT IS ROUNDED! *******", e$
        ]
      

The function you want is 'frac'. This will return the decimal portion of a number. Just be careful of where you use the function, to be sure that you don't get repeating values like you've seen.

 

For "Indexing" posts, the behavior you've seen is normal when an error is encountered. The post check the value 'cdelta' against the value of 'ixtol' (the tolerance variable defaulted to .01 degrees). If the position is not less than the 'ixtol' value, and error is generated.

 

Unfortunately every single move in the NCI file passes through the 'pncoutput' post block. This in-turn, calls 'pcom_moveb', which makes a call to 'pxyzcout'. This is where the positions are mapped/calculated, so even a "Toolplane" based toolpath will have every move pass through this post block. (Which makes it a pain to debug.)

 

So you could potentially modify that 'ixtol' value to something large (.9999, basically almost, but not quite, 1 degree). Then add your new logic to 'psof$', 'ptlchg$', and 'ptlchg0$', and reduce the number of error checks substantially. (checking 'c$' using 'frac' at the tool changes only lets you get through a program without seeing an error for every single move...)

 

The other solution would be to modify the logic in 'pindxcalc' to only perform the error checking once per operation. You could do this by checking the value of 'op_num', and not allowing the logic to enter the block if the operation number is the same as the last time the check was ran.

 

For outputting the Operation Number, you will need to add some code to capture parameter number 15240. This parameter holds the actual operation number in the operations manager. In the sample code I have a user-defined variable called 'op_num'.

 

Hope that helps,

 

Colin

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