Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: Tarak on December 06, 2012, 11:19:53 PM
-
Is it possible to output the current machine position into a log file every time a certain M code is ran?
So every time the M code is called it just adds X_ _ Y_ _ X_ _ into the log file.
I think something like this would be great for debugging some VB code.
Darc
-
YES
Open"C:/Mach3/DebugLOG.txt" For Append As #1
Print #1,"X: " & GetDro(0) &" Y: " & GetDro(1) &" Z: " & GetDro(2)
Close#1
END
-
Oh nice, thanks, I'll give it a go!
-
Thanks BR549, that works great, just on another note.
Is it possible to trim to 4 decimal places rather than 13?
Darc
-
That interesting as HERE that script writes it exactly like it is in the DROs same format.
What version are you running?
(;-) TP
-
Try This
Open"C:/Mach3/DebugLOG.txt" For Append As #1
Print #1,"X: " & Format(GetDro(0),"0000.0000") &" Y: " & Format(GetDro(1),"0000.0000") &" Z: " & Format(GetDro(2),"0000.0000")
Close#1
END
-
Thanks BR549, that works great.
BTW, I'm running Version R3.043.066.