Hello Guest it is April 26, 2024, 07:26:14 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - DazTheGas

411
Mach4 General Discussion / Re: Mach4 Keyboard Emulation
« on: September 13, 2016, 01:40:01 PM »
Perhaps this quicky will help.

http://www.machsupport.com/forum/index.php/topic,33270

DazTheGas

412
Mach4 Videos / Mach4 Quicky #6 - Disable Keyboard Plugin
« on: September 13, 2016, 01:38:54 PM »
Another Quicky  ;)

https://youtu.be/8KgZ1SYxEdg

0 = Disable
1 = Enable

Code: [Select]
local Handle = mc.mcIoGetHandle (inst, "Keyboard/Enable")

if Handle ~= nil then
    mc.mcIoSetState(Handle,0)
end

413
Mach4 General Discussion / Re: Altering M6 but am confused
« on: September 13, 2016, 11:49:50 AM »
One thing to remember when your writting a macro is the ability you have to step through the code live (debug) and see whats going on, start with a small piece of code IE moving to a safe Z then moving to the position over your touchplate, once you have that then you can move on to creating your toolchange.

DazTheGas

414
Mach4 General Discussion / Re: Mach4 Keyboard Emulation
« on: September 13, 2016, 09:50:31 AM »
It is possible from a plugin to do this, however this can only be done by disabling the keyboard plugin when mach4 loses focus, if the keyboard was enabled when in focus you will not be able to use the mdi panel as the windows event for onFocus will keep enabling the plugin.

Have a look at the function for enable/disable in the startup script, this can be adapted and used within the tabs when choosing between GCode and Mdi screens.

DazTheGas

415
Mach4 General Discussion / Re: Altering M6 but am confused
« on: September 13, 2016, 02:41:11 AM »
Quote
The mc.mcCntlSetLastError() will never execute because it is after the "return".  Any lines of code between a "return" and an "end" (end of code block) will not be executed.  So move the mc.mcCntLSetLastError() line between the "if" and the "return" so that it looks like this:

Never noticed that cheers Bob, although looking at it further because its an "if" or "else" statement then the return is not actually required.


rae_gordon - I understand what you are trying to do using a fixed reference point for zero and will dig out the code for you to play with that I  did for a friend who does just the same thing and sets his wcs to his bed.

DazTheGas

416
Mach4 General Discussion / Re: Namespace?
« on: September 12, 2016, 03:11:51 PM »
Perhaps this one could help too.

http://www.machsupport.com/forum/index.php/topic,29452.0.html

DazTheGas

417
Mach4 General Discussion / Re: Namespace?
« on: September 12, 2016, 12:17:26 PM »
I dont think these were documented but could be wrong?? - if you run the mcLuaEditor and type scr.d you should have a box come up with the commands available.

DazTheGas

418
Mach4 General Discussion / Re: wxLua functions
« on: September 11, 2016, 06:43:42 AM »
Quote
If I understand correctly plugins are C++ programs that interface with the Mach4 core
whereas Lua scripts are 'within' Mach4.

That is correct

One place you can look is the examples in the mach4 folder and the wizards or modules, most are left open source for you to look at or change. A good help is to google wxLua examples and get a copy of wxFormbuilder https://sourceforge.net/projects/wxformbuilder/

DazTheGas

419
Mach4 General Discussion / Re: wxLua functions
« on: September 11, 2016, 03:50:11 AM »
The API.chm contains both purely as the script environment for mach4 is wxLua and the c++ is used when creating plugins.

Mach4 is not just wxLua, basic plain Lua can be used also.

Places I use a lot:

wxLua reference manual - http://wxlua.sourceforge.net/docs/wxluaref.html
wxLua user manual - http://wxlua.sourceforge.net/docs/wxlua.html
Lua reference manual - https://www.lua.org/manual/5.3/

apart from these you can also learn a lot by using the wxwidgets manual at http://docs.wxwidgets.org/3.0/


DazTheGas

420
Mach4 General Discussion / Re: Axis setup
« on: September 10, 2016, 02:23:50 AM »
Take a look at the formula i use in the video for fine tuning my x axis, you will need to be at about 10 min mark.

https://www.youtube.com/watch?v=HIE0k6mu2yc&list=PL7IitnI6IOQB0Ws59EFXhBtYsWOgPCKT9&index=1

DazTheGas