Hello Guest it is April 23, 2024, 01:32: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 - Cbyrdtopper

21
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.

22
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

23
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.

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

25
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

26
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!

27
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

28
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.


29
Mach4 General Discussion / Re: MACH4 LATHE
« on: May 08, 2023, 02:26:12 PM »
I don't mind NFS getting rid of the diagnostics tab since it is full of fluff... however, I used the REF separate axis buttons all the time when setting up a new machine, so now it's a pain to have to put these in there manually each time.

30
Mach4 General Discussion / Re: Spindle and coolant stop on M01
« on: April 14, 2023, 11:57:19 AM »
You will have to ensure that you turn your spindle and coolant back on after the M101 is called. 
But this should get you going.

function m101()
local inst = mc.mcGetInstance()
local m01 = mc.mcSignalGetHandle(inst, mc.OSIG_OPT_STOP)
local m01State = mc.mcSignalGetState(m01)
local CoolantOutput = mc.mcSignalGetHandle(inst, mc.OSIG_COOLANTON)
if m01State == 1 then
    mc.mcSignalSetState(CoolantOutput, 0)
    mc.mcSpindleSetDirection(inst, 0);
    mc.mcCntlFeedHold(inst)
end--m101State
end

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