Hello Guest it is April 17, 2024, 09:06: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 - fritzzco

Pages: 1 2 3 »
1
Hi,  Well, I didn't get your scripts to work, but I did figure it out using your parts, thanks to you!!   I got this working well in windows 7pro and 10pro.  The only thing is can't use the mouse on the slider or it will disrupt the DRO for some reason, but I don't use a mouse anyhow on any CNC machinery, I have touch screens.   Here is what I'm using and so grateful because of you.


2
Well thank you, i'm going to do some plug and play to see how it works.   Let you know soon.......and thank you again for all your time on this. 
Fritz

3
Ok, Great, can't wait to see what you come up with.  Thank you.

4
I tried this, no work either   :-[

--Set Jog Rate

function Feed2()
    local inst = mc.mcGetInstance()
    local Feed2 = mc.mcJogGetRate(inst)
    if Feed2 == 100 then
       mc.mcCntlSetLastError(inst, "Can't increase JogRate anymore.")
    else
       local Feed2 = (Feed2 + 10)
      mc.mcJogSetRate(inst, mc.X_AXIS, SetRate) -- set set for axis
      mc.mcJogSetRate(inst, mc.Y_AXIS, SetRate) -- set set for axis
      mc.mcJogSetRate(inst, mc.Z_AXIS, SetRate) -- set set for axisMotor 3   
    end
   
end   

5
Ok, tried it, don't work.  rats and more rats

6
Like this:?

-Set Jog Rate

function Feed2()
    local inst = mc.mcGetInstance()
    local Feed2 = mc.mcJogGetRate(inst)
   mc.mcJogSetRate(inst, 0, JogRate)  --Motor 0
   mc.mcJogSetRate(inst, 1, JogRate)  --Motor 1
   mc.mcJogSetRate(inst, 2, JogRate)  --Motor 2
   mc.mcJogSetRate(inst, 3, JogRate)  --Motor 3
    if Feed2 == 100 then
       mc.mcCntlSetLastError(inst, "Can't increase JogRate anymore.")
    else
       local Feed2 = (Feed2 + 10)
       mc.mcJogSetRate(inst, Feed2)
    end
end

7
Craig,  What am I doing wrong here?   I get errors no matter what I put in for a jog API.  I'm trying to map this to my keyboard F1 key.

SigLib = {
   
[mc.ISIG_INPUT22] = function (state)
    if (state == 1) then --
      local inst = mc.mcGetInstance()
        Feed2()
    end
end,


function Feed2()
    local inst = mc.mcGetInstance()
    local Feed2 = mc.mcJogGetRate(inst)
    if Feed2 == 100 then
       mc.mcCntlSetLastError(inst, "Can't increase JogRate anymore.")
    else
       local Feed2 = (Feed2 + 10)
       mc.mcJogSetRate(inst, Feed2)
    end
end

8
OK,  Thanks for that, always learning.


9
Ok, try this, I don't know how to copy code into a thread, im dumb as hell on this stuff, sorry.

I put a + & - button by the jograte slider, they work good, but I cannot get to do that with the keyboard, :(

Thanks for your time,
Fritz

10
smav,
There aren't any more functions from a drop down other than jogging from the Keyboard Plugin Config.  You will have to add your inputs to the Signal Library just like you did with the E Stop.
The EStop was easy because there is already a call for E Stop; but you will have to write a script to do other functions like increasing Jog %.

I made a script to increase and decrease the Spindle Override with the (+) and (-) buttons.
I mapped the Buttons to Input 3 and Input 4.
In the screen load script; I made a function called SpindlePlus() to increase by 10% and SpindleMinus() to decrease by 10%
In the Signal Library, I put those functions in Input 3 and Input 4 respectively.



[mc.ISIG_INPUT3] = function (State)
    if (State == 1) then   
       SpindlePlus()
     end
end,

[mc.ISIG_INPUT4] = function (State)
    if (State == 1) then   
       SpindleMinus()
     end
end,

---------------------------------------------------------------
function SpindlePlus()
    local inst = mc.mcGetInstance()
    local SSO = mc.mcSpindleGetOverride(inst)--Returns:  0.5 - 1.5
    if SSO >= 1.5 then
       mc.mcCntlSetLastError(inst, "Can't increase SSO anymore.")
    else
       SSO = (SSO + 0.1)
       mc.mcSpindleSetOverride(inst, (SSO))
    end
end
---------------------------------------------------------------
function SpindleMinus()
    local inst = mc.mcGetInstance()
    local SSO = mc.mcSpindleGetOverride(inst)--Returns:  0.5 - 1.5
    if SSO <= 0.5 then
       mc.mcCntlSetLastError(inst, "Can't decrease SSO anymore.")
    else
       SSO = (SSO - 0.1)
       mc.mcSpindleSetOverride(inst, (SSO))
    end
end
---------------------------------------------------------------
Chad, Your posted script works well, I did it for also the FRO.   Thanks.   Can you show me how this would look for the JogRate?   I been trying for days now, no luck for some reason.   I just keep getting errors.  This is what I have for JogRate:

Pages: 1 2 3 »