Hello Guest it is April 28, 2024, 05:02:00 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 - Cbyrdtopper

821
Mach4 General Discussion / Re: Keyboard Inputs Enabled or Disabled Handle
« on: January 03, 2017, 09:48:30 PM »
I found this video by DazTheGas
https://www.youtube.com/watch?v=8KgZ1SYxEdg
Gonna check it out in the morning and see if I can use some of this code.

822
Mach4 General Discussion / Keyboard Inputs Enabled or Disabled Handle
« on: January 03, 2017, 06:02:52 PM »
I'm trying to get a handle on the Keyboard Inputs, whether it is enabled or disabled so I can set an output on or off. 

I've seen where there is GetHandle on Keyboard/Enable in the PLC First run but I'm not sure what it is getting a handle on. 

Is there a way to get the handle on whether or not the Keyboard is Enabled or Disabled?

823
Mach4 General Discussion / Re: Toggle Coolant on/off in SigLib
« on: January 03, 2017, 10:02:22 AM »
I really like your idea of sending the alarm signal through the estop loop, that should work just fine for me and very simple to set up!!  Thanks for the insight, really appreciated over here!

824
Mach4 General Discussion / Re: Toggle Coolant on/off in SigLib
« on: December 28, 2016, 12:02:29 PM »
Thanks for the reply and for looking at my script!  I truly appreciate the time you took for that!  The screen designer is very powerful and has some really great functions, however I'm using this code for physical buttons on my control panel as well as a foot pedal to toggle a pneumatic clamp for a grinder we are building. 

Also, has the Mach team thought about having Axis Fault inputs integrated into Mach?  Or would that be something that would be controlled via plugins?

825
Mach4 General Discussion / Re: Toggle Coolant on/off in SigLib
« on: December 28, 2016, 11:33:55 AM »
I hadn't thought about that Chaoticone, Thanks!

I took the code from the spindle cw button and it worked great!  The Coolant button didn't have code in it but I put together something that works well.


------------Input0----------------
--------Toggle SpinCW()-----------
[mc.ISIG_INPUT0] = 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
         mc.mcSpindleSetDirection(inst, 1);
     end
end
   
end,


----------Input 1------------
------Toggle Coolant---------
[mc.ISIG_INPUT1] = 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,

826
Mach4 General Discussion / Toggle Coolant on/off in SigLib
« on: December 27, 2016, 04:48:18 PM »
I'm setting up a new machine and I have 2 buttons on my control panel, one to toggle the spindle and one to toggle the coolant.  I haven't figured out how to toggle them on and off in the signal library.  
  
Button1 is set to input 1
Here is what I am wanting:
Input1 triggered ----> turn on coolant
Input1 triggered again ----> turn off coolant

I keep referencing the scripting manual but I can't figure out what the signal table is or where to put it.  I'm working in the screen load script under Signal Library.  I've made the button turn on the coolant on the press and then it shuts off on the release.

Is this possible in the signal library?


Here is what i've worked on so far and have gotten practically nowhere


----Input 1 Coolant On/Off --------------> THIS KEEPS COOLANT ON BUT DOESN'T TURN IT OFF 12/27/16
--[mc.ISIG_INPUT1] = function (on_off)
    
--     if mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON, 0) then
--         if (on_off == 1)  then
--         local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
--         mc.mcSignalSetState(OSigCool,1)
--         mc.mcCntlSetLastError(inst, "Coolant On")
--         end
--     else
--         if (on_off == 1)  then
--         local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
--         mc.mcSignalSetState(OSigCool,0)
--         mc.mcCntlSetLastError(inst, "Coolant Off")
--         end
--     end
--end,

----------------------> this turns on with press and turns off with release
--Input 1 Coolant On/Off
--[mc.ISIG_INPUT1] = function (on_off)
--    if (on_off == 1) then
--         local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
--         if mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON, 0) then
--         mc.mcSignalSetState(OSigCool,1)
--         mc.mcCntlSetLastError(inst, "Coolant On")
--         end
--    else
--         local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
--         if mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON, 1) then
--         mc.mcSignalSetState(OSigCool,0)
--         mc.mcCntlSetLastError(inst, "Coolant Off")
--         end
--     end
--end,

Any help would be great.


827
General Mach Discussion / G32 not working.
« on: July 20, 2016, 12:06:27 PM »
We were previously not having any problem with threading on our lathe, then all of a sudden it stopped reading the G32 command.  We will run the program through and it stops on the line before G32.
Attached is the current XML and the Threading program being used.
Any thoughts??
-Chad

828
General Mach Discussion / Re: Measuring Down Time
« on: June 06, 2016, 03:02:33 PM »
Okay, I've got something working.
I have attached a screenset and two macros. 
The screenset has a tab called "Down Time" in it you will find Down Time in minutes, parts, and average down time per part and a button to reset all the DRO's to start a new week. 
The Macros will run off of M30 and the cycle start button.  You will need to configure Mach3 to ignore M calls while loading.  It is in the general config section in Mach3 (it is a checkbox).
Hope this will help.  Any questions just send me a message or email.
Cbyrdtopper@gmail.com
-Chad

829
General Mach Discussion / Re: Measuring Down Time
« on: June 03, 2016, 07:34:09 PM »
Hey,
I've got an idea on how to do this.  Been working on it today for my own use.  I'm away for the weekend but will get back on it Monday and post my results. 
-Chad

830
General Mach Discussion / Re: Spindle S Command Not Working
« on: June 01, 2016, 02:46:31 PM »
Okay, problem is fixed.  I was running Mach3 R3.043.066 and switched it to R3.043.062 and everything is working just fine!! =)
-Chad