Hello Guest it is April 28, 2024, 07:43:00 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 - tomltom

Pages: 1
1
Mach4 General Discussion / Re: Map Lua Code to ShuttlePro button
« on: March 11, 2016, 02:44:31 PM »
I think there is a missing end at the end  ;)

-- Turn on Laser at low power map to shuttle pro button 7
---------------------------------------------------------------
-- Signal Library
---------------------------------------------------------------
SigLib = {
[mc.OSIG_MACHINE_ENABLED] = function (state)
    machEnabled = state;
    scr.SetProperty('btnRefAll', 'Enabled', tostring(state));
    scr.SetProperty('btnRefAll2', 'Enabled', tostring(state));
    scr.SetProperty('btnGotoZero', 'Enabled', tostring(state));
    scr.SetProperty('tabJogging', 'Enabled', tostring(state));
    if (state == 1) then
        AxisEnable();
    end
end,
[mc.ISIG_INPUT7] = function (state)
local inst = mc.mcGetInstance();
local rpm = 1;    -- Set this to the actual RPM you want as your starting point
mc.mcSpindleSetCommandRPM( inst, rpm );
mc.mcSpindleSetDirection( inst, 1 );    -- 1 == forward, 0 == off, -1 == reverse
end
}

2
Mach4 General Discussion / Pokeys pin setup
« on: March 11, 2016, 02:32:18 AM »
Does anyone have any info on pokeys pins.
By default pokeys plugin for M4 set home status to pokeys pulse engine home status.
The same for limits.



Which are the correct physical pin on the pokeys for home and limit status?

Tom

3
Mach4 General Discussion / Re: Map Lua Code to ShuttlePro button
« on: March 10, 2016, 12:54:22 PM »
Here the forgoten function JOGSETAXIS
Insert it after the the SigLib Definition
This function select the axis.

ledX,ledY,ledZ are LEDs on the Screen to show me which axis is selected.
If you don't need comment out all lines with setproperty for led.
Or insert a LED on the Screen and name it ledX,........


function JogSetAxis(axis)
    scr.SetProperty("ledX", "Value", "0")   
    scr.SetProperty("ledY", "Value", "0")   
    scr.SetProperty("ledZ", "Value", "0")
    if (axis==0) then
            scr.SetProperty("ledX", "Value", "1") ;
    end
    if (axis==1) then
            scr.SetProperty("ledY", "Value", "1") ;
    end
    if (axis==2) then
            scr.SetProperty("ledZ", "Value", "1") ;
    end
    mc.mcMpgSetAxis(0, 0, axis);
    mc.mcCntlSetLastError(inst, "Axis " .. tostring(axis));   -- write to history
end

4
Mach4 General Discussion / Re: Map Lua Code to ShuttlePro button
« on: March 10, 2016, 12:41:22 PM »
Hi Peter,
here are a short description

1. enable shuttle plugin


2. Map Input signals to shuttle keys (shuttle key numbers are 0 to 15 from upper left and ignore my change beetwen input2 and input0, description in the code sample)


3. edit screen (menu/Operator/edit Screen)
    select first line in the screen tree manager (in my picture wx4)
    in the lower tab select events
    open "Screen load script"


here you can write handles for all input signals
must be in the SigLib Definition enclosed by { }

