Hello Guest it is March 28, 2024, 07:17:52 AM

Author Topic: execute a function with "input 1"  (Read 9618 times)

0 Members and 1 Guest are viewing this topic.

execute a function with "input 1"
« on: January 10, 2012, 05:23:36 PM »
Hello
 can you tell me, how to make the "input1" I stop moving the Z axis, are a contact.
 mach3 and keeps track of the value of Z.
 It is to a height sensor for my CNC tool does not support "G31" :'(

 thank you














Re: execute a function with "input 1"
« Reply #1 on: January 12, 2012, 07:38:06 AM »
hello
 we can say that people familiar with the programming of macro mach3, at least not this command

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: execute a function with "input 1"
« Reply #2 on: January 12, 2012, 10:35:59 AM »
LOL - there's nothing like a little poke yes?

It's probably because your post isn't too clear about your problem. I think maybe you need to explain why your "CNC tool does not support G31"
Re: execute a function with "input 1"
« Reply #3 on: January 12, 2012, 11:11:10 AM »
Hello
 my cnc does not take the G31 because it is connected to the PC via a USB port for now is that the driver of pluging it does not support the G31.
 That's why I want a solution with  "input1" to mach3

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: execute a function with "input 1"
« Reply #4 on: January 12, 2012, 12:14:10 PM »
You probably want to get onto your hardware supplier and ask them why they haven't implemented G31.

Unfortunately I don't think you can do what you want very elegantly. It's pretty easy to write a macro that will record your Z value when an input goes active but your problem is going to be in stopping Z during a programed move. The only way I can think of you doing this is to decrement Z by a small amount in a loop and break out of the loop when the input activates. It's not a good solution and that's why I think you should complain to your hardware vendor about their lack of G31 support.
Re: execute a function with "input 1"
« Reply #5 on: January 12, 2012, 03:34:15 PM »

OK,
but it is possible to trigger a pause (or stop) with Gcode by a input1 in a macro.

 what do you mean by a loop














Re: execute a function with "input 1"
« Reply #6 on: January 12, 2012, 04:06:01 PM »

OK,
but it is possible to trigger a pause (or stop) with Gcode by a input1 in a macro.

 what do you mean by a loop

These can be put in a macropump

If IsActive(Input1)Then
    
DoOemButton(1003)      'Stop
DoOemButton(1001)      'Pause or feed hold
'DoOemButton(218)      ‘Z-inhibit ON
'DoOemButton(219)      ‘Z-inhibit OFF
DoOembutton(252)           'Disable movement on axis Z, this is a toggel
End if

Tony
















« Last Edit: January 12, 2012, 04:16:59 PM by Tony Bullard »
Re: execute a function with "input 1"
« Reply #7 on: January 12, 2012, 04:35:14 PM »
You could also put some code like this in either a macropump or macro in the the Gcode.
   'Do probe down to establish torch height
code"g31 z-2 "      'G31 = streight probe
While ismoving()
Sleep 100
Wend
z= getvar(2002) 'this gets value when
      'switch hit.
You'd have to wight you're own code for what you are trying to do and put you're probe switch on Probe input instead of Input 1.
« Last Edit: January 12, 2012, 04:39:08 PM by Tony Bullard »
Re: execute a function with "input 1"
« Reply #8 on: January 12, 2012, 05:05:23 PM »
Hello Tony
the problem is that G31 does not work with my driver UBS
so if I write

If IsActive (input1) Then
     DoOembutton(252)
     Code "G4 P1" or Sleep (60)
     ZProbePos = GetVar(2002)
Else
     Code "F40 G53 Z-70"
Wend
« Last Edit: January 12, 2012, 05:07:00 PM by ch_porchet »

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: execute a function with "input 1"
« Reply #9 on: January 12, 2012, 05:23:04 PM »
G4 P1 is the same as Sleep(1000)

and I believe GetVar(2002) will only work if you use G31.

From the manual in the G31 section:

Quote
After successful probing, parameters 2000 to 2005 will be set to the coordinates of the
location of the controlled point at the time the probe tripped
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html