×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

post builder help

post builder help

post builder help

(OP)
In NX4, i am editing a 5 axis post processor, i have a command which calculates the time to run the program, which states ....
MOM_output_literal "(Time: [format "%.2f" $mom_machine_time] Minutes)"

Firstly, how can i get it to display in Hours, minutes,and seconds.
And secondly, how can i create a command to display The Date it was created ??

Help appreciated

RE: post builder help

Greetings-
I've been meaning to do the alteration on machine time also, just haven't yet and I've made a good time/date that is easily altered if you don't like the format. Right now it would put out (10-18-2008 12:33PM). I'll try to get the machine time done Sunday or Monday evening and get them both posted and you'll see how simple these two really are to do.

Todd Asher

RE: post builder help

Greetings-
Here is the date tcl. I'll get more time later for the time tcl.

# Output date and time the way I prefer.
# Asher 03-14-2007

    global mom_date
    

    set month [string range $mom_date 4 6]
    if {$month == "Jan"} {
    set month 01}
    if {$month == "Feb"} {
    set month 02}
    if {$month == "Mar"} {
    set month 03}
    if {$month == "Apr"} {
    set month 04}
    if {$month == "May"} {
    set month 05}
    if {$month == "Jun"} {
    set month 06}
    if {$month == "Jul"} {
    set month 07}
    if {$month == "Aug"} {
    set month 08}
    if {$month == "Sep"} {
    set month 09}
    if {$month == "Oct"} {
    set month 10}
    if {$month == "Nov"} {
    set month 11}
    if {$month == "Dec"} {
    set month 12}


    set day [string range $mom_date 8 9]
    set year [string range $mom_date 20 23]
    set time_h [string range $mom_date 11 12]
    set time_m [string range $mom_date 13 15]
    if {$time_h >= 12} {
    set ap PM
    } else {
    set ap AM}
    if {$time_h >= 13} {
    set time_h [expr $time_h-12]}
    if {$time_h < 10 && [string length $time_h] == 2} {
    set time_h [string range $time_h 1 1]
    } else {
    set time_h [string range $time_h 0 1]
    }
    

    MOM_set_seq_off
    MOM_output_literal "($month-$day-$year $time_h$time_m$ap)"
    MOM_set_seq_on
}

Todd Asher

RE: post builder help

(OP)
Thanks Todd for your help, but i'm new to modifying these files, and i can't get it to work, i've created a custom command, and pasted all of that in, but i can't get it to work, do you think it would be possible to attach a post-proc so i can just copy that command ?

RE: post builder help

Here is the time tlc:

# machine time is output in minutes, this converts
# time to hrs min sec
# Asher 10-20-2008

    global mom_machine_time
    global t_hours
    global t_min
    global t_sec

    set tt_hours [expr {($mom_machine_time) / 60}]
    if {$tt_hours > 0.0} {
    set t_hours [expr {int($tt_hours)}]
    } else {
    set t_hours 0}
    set tt_min [expr {$tt_hours - $t_hours}]
    set tt_min [expr {60 * ($tt_min)}]
    set t_min [expr {int($tt_min)}]
    set tt_sec [expr {$tt_min - $t_min}]
    set t_sec [expr {60 * ($tt_sec)}]
    set t_sec [format "%1.2s" $t_sec]

    MOM_set_seq_off
    MOM_output_literal "(MACHINE TIME = $t_hours\hrs $t_min\min $t_sec\sec)"
    MOM_set_seq_on
}

And if everything goes well I've uploaded and you can import the custom commands.

Todd Asher

RE: post builder help

(OP)
thanks i got them working fine

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources