Hello Guest it is May 22, 2024, 11:12:46 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 - Cbyrdtopper

21
Mach4 General Discussion / Re: 4th of July
« on: June 30, 2023, 10:19:42 AM »
Thanks Bill!  You as well!

22
Mach4 General Discussion / Re: Tool back into the tool magazine?
« on: June 05, 2023, 08:26:26 AM »
I made a tool change program that would put the tool up when you call and T0M6.  So Mach4 will read Tool 0.  Just put a conditional if selectedtool == 0 then...
But you should also be sure that you pick up the next tool correctly.  You don't want your carousel to move forward into the spindle expecting to grab a tool to put away... you need to have your spindle move up first (assuming it is an umbrella type tool changer).  if currentool == o then.....
As far as calling your T0M6 from a macro, I'm not sure you can do that.  You can try it; put an mc.mccntlmdiexecute("inst", CODE).
But I would probably just put the T0M6 on the block above the M30.

23
Mach4 General Discussion / Re: Customized spindle warm-up?
« on: May 23, 2023, 09:25:10 AM »
I just load the G Code File and run it from there.
But you can make a custom button if you want to do that as well.
Save your Spindle warm up program as O9001 (as an example).  Save it in the "Subroutines" folder in the Mach4 Directory
Make a button on your screen and in the button's Clicked Script put following code in:

local inst = mc.mcGetInstance()
mc.mcCntlMdiExecute(inst, "M98 P9001")

The only thing you need to do different in your spindle warm up program is to have an M99 at the end instead of an M30 so it will return to the button press and stop from there.  Weird I know, but that is how it works for me when I run sub programs from a button press.



Or just save it and run it is as a G Code file.

24
Mach4 General Discussion / Re: Customized spindle warm-up?
« on: May 23, 2023, 09:15:29 AM »
Just write a G Code program and save it as your spindle warm up.  That is how I have all of our spindle warm up programs here in the shop.
Figure out a time that your spindle warms up to that 85 deg mark and let it be that. 
Use your own Spindle RPM in place of S
G04 P###  Adding a "." will make it read seconds instead of milliseconds (from my experience).   G04 P1.0 = 1 Second

(Spindle Warm Up)
S1000
G04 P180.0 (Dwell for 3 Minutes)
M5
G04 P60.0 (Dwell for 1 Minute)
S1500
M3
G04 P180.0
M5
G04 P60.0
S2000
M3
G04 P180.0
M5
G04 P60.0
ETC......
ETC....
M30

25
Mach4 General Discussion / Re: mcSignalWait
« on: May 23, 2023, 08:38:36 AM »
I would revert to the version that was working then and let NFS know there is an issue with the version you are having issues with.

26
Mach4 General Discussion / Re: mcSignalWait
« on: May 22, 2023, 04:10:29 PM »
Yeah. That looks like all it is.

27
Mach4 General Discussion / Re: mcSignalWait
« on: May 22, 2023, 02:43:36 PM »
You don't make the wait signal a variable.

I use the mcSignalWait all the time on tool change macros. 
Here is the example from the LUA Examples in the mach4 folder.


   local inst, hSig, rc
   inst = mc.mcGetInstance()
   
   hSig, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT1) -- Get handle for output 1
   if (rc~= 0) then --Check our return call
      mc.mcCntlSetLastError(inst, "There was an error")
   end
   
   rc = mc.mcSignalSetState(hSig, 1) --turn on output 1
   if (rc~= 0) then --Check our return call
      mc.mcCntlSetLastError(inst, "There was an error")
   end
   
   rc = mc.mcSignalWait(inst, mc.ISIG_INPUT21, 1, 5) --Wait 5 seconds for input 21 to become active
   if (rc~= 0) then --Check our return call
      mc.mcCntlSetLastError(inst, "There was an error")
   end

28
Mach4 General Discussion / Grinder with LR Mate 200iB
« on: May 16, 2023, 04:50:22 PM »
Pretty fun project!  We got a carbide insert grinder going and added a little Fanuc LR Mate 200iB to do the loading and unloading for us.
This is going to save a lot of time with automated loading and unloading!

29
Mach4 General Discussion / Re: Save #VARS
« on: May 16, 2023, 03:35:46 PM »
I found some examples and made a macro to do this.
This will write to a txt document that we can compare to if Mach4 crashes.
I will just run this at the end of a program to update the file.
--Update #VARS into VARS LOG File
function m101()
local inst = mc.mcGetInstance()

local Vars550 = mc.mcCntlGetPoundVar(inst, 550)
local Vars551 = mc.mcCntlGetPoundVar(inst, 551)
local Vars552 = mc.mcCntlGetPoundVar(inst, 552)
local Vars553 = mc.mcCntlGetPoundVar(inst, 553)
local Vars554 = mc.mcCntlGetPoundVar(inst, 554)


local VARSLog = string.format("#VARS 550 = ".. Vars550 .."\n")
VARSLog = VARSLog .. "#VARS 551 = " .. Vars551 .."\n"
VARSLog = VARSLog .. "#VARS 552 = " .. Vars552 .."\n"
VARSLog = VARSLog .. "#VARS 553 = " .. Vars553 .."\n"
VARSLog = VARSLog .. "#VARS 554 = " .. Vars554 .."\n"


--Write to the File Log
local MyFile = wx.wxGetCwd() .. "\\VARS Log\\VARS LOG.txt" --Mach4Hobby - VARS Log - VARS LOG.txt
file = io.open(MyFile, "w+") --Open the file in update mode, all previous data is erased
file:write (VARSLog) --Write the Gcode file
file:flush (MyFile) --Save written data
file:close (MyFile) --Close file

end--m101

if (mc.mcInEditor() == 1) then
   m101()
end

30
Mach4 General Discussion / Save #VARS
« on: May 15, 2023, 10:47:56 AM »
Is there a way to save the #VARS like you can the tool table and fixture offsets?  mcToolSaveFile  mcFixtureSaveFile
Or even if I could save them in an external document, that would be fine too.  If Mach4 crashes or you drop the computer our of the electrical cabinet...........  it doesn't save the values in my #VARS.