cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

T-Code is Modal still outputs an M06

SOLVED
mrego
Newbie

T-Code is Modal still outputs an M06

Hello,

I and setting up a post for a Leadwell V-60i and need to set the Tool as modal. When I set this option in the Tool Change Sequence output options to "T-code is modal" it will stop posting the T code but still posts an M06.

How can I set up my post not to post an M06 when the T code is modal?

Does any one have a post for this machine that they can share?

Mike

1 ACCEPTED SOLUTION

Accepted Solutions

Re: T-Code is Modal still outputs an M06

The code Ken supplied should have worked except with out pre-defining the variable CUTOOL you will get FIL errors.  Here is some simpler code you could try...

$$ This variable goes in the Global Section

LSTTN = 0                      $$ DEFAULT LAST TOOL NUMBER TO ZERO

CIMFIL/ON,LOADTL

  TN = POSTF(7,4)          $$ GET THE CURRENT TOOL NUMBER

  IF(TN .NE. LSTTN)THEN

    XX = POSTF(13)          $$ PROCESS TOOL CHANGE...

    LSTTN = TN

  ELSE

    CONTIN                      $$ DO NOT PROCESS A DUPLICATE TOOL CHANGE

  ENDIF

CIMFIL/OFF

Fred

View solution in original post

8 REPLIES 8

Re: T-Code is Modal still outputs an M06

If you are editing one of the GPost files, I've got a piece of code from one of my post-processors that handles tool changes. I didn't like the way tools were output by default and have always liked to have an optional stop after a tool change so I can verify the tool and its acceptability when doing the initial program tests. Here's the bit of FIL code:

----- [ Begin Code ] -----

$$

$$ --[ LOADTL ]---------------------------------------------------------

$$

$$ Handle a tool change to ensure that the machine is moved to the home

$$ position, that the outputs are in the desired format, etc.

$$

CIMFIL/ ON, LOADTL

  $$

  $$ Obtain the tool number requested from the current line. If the tool

  $$ number called for is different from the current tool, process it in

  $$ the appropriate fashion. Otherwise, ignore it.

  $$

  TLNUM  = POSTF ( 7, 4 )

  IF ( TLNUM .NE. CUTOOL ) THEN

    CUTOOL = TLNUM

    $$

    $$ Write preparatory lines.  Some of the machines need to be

    $$ in the home position to properly load tools, so we might as

    $$ well default to moving there.

    $$

    INSERT/ 'G00$'

    INSERT/ 'G49 G28', REPEAT, 17, ' ', 'Z0.0000$'

    INSERT/ 'G91$'

    INSERT/ 'G28 X0.0000   Y0.0000$'

    INSERT/ 'G90$'

    $$

    $$ Output the tool change and an optional stop.

    $$ "IN2TXT" is a routine that makes the tool number, in this case, 2 digits

    $$ of text. For example, 2 becomes "02", etc.

    $$

    CALL/ IN2TXT, INTVAL = TLNUM, NUMDIG = 2

    INSERT/ 'M06 T', TXTVAL, '$'

    INSERT/ 'M01$'

  ENDIF

CIMFIL/ OFF

----- [ End Code ] -----

You could change this stuff to output things the way you want.

Re: T-Code is Modal still outputs an M06

Thanks Kenneth,

I tried that FIL code but it still posts out the M06.

See example of post below.

G01 Z.1 F196.

M48

M05

G0 G17 G20 G40 G49 G69 G94

M06        <- This is what I need removed when the post is set to T-Code is modal

G54 G90

MIke

Re: T-Code is Modal still outputs an M06

The code Ken supplied should have worked except with out pre-defining the variable CUTOOL you will get FIL errors.  Here is some simpler code you could try...

$$ This variable goes in the Global Section

LSTTN = 0                      $$ DEFAULT LAST TOOL NUMBER TO ZERO

CIMFIL/ON,LOADTL

  TN = POSTF(7,4)          $$ GET THE CURRENT TOOL NUMBER

  IF(TN .NE. LSTTN)THEN

    XX = POSTF(13)          $$ PROCESS TOOL CHANGE...

    LSTTN = TN

  ELSE

    CONTIN                      $$ DO NOT PROCESS A DUPLICATE TOOL CHANGE

  ENDIF

CIMFIL/OFF

Fred

View solution in original post

Re: T-Code is Modal still outputs an M06

Fred,

Thank you that worked!

Re: T-Code is Modal still outputs an M06

Yes, I always predefine my variables in the beginning of the program, especially if I'm going to be using them within other macros. I use "CUTOOL" to determine whether other stuff should be done as I process the file. Languages that require definition of variables are much less error prone.

Re: T-Code is Modal still outputs an M06

Languages that require pre-defenition of variables still do not set the given variable to a default value, C++ for example.  You still have to give them a default value if they may be used before being defined.  Our RESERV/name,value (Sub Scripted) variables are a good example of this.

Fred

Re: T-Code is Modal still outputs an M06

My trouble with a lot of languages that do not require one to define variables, like this one, is the inevitable "typo" bug. Where you meant to type INDEX, but accidentally typed INDEXX, and now your program doesn't seem to be working. Or worse, the nefarious "O" instead of "zero".

Re: T-Code is Modal still outputs an M06

Hello~~

I think you need to select "Not Available" in "Auxiliary Code" then M06 code not generate.

Have a good day!!

Mark Rao

Announcements