Hello Guest it is May 22, 2024, 04:52:23 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 - thosj

221
Mach4 General Discussion / Re: Mach4 Coolant Toogle Problems
« on: January 03, 2019, 02:25:45 PM »
Daniba,

Do you mean you copied and pasted MY code from above? Into the Signal Library of the Screen Start script? If so, I don't know why it works for me and not for you. The only thing I can think of, is that's a TOGGLE script. I have a MOMENTARY switch wired to the Mach4/PoKeys input. Each press of the button TOGGLES the coolant. If you have a regular switch in there you might need different code that doesn't toggle but simply switches the coolant ON in one state of the switch and OFF in the other.

I could, of course, completely misunderstand what you're trying to do/doing. If so, disregard.

Tom

222
PoKeys / Re: PoKeys 57U, Mach4, Buttons and you.
« on: December 27, 2018, 06:11:57 PM »
Here's some code for you! You'll need to setup your inputs in your device settings and Mach4 settings then code like this goes in the Screen Start script in the Signal Library section. I included ALL of mine, but it should give you a clue where to start. There's coolant/mist, spindle on, setting speed to 1000 (Mach4 doesn't remember the last speed when shut down so this is a work around for me trying to start the spindle with no speed set!!!) It's commented so you should be able to figure some stuff out for the basics.

Tom

Code: [Select]
---------------------------------------------------------------
-- Signal Library
---------------------------------------------------------------
SigLib = {
[mc.OSIG_MACHINE_ENABLED] = function (state)
    machEnabled = state;
    ButtonEnable()
end,

-- PoKeys pin 9, Mach4 Input 0
-- Physical Cycle Start Button
[mc.ISIG_INPUT0] = function (state)
    if (state == 0) then
        CycleStart()
    end
end,

-- PoKeys pin 10, Mach4 Input 1
-- Physical Feed Hold Button
[mc.ISIG_INPUT1] = function (state)
    if (state == 1) then
        mc.mcCntlFeedHold (0)
    end
end,

-- PoKeys pin 11, Mach4 Input 2
-- Physical Stop Button
[mc.ISIG_INPUT2] = function (state)
    if (state == 1) then
        CycleStop()
    end
end,

--PMDX-108 Port 2 Pin 6 Mach4 Input 10
--HLFB_X ERROR
[mc.ISIG_INPUT10]= function(state)
    if (state==1) then
          mc.mcCntlCycleStop(inst)
          mc.mcCntlSetLastError(inst, "HLFB_X Servo Error")
    end
end,

--PMDX-108 Port 2 Pin 7 Mach4 Input 11
--HLFB_Y ERROR
[mc.ISIG_INPUT11]= function(state)
    if (state==1) then
          mc.mcCntlCycleStop(inst)
          mc.mcCntlSetLastError(inst, "HLFB_Y Servo Error")
    end
end,

--PMDX-108 Port 2 Pin 8 Mach4 Input 12
--HLFB_A ERROR
[mc.ISIG_INPUT12]= function(state)
    if (state==1) then
          mc.mcCntlCycleStop(inst)
          mc.mcCntlSetLastError(inst, "HLFB_A Servo Error")
    end
end,

--PMDX-108 Port 2 Pin 9 Mach4 Input 13
--HLFB_Z ERROR
[mc.ISIG_INPUT13]= function(state)
    if (state==1) then
          mc.mcCntlCycleStop(inst)
          mc.mcCntlSetLastError(inst, "HLFB_Z Servo Error")
    end
end,

----------Mach4 Input 17 PoKeys Pin 17-----
----------Toggle Coolant M8----------------
[mc.ISIG_INPUT17] = function (state)
if (state == 1) then
     local inst = mc.mcGetInstance();
     local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_COOLANTON);
     local sigState = mc.mcSignalGetState(sigh);
     if (sigState == 0) then
         local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
         mc.mcSignalSetState(OSigCool,1)
         mc.mcCntlSetLastError(inst, "Coolant On")
     else
         local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
         mc.mcSignalSetState(OSigCool,0)
         mc.mcCntlSetLastError(inst, "Coolant Off")
     end
end
   
end,

----------Mach4 Input 14 PoKeys Pin 14--
----------Toggle Mist M7----------------
[mc.ISIG_INPUT14] = function (state)
if (state == 1) then
     local inst = mc.mcGetInstance();
     local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_MISTON);
     local sigState = mc.mcSignalGetState(sigh);
     if (sigState == 0) then
         local OSigMist = mc.mcSignalGetHandle (inst,mc.OSIG_MISTON)
         mc.mcSignalSetState(OSigMist,1)
         mc.mcCntlSetLastError(inst, "Mist On")
     else
         local OSigMist = mc.mcSignalGetHandle (inst,mc.OSIG_MISTON)
         mc.mcSignalSetState(OSigMist,0)
         mc.mcCntlSetLastError(inst, "Mist Off")
     end
