Hello Guest it is May 11, 2024, 03:36:27 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 - Bill_O

141
Havoc and Chriscam,

This might help some.
When I was trying to learn Lua I made this for people like me to get started.

https://www.machsupport.com/forum/index.php?topic=45397.0


142
Mach4 General Discussion / Re: Homing scripts
« on: January 17, 2022, 08:31:41 AM »
Brad,

Here is a starter for you to start learning how to modify your Mach4.
Hope it helps.
https://www.machsupport.com/forum/index.php?topic=45397.0

Bill

143
Mach4 General Discussion / Merry Christmas
« on: December 20, 2021, 08:41:32 AM »
Well i am going to be off for a couple of weeks so have to say Merry Christmas a little early.
Hope everyone has a great new year.

Bill

144
Mach4 General Discussion / Re: Mechanical button to release tool from atc
« on: December 13, 2021, 07:22:28 AM »
It will take some work.
First you need to learn a little on how to write the code that Mach uses.
Here is a link to something I made while trying to learn the basics.
https://www.machsupport.com/forum/index.php?topic=45397.0
It is not hard once you get started.
To get to the Signal Script you need to go to Operator then Edit Screen.
On the left side of the screen under Screen Tree select the top level.
Under properties below that select the center icon (Events)
Next to Signal Script click on the code and a window will pop up with all the code in the Signal Script.
Make sure you made a backup copy of your Mach4 so if you mess up it is easy to start back over.

145
Mach4 General Discussion / Re: Mechanical button to release tool from atc
« on: December 10, 2021, 07:26:00 AM »
Here are the basics.
You need to make an input into Mach for when the button is pressed.
Then you can use the PLC or the Signal Script and put the code in to activate your tool release when the input is pressed.

146
Mach4 General Discussion / Re: Need help writing scripts for Mach4
« on: December 07, 2021, 07:21:31 AM »
It might be worth learning to do it yourself.
Then if you want anything else you can do it.

147
Mach4 General Discussion / Re: Prevent spindle rotation for certaint tools
« on: November 08, 2021, 09:16:04 AM »
I have a few options for our machines that I do not want the spindle turning on while being used.
I wrote a custom m3 that if those tools are the current tool to not turn on the spindle.
I used registers to pass the information to the m3.
Here is the code.

function m3()
   --wx.wxMessageBox('In M03')
   --mc.mcCntlSetLastError(inst, "In M03")
   local inst = mc.mcGetInstance()
   --Get Spindle On and Spindle Auto handles
   local hSpin = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEON)
   local hreg = mc.mcRegGetHandle(inst, 'iRegs0/SpindleAuto')
   --Get spindle on state
   local SpinOn = mc.mcSignalGetState(hSpin)
   --Get Spindle Auto value
   local SpinVal = mc.mcRegGetValue(hreg)
   --get if tk turned on and tk osc selected
   local TKOnOff = mc.mcCntlGetParameter(502)
   local TKOReg = mc.mcRegGetHandle(inst, 'iRegs0/TKOscOnOff')
   local TKORegVal = mc.mcRegGetValue(TKOReg)
   
   local TKOnOffReg = mc.mcRegGetHandle(inst, 'iRegs0/TKOnOff')
   local TKOnOffVal = mc.mcRegGetValue(TKOnOffReg)
   
   if (TKOnOff == 0) then--or (TKOnOffVal == 0) then
      if (SpinVal == 0) then
         --mc.mcSignalSetState(hSpin, 0)
      elseif (SpinOn == 0) then
      
         local hregSpinType = mc.mcRegGetHandle(inst, 'iRegs0/SpindleType')
         local SpinType = mc.mcRegGetValue(hregSpinType)
         --local hregSpinCool = mc.mcRegGetHandle(inst, 'iRegs0/SpinCool')
         local hsigSpinCool = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT4)
         if (SpinType == 2) then --and (TKOnOff == 0)then
            --mc.mcRegSetValue(hregSpinCool, 1)
            mc.mcSignalSetState(hsigSpinCool, 1)
            wx.wxMilliSleep(2000)
         end

--         if (TKOnOff == 0) then
            mc.mcSignalSetState(hSpin, 1)
            --local hrSpinType = mc.mcRegGetHandle(inst, 'iRegs0/SpindleType')
            --local SpinType = mc.mcRegGetValue(hrSpinType)
            if (SpinType == 0) then
               wx.wxMilliSleep(1500)
            elseif (SpinType == 1) then
               wx.wxMilliSleep(5500)
            elseif (SpinType == 2) then
               wx.wxMilliSleep(11000)
            end
--         end
      end
   elseif (TKOnOff == 1) and (TKORegVal == 1)then
      local TKOscH = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT9)
      mc.mcSignalSetState(TKOscH, 1)
   end
end
if (mc.mcInEditor() == 1) then
   m3()
end

148
Mach4 General Discussion / Re: Shift Z-axis workshift with scale on knee
« on: November 08, 2021, 09:05:23 AM »
Most of the API calls are in the Mach4CoreAPI.
It is in the C:\Mach4 Hobby\ Docs folder.

This might also help.
https://www.machsupport.com/forum/index.php?topic=45397.0

149
Mach4 General Discussion / Re: Modbus control huanyang GT vfd
« on: November 04, 2021, 07:52:41 AM »
I could be very wrong but don't the variables "path" and "value" need to be defined what they are?

150
Mach4 General Discussion / Re: lines in toolpath screen
« on: October 28, 2021, 03:01:44 PM »
Thanks jbuehn

Well it is the video driver as talked about here.
https://www.machsupport.com/forum/index.php?topic=44113.10
Only problem is the pos laptop will not update even when I download the updated driver.
I will just use a different laptop that has the newer driver already.