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:

Syntax question


Recommended Posts

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"?

Link to comment
Share on other sites

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

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

 

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

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