Hello Guest it is March 28, 2024, 06:18:05 AM

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

0 Members and 1 Guest are viewing this topic.

Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #10 on: April 04, 2013, 12:25:08 AM »
If I put this in the reset button:
SetUserDro(2003,Date)
it will output a setting to my date DRO but the format is weird.  Using the default %+.4f format it shows 41368.00 and today is April 04 2013.  If I change my computer date back one day it will display one digit lower as 41367.00.  So it seems to work, I just have to figure out the format.

I'm reading this page 76-80 but it's not really helping haha:
http://www.machsupport.com/docs/VBScript_Commands.pdf

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #11 on: April 04, 2013, 12:57:30 AM »
Instead of a dro use a UserLabel()

Set uP a userlabel on the screen say UserLabel(15)

Then code to add date,time

SetUserLabel(15,"" &Date &Time)

(;-) TP

Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #12 on: April 04, 2013, 01:36:45 AM »
Can't get it to work.  In my Reset Hours button I have this:

SetUserDro(2000,0)
SetUserLabel(15,"" &Date &Time)

What do I call my Label, 15?  Doesn't work.  I tried calling it (15), UserLabel15, UserLabel(15), no dice.  I can't get any action to it.  Thoughts?
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #13 on: April 04, 2013, 10:54:39 AM »
Hi guys,
Quote
is there a way to turn it off with M5?
No. ( I think  ;D )

but you can add this to your sequence

If GetOemLED(11)=-1 then

bla bla bla ( your timer addition )

end if

Alex

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #14 on: April 04, 2013, 11:02:25 AM »
The label would be called UserLabel15 if you used the number 15 . It can be any number as long as the label# and call # are the same.

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #15 on: April 04, 2013, 12:22:17 PM »
OK just tested some more and that was a bad plan, Mach3 does not SAVE userlabels to the XML on shutdown.

So plan B you would write the date to a file to hold and call it to screen in the intiation string so it views in the label when you start MACH3.

Just a bit more programming, (;-) TP




Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #16 on: April 04, 2013, 01:34:16 PM »
OK plan C (;-) Extract the Month, day, Year from the DATE as mm,dd,yy  then create a Interger as a string.
Then write the interger to a DRO(which IS saved)




It would look like this as an integer

040413    where mmddyy is the format

Yep I would do it that way so no file writing involved.

Just a thought, (;-) TP

Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #17 on: April 04, 2013, 02:18:38 PM »
CNCAlex, this worked great!
If GetOemLED(11)=-1 then
   SetUSerDro(2000, (GetUserDro(2000) + ((GetTimer(10) /60) /60)))
End If
Now multiple M5's don't keep adding to the timer.  Which brought me to another thought, how can I "watch" the spindle LED GetOEMLED(11) so that when that turns off, it executes the same code as above?  That way an e-stop, esc key, Program Reset, etc will all turn off the timer so it doesn't keep running for hours or days because I never executed M5.

BR549, truly appreciate all the help.  I got the date to work as a label but just like you said Mach forgets about it upon restart.  What about this, instead of displaying the date, every time you hit the Reset Hours button it adds a note to a text document somewhere.  The line would say 42.2342 Hours on 04-04-13, and every time you clicked the reset button it adds another line.  This would be an easy way to log it without having to remember it all.  And it'll save us from accidentally resetting the timer halfway through the month without writing it down, cuz the file will have it all tracked.  So once a month, or just whenever you think about it, you can click the reset button and log the time since the last time you reset it.

Thoughts?  Hope I'm not asking too much here ;-)

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #18 on: April 04, 2013, 02:44:32 PM »
OK just to clear something up the timer is NOT really a run timer as per say. It just sets a flag and then compares 2-1=secs.  when Mach shuts down the function stops.

AND this will NOT work unless you are running the LPT version driver(;-) so if you are using a SS it will not work.

Just thinking ,I think this would work from the macropump and be an automatic Function done this way. It uses bypass functions so it does not ping the leds all the time. IF the function needs to change only then will it ping the LEDs.
At least I think , I have not tested it in real life for this function. Look like that is YOUR job now (;-)

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

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

« Last Edit: April 04, 2013, 02:49:14 PM by BR549 »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Maintenance - box "Spindle On Time" is alway 0
« Reply #19 on: April 04, 2013, 05:47:17 PM »
OK for the DRO to store the date. It comes out as "040413" (no quotes), Make your dro with 6 leading values and NO trailing.

MyDate =  format(Date ,"mmddyy")
SetOemDro(2000,Mydate)


NOW you can track date and hrs on screen and it will stay persistant. SO NOW you want to write it to a file?