Hello Guest it is March 28, 2024, 09:06:12 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 - thespindoctor

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 »
181

      mc.mcSoftLimitSetState(inst, mc.Z_AXIS, mc.MC_ON);

     mc.mcSoftLimitSetState(inst, mc.Y_AXIS, mc.MC_ON);

     mc.mcSoftLimitSetState(inst, mc.X_AXIS, mc.MC_ON);

[/quote]
Notice the capitalization!  Apparently this code is CASE Sensitive!  I did not know that.  Anytime we want to run a mcAnything() we need to add the mc to the mcAnything to get mc.mcAnything   Slowly making more sense.  Studying the LUA Scripting Guide line by line is helping to learn Lua.  Feeling like a champ right now with these one liners...

Keith

182
It works   Here is the code   GO to screen edit on operator menu to open editor.  Click on top wx of upper left screen   Then click on lightening bolt option on lower left box to see plc line the click on ... button to open up plc script.  insert where indicated in code below.  Compile   Save    then exit screen editor by clicking on screen edit of operator menu which will ask again to save screen.  Now when you come into Mach4 the softlimits will be on and the softlimits button will be green!

-here is section of plc to insert the code into
-------------------------------------------------------
--  PLC First Run
-------------------------------------------------------
if (testcount == 1) then --Set Keyboard input startup state
    local iReg = mc.mcIoGetHandle (inst, "Keyboard/Enable")
    mc.mcIoSetState(iReg, 1) --Set register to 1 to ensure KeyboardInputsToggle function will do a disable.
    KeyboardInputsToggle()

--INSERT HERE THE FOLLOWING CODE
-- turn on soft limits
      mc.mcSoftLimitSetState(inst, mc.Z_AXIS, mc.MC_ON);

     mc.mcSoftLimitSetState(inst, mc.Y_AXIS, mc.MC_ON);

     mc.mcSoftLimitSetState(inst, mc.X_AXIS, mc.MC_ON);
-- ----------------------------------------------

183
Stuart

I am sure it goes in the plc program and has to be done for each axis. It needs to be in the section of the plc script where a counter is active so it only gets run one time when the counter equals 1

184
compiled last version but bad call   almost working

185
-- turn on soft limits by kfc 12/2016
    local TurnOn=MC_ON;

    local axis=Z_AXIS;
    mcSoftLimitSetState(inst, axis, TurnOn);

    local axis = Y_AXIS;
    mcSoftLimitSetState(inst, axis, TurnOn);

    local axis = X_AXIS;
    mcSoftLimitSetState(inst, axis, TurnOn);
-- ----------------------------------------------


?seemed to work???

186
This is my first attempt to program in Lua in the PLC script.  Trying to turn on softlimits   Here is the code that says syntax error.
I have no idea what I am doing...  I put the code under the PLC First Run section which should be correct?  Got to start somewhere...

Thanks!
-------------------------------------------------------
--  PLC First Run
-------------------------------------------------------
if (testcount == 1) then --Set Keyboard input startup state
    local iReg = mc.mcIoGetHandle (inst, "Keyboard/Enable")
    mc.mcIoSetState(iReg, 1) --Set register to 1 to ensure KeyboardInputsToggle function will do a disable.
    KeyboardInputsToggle()

----------- turn on soft limits by kfc 12/2016

    int TurnOn=MC_ON;

    int axis=Z_AXIS;
    mcSoftLimitSetState(inst, axis, TurnOn);

    int axis = Y_AXIS;
    mcSoftLimitSetState(inst, axis, TurnOn);

    int axis = X_AXIS;
    mcSoftLimitSetState(inst, axis, TurnOn);
-- ----------------------------------------------

187
Thanks!

188
Mach4 General Discussion / Can soft limits be automatically on at start up?
« on: December 11, 2016, 09:53:59 AM »
My machine is working great with limit override and soft limits!  ;D It is wonderful to be able to go at rapids to the limits and it always stops now with no limit switches being hit.  The only issue is that I have is that I have to activate soft limits by going to another screen to hit the button to turn on soft limits.  It would be better to have soft limits on when the Mach4 boots then turn off soft limits if not needed.  I see no reason to ever run the machine with soft limits off?  Is there a way to set soft limits on at boot. 

Thanks
Keith

189
Mach4 General Discussion / Re: *** PROBING SCREEN ? ***
« on: December 10, 2016, 10:59:20 AM »
Working great for me!!

190
SmoothStepper USB / Re: Mach4 Motion Controller recommendations
« on: November 28, 2016, 07:40:39 PM »
Mach4 with Ethernet Smooth Stepper motion controller and CnC4PC C62 Multifunction breakout board are working nicely for me but I don't have everything fully implemented yet.

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 »