Hello Guest it is March 28, 2024, 09:05:50 PM

Author Topic: Log file?  (Read 4597 times)

0 Members and 1 Guest are viewing this topic.

Offline Tarak

*
  •  229 229
    • View Profile
Log file?
« 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

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Log file?
« Reply #1 on: December 06, 2012, 11:33:16 PM »
YES


Open"C:/Mach3/DebugLOG.txt" For Append As #1
Print #1,"X: " & GetDro(0)  &"  Y: " & GetDro(1)  &"  Z: "  & GetDro(2)
Close#1
END

Offline Tarak

*
  •  229 229
    • View Profile
Re: Log file?
« Reply #2 on: December 10, 2012, 02:58:56 PM »
Oh nice, thanks, I'll give it a go!

Offline Tarak

*
  •  229 229
    • View Profile
Re: Log file?
« Reply #3 on: December 10, 2012, 03:31:53 PM »
Thanks BR549, that works great, just on another note.
Is it possible to trim to 4 decimal places rather than 13?
Darc

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Log file?
« Reply #4 on: December 10, 2012, 08:44:39 PM »
That interesting as HERE that script writes it exactly like it is in the DROs same format.

What version are you running?

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Log file?
« Reply #5 on: December 10, 2012, 08:49:31 PM »
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

Offline Tarak

*
  •  229 229
    • View Profile
Re: Log file?
« Reply #6 on: December 10, 2012, 10:05:15 PM »
Thanks BR549, that works great.
BTW, I'm running Version R3.043.066.