This is in response to a request by Pedio. He would like to input a number value into a DRO and have the axis jog to that position instead of going to the MDI input page, writing the block and pressing Cycle Start. I believe his intent is to maximize time efficiency by jogging to a known position from his home page. ie "Enter value, press enter" => axis jogs to desired position. This example is simple without error checking or safety checking (ie. rc values, is axis homed, or is Z axis clear before movement, etc) To implement direct input into a DRO as a text box I will do my best to describe the instructions below. By the way, this was a great idea! Thanx Pedio (If you don't mind, I would like to add this feature to my Blackout Screenset --which is open code for everyone to use, edit, play, add their own features, repost, etc....) You guys are gonna be like "That's it?!?!?" Yep, gotta love m4! I demonstrate a mc.mcCntlMdiExecute function to jog to an absolute coordinate position (G90) and then using mc.mcJogIncStart function call instead of mc.mcCntlMdiExecute G91 command. Hope this helps!
Absolute Position:[/color]
1. Operator -> Edit Screen
2. Add DRO --to wherever you would like for this MDI input to be
3. DRO properties are: DRO Code = Blank, Editor = Keypad
4. On Modify Script =
local inst = mc.mcGetInstance()
local gCode = ""
local Xmove = scr.GetProperty('droXMdiAbs', 'Value')
Xmove = tonumber(Xmove)
if Xmove == nil then Xmove = '0' end
gCode = gCode ..string.format("G0 G90 X%.3f\n", Xmove)
mc.mcCntlMdiExecute (inst, gCode)
Incremental Movement:[/color][/color]
1. Operator -> Edit Screen
2. Add DRO --to wherever you would like for this MDI input to be
3. DRO properties are: DRO Code = Blank, Editor = Keypad
4. On Modify Script =
local inst = mc.mcGetInstance()
local Xmove = scr.GetProperty('droXMdiInc', 'Value')
Xmove = tonumber(Xmove)
if Xmove == nil then Xmove = 0 end
mc.mcJogIncStart (inst, 0, Xmove)
[/color]
That's it folks! I'll post some screen shots below in the next post to help you guys visualize the concept. It's pretty cool. Pedio had a great time-saving idea.
--josh