Hello Guest it is April 18, 2024, 12:45:30 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TPS

911
this two documents should give you a good reference and overview

https://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf
http://www.machsupport.com/wp-content/uploads/2013/02/VBScript_Commands.pdf

as far i know, this is all what is avaliable.

here:

https://www.machsupport.com/forum/index.php?topic=6657.90

you can find Information about DRO's Button's and Led's

912
here we go, not tested, just made it readable and running.

Code: [Select]
' Auto zero all axes Or just tool length

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state

' Define constant for MachMsg dialog types

MachMsgTypeYesNo = 4

' Define constant for MachMsg return codes

MachMsgReturnYes = 6
MachMsgReturnNo = 7

' Display a Yes or No dialog
Ret = MachMsg("Zero Z axis only?", _
 "Zero Z axis only or all axes", MachMsgTypeYesNo)

If Ret = MachMsgReturnYes Then

Message "(Starting Z Zero...)"
If GetOemLed (825)<>0 Then 'Check to see if the probe is already grounded or faulty
Message "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
End If

DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P3" 'this 3 sec. delay to get from computer to hold probe plate in place
Code "G90 G31Z-25 F100" '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 exact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend

' Define some constants
ZaxisDRO = 2
' Set Z Axis DRO to 1.234 (plate thickness)
SetOEMDRO(ZaxisDRO, 1.234)

Sleep 200 'Pause for Dro to update
Code "G1 Z1. F50" 'put the Z retract height you want here, must be greater than the touch plate thickness
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Code "G4 P3" 'Delay to allow reading of status bar

Else
If Ret = MachMsgReturnNo Then
Message "(Starting X-Y Corner setting...)"

Rem VB Script For probing X axis

Message "(Jog CNC near centre and 5mm inside the hole, then click OK)"
XCurrent = GetDro(0)
YCurrent = GetDro(1)
Code "G4 P3" 'this 3 sec. delay to get from computer to hold probe plate in place
Code "F100"

Rem Probe Left
XNew = XCurrent -50 'probe 50mm to left
Code "G31 X" &XNew
While IsMoving() ' wait for the move to finish
Wend
XPos1 = GetVar(2000) 'get the probe touch location
Code "G0 X" &XCurrent 'rapid move back to start point

Rem Probe Right
XNew = XCurrent +50 'probe 50mm to right
Code "G31 X" &XNew
While IsMoving()
Wend
XPos2 = GetVar(2000)
XCentre = (XPos1 + XPos2)/2 'centre is midway between XPos1 and XPos2
Code "G0 X" &XCentre ' rapid move to x centre location

Rem Probe up
YNew = YCurrent +50
Code "G31 Y" &YNew
While isMoving()
Wend
YPos1 = GetVar(2001)
Code "G0 Y" &YCurrent

Rem Probe down
YNew = YCurrent -50
Code "G31 Y" &YNew
While isMoving()
Wend
YPos2 = GetVar(2001)
YCentre = (YPos1 + YPos2)/2
Code "G0 Y" &YCentre 'rapid move to y centre location
While isMoving()
Wend

Message "(Starting Z Zero...)"
Code "G0 Z20"
Code "G0 X20Y20"

If GetOemLed (825)<>0 Then 'Check to see if the probe is already grounded or faulty
Message "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
End If

DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P3" 'this 3 sec. delay to get from computer to hold probe plate in place
Code "G90 G31Z-25 F100" '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 exact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend

' Define some constants
ZaxisDRO = 2
' Set Z Axis DRO to 1.234 (plate thickness)
SetOEMDRO(ZaxisDRO, 1.234)

Sleep 200 'Pause for Dro to update
Code "G1 Z1. F50" 'put the Z retract height you want here, must be greater than the touch plate thickness
While IsMoving ()
Wend
Message "(Z axis is now zeroed)" 'puts this message in the status bar

Code "F" &FeedCurrent  'restore starting feed rate
DoOEMButton (1008)
DoOEMButton (1009)
End If
End If

If CurrentAbsInc = 0 Then 'If G91 was in effect before then return to it
Code "G91"
End If

If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If

913
General Mach Discussion / Re: Probe debounce...
« on: June 07, 2020, 03:45:29 AM »
ok nothing Spezial there.

you are doing the probe with G28.1 (referencing) i see.

have you tryed a Ref Z in the diagostic page, witch should prizipial do the same Thing, just to verify.

before you start the probe/reference is the M3Home LED on diagnostic page on or off?

914
General Mach Discussion / Re: Probe debounce...
« on: June 07, 2020, 03:33:04 AM »
your macrocode M1050 and M1051 would be interesting.

915
for 1. you can try to add a Sleep(1234), time is in milliseconds, to wait for the camera is finished

for 2. Config -> General config -> General Configuration -> Ignore M calls while loading

917
Mach Screens / Re: Screenset 2010 - is there a better one?
« on: June 04, 2020, 02:30:10 PM »
you have answered the entire Problem by your own. spindle on/off control is not a 2010 screenset Problem, it is a Basic Mach3 Settings Thing.

919
witch Version of Mach3 are you using?

920
ok when you say you open it throught Mach you mean Operator -> VBScript Editor ?