Hello Guest it is March 28, 2024, 09:37:22 AM

Author Topic: Time estimation until tool change  (Read 10417 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Time estimation until tool change
« Reply #10 on: May 09, 2010, 12:16:23 PM »
OK Lets start with the Code for the WorkLog,

First create a new button on the main screen OR use an existing EMPTY button. I used the AutoToolZero button as it is NOT used. This button is used to START any program that you want logged. Just load your program and if you want it logged then Push the Button to start the program. It will turn ON the  LOG function and start the log. IF there is NO worklog.txt file  IT will create the file for you.

Next add in the M6start code to the M6start macro

NOW  create an M1030 macro. It will automatically be called by the M30 in the program. You must enclude an M30 and your program end for this to work.

Once you have started the program with the LOGFILE button you do not use it again until the next program start. To restart after the tool changes you do the standard cyclestart as you normally do.

IF you do not want to log the file then just use the Cycle start button. The M1030 will sense that you did not use the LogFile button and wil NOT add any info to the file.

******************************************************

'Macro ProgramRun use for start worklog code
Open"C:/Mach3/worklog.txt" For Append As #1
Write #1,"" & Date &"....." & Filename &"," &"StartTime " & Time()
Close#1
SetVar(499,0)
DoButton(0)
End

*******************************************
'M6Start Macro

  tool = GetSelectedTool()
  SetCurrentTool( tool )


Open "C:/Mach3/Worklog.txt" For Append As #1
Write #1,"__________ToolChange "  &  "T# " & GetSelectedTool() & "," & Time()
Close #1
End
 

*******************************************

'Macro M1030 use to build the M1030 macro that the M30 calls at program end

Sub main()
If GETvar(499) <> 0 Then End
If GetVar(499) =0 Then

Open "C:/mach3/worklog.txt" For Append As #1
Write #1,"          " &Filename &"..........EndingTime" & Time()
Close #1

setVar(499,1)
End If
End Sub 
 
*******************************************
WorkLog Sample Output

"5/9/2010.....C:\Mach3\GCode\TestWorkLog.txt,StartTime 12:01:42 PM"
"__________ToolChange T# 1,12:01:43 PM"
"__________ToolChange T# 2,12:01:55 PM"
"__________ToolChange T# 3,12:02:00 PM"
"__________ToolChange T# 4,12:02:05 PM"
"          C:\Mach3\GCode\TestWorkLog.txt..........EndingTime12:02:10 PM"

Hope that helps
Re: Time estimation until tool change
« Reply #11 on: May 13, 2010, 10:48:59 AM »
Dear BR549,

thanks for your help. I can create the Worklog now (sample see below). But its running in real time, so for my programs
it would run 10h or so. How can i make the worklog creation running faster? Furthermore i need to click start after TC each
time.

"5/13/2010.....O:\Zeichnungen\BF20L_3Phasenmotor\lichtschrankenhalter.tap,StartTime 4:21:44 PM"
"__________ToolChange T# 8,4:21:45 PM"
"__________ToolChange T# 7,4:25:03 PM"
"__________ToolChange T# 14,4:26:37 PM"
"__________ToolChange T# 13,4:28:30 PM"
"__________ToolChange T# 8,4:32:51 PM"
" O:\Zeichnungen\BF20L_3Phasenmotor\lichtschrankenhalter.tap..........EndingTime4:41:53 PM"


Now i have the TC times inside the worklog file. How do i now get it used for the DRO? Shall i just add
the code from your post from May 7 and create a OemDRO 1000? In this case i need to manually input
the #401, #402... variables each time as far as i understand. Is it possible to read it out from the worklog or
in some other way that i dont need to input the times manually?

Wolfgang

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Time estimation until tool change
« Reply #12 on: May 31, 2010, 02:04:12 PM »
Sorry Wolfgang I missed your reply, Did you get it working??

Re: Time estimation until tool change
« Reply #13 on: May 31, 2010, 02:40:09 PM »
Hi BR549,
somehow. Its working to create the worklog file. But it runs 10h in case of a 10h program.
Thats not what i really want.

Besides that i tried to directly write the times until next tool change
into the #40x variables. It works to write the TC times into the variables but when i click "CycleStart" to
really run the program the variables are all reset ...
Does Mach always reset all variables when i use "CycleStart"??

Wolfgang

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Time estimation until tool change
« Reply #14 on: May 31, 2010, 02:45:15 PM »
DID you mean 10hours in the case of 10 minute program??   OR do you mean you would like to run the program quickly to "GET" the TC times without having to wait the ten hours(;-)

NO mach does not reset vars automatically UNLESS you close down mach then only Vars#500-600 are persistant and are saved by mach.

 We can start from there IF you wish to continue. YOUR choice(;-)
« Last Edit: May 31, 2010, 02:48:53 PM by BR549 »
Re: Time estimation until tool change
« Reply #15 on: May 31, 2010, 02:56:03 PM »
I would like to get the TC times "quickly" without waiting 10h in case of a 10h program.

Ok. Maybe my programming error. Need to try again and check if i can find out why the variables where
gone after new CycleStart. I didnt close down Mach so it should work.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Time estimation until tool change
« Reply #16 on: May 31, 2010, 03:05:36 PM »
OK I see what you mean by reset the VARs. In the M1030 routine, WHICH is automatically called by the M30,  it does reset the Vars back to zero. AS it thinks you are finished with the Program (M30 program end)

OR that can be changed to NOT reset the VARS(;-) at program end.

This process is assuming that your Vars were originally loaded from the Gcode file. IF you hand load the Vars from the MDI then you must do it each time you run the program.

UNfortunately it cannot PRE RUN the program Quickly AS mach does not have a function call to access any times from the preveiw routine like some other system have.

This routine ASSUMES that you have run it before and already have the times available.  Perhaps you can ask Brian to consider this function in the new MachV4.

Sorry for the confusion, (;-)
« Last Edit: May 31, 2010, 03:08:59 PM by BR549 »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Time estimation until tool change
« Reply #17 on: May 31, 2010, 03:17:12 PM »
Saying that, SOME cams can output those TC times as VARs in the original POST so they would be available.

We are working with LES over at SheetCam to do just that. SO in that case"Sheetcam" users would have that info available first hand and at first run of the program.

Re: Time estimation until tool change
« Reply #18 on: May 31, 2010, 03:26:30 PM »
I use Pro Engineer as CAM. Need to check if i can get my post processor to tell me this times
and put it into the G code file...could be.

I think a countdown until next TC would be a good idea for the MachV4!

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Time estimation until tool change
« Reply #19 on: May 31, 2010, 04:03:10 PM »
I agree, YOU have a GREAT idea (;-)  Might want to drop your idea in the new features section.

(;-)