---------  code sample start ---------
---------------------------------------------------------------
-- Signal Library
---------------------------------------------------------------
SigLib = {
[mc.OSIG_MACHINE_ENABLED] = function (state)
    machEnabled = state;
    scr.SetProperty('btnRefAll', 'Enabled', tostring(state));
    scr.SetProperty('btnRefAll2', 'Enabled', tostring(state));
    scr.SetProperty('btnGotoZero', 'Enabled', tostring(state));
    scr.SetProperty('tabJogging', 'Enabled', tostring(state));
    if (state == 1) then
        AxisEnable();
    end
end,

-- here handle for input0
[mc.ISIG_INPUT0] = function (state)
     --- your code here
end,

.....
.......
....
....

---------  code sample ende ---------


Here my code to select axis and steps for the jog
---------  code sample start ---------
-- if screen loaded all inputs are called multiple
-- to save x axis is first selection after screen start i swap  INPUT2 and INPUT0

InputTrigger = 0  --suppress toggle for input7

[mc.ISIG_INPUT0] = function (state)
    JogSetAxis(2)
end,
[mc.ISIG_INPUT1] = function (state)
    JogSetAxis(1)
end,
[mc.ISIG_INPUT2] = function (state)
    JogSetAxis(0)
end,
[mc.ISIG_INPUT4] = function (state)
    local jogRate
    jogRate=0.001
    mc.mcJogSetInc(inst, 0,jogRate);
    mc.mcJogSetInc(inst, 1,jogRate);
    mc.mcJogSetInc(inst, 2,jogRate);
end,
[mc.ISIG_INPUT5] = function (state)
    local jogRate
    jogRate=0.01
    mc.mcJogSetInc(inst, 0,jogRate);
    mc.mcJogSetInc(inst, 1,jogRate);
    mc.mcJogSetInc(inst, 2,jogRate);
end,
[mc.ISIG_INPUT6] = function (state)
    local jogRate
    jogRate=0.1
    mc.mcJogSetInc(inst, 0,jogRate);
    mc.mcJogSetInc(inst, 1,jogRate);
    mc.mcJogSetInc(inst, 2,jogRate);
end,
[mc.ISIG_INPUT7] = function (state)
    local jogRate
    jogRate=1
    mc.mcJogSetInc(inst, 0,jogRate);
    mc.mcJogSetInc(inst, 1,jogRate);
    mc.mcJogSetInc(inst, 2,jogRate);
end,
[mc.ISIG_INPUT8] = function (state)
    if (state==1 and InputTrigger==0) then
        InputTrigger = 1
        ButtonJogModeToggle()
    end
    if (state==0 and InputTrigger==1) then
        InputTrigger = 0
    end
end,

....
.....
....
---------  code sample ende ---------



Hope i can help  ;)
Tom






5
Mach4 General Discussion / Re: Mach4 - pokeys settings reset
« on: March 05, 2016, 09:08:01 AM »
I can't find nowhere pin 0. Pokeys start with pin 1
Which other Software do you use now?

Tom

6
Mach4 General Discussion / Re: Mach4 - pokeys settings reset
« on: March 04, 2016, 02:27:27 PM »
Hi Daniel

thanks for yor reply. But it works not for me.
I have  try all ways but nothing works correct.

Here are a Short description
- Install Mach4 and pokey plugin
- Enable pokey plugin and add new device
- Enable integrated 3ch pulse engine confirm all
- Restart Mach4 and select pokey as motion controller
- Setup motor parameters counts and speed

MDI = G0 x5    ......axis moved !!!!!
Very Easy!

Now i will setup my home and limit switchs
By default i have this settings



My limits switch are on pokeys pin 35/36/37



Now i can trigger home and limit

https://dl.dropboxusercontent.com/u/60701703/Foren/Pic3.png

AND NOW if i enter the Mach configure menu all settings for home and limit are set to default



The second way
I go to the pokeys plugin setup/ Pulse engine and setup there my switches.



Now i can trigger home and Limit



AND NOW if i enter the Mach configure menu all settings for home and limit are set to default
In the pokeys plugin configruation



What is wrong ?????
What are the Default Pins for the pulse engine home and Limit Switches?
Why.....

thanks
Tom

7
Mach4 General Discussion / Mach4 - pokeys settings reset
« on: March 03, 2016, 05:49:14 AM »
I am preparing Mach4 to work with my mill and a pokeys57e.

Most settings are done , but a big problem I have yet.
Whenever I changed settings for mach the settings for my pokeys reset.
Specifically the settings in the pulse engine tab.
Home and limit switchs.

 Is this a bug or a Feature.

Tom

Pages: 1