Recommended Posts

What is this statement doing?

if (mr1$ <> mr1flg), phsm_off

I understand that it is stating "if misc real #1 is less than or greater than mr1 flag, turn off high-speed machining.

But I don't understand what the mr1 flag represents.

Share this post


Link to post
Share on other sites
Guest

I'm thinking thats a logical not operator <>

its a boolean flag find where its declared 

mr1flg:

then see where it is being alterned

Share this post


Link to post
Share on other sites
3 minutes ago, Thee Byte™ said:

I'm thinking thats a logical not operator <>

I'm not sure what that means (I really need to take some basic programming courses)

This is the complete line in the post:

if (mr1$ <> mr1flg) | (mr2$ <> mr2flg) | (mr3$ <> mr3flg), phsm_off

So, I get that it's stating that if mr1, or mr2, or mr3 are greater or less that mr1flg, mr2flg or mr3flg, respectively , turn off high-speed machining.

But I have no earthy idea what the mr flags represent.

Does: if (mr1$ <> mr1flg) mean "if mr1 is greater than 0"?

Share this post


Link to post
Share on other sites
Guest

I don't know the language, I think its

if mr1 does not equal mr1flag or mr2 does not equal mr2flag .. then phsmoff

Share this post


Link to post
Share on other sites
24 minutes ago, Thee Byte™ said:

I don't know the language, I think its

if mr1 does not equal mr1flag or mr2 does not equal mr2flag .. then phsmoff

It's the MP language used for MC posts

Share this post


Link to post
Share on other sites
Guest
1 minute ago, So not a Guru said:

It's the MP language used for MC posts

Yes, I understand that, I am saying I don't "speak" Mp

Share this post


Link to post
Share on other sites
Guest

201. Default miscellaneous real variable 1 (mr1)? 0.0

mr1_flg    : 0      #Flag to indicate whether look ahead function is active or not

phsm1_on         #High speed functions before G43
      if opcode$ = 3 | opcode$ = 16,
        [
        mr1$ = 0
        mr2$ = 0
        ]
      if mr1$ = 1 & mr1_flg <> 1, #Advanced Preview (look-ahead) control - G08 P1
    .....

phsm2_on         #High speed functions after G43
      if opcode$ = 3 | opcode$ = 16,
        [
        mr1$ = 0
        mr2$ = 0
        ]
#      HPCC is working when called before G43.4 on Fanuc 31i, see phsm_1 above
      ....

phsm_off         #High speed functions Off
      if mr1_flg = 1, #Advanced Preview (look-ahead) control - G08 P1
        [
   ...

Share this post


Link to post
Share on other sites
Guest

From my post

Share this post


Link to post
Share on other sites

I've got it. The flag is set in the phsm2_on or phsm_off sections.

phsm2_on        #High speed functions after G43
      if opcode$ = 3 | opcode$ = 16,
        [
        mr1$ = 0
        mr2$ = 0
        mr3$ = 0
        ]
      if fmtrnd(mr2$) & not(mr2flg),
        [
        pbld, pn, *mr2$, pe  #M821 - Accuracy Level 1 through M830 - Accuracy Level 10
        mr2flg = 1
        ]
      if mr1$ & not(mr1flg),
        [
        shapecomp_r = mr5$
        pbld, pn, "G61.1", [if shapecomp_r, *shapecomp_r], pe
        mr1flg = 1
        ]
      if mr3$ & not(mr3flg),       #you can't call any G codes inside this
        [
        if dyndatum <> 1,
          [
          pbld, pn, "G5", "P2", pe
          mr3flg = 1
          ]
        ]

phsm_off        #High speed functions off
      if mr3flg,
        [
        pbld, pn, "G5", "P0", pe
        mr3flg = 0
        ]
      if mr1flg | mr2flg,
        [
        #pbld, pn, "G64", pe
        pbld, pn, "G61.1 P0", pe
        mr1flg = 0
        mr2flg = 0
        ]
      hsmflg = 0

 

Share this post


Link to post
Share on other sites

In MP those characters represent the "Not Equal To" Logic Operator. (<> is NOT EQUAL)

If 'the current value of MR1$' is not equal to the 'value of MR1 Flag', then do something...

  • Thanks 1

Share this post


Link to post
Share on other sites
4 hours ago, So not a Guru said:

What is this statement doing?

if (mr1$ <> mr1flg), phsm_off

I understand that it is stating "if misc real #1 is less than or greater than mr1 flag, turn off high-speed machining.

But I don't understand what the mr1 flag represents.

Zeek,

Based of my reading:

Someone created a variable (mr1flg), that tracks the state of MR1.

If the value of the current Operation has a value that is different from the value programmed in the last Operation, then don't turn off HSM.

If the value of MR1 is different from the last Operation's value, turn off HSM.

It makes more sense, if you are aware that each depth-cut or Multi-pass, is coded as 'an operation', in the NCI Data.

Share this post


Link to post
Share on other sites

So this allows you to skip turning off HSM (mode remains on), unless there is a new value detected in MR1.

When there is a new MR1 value, the HSM Off block gets called here.

There will be other logic, to output the HSM On block. Search for both 'mr1$', and 'mr1flg', using Code Expert Editor, and use CTRL + B to set a bookmark at each location where those variables are used.

mr1flg is user defined, so there should be a variable initialization somewhere. It may be in the PSB, depending on who built the Post.

mr1$ is predefined, so the Post Developer can just 'use it', without having to format or initialize the variable.

Have you attempted to watch my Post Processor Development Class on YouTube yet? 28 videos for basic MP...

  • Like 1

Share this post


Link to post
Share on other sites
11 minutes ago, Colin Gilchrist said:

Zeek,

Based of my reading:

Someone created a variable (mr1flg), that tracks the state of MR1.

If the value of the current Operation has a value that is different from the value programmed in the last Operation, then don't turn off HSM.

If the value of MR1 is different from the last Operation's value, turn off HSM.

It makes more sense, if you are aware that each depth-cut or Multi-pass, is coded as 'an operation', in the NCI Data.

Yes, I had been assuming that the <> was the same as the ≠ sign.

I got it sorted out, I didn't initially see where it was defined, so I was worried it might be in the binned portion. I'm a little slow on the draw some days.

12 minutes ago, Colin Gilchrist said:

Search for both 'mr1$', and 'mr1flg

That was where I was brain-farting for a bit. I don't know why it took me 20 minutes to decide to do the simple search, that I should have thought of 1st thing. Meh, like I said, 'some days I'm a little slow'🙃.

  • Like 1

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

  • 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