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:

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)
Link to comment
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
Link to comment
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.

Link to comment
Share on other sites
  • 3 years later...
On 8/17/2019 at 6:48 AM, Colin Gilchrist said:

I believe that Jeff is correct. funny shooter 2

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

I tried it and it really works perfectly. 

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