Code: Select all
Option Explicit ' I alsway do this as it foreces me to declare variables before they can be used - saves you from problem caused by typos in varaiable names
Const TCPZDRO = 1722
' this is the line that does the actual Z movement
' the movement will be done in whatever modes are active when G53 is used (G00/G01 & G90/G91 etc)
CodeQW("G53 Z" & GCN(GetOEMDRO(TCPZDRO)))
' here are the util routines the line uses
Sub CodeQW(ByVal CodeString As String)
' QUEUE Up Code AND Wait for Execution to Complete
' this function takes the passed g-code string and give it to Mach to be put
' into the Gcode queue for execution
'
'This routine WAITS for all motion to stop before returning to the caller
Code(CodeString)
Call MotionWait()
Exit Sub
End Sub
Function MotionWait()
' Wait for movement to complete
While IsMoving()
Wend
Exit Function
End Function
Function GCN(ByVal VBNum) As String
' GCodeNumber: a small util to take a VB double, format it and return it as a string
' this is needed so that all numbers put into strings that will be sent to CodeQ or CodeQW will not
' have things of the form: X0.123456e-9 - which is not legal gcode format
GCN = Format(VBNum, "#########0.000000") ' 6 sig digits to right of decimal point should be enough
End Function ' GCN
I don't think I understand the question;nthliabrtn wrote:Is there any other representation of x,y,z co-ordinates? Are they set into zero by default if any value is not assigned there???