Hello Guest it is April 20, 2024, 03:09:26 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 - smurph

341
Mach4 General Discussion / Re: Mach4 "Tool Path Progress" message
« on: February 23, 2020, 11:33:47 PM »
Execute this code in MDI and see if that doesn't fix your issue. 
Code: [Select]
G10 L50
N8110 R998
N8111 R999
G11

After executing that code, shut down and restart Mach.

Steve

342
Yeah...  the PMC rules for this kind of stuff.  It is a one rung'er.  :) 

Unfortunately, I broke the PMC editor in builds 4394 to 4410.  A new dev build will be there soon.  But you can try it out just dropping the .pmc and .lua files in your Pmc directory and then telling the screen set to use them.  Like I said, only the PMC Editor was broken.  I tried to get fancy and had an epic failure.  LOL

Both the scripts above and this pmc file raise ISIG_MOTION_INHIBIT (Gode/MDI) and ISIG_JOG_INHIBIT (jogging). 

Steve

343
Also, the PMC could be used to accomplish the same thing. 

Steve

344
Simply put a sign on the computer.... Machine Must be Homed before any other movement!
This.  Simply brilliant!!!  :) 

Way back when, I was a systems analyst.  Believe it or not, systems analysts existed before computers got so accessible/popular.  System analysts were basically problem solvers when trying to improve any system, be it a manual or automated system of any type.  It could be logistics flow of material through a plant, or simply how to keep track of shipment items when they are loaded onto a truck.  And later on when computers became "the way" to solve problems, everyone wanted to do things that way.  But sometimes, the more direct approach was the cheaper and BETTER solution.  A sign is cheap.  Nothing more simple or direct than that.  And a lot of times, that simpler and more direct approach was job training. 

So I found myself becoming a big proponent signs and training! 

But I'm not ignoring the fact that sometimes a completely automated means to force a certain behavior is a bad idea.  I like shock collars.  LOL 

All that being said, here is my implementation of the no motion before home op.:

The following functions are put in the Screen Load script.
Code: [Select]
function InhibitMotion(inhibit)
    local inst = mc.mcGetInstance('InhibitMotion()')
    local rc, hSigInhitbitMotion

    hSigInhitbitMotion, rc = mc.mcSignalGetHandle(inst, mc.ISIG_MOTION_INHIBIT)
    if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
        mc.mcCntlMacroAlarm(inst, 600, 'Could not retrieve ISIG_MOTION_INHIBIT signal handle!')
return
end

if (inhibit) then
rc = mc.mcSignalSetState(hSigInhitbitMotion, 1) -- raise the mc.ISIG_MOTION_INHIBIT signal
if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
mc.mcCntlMacroAlarm(inst, 602, 'Could not set ISIG_MOTION_INHIBIT signal state to 1!')
return
end
else
rc = mc.mcSignalSetState(hSigInhitbitMotion, 0) -- lower the mc.ISIG_MOTION_INHIBIT signal
if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
mc.mcCntlMacroAlarm(inst, 604, 'Could not set ISIG_MOTION_INHIBIT signal state to 0!')
return
end
    end
end

function InhibitJog(inhibit)
    local inst = mc.mcGetInstance('InhibitMotion()')
    local rc, hSigInhitbitJog

    hSigInhitbitJog, rc = mc.mcSignalGetHandle(inst, mc.ISIG_JOG_INHIBIT)
    if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
        mc.mcCntlMacroAlarm(inst, 601, 'Could not retrieve ISIG_JOG_INHIBIT signal handle!')
return
end

if (inhibit) then
rc = mc.mcSignalSetState(hSigInhitbitJog, 1) -- raise the mc.ISIG_JOG_INHIBIT signal
if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
mc.mcCntlMacroAlarm(inst, 603, 'Could not set ISIG_JOG_INHIBIT signal state to 1!')
return
end
else
rc = mc.mcSignalSetState(hSigInhitbitJog, 0) -- lower the mc.ISIG_JOG_INHIBIT signal
if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
mc.mcCntlMacroAlarm(inst, 605, 'Could not set ISIG_JOG_INHIBIT signal state to 0!')
return
end
    end
end

function InhibitMotionAndJog(inhibit)
InhibitMotion(inhibit)
InhibitJog(inhibit)
end

function CheckHomed()
    local inst = mc.mcGetInstance('CheckHomed()')
    local homedX, homedY, homedZ, homed, rc, hSigInhitbitMotion, inhibitMotion
    homedX, rc = mc.mcAxisIsHomed(inst, mc.X_AXIS)
    if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
        mc.mcCntlMacroAlarm(inst, 5000, 'Could not retrieve X axis homed condition!')
