Hello Guest it is October 18, 2019, 06:12:29 AM

Author Topic: Maintenance - box "Spindle On Time" is alway 0  (Read 7157 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #20 on: April 04, 2013, 06:19:55 PM »
OK here is how to write the log file. This assumes that you converted the start date to an integer and store it in UserDro(2001) and the Spindle run time hrs is stored in Userdro(2000). Each time it write the the file it ADDS it to the end of the file.

It writes the LOG date(current date) the start date of the total and the total hours.

Open"C:/Mach3/Spindle_HRS_LOG.txt" For Append As #1
Print #1,"LogDate: " & Date &" StartDate: " & Format(GetUserDro(2001),"000000")  &" " &"Total Spindle Hours: " & GetUserDro(2000)
Close#1
End

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #21 on: April 04, 2013, 08:53:07 PM »
OK you have gone this far might as well add TOOL cut time or inches to your list for tool wear tracking. there are 2 slots in teh tool table that are not being use by Mach3 you could store the tools cut time and Cut inches to the table (;-) then add a bit of code in the tool change macrop to WARN you when a tool is reaching a replacement point based on time or inches cut.

See where this leads (;-) Long night late into the wee hrs of the morning and just as the sun breaks  you realize it is still NOT done. There is MORE to add. LOL

(;-) TP

Offline Vogavt

*
  •  258 258
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #22 on: April 05, 2013, 09:48:45 AM »
So can you put this all together in on listing of code AND give more details on how to implement it, i.e., create a button, create a file (macro), etc, etc.

Thanks!

I was just about to purchase a resettable clock off eBay and another clock to keep the total time.
Just for eye candy really, since it appears that Mach3 will keep the info.

I want some way for it to tell me that it's time to check brushes, perform gib tightening checks, oil, change coolant, etc. based upon user defined presets for my machine.  Would be nice if the macro could popup a dialog or even a macro that could tally the run time and give a countdown of sorts to look at.
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #23 on: April 06, 2013, 11:03:41 PM »
Quick update, more later.  I've been using the spindle timer on my Tormach (this is before BR's new updates on Apr 04).  It seems to work fine on my home computer when typing M3/M5, but on the Tormach it's not adding properly.  I've put at least 10 hours of spindle time on in in the past few days and it's only reading 0.8xx hours.  Sometimes it adds time, sometimes it doesn't.  Sorry I can't give any better debug details than that.  My codes do have definite M3 and M5 calls. 

BR I'm looking forward to your new code and date extraction, I'll try it out in the next few days. 

Offline BR549

*
  •  6,902 6,902
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #24 on: April 07, 2013, 10:17:02 AM »
John try the Tormach this way. Mach may need time on the Tormach to do the updates.

If GetOemLed(11) AND Not GetUserLed(1000) then
       SetTimer(10)
While Ismoving()
Wend
      SetUserLed(1000,1)
While Ismoving()
Wend
End If

If NOT GetOemLed(11) AND GetUserLed(1000) then
       SetUSerDro(2000, (GetUserDro(2000) + ((GetTimer(10) /60) /60)))
While Ismoving()
Wend
        SetUserLed(1000,0)
While Ismoving()
Wend
End IF