Hello Guest it is April 19, 2024, 11:30:32 AM

Author Topic: MDI Execute  (Read 794 times)

0 Members and 1 Guest are viewing this topic.

MDI Execute
« on: July 28, 2023, 07:33:48 PM »
Greetings,

In the MDI window, I can put these 2 lines together: "G53 X12.4129 Y433.9433 and next line G92 X0 Y0", and they both work doing exactly what they are supposed to. I want those two commands to run after the machine is homed using the "Home X Y Z Axis" button. As I mentioned, both work manually in the MDI window.

I added the following 2 lines to the screenscript.lua file at the end of the "function RefAllHome()" section.

mc.mcCntlMdiExecute(inst, "G53 X12.4129 Y433.9433")  -- This line works
mc.mcCntlMdiExecute(inst, "G92 X0 Y0")        --This line doesn't work

I can't figure out why the G53 line works but the G92 line does not work inside the script as it does when manually entered into the MDI window?

I'd appreciate any help in getting this to work. Thanks!
*FIXED* MDI Execute
« Reply #1 on: July 28, 2023, 08:42:27 PM »
I figured it out. If it helps anyone, this is the scripting I added. Cheers!

GCode = ""
   GCode = GCode .. string.format("G53 X12.4129 Y433.9433\n")
   GCode = GCode .. string.format("G92 X0 Y0 Z0\n")
   mc.mcCntlGcodeExecuteWait(inst, GCode)