Hello Guest it is April 27, 2024, 11:15:11 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 - Bill_O

261
Mach4 General Discussion / Re: Button G code juggle
« on: September 10, 2020, 04:13:06 PM »
Try using mc.AxisGetPos instead.

Bill

262
Mach4 General Discussion / Re: z inhibit / max z depth
« on: September 03, 2020, 08:50:50 AM »
Steve,

It works great.
Thank you.

Bill

263
Mach4 General Discussion / Re: z inhibit / max z depth
« on: September 01, 2020, 10:34:23 AM »
Steve,

Thanks.
I will give it a try.

Bill

264
Mach4 General Discussion / Re: z inhibit / max z depth
« on: August 27, 2020, 08:25:49 AM »
David,

I thought about that but it looked like that only worked for jogging or if in a program would stop if the file went outside the limits.
I will give it a try and see what happens.

Thank you.

Bill

265
Mach4 General Discussion / z inhibit / max z depth
« on: August 26, 2020, 05:18:38 PM »
Is there a function in Mach4 that will limit how deep the z axis will move?
I think there was one in Mach3 but I never used it.

Bill

266
Mach4 General Discussion / Re: Mach4 Re-Zeroing mid run
« on: August 21, 2020, 08:38:14 AM »
If it is a stepper motor system you could be loosing steps.
How fast are you moving the Z axis and what is the acceleration.

Bill

267
Mach4 General Discussion / Re: set selected tool
« on: August 19, 2020, 11:57:30 AM »
Swifty,

It worked great.
Thanks for the help.
Here is the final code.

Tool to get plus;
Code: [Select]
local inst = mc.mcGetInstance()
local Tool = mc.mcToolGetSelected(inst)
--get max tools
local ATCMaxTlsReg = mc.mcRegGetHandle(inst, 'iRegs0/ATCMaxTools')
local ATCMaxTlsVal = mc.mcRegGetValue(ATCMaxTlsReg)

--if tool is in range add one to tool #
if (Tool <= (ATCMaxTlsVal - 1)) then
Tool = (Tool + 1)
mc.mcCntlSetPoundVar(inst, mc.SV_CUR_SELECTED_TOOL, Tool)
end


Tool to get minus;
Code: [Select]
local inst = mc.mcGetInstance()
local Tool = mc.mcToolGetSelected(inst)

--if tool is in range subtract one from tool #
if (Tool >= 2) then
Tool = (Tool - 1)
mc.mcCntlSetPoundVar(inst, mc.SV_CUR_SELECTED_TOOL, Tool)
end


268
Mach4 General Discussion / Re: set selected tool
« on: August 19, 2020, 10:01:36 AM »
Swifty,

Thank you.
I will give it a try.
I do not care about the best way I just need it to work.

Bill

269
Mach4 General Discussion / Re: set selected tool
« on: August 18, 2020, 08:36:31 AM »
Swifty,

I want to set the Selected Tool not the Current Tool.

Bill

270
Mach4 General Discussion / set selected tool
« on: August 17, 2020, 04:12:59 PM »
I have a button to raise and lower the selected tool number.
The code works one time then I must exit Mach for it to work again.
I can not find any way to set the selected tool number other than using the gcode.

Code: [Select]
local inst = mc.mcGetInstance()
local Tool = mc.mcToolGetSelected(inst)
--get max tools
local ATCMaxTlsReg = mc.mcRegGetHandle(inst, 'iRegs0/ATCMaxTools')
local ATCMaxTlsVal = mc.mcRegGetValue(ATCMaxTlsReg)

--if tool is in range add one to tool #
if (Tool <= (ATCMaxTlsVal - 1)) then
Tool = (Tool + 1)
mc.mcCntlGcodeExecute(inst, string.format("T" .. Tool))
end


Thanks,
Bill