Cancel
Showing results for 
Search instead for 
Did you mean: 

machining time

Creator
Creator

Hello

 

i'm having trouble with mom_machine_time   command, it shows 0 time for both hours and minutes for any operation i post process

 

this is my code 

 

 

#display the estimated machining time

global mom_machine_time

set hours [format %2.0f [expr $mom_machine_time / 60]]
set minutes [format %2.0f [expr $mom_machine_time - 60 * $hours]]

MOM_output_literal "Estimated Machining Time: Hours:$hours Minutes:$minutes"

 

 

though it works if i replace mom_machine_time with mom_tool_path machining_time, any idea what i might be missing?

8 REPLIES

Re: machining time

Gears Phenom Gears Phenom
Gears Phenom

where do you have this code/cmd in use?

also "global minutes hours " is missing

---------------------------------------------
#♫ PB, 5ax, itnc, nx, vericut ♫ #

Re: machining time

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hi @Helmi

 

I have uploaded the postprocessor, that inside the post there is a time calcilation, Hour:MinuteSmiley Frustratedecond.

 

Please have a try for that:

 

https://community.plm.automation.siemens.com/siemensplm/attachments/siemensplm/open_forum/18807/1/ex...

 

Hope this will help you.

 

Maryadi

PT.MMT-Jakarta-Indonesia

 

Re: machining time

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hi @Helmi,

 

Create proc(custome command),In the end_of_path(PB) or start_of_operation, just insert this proc.

 

#=============================================================
proc PB_CMD_TIME_est { } {
#=============================================================
global mom_toolpath_time pathtime
global hour min sec
global hours minutes second


    if {$mom_toolpath_time >= "1" } {
       set hour [expr int(($mom_toolpath_time)/60)]
       set min [expr int($mom_toolpath_time-($hour*60))]
       set tot_min [expr int($mom_toolpath_time)]
       set sec [expr int(($mom_toolpath_time - $tot_min)*60)]


       set hours [format "%02d" $hour]
       set minutes [format "%02d" $min]
       set second [format "%02d" $sec]
       set pathtime "Time:$hours:$minutes:$second"
   } elseif {$mom_toolpath_time < "1"} {
       set second [format "%.0f" [expr $mom_toolpath_time*60 ]]
       set pathtime "Time:00:00:$second"
   }
	MOM_output_literal "($pathtime)"
}

 

Maryadi

PT.MMT-Jakarta -Indonesia

Re: machining time

Siemens Legend Siemens Legend
Siemens Legend

This is what I use to output time at end of program

 

Add this to Auto Tool Change

ScreenHunter_02 Jun. 27 07.36.gif

 

AddThis to End of Program

ScreenHunter_01 Jun. 27 07.36.gif

Re: machining time

Creator
Creator

Hello Maryadi

 

i created a procedure and pasted your TCL program, but when i post processed a part it doesn't output any time at all, just the usual G code

 

please keep in mind that i'm using Post Builder 9.0 

 

Regards

Re: machining time

Legend
Legend

It is not enough to copy and past the proc, it is also necessary to call it...

e.g below :

proc myproc {} {
MOM_output_literal "myproc..."
}
# call proc to print info
myproc
# return
myproc...
Production: NX11.0.2.7,VERICUT 8.1.2
Development: Tcl/Tk, Gnuplot
www.adgroupe.com

Re: machining time

Creator
Creator

Hello 

 

i already created a Custom Command at the start of operation and it works fine and here it is

 

#display the machining time of the current operation

global mom_toolpath_time

set hours [format %2.0f [expr $mom_toolpath_time / 60]]

set minutes [format %0.2s [expr $mom_toolpath_time - 60 * $hours]]

set s [expr $mom_toolpath_time - $minutes]

set seconds [format %2.0f [expr $s * 60]]

if { $hours > 0 } {

MOM_output_literal "temps estimé de l'opération: $hours heure(s), $minutes minute(s), $seconds seconde(s)"
} elseif {$minutes > 0 } {
MOM_output_literal "temps estimé de l'opération: $minutes minute(s), $seconds seconde(s)"
} else { MOM_output_literal "temps estimé de l'opération: $seconds seconde(s)" }

 

i want to know if i can sum the time of all the operations and display them at the end or start of program, if yes please then show me how

Re: machining time

Legend
Legend
@Helmi wrote:

 

i created a procedure and pasted your TCL program, but when i post processed a part it doesn't output any time at all, just the usual G code


It's not normal because Maryadi1 output at the end of proc "MOM_output_literal ($....)" If it does not work you should see anyway "N..... ()" or an error if the variable does not exist.

 


@Helmi wrote:

 

 i want to know if i can sum the time of all the operations and display them at the end or start of program, if yes please then show me how


For end of program : Michael_Mannino 's solution

Production: NX11.0.2.7,VERICUT 8.1.2
Development: Tcl/Tk, Gnuplot
www.adgroupe.com

Learn online





Solution Information