return
end
    homedY, rc = mc.mcAxisIsHomed(inst, mc.Y_AXIS)
    if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
        mc.mcCntlMacroAlarm(inst, 5001, 'Could not retrieve Y axis homed condition!')
return
end
    homedZ, rc = mc.mcAxisIsHomed(inst, mc.Z_AXIS)
    if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
        mc.mcCntlMacroAlarm(inst, 5002, 'Could not retrieve Z axis homed condition!')
return
end

    hSigInhitbitMotion, rc = mc.mcSignalGetHandle(inst, mc.ISIG_MOTION_INHIBIT)
    if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
        mc.mcCntlMacroAlarm(inst, 5003, 'Could not retrieve ISIG_MOTION_INHIBIT signal handle!')
return
end

    inhibitMotion, rc = mc.mcSignalGetState(hSigInhitbitMotion)
    if (rc ~= mc.MERROR_NOERROR) then -- check retun codes!
        mc.mcCntlMacroAlarm(inst, 5005, 'Could not retrieve ISIG_MOTION_INHIBIT signal state!')
return
end

homed = homedX and homedY and homedZ
   
if ((homed == 0) and (inhibitMotion == 0)) then
InhibitMotionAndJog(true)
elseif ((homed == 1) and (inhibitMotion == 1)) then
InhibitMotionAndJog(false)
    end
end

And put this one liner in your PLC script:
Code: [Select]
CheckHomed()

Steve

345
Mach4 General Discussion / Re: New Forum!
« on: February 16, 2020, 12:46:13 AM »
I would love to see a section on whats new in each release along with any documentation on the new features.

Look in the change log. 
ftp://www.machsupport.com/Mach4/DevlopmentVersions/ChangeLog.txt

Steve

346
Mach4 General Discussion / Re: Create elements in Mach 4
« on: February 16, 2020, 12:41:23 AM »
The bolt hole wizard is a good example.  It is designed to run as a stand alone wizard OR inside of a Lua panel.  To test it, just copy the bolt hole wizard code into the paste buffer and then paste it into the LUA panel's script. 

You will see the switch code in there that is similar to what SwiftyJ mentioned.  If the mcLuaPanelParent variable is not NIL, then the bolt hole wizard knows that it is running inside a Lua panel.  Otherwise, it is running as a stand alone wizard and will create a frame.

It is important to realize that wxFormBuilder will most likely NOT generate drop in code.  Use it to generate the user interface and then cut and paste the needed code into your panel script. 

Steve

347
Mach4 General Discussion / Re: Problems - Win10 update + PMDX_424 + LUA
« on: February 16, 2020, 12:31:18 AM »
The mcLua.mcc file is recreated each time that m4 starts.  It reads all macros (*.mcs) for that profile and then outputs the compiled code to the mcLua.mcc file.  It appears that that file is not being made due to either lack of permission or that there is an error in one of the macros that it is compiling.  Are there any other error messages thrown before that one?

It is not a permissions problem.  There is a source file (.mcs) that has an error in it. 

As rhtuttle said, the mcLua.mcc file gets built the first time you hit cycle start if it doesn't exist.  Each msc file gets "compiled" into a .mcc file.  And then all of the .mcc files are rolled up to create one mcLua.mcc file.  If a source file has an error, there won't be a resulting .mcc file for it and there definitely won't be a mcLua.mcc file created. 

The easiest way to find the problem child is to launch mach, then choose Operator->Open Script Editor.  Then open up EACH .mcs file in your macro directory and compile it.  The compile option is under the Project menu of the Zerobrane editor.  Eventually, you will see a file give an error there. 

Steve

348
Mach4 General Discussion / Re: New to jogging/ non g-code moves
« on: February 05, 2020, 04:50:11 PM »
The way THC works is by overriding the Z axis with an out of band (non coordinated axis).  So Craig has again hit the nail upon the head.  You can jog out of band axes via velocity or incrementally.

I don't have time to write this out in code, but I will give a general synapses of how it would work.

Override the Z axis with say OOB1. 
Have the PLC script track an input signal (sig lib)
If the signal changes from low to high, jog the OOB axis up .050".
If the signal changes from high to low, jog the OOB axis down .050" (if required).

Not terribly complicated, but not a one liner either.  It is left as an exercise for the user to implement it.  :)

Steve

349
Mach4 General Discussion / Re: Mach 4 Lathe. Missing tool change script.
« on: February 03, 2020, 01:27:01 AM »
Yeah, it is indeed not there.  I guess the guys that do the installer took them out for some reason.  I will inquire. 

Steve

350
Mach4 General Discussion / Re: MACH 4 LATHE POST
« on: February 02, 2020, 05:57:34 PM »
It should work with any Generic ganuc post.  We support both the single line and double line formats of G76.

Steve