end
   
end,

------------Mach4 Input 8 PoKeys Pin 8----------------
------------Toggle SpinCW-----------------------------
[mc.ISIG_INPUT8] = function (state)
if (state == 1) then
     local inst = mc.mcGetInstance();
     local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEON);
     local sigState = mc.mcSignalGetState(sigh);
     if (sigState == 1) then
         mc.mcSpindleSetDirection(inst, 0);
     else
         SpinCW()
     end
end

end,

------------Mach4 Input 7 PoKeys Pin 7------------
------------Set S1000-----------------------------
[mc.ISIG_INPUT7] = function (state)
    if (state == 1) then   
        mc.mcCntlGcodeExecuteWait(inst, "S1000");
mc.mcCntlSetLastError(inst, 'Speed Set to 1000')
    else
        --mc.mcCntlFeedHold (0)
    end

end,

--sample input use that was originally in here!!
[mc.ISIG_INPUT60] = function (state)
   -- if (state == 1) then   
--        CycleStart()
--    --else
--        --mc.mcCntlFeedHold (0)
--    end

end,

223
Mach4 General Discussion / Re: Excel to Mach4
« on: December 13, 2018, 08:08:14 AM »
I'm guessing yes here. We did this back in the day, before fancy CAD/CAM, to mill cam tracks. Let Excel calculate the path and output the text file. Gcode is nothing more than text, so anything that saves a text file will import to Mach4 gcode. If you can write Gcode in Notepad, you can surely do it in Excel!! The trick, of course, is getting the output format correct.

Tom

224
Mach4 General Discussion / Re: lathe speed range in Mach4
« on: December 05, 2018, 01:32:04 PM »
I'm not sure what you want images OF, but here goes.

In the upper left, click the Machine Diagnostics tab. Click in Range and type what you want. Then Mach will sent 10v to your VFD when you command S100 M3.

If you meant how do I have my screen edited so I don't have to go to the Machine Diagnostics tab, look in the lower right to see the things I've added there. Pulley is Range, just a text box and a box to enter Pulley (Range). Pulley Max is the top speed of selected Pulley (Range). The top box above SRO% shows spindle index generated actual speed which might or might not be the same as commanded speed depending on how linear your 0-10v output is.

My screen has been edited some more, this is from my test computer which doesn't run a machine, so just for fiddling.

Tom

225
Mach4 General Discussion / Re: lathe speed range in Mach4
« on: December 05, 2018, 08:33:16 AM »
It seems you have that part right, but I didn't go to my machine and compare. Go to the Machine Diagnostics tab and select Range. then do an S90 M3 in MDI or type in a speed and start the spindle with the button on the screen. I do this all the time with a Bridgeport pulley head, so I added some items to the lower right blank area of the Wx4 screenset to have Pulley (Range, Mach3 used Pulley!!) and a box for what the current Range top speed is, and also a box for the actual speed since I have a sensor on my spindle. I have a VFD and Pulleys.

One other thing, Mach4 doesn't remember the speed, session to session, like Mach3 did if I remember correctly, it starts up at 0. If you try to do an M3 or hit the button to start the spindle without first entering a speed, either in MDI or typing in the Speed box, the spindle won't run!!

227
I have a P2S and it mostly works, and WITH the screen, in Mach4. Here is my humble assessment. Lee Neuman of VistaCNC needs to write a new plugin that works. He promised one an August, last August. So.....I would remove all plugins you don't use. Remove, not disable. I think the keyboard plugin is where the conflict is but I'm not the expert. If you don't use the Mach4 keyboard plugin, remove it. One thing I know is, in my case, I can't edit keyboard shortcuts with the Vista plugin even in the folder.. Remove it, edit keyboard shortcuts, put it back, keyboard shortcuts stick and the pendant works. Hence my theory on the keyboard plugin conflicting.

Other than that, we're waiting for Lee!

Tom

228
Bargain Basement / Gecko G320X/G320
« on: November 22, 2018, 08:37:03 PM »
I have 7 Gecko G320X Servo drives for sale.

I have 5 Gecko G320 Servo drives for sale.

All in great shape, all working when removed. None used a lot but all probably over 7 years old.

G320Xs $50 each shipped to US addresses only.
G320s $30 each shipped to US addresses only.

Shipping from Greenville, WI, USA, PayPal OK or ??

229
Kind of looking forward to when/why to use the Touch UI vs the Probe tab.

230
Mach4 General Discussion / Re: New Forum!
« on: November 06, 2018, 06:29:40 AM »
I'm +1 on both of those!

Big MACHSUPPORT FORUMS button on the main page.

Get rid of the file name restriction!

Also, is this the forum with the short timeout restriction? I'll type, have to run to the shop to look at something or otherwise spend time not typing, come back, type more, try to post, get timeout, all my typing is gone. If so, that could be extended, too!! I could be thinking of a different forum ;)

Tom