Hello Guest it is April 17, 2024, 10:11:42 PM

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

131
Mach4 Videos / Re: Mach4 and Coroutines
« on: January 11, 2018, 06:34:27 PM »
There are 2 instances/states of wxLua, one is for the Gui and this is where the PLC/Timer Event is that makes coroutines possible. Macros run in a different wxLua state with no PLC/Timer Event available. neither of these 2 states can comunicate with eachother directly.

DazTheGas

132
Mach4 General Discussion / Re: Tool Finding
« on: January 10, 2018, 04:10:30 AM »
You can get the center of the tool by using

Code: [Select]
local center = mc.mcToolGetData(inst, mc.MTOOL_MILL_RAD, 1);
assuming you are using the tooltable, from here you can add or subtract it to your XY Coords

DazTheGas

133
Mach4 General Discussion / Re: Lua editor
« on: January 10, 2018, 04:00:18 AM »
Check your Firewall, the lua editor opens up a socket for debbuging and could be blocked.

DazTheGas

134
Mach4 General Discussion / Re: Setting to millimeters
« on: December 30, 2017, 05:49:10 AM »
There prob will be a downside like it will reset things like spindlespeed back to 0 etc everytime you enable the machine.

DazTheGas

135
Mach4 General Discussion / Re: Setting to millimeters
« on: December 30, 2017, 04:25:14 AM »
Well yep after following exactly the above I can get it to go 25.4mm, as a quick fix after coming out of the config enable the machine and press reset. This will initialize the unit back to metric and save shutting down mach4.

DazTheGas

136
Mach4 General Discussion / Re: Setting to millimeters
« on: December 30, 2017, 03:54:31 AM »
I have tried for the last couple of hours to recreate a fault using metric and cannot reproduce any of this,

when starting mach4 or when you enter and exit the screen editor it will run the screen load script, its from here that the jog mode gets reverted back to continuous so just a small tweak can fix this.
Check your mach4 config, at the bottom you have initialization codes, make sure you haven't got a G20 within those boxes other than that I would suggest going to the help menu and packaging your profile and uploading, you will be surprised how quick a new set of eyes can pinpoint anything that is out of place.

DazTheGas

137
Mach4 General Discussion / Re: Mach4 PCID to get for LUA.
« on: December 28, 2017, 06:59:51 AM »
This isnt tested but should give you an idea.

Code: [Select]
local MyModule = {}

function PCID_CHECK() -- this becomes a private function that users cant access
local inst = mc.mcGetInstance()
local PCID = mc.mcCntlGetComputerID(inst)
if (PCID == "key to match") then
return
else
package.loaded.MyModule = nil -- unload the module so it cant be used
end
end

function MyModule.whatever()
PCID_CHECK() -- include where-ever you like
-- rest off function
end

return MyModule

DazTheGas

138
Mach4 General Discussion / Re: Mach4 PCID to get for LUA.
« on: December 28, 2017, 06:01:35 AM »
Just compile your module and include the PCID check within it, then its not readable.
Have a look at one of the mcc files in your macro folder to see what a compiled file looks like.
DazTheGas

139
Mach4 General Discussion / Re: Mach4 PCID to get for LUA.
« on: December 28, 2017, 03:45:14 AM »
To get the PCID as in the same as you use for your Mach4 License then you can get it using

Code: [Select]
local inst = mc.mcGetInstance()
local PCID = mc.mcCntlGetComputerID(inst)
wx.wxMessageBox(PCID)

from here then just use an if statement to compare IE

Code: [Select]
if (PCID == "key to match") then
Succces
end

DazTheGas

140
IMHO i cannot see a problem with proximity switches as home switches and limit, i have used these on my machine for 4 years as the same and will do on my new machine shortly, they are very accurate.

DazTheGas