Hello Guest it is March 28, 2024, 01:32:04 PM

Author Topic: Needing help with screens  (Read 17782 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Needing help with screens
« Reply #40 on: December 06, 2014, 09:14:35 PM »
Hey, that script your using is for doing "Modules",

A few things:

If you want to use a module, you will need to create a module, (your script),
and if your using .mcc then you will need to compile the module.
your path will need to point to where your module is.

Your code that calls it, is also only partially complete.
you show getting the path, but your not calling/assigning the module to a variable.

See the lua website for how to make/use a module.

Scott
fun times

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Needing help with screens
« Reply #41 on: December 06, 2014, 09:37:20 PM »
yea I thought I was doing it wrong I would probley be better off doing it as a macro

thanks scott

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Needing help with screens
« Reply #42 on: December 10, 2014, 03:19:00 AM »
is there a move code like what was in M3
like this
Xmove = -73.3844 * 1/Xs 'Move distance adjusted for X-Scale factor
Code "G91 G0 X" &Xmove & "Y" &Ymove ' Makes an incremental move the distances that you set

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Needing help with screens
« Reply #43 on: December 10, 2014, 07:12:22 AM »
local inst = 0; local rc = 0;
local Xmove = "X2";
local Ymove = "Y3";
rc = mc.mcCntlMdiExecute(inst, "G91 G0 X" .. Xmove .. " Y" .. Ymove);
fun times

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Needing help with screens
« Reply #44 on: December 10, 2014, 01:49:38 PM »
In a M code script, one that will be run from a G code file, it is best to use mc.mcCntlExecuteGcode() mc.mcCntlGcodeExecute() or mc.mcCntlExecuteGcodeWait() instead of mc.mcCntlMdiExecute().  MdiExecute will only run if the machine is in the idle state.  

mc.mcCntlExecuteGcode() mc.mcCntlGcodeExecute() will not wait for the G code to complete.  It is there so that button scripts can fire off code like the Goto Zero button uses.  You don't really want to wait on G code in a button script as it will freeze the GUI until it completes.  The act of executing the G code changes the machine state and you can use the state to lock out buttons to keep things from happening while the G code is running to completion.  mc.mcCntlExecuteGcode() mc.mcCntlGcodeExecute() will call MdiExecute() if the machine is in the idles state.  This is a good choice to use in button scripts.  

mc.mcCntlExecuteGcodeWait() does as it implies.  It will actually run G code while a file is running, so it is the best thing to use for M code scripts.  Again, mc.mcCntlExecuteGcodeWait() will call MdiExecute() if the machine is in the idles state.  Not so good for button scripts.  

Steve
« Last Edit: December 15, 2014, 11:23:11 PM by Chaoticone »

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Needing help with screens
« Reply #45 on: December 10, 2014, 02:06:44 PM »
Steve == 'DA MAN!';

Scott
fun times

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Needing help with screens
« Reply #46 on: December 10, 2014, 02:49:16 PM »
thank you very much