585,743 active members*
5,035 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > CNC Machine Related Electronics > Incorporating Switch into CNC Code
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2015
    Posts
    19

    Incorporating Switch into CNC Code

    Does anyone know if it is possible to incorporate a switch into CNC Program. Basically I want to run the X axis towards a part until a switch is made. When switch is made the x axis will stop and the program will advance to the next line of code and the Y axis will kick in. Sort of like how probing works. I know it can be hard wired without cnc control using arduino, but wondering if there was any way to do this in Mach 3? Thanks in advance.

  2. #2
    Join Date
    Dec 2013
    Posts
    5717

    Re: Incorporating Switch into CNC Code

    Maybe use M1 (optional stop) or M0 (program pause), then wait for the input to trigger before proceeding.

    Not sure if this will work in Mach3, but worth looking at.
    Jim Dawson
    Sandy, Oregon, USA

  3. #3
    Join Date
    Nov 2013
    Posts
    4361

    Re: Incorporating Switch into CNC Code

    Hi,
    Mach3 and Mach4Hobby DO NOT have conditional Gcode whereas Mach4Industrial does.

    With conditional Gcode, sometimes called Fanuc B, you can have a statement like:

    If (signal/switch/condition) then
    ..................................
    else
    ...................................
    endif

    As Jim points out you may be able to use a trick to accomplish what you want in Mach3, there was a guy BR548, a regular on the Mach3 forum, and he was
    famous for these little tricks to get Mach3 behave as if it had conditional programming. Could be worth posting there...

    Craig

Similar Threads

  1. Replies: 4
    Last Post: 07-31-2019, 09:54 PM
  2. Replies: 0
    Last Post: 03-23-2016, 03:02 PM
  3. Incorporating a pallet change into a program
    By cdmnyew in forum G-Code Programing
    Replies: 1
    Last Post: 09-29-2015, 12:43 PM
  4. Thread count considerations when incorporating a fastener into a design
    By jerseyguy1996 in forum Mechanical Calculations/Engineering Design
    Replies: 7
    Last Post: 12-29-2014, 03:04 PM
  5. Z axis limit switch mounting (and X and Y switches and G-code too)
    By momus_cnc in forum Momus Design CNC plans
    Replies: 0
    Last Post: 10-03-2011, 04:14 AM

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
  •