Cancel
Showing results for 
Search instead for 
Did you mean: 

Machine time

Pioneer
Pioneer

Hello again,

I set the machine time, but it is shown at the end of the program

How to output the machine time on the top of my NC code? Probably I must use temporary file and double postprocessing my operation in order to collect data about machine time of every operation. 

Does anyone know how to do it?

 

Best regards,

Jack1

10 REPLIES

Re: Machine time

Gears Phenom Gears Phenom
Gears Phenom

Look at the post below.

You could also search for Machine time there have been several examples posted in this Forum

 

 

https://community.plm.automation.siemens.com/t5/Discussion-Forum-NX-Manufacturing/Posting-total-mach...

 

John Joyce, Manufacturing Engineer,
Senior Aerospace
Statements and opinions are mine alone and do not reflect
the opinion of my employer or any other member of the human race

Re: Machine time

Gears Phenom Gears Phenom
Gears Phenom

I dont know what about mom run postproces, but closing, creating another file, renaming doesnt work in simulation is it?

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

Re: Machine time

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

There are sufficient tcl variables defined that, as you are ONLY putzing with the machine time, you can skip the file manipulation if you are in simulation.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: Machine time

Gears Phenom Gears Phenom
Gears Phenom

hi, I have it like that but I am just asking if there is a way to do it within simulation

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

Re: Machine time

Siemens Legend Siemens Legend
Siemens Legend

You can also make use of the MOM_cycle_objects command to cycle through all the operations and gather the times you need.

NX has on each operation the following tcl variables for time:

  • mom_toolpath_time
  • mom_toolpath_cutting_time

The time given there is in decimal minutes. Subtracting the 2 will give you the rapid time in the operation.

These times are the theoretical times (length/feedrate).

When you use MOM_cycle_objects in the postprocessor at the beginning i would advise you to use the attached tcl procedures to save and restore all mom variables before and after the MOM_cycle_objects command.

 

Regards,

Gerrit Koelewijn

Re: Machine time

Gears Phenom Gears Phenom
Gears Phenom

hi @GerritKoelewijn

can you please show how to properly use MOM_cycle_objects on some simple example

(to store something and output it)

 

thank you

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

Re: Machine time

Siemens Legend Siemens Legend
Siemens Legend

@Juraj

 

Here some sample code that lists the operation name and times in simple output at the header of a program.

Add the code to a custom command in the "Start of Program":

uplevel #0 {

  proc MOM_OPER_BODY {} \
  {
    global mom_toolpath_time mom_toolpath_cutting_time
    global saved_toolpath_time saved_toolpath_cutting_time
    global mom_operation_name
    if ![info exists saved_toolpath_time] \
    {
       set saved_toolpath_time 0
       set saved_toolpath_cutting_time 0
    }
    MOM_output_literal [format "Operation %+40s takes %.2f minutes." $mom_operation_name $mom_toolpath_time]
    set saved_toolpath_time [expr $saved_toolpath_time + $mom_toolpath_time]
    set saved_toolpath_cutting_time [expr $saved_toolpath_cutting_time + $mom_toolpath_cutting_time]
  }

  proc PB_CMD_StoreMomVars {} \
  {
    global BNL_mom_list
    set BNL_mom_list [lsort [info globals "mom_*"]]

    foreach var $BNL_mom_list \
    {
      global $var BNL_STORED_$var
      if {[array exist $var]} \
      {
        array set BNL_STORED_$var [array get $var]
      } \
      else \
      {
        set BNL_STORED_$var [set $var]
      }
    }
  }

  proc PB_CMD_RestoreMomVars {} \
  {
    global BNL_mom_list

    if {![info exists BNL_mom_list]} return

    foreach var $BNL_mom_list \
    {
      global $var BNL_STORED_$var
      if {[array exist BNL_STORED_$var]} \
      {
        array set $var [array get BNL_STORED_$var]
        array unset BNL_STORED_$var
      } \
      else \
      {
        set $var [set BNL_STORED_$var]
        unset BNL_STORED_$var
      }
    }
    unset BNL_mom_list
  }
}

PB_CMD_StoreMomVars
MOM_cycle_objects {SETUP{PROGRAMVIEW{MEMBERS}}}
PB_CMD_RestoreMomVars
global saved_toolpath_time saved_toolpath_cutting_time
MOM_output_literal [format "Total program takes %.2f minutes." $saved_toolpath_time]

Be aware that it needs a bit more refining when you want it to list only the operations that are posted.

Check also in the Review tool wich events are generated so you understand what is going on.

Here you can also see when it enters and exits a Program Group. You can use that to mechanism to filter only the operations that are part of your selected program ("mom_group_name" in the first MOM_start_of_group event).

There is also some documentation on the topic.

 

I hope this helps a bit.

Regards,

Gerrit Koelewijn

Re: Machine time

Gears Phenom Gears Phenom
Gears Phenom

Thank you for explanation and initial info

 

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

Re: Machine time

Pioneer
Pioneer

thank you all, I will try to use your tips!

Learn online





Solution Information