Hello Guest it is April 24, 2024, 09:32:13 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 - rhtuttle

61
Mach4 Toolbox / Re: Getting tool info into tool table
« on: May 07, 2021, 11:35:22 AM »
Maybe this will help get you started:

Code: [Select]
--[[
Macro to set Z or X offset or tool description
example: m6061 z1.3333 d.250
--]]

function m6061(hParam)
if (hParam ~= nil) then
--mc.mcCntlSetLastError(inst, 'handle == ' .. tostring(hParam));
local inst = mc.mcGetInstance();
local zVal = mc.mcCntlGetLocalVar(inst, hParam, mc.SV_Z)
local zFlag = mc.mcCntlGetLocalVarFlag(inst, hParam, mc.SV_Z)
local xVal = mc.mcCntlGetLocalVar(inst, hParam, mc.SV_X)
local xFlag = mc.mcCntlGetLocalVarFlag(inst, hParam, mc.SV_X)
local dVal = mc.mcCntlGetLocalVar(inst, hParam, mc.SV_D)
local dFlag = mc.mcCntlGetLocalVarFlag(inst, hParam, mc.SV_D)
if(zFlag == 1)or(xFlag==1)or(dFlag==1) then
if zFlag==1 then
    rc=mc.mcToolSetData(inst,mc.MTOOL_LATHE_Z,61,tonumber(zVal))
end
if xFlag==1 then
    rc=mc.mcToolSetData(inst,mc.MTOOL_LATHE_X,61,tonumber(xVal))
end
if dFlag==1 then
    rc=mc.mcToolSetDesc(inst,61,'Bit Diameter: '..tostring(dVal))
end
else if zFlag==1 then
    mc.mcCntlSetLastError(inst, 'ERROR: Z, X or D value required with M6061');
    mc.mcCntlEStop(inst);
end
end
else
mc.mcCntlSetLastError(inst, 'ERROR: handle == nil');
end
end

if (mc.mcInEditor() == 1) then
    m6061()
e

62
Mach4 General Discussion / Re: X Box here we come!
« on: April 20, 2021, 04:56:59 PM »
Anyone working on this?  Super useful when it works!

63
Mach4 General Discussion / Re: SSR m7 serial
« on: April 13, 2021, 07:40:46 PM »
That's the route I took along with 2 teknic clearpath motors and cables and power supply.
Now I just need some recommendations on the logic level limits!

64
Mach4 General Discussion / Re: SSR m7 serial
« on: April 13, 2021, 04:06:25 PM »
You guys just cost me a lot of money! ;)

RT

65
Mach4 General Discussion / Re: SSR m7 serial
« on: April 13, 2021, 11:26:30 AM »
Craig, you have been a great resource here over the last few years and have given great advice and insight which is much appreciated.  However, I am an electronically challenged individual.  I've tried to glean something from the internet regarding PLC modules but l am befuddled by their usage of wattage, amps, volts...

I don't know how to evaluate the options.  Would this work: https://www.amazon.com/MODBUS-Multi-Function-Ultra-Small-Controller-Channel/dp/B08238RBNH/ref=sr_1_4?dchild=1&keywords=plc+controller+12v&qid=1618326075&sr=8-4  If not could you supply a link to what I should be considering?

If money and time were no object I would buy a new bob and ess and power supply, or, buy another PoKeys57CNC since I have one of those on my mill and have successfully hooked in a mist system on that.


67
Mach4 General Discussion / Re: macro lathe toolchange
« on: April 12, 2021, 03:01:06 PM »
C:\Mach4Hobby\LuaExamples\Toolchanger

68
Mach4 General Discussion / SSR m7 serial
« on: April 12, 2021, 02:10:51 PM »
Would appreciate any help on the following.
I am running M4 with a pmdx-411 and g540.
I am out of outputs available with this setup.
For a mist system I have a 3vdc - 12vdc SSR
What is the easiest way to control that switch?
It seems that I should be able to control it through a serial cable.

TIA

RT

69
PoKeys / Pokeys57CNC - wiring SSR
« on: April 01, 2021, 01:30:29 PM »
I'm electronically challenged. >:(
I have a 3-32vdc input 5-60vdc output SSR
I want to drive a 12v pneumatic switch for a misting.
What pins/connector will work for this?

TIA

RT

70
As always you are correct.  My more recent macros and scripts are better-ish about checking return codes.  Sometimes I'm just lazy.
And yes, lathe.  Lathe gets no love.  Not enough of us using it to make it worthwhile for NFS and vendors to test all features.  Still love tweaking M4 to suit my needs.  No other software makes it so easy to customize.  Of course that means more mistakes and less hair!

RT