584,837 active members*
5,353 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Haas Machines > Haas Mills > help using custom M codes and M-FIN on haas
Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2008
    Posts
    25

    help using custom M codes and M-FIN on haas

    I've been reading the manual and trying to figure out what the M-FIN switch does.

    Right now, M21 is hooked up to the outside M function connector on the side of the haas.

    If I issue:
    M51;

    Then the M21 relay is closed.

    If I use M61; then M21 relay is turned off.

    Questions:
    1) What does M-FIN do? In the technical manual it says it is normally open (connected to +12V) and closed if connected to gnd.

    2) Does the issue of "M51;" wait until it receives a closing of "M-FIN" before processing the next line OR does one need to poll read M-FIN somehow in a loop?

    4) How does one "read" M-FIN? Like how would one write the following in G-Code:
    -turn on M21 relay
    -if M-FIN is closed then turn off M21 relay
    -else wait and continuously recheck M-FIN

    3) Why is M51 mapped to turn on M21 instead of M21 directly? What does "M21;" do if issued in MDI mode?

    Thanks in advance for any help!

  2. #2
    Join Date
    Apr 2007
    Posts
    178
    51 61 do not wait for the mfin and basically stay where you put them until you reset 21 wairts for the m fin you would wire a switch to the m fin and when you close the switch the machine will open the contact basically m21 close contact wait for m fin mfin received open contact m51 close until reset or 61
    REYTECH Machine Service Corp. CNC repair NY, NJ
    http://www.reytechmachine.com

  3. #3
    Join Date
    Jul 2005
    Posts
    12177
    Quote Originally Posted by josh591 View Post
    4) How does one "read" M-FIN? Like how would one write the following in G-Code:
    -turn on M21 relay
    -if M-FIN is closed then turn off M21 relay
    -else wait and continuously recheck M-FIN
    !
    If you write M21 the machine will close the M21 relay contacts and then stop waiting for the M-Fin circuit to be closed. In the bottom corner of the screen you will see the word MFIN or something like that.

    When the MFin circuit is closed then the machine will continue and you have to program the M code to open the relay contacts.(I forget which it is)
    An open mind is a virtue...so long as all the common sense has not leaked out.

  4. #4
    Join Date
    Sep 2008
    Posts
    11
    M51 turn M21 Relay On
    M61 Turn M21 Relay Off (reset or m30 will also do this)
    M121 Turn M21 Relay On and Wait for M-fin Input before continuing the program

    I use the M121 Input with a Robot I/O sending the M-fin signal.

    Edit* There is also a M-fin Parameter so the M/C will always wait for M-fin at all M21-28 codes. I personally Use M121 so i control when the M/C needs to wait and when it does not.

  5. #5
    Join Date
    Sep 2008
    Posts
    1
    Ok, as I read this (and please correct me if I'm wrong) you are trying to use an M21 (or 22 or.. ) in combination with a robot system. The way this works in the company I work at is as follows:

    The M21 calls the robot system, making it load a product. When the robot is done it calls off the M21, making the machine continue it's cycle. So the machine will be stuck in M21 until it get's a signal from the outside to continue.

  6. #6
    Join Date
    Feb 2008
    Posts
    9

    Little help, more question

    It's not the same application you're using, but it's similar. We use a limit switch as a broken tool detector. We program the VF5 to drive to the switch, and depress it. Then we fire the M21. We have the switch wired into the M21 relay and the M-fin circuit. That way, if the switch (normally open) is closed by the tool, as soon as we fire the M21, it reads the signal and goes on. If the tool is broke, no switch closes, so the machine sits there and waits. Here's my question. Does anyone know of a way to make the machine alarm out (blink red) is the M-fin isn't made after a certain amount of time? As to the robot, if you fired the M21, the machine would wait for a signal. Once the robot does it's thing, fire an output from it to the M-fin circuit, and the machine would then continue.

  7. #7
    Join Date
    Sep 2008
    Posts
    11
    Quote Originally Posted by Fido57 View Post
    It's not the same application you're using, but it's similar. We use a limit switch as a broken tool detector. We program the VF5 to drive to the switch, and depress it. Then we fire the M21. We have the switch wired into the M21 relay and the M-fin circuit. That way, if the switch (normally open) is closed by the tool, as soon as we fire the M21, it reads the signal and goes on. If the tool is broke, no switch closes, so the machine sits there and waits. Here's my question. Does anyone know of a way to make the machine alarm out (blink red) is the M-fin isn't made after a certain amount of time? As to the robot, if you fired the M21, the machine would wait for a signal. Once the robot does it's thing, fire an output from it to the M-fin circuit, and the machine would then continue.
    Assuming you don't have a tool probe.
    M96 Jump if no Input

    (your program here)
    N50 M21 (m21 for tool check)
    N60 M96 P100 Q27 (Loop to N100 if spare input [#27] is 0, 0=open)
    .
    M30

    N100 #3000=1(TOOL BROKEN), programmable alarm

    that should work for you, Just have to change the Q27 to whatever spare input your M21 is on in diagnostic screen.think its 27 :P

    Cheers

  8. #8
    Join Date
    Jan 2009
    Posts
    7
    Quote Originally Posted by Mechboy View Post
    Assuming you don't have a tool probe.
    M96 Jump if no Input

    (your program here)
    N50 M21 (m21 for tool check)
    N60 M96 P100 Q27 (Loop to N100 if spare input [#27] is 0, 0=open)
    .
    M30

    N100 #3000=1(TOOL BROKEN), programmable alarm

    that should work for you, Just have to change the Q27 to whatever spare input your M21 is on in diagnostic screen.think its 27 :P

    Cheers
    I've also wired up a tool break detection switch. It works fine by just firing an m21. That stops everything if the tool is not detected. The problem is that the head is down and the machine appears to be in cycle. The above program example will not work for me as m21 stops anything else from happening until the switch is made. Therefore it won't read m96 line.

    Can anyone offer some clarification?

  9. #9

    Re: help using custom M codes and M-FIN on haas

    I recently made a 3 minute video about Haas' M-Fin which actually explains everything but I don't know if I'm allowed to post links. If you click my name, the "visit homepage" takes you to my youtube channel.

    3 minute video about Haas' M-Fin

Similar Threads

  1. Dyna 4M macros and custom G codes
    By dave design in forum Dyna Mechtronics
    Replies: 2
    Last Post: 01-13-2021, 04:21 AM
  2. custom g or m codes with mach ???
    By dertsap in forum Mach Software (ArtSoft software)
    Replies: 8
    Last Post: 11-13-2011, 07:53 PM
  3. Replies: 2
    Last Post: 04-07-2010, 02:46 AM
  4. Replies: 5
    Last Post: 03-22-2010, 03:13 PM
  5. Custom G codes in Custom G codes
    By stevo1 in forum Fanuc
    Replies: 7
    Last Post: 09-09-2008, 08:32 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •