Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: mofetters on December 14, 2014, 10:06:41 PM

Title: Help porting Mach3 script to Mach4
Post by: mofetters on December 14, 2014, 10:06:41 PM
I have been using the following auto tool zero script in Mach3 and I would like to port it over to Mach4. Any help would be appreciated.

Thanks,
Mark

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
    DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
    Code "G4 P1" ' this delay gives me time to get from computer to hold probe in place
    Code "G31Z-2 F2" 'probing move, can set the feed rate here as well as how far to move
    While IsMoving() 'wait while it happens
    Wend
    ZProbePos = GetVar(2002) 'get the axact point the probe was hit
    Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
    While IsMoving ()
    Wend
    Call SetDro (2, .0627) 'set the Z axis DRO to whatever is set as plate thickness
    Code "G4 P0.25" 'Pause for Dro to update.
    Code "G0 Z1" 'put the Z retract height you want here
    Code "(Z axis is now zeroed)" 'puts this message in the status bar
    Else
    Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
    Exit Sub
End If
Title: Re: Help porting Mach3 script to Mach4
Post by: kane17752 on May 17, 2017, 05:11:11 PM
Have you had any luck with this.  I just started looking at this.  I have the Triqueta zeroing block. 
Title: Re: Help porting Mach3 script to Mach4
Post by: Chaoticone on May 18, 2017, 03:31:52 PM
Have you looked at the touch module in 4? It was designed to be used with a touch plate.

https://www.youtube.com/watch?v=VA49atQNzmg
Title: Re: Help porting Mach3 script to Mach4
Post by: kane17752 on May 18, 2017, 08:24:57 PM
I did discover that last night.  Tried it this morning and it would not work.  I am using a pdmx 424 board and have the probe mapped to input3 which is the touch plate.  But touch dialog shows inactive state.  Looking at the input status indicators show the touch plate working.  Not sure what I am doing wrong.  Would love to get this working. 
Title: Re: Help porting Mach3 script to Mach4
Post by: Chaoticone on May 19, 2017, 08:13:11 AM
Quote
have the probe mapped to input3

Have you tried mapping it to the Probe input?
Title: Re: Help porting Mach3 script to Mach4
Post by: kane17752 on May 19, 2017, 08:54:02 AM
Yes  input3 is mapped to the probe input
Title: Re: Help porting Mach3 script to Mach4
Post by: Chaoticone on May 19, 2017, 04:19:01 PM
Quote
Looking at the input status indicators show the touch plate working

What input status indicators are you referring to? Is this in the PMDX diagnostics, Mach's diagnostics logging or the machine diagnostics tab of the screen set? There are also probe, probe 1, probe 2 and probe 3 leds above the touch button in the current default wx4, wx6 and wxRouter screen sets.

It sounds like you have the input signal incorrectly mapped but I could be wrong. Post a screen shot of the input configuration page with the signal your using for the probe in view.

Title: Re: Help porting Mach3 script to Mach4
Post by: kane17752 on May 20, 2017, 12:09:55 PM
I have watched this.  Where can I get the touch module document that is referred too?  I have looked for it and can not find it.  The help menu item prints up a placeholder down no details.

Title: Re: Help porting Mach3 script to Mach4
Post by: Chaoticone on May 23, 2017, 02:11:15 PM
The touch doc is in the docs folder. You must be running an old version?