Sign in to follow this  
PcRobotic

Plunge FeedRate

Recommended Posts

Good afternoon everyone,
   I am trying to write out an alarm of which "IF FEED <> PLUNGE, then alarm".  I don't have the right parameter I think.  Would you guys point out me the right direction to correct my mistake on this...?  

 

Thanks,

Plunge.png.1bd96af50ef6bbc6fc91629c8814a5c7.png

============================

FeedRatePlunge: 0


#Region sPlungeFeedCheck
sPlungeFeedCheck = "CUT# "+sToolPathNumber+", FEEDRATE and PLUNGERATE should be the same"
                   +no2asc(13)+"TOOL#"
                   +no2str(t$)+" ("+no2str(tldia$)+", "+s20001+")"
                   +no2asc(13)
                   +no2asc(13)+"FeedRate         =====> F"+no2str(feed)
                   +no2asc(13)+"Plunge Rate    =====> F"+no2str(FeedRatePlunge)
                   +no2asc(13)
                   +no2asc(13)+"Do these following step:"
                   +no2asc(13)+"Step 1 = Click on PARAMETERS"
                   +no2asc(13)+"Step 2 = Click on TOOLS tab"
                   +no2asc(13)+"Step 3 = Look for FeedRate        =====> F"+no2str(feed)
				   +no2asc(13)+"Step 4 = Look fore FeedRate      =====> F"+no2str(FeedRatePlunge)
				   +no2asc(13)+"Step 5 = They both should be the same."
                   +no2asc(13)
                   +no2asc(13)+"                                               OK to proceed posting."
                   +no2asc(13)+"                                               CANCEL to abort posting."
#EndRegion sPlungeFeedCheck

fmt "" 2 FeedRatePlunge



           if FeedRatePlunge <> feed & opcode$ <> 3, [if mprint(sPlungeFeedCheck, 2) = 2, exitpost$] #End Mill Bull No Break Through
pparameter$ # Run parameter table
     if prmcode$ = 10031, FeedRatePlunge = rpar(sparameter$, 1)

Share this post


Link to post
Share on other sites

Hello,

The parameter is correct.  I think your issue is that you are not rounding the values to their respective formats before the comparison.

  • Like 1

Share this post


Link to post
Share on other sites

I believe that Jeff is correct.

If you embed the 'format round' function into the 'if' statement, it will 'round' the current value, before it compares it with the 'feed' variable.

Note that 'feed' may have a different 'fs2' "number" tied to it, depending on if you are in 'feed per minute' or 'feed per revolution'. In other words: there are places in the post where 'newfs' might be applied to 'feed'. You'll need to search the post for 'feed', and might need to use 'newfs' function on the 'FeedRatePlunge' variable, in addition to using 'fmtrnd'. The "format round" function will currently round 'FeedRatePlunge' to '4 decimal place output'. Why? because your 'format assignment' line (fmt) has a value of '2', and '2' is the default standard output.

if fmtrnd(FeedRatePlunge) <> feed & opcode$ <> 3, [if mprint(sPlungeFeedCheck, 2) = 2, exitpost$] #End Mill Bull No Break Throug

By default, in MPMaster, the 'feed' variable has a Format Assignment of '15', which I believe is 2 place rounding.

So, you will either need to change this:

fmt "" 2 FeedRatePlunge

to this:

fmt "" 15 FeedRatePlunge

Or, you will need to use a line above the 'if' statement, to apply the correct 'Format Statement', prior to executing 'fmtrnd'!!!

result = newfs(FeedRatePlunge, 15)
if fmtrnd(FeedRatePlunge) <> feed & opcode$ <> 3, [if mprint(sPlungeFeedCheck, 2) = 2, exitpost$] #End Mill Bull No Break Throug
  • Like 1

Share this post


Link to post
Share on other sites
On 8/16/2019 at 4:48 PM, Colin Gilchrist said:

I believe that Jeff is correct.

If you embed the 'format round' function into the 'if' statement, it will 'round' the current value, before it compares it with the 'feed' variable.

Note that 'feed' may have a different 'fs2' "number" tied to it, depending on if you are in 'feed per minute' or 'feed per revolution'. In other words: there are places in the post where 'newfs' might be applied to 'feed'. You'll need to search the post for 'feed', and might need to use 'newfs' function on the 'FeedRatePlunge' variable, in addition to using 'fmtrnd'. The "format round" function will currently round 'FeedRatePlunge' to '4 decimal place output'. Why? because your 'format assignment' line (fmt) has a value of '2', and '2' is the default standard output.

if fmtrnd(FeedRatePlunge) <> feed & opcode$ <> 3, [if mprint(sPlungeFeedCheck, 2) = 2, exitpost$] #End Mill Bull No Break Throug

By default, in MPMaster, the 'feed' variable has a Format Assignment of '15', which I believe is 2 place rounding.

So, you will either need to change this:

fmt "" 2 FeedRatePlunge

to this:

fmt "" 15 FeedRatePlunge

Or, you will need to use a line above the 'if' statement, to apply the correct 'Format Statement', prior to executing 'fmtrnd'!!!

result = newfs(FeedRatePlunge, 15)
if fmtrnd(FeedRatePlunge) <> feed & opcode$ <> 3, [if mprint(sPlungeFeedCheck, 2) = 2, exitpost$] #End Mill Bull No Break Throug

Thank you Colin, it works perfectly.

Share this post


Link to post
Share on other sites

Untitled.png.4015f4989f9c1e6134cd601ea74ea6f5.png

 

 

Thank you Colin, it works GREAT.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • 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