Hello Guest it is May 07, 2024, 02:50:21 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

461

1  .i have many M function that i build and inside each there many function ,in each Mcode
     always i put one on headr====>>"local inst = mc.mcGetInstance()",and no need any more
     but this last version its not work ,i must put this statement on each function

You should ALWAYS get the instance in every function.  That was the design.  If it worked for you before, it was by accident. 

2.  i know that mach take all m function in 1 file ,but i never had problem when i had 2 function with  same name
     on 2 different M function,last version its not work ,if same name function not work ,need make each function other
     name

In LUA, the last function with the same name wins.  Always.  Now, this version uses LUA 5.3 where the old version you were running may have used LUA 5.2 and that MAY change the order in which functions are loaded. 

It is a programming error to use multiple functions with the same name.  :(


462
You can also export the plasma configuration tab and import it into your screen set.  Right click on the tab element in the screen tree and click export.  :)

Steve

463
The way to disable the automatic scaling of the screen elements is to develop the screen in the resolution that it will used.  E.g. 1200x1920 instead of 1024x768.  You will most likely need to start with the blank screen set, and then set the resolution before adding any elements. 

Mach 4 Industrial has tool table, offset, and in screen editor controls. 

Steve

464
I have no idea where GetXin() comes from.  :(

What is mInst?  Typically the instance is garnered with:

local mInst = mc.GetInstance('my function')

And it is usually going in a function. 

Code: [Select]
function JogAxis(axis, direction)
    local inst = mc.mcGetInstance('My JogAxis Function') -- just a label so that API tracing works. 
    if (direction > mc.MC_JOG_STOP) then
        mcJogVelocityStart(inst, axis, mc.MC_JOG_POS)
    elseif (direction < mc.MC_JOG_STOP) then
        mcJogVelocityStart(inst, axis, mc.MC_JOG_NEG)
    else
        mcJogVelocityStop(inst, axis)
    end
end

And to call that function to jog the Y axis:

Code: [Select]
JogAxis(mc.Y_AXIS, mc.MC_JOG_POS) --Jog positive
...
JogAxis(mc.Y_AXIS, mc.MC_JOG_STOP) -- Stop the positive jog

JogAxis(mc.Y_AXIS, mc.MC_JOG_NEG) --Jog negative
...
JogAxis(mc.Y_AXIS, mc.MC_JOG_STOP) -- Stop the negative jog

Steve

465
You really DON'T want to press a button with a script call.  Why?  M code scripts don't natively have access to the screen.  And the script to press a button paradigm was more of a Mach 3 thing.

What you want to do is DUPLICATE the functionality of the button in script.  You do this with the Mach API.  For example, mcJogVelocityStart/Stop will do what pressing the X jog button does, etc...

Steve

466
Mach4 General Discussion / Re: Loop Counter
« on: May 01, 2019, 12:17:03 PM »
Well...  no.  Other than the way G code already gives you.  This is usually done in the G code with a #var.  Set the var to zero before the M98 L10 call and in the sub increment the #var.

Steve

467
G10 only needs G11 if it is a multi-line or modal G10 operation.  Most G10 calls are on shots. 

Steve

468
Mach4 General Discussion / Re: Loop Counter
« on: April 30, 2019, 10:25:32 PM »
Not at the moment. 

Steve

469
Mach4 General Discussion / Re: plasma thc
« on: April 28, 2019, 06:52:35 PM »
THC only needs to be as fast as the Z motor can accelerate.  :)  The "script based" solution will probably handle > 90% of any THC application in the hobby world. 

Steve

470
Mach4 General Discussion / Re: GALIL 413x M11Px M10Px
« on: April 24, 2019, 01:04:45 AM »
No, the Galil plugin does NOT support M10/M11 in Mach 3. 

M62/M63 in Mach 4 is supported in the Mach4 Galil plugin somewhat.  What I mean by that is that the output fires immediately when received by the plugin.  But the motion attached to it will be executed buffer depth milliseconds later.  This may not make much of a difference to you if say you had a buffer of 50 milliseconds or less.  Because 50 milliseconds is pretty much instantaneous to humans.  And 50 milliseconds probalbly isn't going to make much of a difference in a plasma application either. 

Steve