Hello Guest it is October 04, 2023, 10:43:10 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 - rhtuttle

231
Mach4 General Discussion / Re: Add or edit Mach4 Lathe screen
« on: November 09, 2018, 02:20:42 PM »
local snd=wx.wxSound('c:\\Windows\\Media\\chord.wav',0)
snd:Play()

HTH

RT

232
Mach4 General Discussion / Re: Mach 4 Lathe error on start up
« on: October 30, 2018, 10:54:59 AM »
It appears that there is more to the message.  Drag the message box right side to widen it and see if there is more information.  The message tells you where the offending code is.  Line 768 of the screen script.  To view it, Operator->View Screen Script, scroll down to line 768. 

I searched my screen load script and there is no call to mcToolSetData so either you have written a function that does use it or it is being called by some other function.

HTH

RT

233
Mach4 General Discussion / Re: g83.1 question
« on: October 28, 2018, 03:24:59 PM »
I didn't read the full explanation of the example.  I need g17 to drill from the Z plane.  the example drills from the x plane

234
Mach4 General Discussion / Re: g83.1 question
« on: October 28, 2018, 03:03:02 PM »
Solved

235
Mach4 General Discussion / g83.1 question
« on: October 27, 2018, 07:47:34 PM »
downloaded build 3804 and used my lathe screen set and then the default lathe screen set.

Wanted to make sure that a peck drilling cycle was going to work the way I wanted so I copied the code from the lathe manual and ran it in the simulator. 

G0 G54 G19 G40 G80
t0202
G97 S2500 M3
G0 Z0
g0x0
G83.1 G99.1  x0.0 Z-1.5 R.2 Q0.125 F2
G80
M30

Attached is a picture of the result.  It always goes to x 0.400 at the end and doesn't run as described in the manual.  What am I  missing.  Does this run the same in other builds?

TIA

RT

236
Mach4 General Discussion / Re: Setting Tool Table Values
« on: October 23, 2018, 05:30:45 PM »
This macro sets the Z offset in the tool table for the specified tool entry to a new value.

Yes, it is the tool table and yes you can add custom fields.  view->tool table->edit->table fields->user fields  add.

HTH

RT

237
Mach4 General Discussion / Re: Setting Tool Table Values
« on: October 23, 2018, 01:40:44 PM »
Found the error. 

rc=mc.mcToolSetDataExDbl(inst,61,'ZOffset',tonumber(pVal)) is only used for user and extended fields, not the standard fields, should be:

rc=mc.mcToolSetData(inst,mc.MTOOL_LATHE_Z,61,tonumber(pVal))


HTH

RT

238
Mach4 General Discussion / Setting Tool Table Values
« on: October 23, 2018, 12:13:39 PM »
I am trying to programatically set tool table values.  The following macro runs and returns a rc=0 and the pVal is what is passed but the tool table values do not change.  Anyone have an idea as to what I am doing wrong?

Code: [Select]
function m6001(hParam)
if (hParam ~= nil) then
--mc.mcCntlSetLastError(inst, 'handle == ' .. tostring(hParam));
local inst = mc.mcGetInstance();
local pVal = mc.mcCntlGetLocalVar(inst, hParam, mc.SV_P)
local pFlag = mc.mcCntlGetLocalVarFlag(inst, hParam, mc.SV_P)
if(pFlag == 1) then
rc=mc.mcToolSetDataExDbl(inst,61,'ZOffset',tonumber(pVal))
wx.wxMessageBox(tostring(rc)..' - '..tostring(pVal))
else
mc.mcCntlSetLastError(inst, 'ERROR: P Falue required with M6001');
mc.mcCntlEStop(inst);
end
else
mc.mcCntlSetLastError(inst, 'ERROR: handle == nil');
end
end

if (mc.mcInEditor() == 1) then
    m6001()
end

TIA

RT

239
local buff, rc
buff,rc= mc.mcCntlGetGcodeLine(number mInst, number LineNumber)
local i
i=string.find(buff,'My Unique Processor Name')
if i==nil then
  rc = mc.mcCntlCloseGCodeFile(number mInst)
end