VERICUT Users' Forum

Due to relentless spammers, we are no longer automatically accepting new forum registrations. If you wish to register for this forum, please send an e-mail to: info@cgtech.com

You are not logged in.

#1 2017-05-05 13:34:30

rdix33
Senior Member
Registered: 2005-03-21
Posts: 37

M98 Q????

I am trying to build the logic in Vericut to do a M98 Q???? line jump. This works similar to a GOTO, except when it hits the M99 it jumps back to from where it came from. I tried adding to the M98 a 'Q' with a 'Gotojumpforwardbackwardstart' and it seems to not look for the number attached to the Q. It says cannot locate sequence number 98. Why would it be looking for the 98?

Any help would be great

Offline

#2 2017-05-08 06:42:14

paehv
Senior Member
From: Eindhoven, Netherlands
Registered: 2005-01-17
Posts: 165
Website

Re: M98 Q????

This looks the same as the Fanuc funtion M98 P{program} witch returns on an M99
Assuming that the Q parameter specifies a subprogram number

G-code processing > M-code > M > Range 98 > condition: And Word Q * > Macro: CallSub
G-code processing > M-code > M > Range 99 > Macro: ReturnFromSub

That should do the trick


Patrick Delisse
KMWE Aerospacehttps://www.kmwe.com
(Vericut V9.5, Siemens NX2206, Campost)

Offline

#3 2017-05-08 14:25:00

rdix33
Senior Member
Registered: 2005-03-21
Posts: 37

Re: M98 Q????

The 'Q' is actually a line number jump. So a M98 P1111 Q100, would jump into program O1111 and then jump to line number 100. If you don't put the P1111, it searches within the program it is in for the line number, then the M99 would make it return back from where it was called.

Offline

#4 2017-05-09 07:49:52

paehv
Senior Member
From: Eindhoven, Netherlands
Registered: 2005-01-17
Posts: 165
Website

Re: M98 Q????

Q as the line desitnation in the sub. Interesting, didn't see that one before.

This can be accomplished fairly easily.

Assuming that M98 P1111 > M99 works correct, here's how to make it jump to line Q

Store the value of Q in a variable, only if Q is in combination with M98:
G-code Processing > Word/Adress > Register > Q
Add Word Q range *, Conditions: AND WORD M 98, Variable Name: JumpToRecord, Override value $

When entering a sub program and variable JumpToRecord is unequal to 0 jump to the specified line
G-code Processing > Word/Adress > Specials > O
Add Word O range *, Conditions: AND VARIABLE JumpToRecord <>0, Macro: SubroutineSequence
Add Word O range *, Conditions: AND VARIABLE JumpToRecord <>0, Macro: GotoJump, Override value #JumpToRecord

Make sure to clear the JumpToRecord variable when leaving sub program
G-code Processing > Word/Adress > M_misc > M range 99, Variable JumpToRecord, Override value 0

And that's it.

See https://1drv.ms/b/s!AlhCKwieRPhrk8R2rhVlqvswvLwUxA


Patrick Delisse
KMWE Aerospacehttps://www.kmwe.com
(Vericut V9.5, Siemens NX2206, Campost)

Offline

#5 2017-05-09 12:47:43

rdix33
Senior Member
Registered: 2005-03-21
Posts: 37

Re: M98 Q????

Awesome, I'll give this a try today. Thanks for the help.

Offline

#6 2017-05-10 09:47:34

anorec
Member
Registered: 2014-12-16
Posts: 18

Re: M98 Q????

Our Fanuc31i controllers work that way (Mori-NH5000/Fanuc-Robodrill)

I didn't try Paehv method and i guess it will work with M98 P__ Q__ syntax but i'm not sure with M98 Q__ only (jump to sequence in prog current) ?

For that case here we do it like that:

    <Group Name="M" Type="word" Description="" Range="98" Field="0">
      <ConditionMacro>
        <CondWord Logical="and" Name="Q"/>
        <CondWord Logical="and_not" Name="P"/>
        <Macro Name="CallSubCurrent" Scan="no" AfterMotion="no">
        </Macro>

and

    <Group Name="Q" Type="word" Description="" Field="0">
      <ConditionMacro>
        <CondWord Logical="and" Name="M" Range="98"/>
        <Macro Name="SubStartingSeq" Scan="no" AfterMotion="no">
        </Macro>
      </ConditionMacro>

Offline

#7 2017-05-12 13:28:54

rdix33
Senior Member
Registered: 2005-03-21
Posts: 37

Re: M98 Q????

I used a mixture of both methods and it worked like a charm.

Thanks

Offline

Board footer