|
本帖最后由 Deaton 于 2011-6-22 00:59 编辑
7 Y9 f3 _4 A+ i+ ?( g
0 [& l* X5 ^% V非常详细实用,谢谢!
$ c$ |+ w% I0 t) O0 m/ U3 _) g1 n( X# O/ t1 e8 a+ N
附一个 Sodick 的后处理,已实现上下异形,子程序调用,供各位同学参考。 a( V7 s- ]' i
/ {' d/ S0 n0 z2 w: A* Z
########################## TCL Event Handlers ##########################
/ E; A' T6 W4 k) P, X. P9 b' `* m#
% c0 f+ O- Q1 D: {, w0 p6 u# c0 t- K# Created by Supervisor @ Mon Oct 09 15:07:32 2005 中国标准时间
1 F$ ?6 @: j! K+ ]& H# with Post Builder version 3.4.1.' Z9 p# c; Q% [- e4 V0 @: }+ F
#
) q' M6 U: [. G# l Q, |* }5 y########################################################################
- X X/ n. [/ W6 }6 m" r' a- O
' z! j) X* i4 h9 k6 ` set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR]
5 g, U* Z }% u w+ Z8 b, O6 _" _ f2 E3 o4 `, |) t
C7 b$ j8 o9 s! T: | if { ![info exists mom_sys_post_initialized] } {
/ R- |5 F0 s! q# [
2 ]6 i) f4 r6 ~3 Q source ${cam_post_dir}ugpost_base.tcl
8 b1 O! J! Q) c7 q z0 x: q. p. G; i2 x4 q
proc MOM_before_each_add_var {} {}% S% F+ {; N: G4 q6 J' F* Z+ Z( ^
proc MOM_before_each_event {} {}
" Q+ b) F. A4 ^& i8 n6 @ i+ h
& W0 s; w5 G. \2 K* T# set cam_debug_dir [MOM_ask_env_var UGII_CAM_DEBUG_DIR]
5 j# Z2 w) u2 l; l; d; D# source ${cam_debug_dir}mom_review.tcl
8 s; _5 {4 b" Q! I0 b H6 l( H. e$ [: p' A8 g
MOM_set_debug_mode OFF& i+ ^: a1 J3 x. C9 P
( b+ w4 P7 D# U$ H1 g+ I& l) D/ n5 ^
#### Listing File variables 2 z4 `5 k2 c& o7 g9 W- G2 j+ R$ o
set mom_sys_list_output "OFF"
& m! x( b; U. ^) ]; }2 a9 _5 I9 R set mom_sys_header_output "OFF"9 q) {7 h- r) [+ W: u9 K
set mom_sys_list_file_rows "40"
* H' v9 o$ T, q. w0 F) Y: V set mom_sys_list_file_columns "30"
% ~4 h5 D7 ~1 Q0 u set mom_sys_warning_output "OFF"
/ S9 q& G9 O8 Q, g* u$ Z% O set mom_sys_group_output "OFF"
( h- _9 j" H, {3 O set mom_sys_list_file_suffix "lpt"
4 v" F6 s0 `& c* f! l set mom_sys_output_file_suffix "NC"
0 N' o3 y& ~' b6 v$ [; z4 E set mom_sys_commentary_output "ON"
2 v! u; z6 U% v% m2 b7 N8 M* Q# E set mom_sys_commentary_list "x y z 4axis 5axis feed speed"
/ \5 W$ j) q. P2 ~1 S* a# @/ [ T+ m6 `2 i4 B" w
set mom_sys_control_out "(" : k) |0 U# R9 L( C
set mom_sys_control_in ")"
; Y( ^7 _% o& ~$ [/ V$ ]. X( F/ b/ N3 V: K
set mom_sys_post_initialized 10 v/ Q: v2 Z- [# Q8 B f) ?
} y5 b7 n6 P0 g5 _8 {6 f4 h
! d3 x7 N( M# Z+ D2 E+ z& N/ d
# Y4 o; v9 T) Q! r) S
########## SYSTEM VARIABLE DECLARATIONS ##############
7 p0 ~( y! O B5 ^5 l8 a set mom_sys_rapid_code "0"
; f5 B8 n: ]7 i; L. @ B set mom_sys_linear_code "1" 0 K( j5 `" X. L8 t9 e
set mom_sys_circle_code(CLW) "2" ( E) D2 J0 x" Q9 g1 r
set mom_sys_circle_code(CCLW) "3"
) H* V& w; g8 _* u set mom_sys_delay_code(SECONDS) "4"
; K7 x4 B! B3 V' W5 g% y% L set mom_sys_cutcom_code(OFF) "40"
7 w) c$ n1 C- |8 e) }( ] set mom_sys_cutcom_code(LEFT) "41"
6 m' G$ E7 H1 c) ^* t$ E/ f set mom_sys_cutcom_code(RIGHT) "42"
, k( ~: A! Q" P* F" Y1 v set mom_sys_unit_code(IN) "70"
3 o% p w% y! O( b( v+ z set mom_sys_unit_code(MM) "71"
5 g$ b4 W4 a& d6 f7 X set mom_sys_output_code(ABSOLUTE) "90" 8 J% @. a# g P' @! h* U
set mom_sys_output_code(INCREMENTAL) "91"
3 I9 D+ J2 o* {, d& z set mom_sys_reset_code "92" 8 ^) `8 [# D: e/ o- q4 n" m, H
set mom_sys_program_stop_code "0" 5 b, E( }1 n5 p8 S/ `
set mom_sys_optional_stop_code "1"
) K) |; C& g8 n" X set mom_sys_end_of_program_code "2" + G8 x( l$ ~( H
set mom_sys_rewind_code "30"
5 J9 n. }+ @: x+ j1 A set mom_sys_thread_wire "20"
. K$ r3 l' E; p- W+ H% _ set mom_sys_cut_wire "21" + {9 \, b- }2 L8 V7 G& R6 [* f7 Y- G
set mom_sys_flushing_on "80" ' f% V5 V! ]& G: y9 @1 p# S
set mom_sys_flushing_off "81"
# L( Q5 J9 L) S/ P6 Q7 G3 x N set mom_sys_power_on "84"
7 d: p9 @/ R8 ]6 _ x set mom_sys_power_off "85"
6 Z4 x& [6 m6 F2 y* x# c; L set mom_sys_wire_on "82"
( `) Q0 _, m8 U5 ^+ D set mom_sys_wire_off "83" 0 [7 [/ R% k$ C& M0 J9 o' F
set mom_sys_cir_vector "Vector - Arc Start to Center"
7 \4 J8 m5 h$ k; T+ s* N/ L set mom_sys_rewind_stop_code "\#"
& f0 n t, I6 ?! X0 X set mom_sys_home_pos(0) "0"
1 E) S! C0 _9 I, B. ~- k1 Y set mom_sys_home_pos(1) "0" ' g; ?9 p" e- q# F
set mom_sys_home_pos(2) "0"
, r E$ y) C" Z- [: m1 {- u" X set mom_sys_zero "0" / m1 t& w# K; h" [
set mom_sys_opskip_block_leader "/"
5 z k* ?- O: T0 V3 C8 `/ g set mom_sys_seqnum_start "10"
: Q# H0 ^1 X/ r2 _ R/ y/ j0 P. S set mom_sys_seqnum_incr "10"
+ Q1 J& G2 q, X0 A0 B' { set mom_sys_seqnum_freq "1" 2 c/ r1 J9 R7 a8 d- h
set mom_sys_seqnum_max "9999"
' d! H: W, ]+ Q/ _0 } set mom_sys_leader(N) "N" 7 n1 _& K0 \+ F
set mom_sys_leader(X) "X"
% r* \8 |% ~: m+ F set mom_sys_leader(Y) "Y"
0 `& P5 z5 h& Y+ Q$ [1 k9 z% Y set mom_sys_leader(Z) "Z" 1 R, K2 k' y$ I9 p. K `& o% G
set mom_sys_leader(U) "U" # g9 ~2 s& ^, U, e* J+ D4 [. B
set mom_sys_leader(V) "V"
7 h0 \8 D6 N9 f& z S set mom_sys_contour_feed_mode(LINEAR) "MMPM"/ @ x0 _! D1 {! C7 k; G
set mom_sys_rapid_feed_mode(LINEAR) "MMPM"0 O! z4 ]" S7 f2 E
set mom_sys_cycle_feed_mode "MMPM"
. x' F0 e! O0 H6 s1 z% [ set mom_sys_feed_param(IPM,format) "Feed_IPM"' G6 V8 Q! Q4 x2 c% [" X+ R1 p( O
set mom_sys_feed_param(MMPM,format) "Feed_MMPM"
4 X' w* Y' c/ v. }; d# O2 s- e set mom_sys_feed_param(MMPR,format) "Feed_MMPR": Z* L9 L. a0 v. r% @2 W. }
set mom_sys_post_description "Unigraphics NX 4.0 WireCut Poster for Sodick.\n\9 d: t, R- V/ r9 S2 t( O
Version: 2.0\n\, @1 C; o; J6 ` x1 o ]* d
Date: 2006/03/15\n\
8 @ p1 {" x3 Y1 ]% w By Deaton, Cheewah Toys Ltd., Co.\n\9 \( C& { G3 B
Email:deaton@21cn.com\n\/ G9 x' f5 M* m9 e
Tel:0756-8277824, 13802674804\n\
. O& D( ^# ]1 o/ n* U Rule and Conic are both supported."
' {" p+ l ?: i$ o( Y set mom_sys_ugpadvkins_used "0"2 B \( A9 ^0 w& o- |
. Q% s( k" s8 y6 Y
####### KINEMATIC VARIABLE DECLARATIONS ##############
* t' `" |0 N" @, E; Y9 a6 ?+ l" u set mom_kin_arc_output_mode "FULL_CIRCLE"
# A; C5 R2 |' K+ x7 l set mom_kin_arc_valid_plane "XY" ) G4 r0 t( w2 k T
set mom_kin_clamp_time "2.0"
0 L0 j8 H( A" J5 B set mom_kin_flush_time "2.0"
% C/ d7 V/ c% ]2 Z set mom_kin_linearization_flag "1"
9 X* i4 O! k. J) q. {; ^ set mom_kin_linearization_tol "0.001"8 m( I! ?, g: M4 b7 Y* s! M! ?
set mom_kin_machine_resolution ".001"( c/ U/ @2 o" q0 c' h
set mom_kin_machine_type "4_axis_wedm"
w& M* p5 c4 C6 L; @4 L9 F set mom_kin_max_arc_radius "99999.999"
+ A6 \& ]7 \+ i* T! J set mom_kin_max_fpm "10000"
3 H* @/ ~; [& U* n5 r( p set mom_kin_min_arc_length "0.001"
7 o* J6 o" U; M1 O0 G. ^5 z+ f- X set mom_kin_min_arc_radius "0.001"7 o0 p; ?4 h; T4 N$ c! Q9 }; v2 O j
set mom_kin_min_fpm "0.01") X5 |& f. Q- W% c
set mom_kin_output_unit "MM"
5 r6 s' A7 p, u. J! i1 g8 `( r1 Z set mom_kin_post_data_unit "MM" + C- U2 \6 o' v/ K5 w
set mom_kin_rapid_feed_rate "15000"
: \- |( t. ^ R& A2 C3 U z7 c. O) i5 G set mom_kin_tool_change_time "12.0"/ h" h3 h. r6 B- g
set mom_kin_wire_tilt_output_type "COORDINATES"5 k& o) D d. z3 a$ M
set mom_kin_x_axis_limit "1000"9 O6 I* R, _0 C+ A+ H. }( X2 U
set mom_kin_y_axis_limit "1000"
* k x+ f) f6 c* ] set mom_kin_z_axis_limit "1000"
0 `6 `8 d, P2 r9 m8 U$ L+ z$ z( |* S' R" H$ S2 @7 n" t) I
; t+ r. ?( f& x7 t2 R. o! U ^1 j
, f# h) {3 J& `! e) U; }
4 }- L6 x% a0 [$ ], ?0 R5 {if [llength [info commands MOM_SYS_do_template] ] {
! j# p6 @! h3 \' S- z0 C if [llength [info commands MOM_do_template] ] {2 P2 v, S& u, A( X) _2 k
rename MOM_do_template ""5 T8 G9 {9 a1 C$ o
}
O6 X) ]% Z& h0 V' ? rename MOM_SYS_do_template MOM_do_template8 o' B r: M3 K% n6 y" X
}
! U! r7 r' H1 ^5 T3 |7 L+ }" E7 o: P x" ~9 S! q/ y7 B
: e6 r, s6 f* C! b
4 E% J, p n! [, R3 N. j1 _
2 l" }0 x3 d" i% g#=============================================================
. a+ j% C9 N- r6 J! H Bproc MOM_start_of_program { } {6 r' G& U9 @3 t% z
#=============================================================" P/ g, p3 l% w5 W
global mom_logname mom_date is_from
( \ w* p% R- K, U: D. N global mom_coolant_status mom_cutcom_status
3 i' F- {5 I( D0 g1 U/ S$ A6 w" l. l global mom_clamp_status mom_cycle_status% `0 x a1 h9 Y$ k7 n
global mom_spindle_status mom_cutcom_plane pb_start_of_program_flag) o( j$ k N2 x0 B4 e! V. D
global mom_cutcom_adjust_register mom_tool_adjust_register
2 @8 s, M _) Z" L( K* f global mom_tool_length_adjust_register mom_length_comp_register
' k: h9 y+ s+ `3 V global mom_flush_register mom_wire_cutcom_adjust_register
3 C( }! f( v" ?6 B( Q5 |3 l- o( P3 W global mom_wire_cutcom_status
% ]) y" r+ W0 E. F6 k3 H3 j9 M: P' L6 H- D) Y/ q
set pb_start_of_program_flag 0
. T+ S8 k6 ~/ U( k8 _+ J& H6 R set mom_coolant_status UNDEFINED. `" X7 ] R; B C7 D, [
set mom_cutcom_status UNDEFINED
5 F, f9 v( B! n( } b set mom_clamp_status UNDEFINED2 P7 X+ L; i5 T6 ~! {% H; Z% ]: c
set mom_cycle_status UNDEFINED
7 F: I6 R# W% m' l( K1 [ set mom_spindle_status UNDEFINED
3 h+ n9 c. B) Y" ` set mom_cutcom_plane UNDEFINED
; e8 j, R. H6 T' }0 [; _3 E set mom_wire_cutcom_status UNDEFINED
g/ p0 D( c$ |- M. g0 |4 K2 ?# D- p) S& G3 U1 h" {9 y$ W2 w2 e
catch {unset mom_cutcom_adjust_register}
! \/ B/ m+ |! K2 z# N9 W catch {unset mom_tool_adjust_register}
- ]" f O' e, n5 B2 L catch {unset mom_tool_length_adjust_register}. P; @7 T6 h+ X4 J8 R* W
catch {unset mom_length_comp_register}
/ w# v0 y% l; r4 X" f catch {unset mom_flush_register}+ u) i ]7 j: Y5 K! a# [, q
catch {unset mom_wire_cutcom_adjust_register}+ m! V- R5 z. {+ R1 [
( G; A0 {! k- C; @/ J$ J' \" P set is_from ""
+ r0 r( C6 F) [0 L8 f- X
) H4 V" R3 [* I. `1 x; `6 s catch { OPEN_files } ; #open warning and listing files; S9 B4 Z3 U; q: P" A9 j
LIST_FILE_HEADER ; #list header in commentary listing2 N: r2 H: I- [
* F7 N2 b' y: o) q, d, \+ a. u
3 o( s; b& s0 U$ s9 c+ W( _* Q% v" Q6 _) r; x' `& p' a
global mom_sys_post_initialized8 \/ ^5 B) `: U$ p) v
if { $mom_sys_post_initialized > 1 } { return }2 K4 Q/ p, x$ ?) F/ p$ Z0 i3 J7 w% J
( j4 I: h' i; \, x) b( J0 q2 m1 H
7 w$ `! Q" `! `$ n( H/ F#************6 r1 X9 K4 h5 g
uplevel #0 {( f9 R: y6 Q$ \- |: }* P
% Q* _& x" x" ], o4 i+ r3 ?2 h+ A% B+ `2 C) x
#=============================================================
$ _ A6 _2 S6 E$ f- {proc MOM_sync {} {
' \- f5 p( s! [+ C#=============================================================
( Y0 T I) n, Q if [llength [info commands PB_CMD_kin_handle_sync_event] ] {
7 Z5 d! [3 s* _6 y# \7 b PB_CMD_kin_handle_sync_event
- [. L( @, g0 H }0 D9 W ^ W; L2 L2 x% [
}0 c% z0 w* V2 }) I" d7 d+ h$ N! v$ t/ P
6 x B& q$ Z- G8 Z& H
$ ^" {% b9 j# w: Q) e+ C* ]
#=============================================================0 q8 D; ~$ q7 P, f3 p/ X6 a/ h
proc MOM_set_csys {} {
' r* `0 j1 D% \0 T! \4 X* ]& k! p#=============================================================
/ S6 u6 V% c7 p" s \2 U if [llength [info commands PB_CMD_kin_set_csys] ] {+ n. K& P" d% a5 G# j- t
PB_CMD_kin_set_csys
- z, y7 }' D- i# x8 q }5 A6 M. O. |4 c1 h# C. O
}
0 M0 I& Q1 s1 D2 D: D2 b- |- o" r) Q
& ~% r1 h. @% {; S
#=============================================================/ A- @& k6 m( ?) p" S/ D0 l+ B0 c% N
proc MOM_msys {} {% c# z6 C$ h7 X9 ~+ n! V4 a9 a
#=============================================================& d6 `& }1 ?- s) g* X
}
. ~7 S; {3 M( B# e. g3 z
6 n. `6 d) Y+ n' U: U
( Z+ d1 k+ D) X; K5 j: r- J6 S" e% }#=============================================================& r. W5 S: t6 b- I
proc MOM_end_of_program { } {
( }$ G1 S% U+ k8 Q+ d# Y9 E#=============================================================* ]& T' r. o" c% D# ]& t+ L9 N# N
PB_CMD_end_of_file
" P* j; f, {; V: S# n+ e PB_CMD_calc_machine_time
) v I; @* A+ m/ ^! E3 v# b" u( A5 {% |0 {- N: H
#**** The following procedure lists the tool list with time in commentary data. n$ \% T1 c1 [5 O# `% J% i& v9 @
LIST_FILE_TRAILER2 L0 v* f. A2 y& f
- W H! i( H) y2 h) w7 ?9 h0 p8 w#**** The following procedure closes the warning and listing files
+ ]1 ?7 f) Q- Q9 y I4 b CLOSE_files r2 {0 h- {+ W2 c; E
}
R- p! k# q- ~
; {0 }' t& W7 X, D+ }3 a* p5 n* B% t. B
incr mom_sys_post_initialized
. M1 w, X9 M" F' H4 J5 }
0 U; m$ v* A& [( i# e
% x" e- Z- `' g" z} ;# uplevel
6 f5 t. o6 `' Y5 C4 k. B: n4 M#***********
2 p3 J# }1 X, [' \; e. E' Q
% n& q2 X7 A8 v5 G9 @' r7 s4 G7 K' [* p) ?4 ]2 V! B' B) r% K
}! x# L6 ], K) y: Y' g8 m$ e
0 a. M6 `. m0 k( v/ [7 S A7 X* U2 N. Z4 @+ C9 m) d3 E2 }5 j$ o
#=============================================================/ W9 o$ x! G# ^% b2 N! D; o3 Z7 n
proc PB_DELAY_TIME_SET { } {
4 B# P- i1 }. w& V3 W0 }#=============================================================' k$ R3 L, {! z1 a) L
global mom_sys_delay_param mom_delay_value
2 h& A# P6 q& m$ E* h global mom_delay_revs mom_delay_mode delay_time
, H6 g7 m3 I8 ]8 K4 `& Y) r6 [* q& j7 X" b" k
# post builder provided format for the current mode:
# Q7 a8 m7 h( N+ Q; A5 V* I if {[info exists mom_sys_delay_param(${mom_delay_mode},format)] != 0} {$ ~9 J2 E, ]: V- N4 P
MOM_set_address_format dwell $mom_sys_delay_param(${mom_delay_mode},format)# |" P6 \1 {. }
}
; _% E1 Y+ B* E/ b# C- z
6 i. Q9 S4 z' o9 S# Y+ ` switch $mom_delay_mode {+ E4 b9 T) C& N8 F7 S+ f3 N0 Y
SECONDS {set delay_time $mom_delay_value}
8 ^+ g* r2 [1 i4 |- c" T6 ` default {set delay_time $mom_delay_revs}! t/ Z; m6 K; g3 Y H8 y8 Q4 Y
}
) C0 w4 l4 p" Y5 Y S. L}
% } o8 [9 K( r" g4 Q3 t
R% z) O9 W" p! J/ \6 N3 s
+ I, A/ [) p, a% f' T, \9 N& d$ e#=============================================================
- w& r7 q6 j7 p( v" _6 [proc MOM_before_motion { } {) G; h% l9 Q! e
#=============================================================- l! o7 Y" p4 l4 H$ M& | V
global mom_motion_event mom_motion_type
4 b$ I0 t+ N. ]
4 d7 t @# |# r FEEDRATE_SET
4 C% D# J$ P# j! ?# {: H9 w7 O& Z2 s8 r# c+ h
9 R$ |1 F7 j7 i; K0 y" G. d
switch $mom_motion_type {
. Z' q# K" F% ?# ^ ENGAGE {PB_CMD_kin_wedm_engage_move}
3 I' W% {' y8 t' b Q5 @ APPROACH {PB_approach_move}
6 h5 Y# Z1 g3 b# F$ k FIRSTCUT {PB_first_cut}
( u7 i: s! I; _4 e: \. i- ` RETURN {PB_return_move}
. W& @1 b: Y6 v7 Q& ?% p+ ^ }
* j4 c4 s: k% D6 ?1 z4 H% ]# M% o/ U6 A7 j+ ~$ u+ C3 T
if [llength [info commands PB_CMD_kin_before_motion] ] { PB_CMD_kin_before_motion }
# A5 H9 L/ {- t; c7 U if [llength [info commands PB_CMD_before_motion] ] { PB_CMD_before_motion }9 f I# d7 r8 Q0 y& H
}
7 ^. T& S1 \" @# _1 l; ]
5 \ ~$ C" g; r& T3 P1 H+ |/ B5 }- K! ~" J2 s
#=============================================================% t7 x( R6 T7 M0 J
proc MOM_start_of_group {} {4 Q: [. c/ o+ n* k9 p
#=============================================================2 g- K; t3 P, |, Y" B6 N0 S' Z, K
global mom_sys_group_output mom_group_name group_level ptp_file_name
( j4 ]% C. P5 V' ?* O% _4 m; f global mom_sequence_number mom_sequence_increment mom_sequence_frequency
, p' h$ y% H( |/ ]- | global mom_sys_ptp_output pb_start_of_program_flag
7 {: y6 U' P, C* ?. D9 s# D- m+ ~$ { \5 X# p
if {![hiset group_level]} {set group_level 0 ; return}
* p& F/ I4 J# |! m! T- w! r# D2 `5 u8 w9 z4 i! p
if {[hiset mom_sys_group_output]} {if {$mom_sys_group_output == "OFF"} {set group_level 0 ; return}}1 P1 ^2 n* o8 J# B V+ O( I
( [% M) K% [4 {- L# R; S0 Q' ] if {[hiset group_level]} {incr group_level} else {set group_level 1}
- H* |6 R# d# b0 i% p w1 ]* S if {$group_level > 1} {return}" @3 N6 ~6 f1 B! M2 X C
( n* b1 L% ]* ?2 w
SEQNO_RESET ; #<4133654>
( z" t" K; p( u MOM_reset_sequence $mom_sequence_number $mom_sequence_increment $mom_sequence_frequency0 @+ g5 `( J/ N* ~7 z- @
d, p; o9 \' w2 Y
if {[info exists ptp_file_name]} {* I, K* ~/ q. }0 _1 {7 ]
MOM_close_output_file $ptp_file_name ; MOM_start_of_program
$ h, k0 [( O3 y. g! l# h if {$mom_sys_ptp_output == "ON"} {MOM_open_output_file $ptp_file_name }# r( p5 w- Z4 j8 j5 J1 M I
} else {$ c2 @* A4 x( k- B' ], m4 h
MOM_start_of_program
+ J: f1 I9 s! j) l% L! @ }1 P. n5 o+ {9 Y+ u* t
4 ^2 C+ L) V. y/ A( O" @ PB_start_of_program ; set pb_start_of_program_flag 17 R4 X- }( F# d' ^' D
}& L8 V, E, Q* n8 a4 g
1 G" A0 h% Y) ]0 L0 p3 [. t
8 R& G- L* g5 z! b; s#=============================================================
4 f5 [+ m; i; Mproc MOM_machine_mode {} {
! M6 H! X6 P4 m; f% }( e+ L: ~#=============================================================5 a& U! P9 C5 x" C5 E# H8 E
global pb_start_of_program_flag' K9 G5 V+ c7 r! Q; j9 y
global mom_operation_name mom_sys_change_mach_operation_name6 ]- @ O" B9 n4 c3 z4 m( ]" l
2 K$ |8 _1 j6 m {! t! P' s( e set mom_sys_change_mach_operation_name $mom_operation_name# L6 @- V, p. k5 \
1 h* K* @$ z: A! e$ }- ]+ w if {$pb_start_of_program_flag == 0} {PB_start_of_program ; set pb_start_of_program_flag 1}
3 r+ k; V% C8 u. y
( V8 x* ]# y$ \- J if [llength [info commands PB_machine_mode] ] {9 i, h) v% `: y+ e9 h3 n
if [catch {PB_machine_mode} res] {
! ^. V+ _5 `# Q! e0 o% s global mom_warning_info4 W5 H0 N( W6 u6 z$ ^; Z
set mom_warning_info "$res"
: p2 [+ S* h% H3 Q7 V8 J; I MOM_catch_warning
( B m0 h& H/ J @( ]9 d }
5 e' x! J( e4 b, {2 @ }
4 H" x: m2 u# L, @* t8 ~, r _}6 d; f9 B# D5 c B
1 U% L/ h6 G! j6 d8 r# O2 @* j
! M: I0 J0 f# f. \# R j
#=============================================================
( B- S0 O b% }, w5 Uproc PB_FORCE { option args } {
+ ^% m: `/ t* w& v1 ^#=============================================================
; p0 u; I, {' {$ d9 F# i: ^ set adds [join $args]
8 H2 d+ F6 R J9 m7 `+ r7 D/ b& x if { [info exists option] && [llength $adds] } {
3 }! d' ~" m2 q) d! ^- | lappend cmd MOM_force
: d; A% f( ^2 f5 @6 g lappend cmd $option
/ D+ d# Y x& k' g6 P' ?, r6 Z lappend cmd [join $adds]1 R# X3 |. R) B$ c1 j( g' W9 u
eval [join $cmd]1 S5 K& v3 t0 f2 b( S
}4 ]' N" H# N f: r3 M
}. a/ ~: E0 ], L$ G5 Y) ]
- |4 B d8 F& y5 R
d% J, d& n Q% F9 V9 d. P) x#=============================================================( d% Q& ~: [) P* M* a6 P, P" q
proc PB_SET_RAPID_MOD { mod_list blk_list ADDR NEW_MOD_LIST } {; K ]3 A; M7 U9 y& C
#=============================================================
6 }$ n' @/ V$ o upvar $ADDR addr4 M) _. C7 O9 p3 q
upvar $NEW_MOD_LIST new_mod_list2 L! A4 d# l$ w- X
global mom_cycle_spindle_axis traverse_axis1 traverse_axis2
0 e' h# O# d/ Q3 Q; e/ \7 e+ @$ o7 b, ?: F( g4 }
- a& C7 q# i) q! l u
set new_mod_list $ X* A" V5 a+ m* I
5 p8 m z+ E7 a+ y& k$ x4 N3 m foreach mod $mod_list {
+ w% q6 n9 M' I, @0 X6 u switch $mod {' @9 i* e8 Q8 n. i; I! v
"rapid1" {5 r# R8 e+ |0 l. d S
set elem $addr($traverse_axis1)$ v1 k+ j ^/ D/ k% z4 M
if { [lsearch $blk_list $elem] >= 0 } {. ?) ]8 c* S9 ]" L
lappend new_mod_list $elem
6 D* z& D% ~+ W1 @ }
8 N; W/ ?5 K+ R* y; w }' m5 i+ t& W; W4 z: M
"rapid2" {; l" {: o0 C1 \% [+ f
set elem $addr($traverse_axis2): a9 J }" C" z1 J' I1 T
if { [lsearch $blk_list $elem] >= 0 } {* u& v9 |) B1 I% l, h1 M
lappend new_mod_list $elem1 n# N9 d4 D4 b' |; @1 Q& K
}& a. u ~$ V+ O: `3 {' [
}
, N* x) |- Q1 U! L: ?7 X1 e1 O "rapid3" { C2 I0 n9 W8 b% t1 Y1 J
set elem $addr($mom_cycle_spindle_axis)
. X8 y6 k9 W" i& V" S/ g) D" p if { [lsearch $blk_list $elem] >= 0 } {
& E, ]/ j' E2 m" l' I3 i) y lappend new_mod_list $elem
p+ b" g. L, M7 _- T8 y }& i) l; P& ?/ u! Q) L( K( l
}
$ L0 g" h, c" G- k5 R2 V! b default {
: n$ K0 }# B! L* s set elem $mod" I$ s& T4 l2 S1 ~
if { [lsearch $blk_list $elem] >= 0 } {
u1 J' i& U) ]4 Z% | lappend new_mod_list $elem
8 I, q7 X1 l! Y' r! d }& m6 Z6 p1 p# @& q& s1 U6 p4 N
}
& r* B5 G l$ o* Y }9 E+ `+ k" f# U1 ]2 k7 u, _& }
}- ]4 i: G/ z9 W" [
}
& q# m* e. i' e s
! j* A/ s4 d7 o3 Y& d
7 h$ b4 R9 C6 O7 D4 c3 R######################### G+ B/ r4 r) P3 b8 y( x& q
# Redefine FEEDRATE_SET
3 t6 P6 R9 x+ w########################
% b9 F) r( w9 N; }) {& Qif [llength [info commands ugpost_FEEDRATE_SET] ] {& e) [( S$ d( @
rename ugpost_FEEDRATE_SET ""' E8 W, [" m" y- w$ l6 ~7 b8 M6 j
}3 t, G$ C: K2 T
0 Y, i2 c, O: ^* j% rif [llength [info commands FEEDRATE_SET] ] {' f) C+ C8 q" s: h( x* r
rename FEEDRATE_SET ugpost_FEEDRATE_SET T9 x, }; R( e; ^
} else {
( _0 k. L% u# W* M$ q3 d proc ugpost_FEEDRATE_SET {} {}) l# W V5 A6 w
}
% ^: O; ]7 Z. r' _8 Q2 v: l) K5 X( i3 m
5 X {1 b, |9 r9 I
#=============================================================
+ x5 ~8 r: K7 C1 `0 y" F2 Sproc FEEDRATE_SET {} {. y: y0 Q" x2 U3 t2 z
#=============================================================
) @9 j: n( ?0 ~$ j2 C if [llength [info commands PB_CMD_kin_feedrate_set] ] {
5 m9 b$ ?- S# J1 @ PB_CMD_kin_feedrate_set
' l, W1 c" C0 h3 ~! D } else {
/ v6 M0 x/ Z/ C; A ugpost_FEEDRATE_SET
h$ B$ M; Y: f/ k1 C& s* P K6 U3 I5 p }( }+ A# s! D" {9 ?8 F
}
( j0 f" H; c$ g/ u! y
2 f9 _5 P* J/ M8 p2 M% R& }7 s' _& ]
#=============================================================. S/ ~' O; [+ G" R4 M4 j% T
proc MOM_wire_cutcom { } {# G1 i, i1 v/ r. j
#=============================================================) U2 N3 i) Y/ \9 P$ C
global mom_wire_cutcom_status mom_wire_cutcom_mode
5 l& G [6 y y+ a, k7 y- _ global mom_cutcom_status mom_cutcom_mode
" |9 C) x% s W5 L
% X7 s3 y0 }( ]/ M5 Q% F" F; {9 D set mom_cutcom_status $mom_wire_cutcom_status( z1 U/ K' [# w7 h: }
set mom_cutcom_mode $mom_wire_cutcom_mode
% r! i ^* a( Z- m& n- E; k- E" |) z% ^- X3 q4 @1 i5 B3 p0 c3 D
switch $mom_wire_cutcom_status { x$ {0 W3 c* ~: W6 z
ON { MOM_cutcom_on }
& h1 V$ T5 `, J7 I1 t9 V OFF { MOM_cutcom_off }
$ T2 K, D# o, l& s/ ]: t/ e0 y) ?, ^ }
4 f5 Z$ m) X5 l0 T, \) _}4 K8 m& i5 m- q4 j
) t& X3 X* i4 p9 U! n
& f: J4 v0 {* l' h) m
############## EVENT HANDLING SECTION ################5 K( _( I- d& Z% F. w" H
( w8 M) L- ]$ B$ w2 X/ D# ]0 A# C
#=============================================================
* v( S# Y/ w; t8 wproc PB_start_of_program { } {
6 c$ d# w- g' l- H1 _' S#=============================================================. J" c: S, @+ a `8 j+ ]0 D7 z
+ g3 k0 s* H1 I# t# O w% b& U! K if [llength [info commands PB_CMD_kin_start_of_program] ] {! H. |: F2 |; z3 ~( t
PB_CMD_kin_start_of_program! n% p# a c+ g; _, D7 p# Q6 S
}
2 u3 o$ g& J1 p- Z2 w7 i) k+ v% j. }* ^
: o/ C2 S* Z& X, c! z" _5 { PB_CMD_start_of_file6 Y0 y: l+ D! E2 D
PB_CMD_start_of_program% z4 c" ^/ w- }- M/ D2 l
PB_CMD_start_of_conic
8 Q1 w! ~- n7 x- i PB_CMD_first_move; _9 N0 |% B6 q% M/ Z) F6 Z# s: _
PB_CMD_drill
' _0 F8 X: K8 L& t; R1 a}' j2 Y1 j% @1 J) z/ G/ `" N% z; H4 S
% V* F: |, ^' Z) y
+ y7 |4 R/ A+ l, H! _& k#=============================================================
6 p: S3 ?2 Z/ y! C) |* Q/ I% h: b& xproc MOM_start_of_path { } {% W9 z3 ?" `9 }# a
#=============================================================
: f7 }9 v `; o0 c/ T global mom_sys_in_operation
- [4 F. |9 v/ d set mom_sys_in_operation 1' j! J* {- s8 ?; h: R
9 A V2 Y; C0 @$ b$ c
global first_linear_move ; set first_linear_move 0
; M" _% v# O; r: E TOOL_SET MOM_start_of_path1 r( ]9 z0 Q; v/ a% B
8 F8 \. q l; G0 C1 V. p$ i* @+ l1 ]. p
if [llength [info commands PB_CMD_kin_start_of_path] ] {8 b! c9 u: |5 k
PB_CMD_kin_start_of_path
0 ?7 v( Z$ d3 M( K+ h% w4 [9 a }7 m" J! U1 O% c
, L# w; t: X0 H( \
PB_CMD_start_of_program) | _2 \! F. e, T3 A
}: O4 D. V. a5 w4 T% X3 S( S# Y; n+ \0 \
( {! m# ]: Q( i g) i7 K% n6 `6 i, t: @* V) r# Y
#=============================================================- |# o, }) C8 g; k. L2 a5 n
proc MOM_from_move { } {
6 x6 B- N* A' _4 V#=============================================================
, ^8 P4 t# l, z: Q% t global mom_feed_rate mom_feed_rate_per_rev mom_motion_type mom_kin_max_fpm
' S' Y+ b2 G; x |9 Y& i# [7 I2 { COOLANT_SET ; CUTCOM_SET ; SPINDLE_SET ; RAPID_SET
0 v1 m0 Q7 s; h}4 T# B, T3 B/ g5 {
7 P; u7 Z n |+ d" R( G+ g) b/ Z' R6 u$ W
#=============================================================4 W! f0 X* e" `+ D( B6 A5 f
proc PB_approach_move { } {2 R3 K; G3 U# H* @/ X" \. \5 f0 c
#=============================================================* L: Y! D% \( @' w
}
$ a8 K3 o m) S9 c- y5 s, n1 ?% ?( }- c. _! O6 J, k& l6 q
* A0 a6 l8 z, q7 g
#=============================================================
0 ]( J* t/ z" G: f( Sproc MOM_start_of_pass { } {
# i1 p1 Y* X8 W% h6 A#=============================================================
1 p% ?; ~8 D5 @% {" w9 l4 {! g, B global mom_sys_start_of_pass, [0 Q6 }/ ?0 e& \9 _- @
set mom_sys_start_of_pass 1, M( B+ Z, s- R& x$ B; B: u) Y
PB_CMD_start_of_pass
( P: }5 ^2 c+ R6 m}
" _1 V4 ?$ O9 _2 e2 |( B6 k: r* y G6 A4 r) c: O
7 D1 r( P( \1 r) c6 O$ O" S3 i) b* M#=============================================================
. _3 v0 X. r. uproc PB_cutcom_move { } {, F/ N+ ]5 c( ~
#=============================================================; @1 y& E& R1 A) {
}
& y! s: h* K* o6 ?/ ^- v3 y% s D' d$ K! @
* \! k; W3 W: A; s7 b6 d+ E$ `4 G#=============================================================$ U" F7 y7 w# W4 e- u7 ]
proc PB_lead_in_move { } {
5 h+ F b5 C0 E. {8 s) |#=============================================================. h' Z9 P4 C/ F1 M) Q3 P
}* m" S# m8 Z8 C4 B# |
1 G# f; b, N2 w5 C+ U: M7 `% `
# K4 a" i5 R" h3 o! T9 B! ]#=============================================================
8 m3 _* e+ j' X" H X/ O8 X! p- Uproc PB_lead_out_move { } {# A6 B( a- U8 l+ [; e( k5 x
#=============================================================" G/ b$ F- d8 I( e
}& A2 X* Q/ {2 m: Q! q: J W2 [$ g
1 q) F8 b( B$ b1 ^' k* G- x; z+ @1 s) n+ c4 P/ S/ w! ~( [1 Z
#=============================================================
7 a' ^1 y6 f6 \6 ]0 k0 a3 L6 Lproc MOM_end_of_pass { } {
1 u, d/ R/ b' F5 g#=============================================================
7 |" \( s) G6 |$ @9 L6 B PB_lead_out_move8 t; D( u6 \' N
PB_CMD_cutcom_off+ Y1 p/ a! W/ j) U
}
# g2 V$ z' T# v, f' o
9 ? h4 @2 l1 E* C9 ~# i* V) ~' K& [/ E' `, R, r0 K( W7 @
#=============================================================
# A: T1 z! `; Q+ ?proc MOM_gohome_move { } {
6 L! c% q' G7 K1 _" l, ~- M#=============================================================5 m: d0 J2 ^6 W D) }
MOM_rapid_move0 W2 ]5 S; q5 ^) V0 J( h! d3 a
}9 o0 y& }4 Z0 k8 V
, K. B8 `7 u$ l3 F1 E& i& m# [
* a( @- q6 ]. O#=============================================================/ l; m: E. ]( L% I% I
proc MOM_end_of_path { } {
- x2 y& P. R4 R, C+ l& m" O1 q#=============================================================
. w1 h' v8 n' W' R3 I/ Z8 k3 M# K2 C5 c& o: R; d9 o
if [llength [info commands PB_CMD_kin_end_of_path] ] {
& }: {1 |, v) n0 _% _ PB_CMD_kin_end_of_path
+ m) B- Y9 j$ t k, w. g }
/ h% ]& z7 e# i8 l: c4 v3 p( _
( Z4 D' h8 \" ^! Q9 t global mom_sys_in_operation6 u6 o" @8 |! L3 O
set mom_sys_in_operation 04 ?& g. m1 y5 z& E" _* W
}
0 L' k- @9 R+ G3 |# I! [0 I
" \+ \4 z8 D' n& m6 V6 F. t; a/ `( Y/ E& |' N, T, e3 ^
#=============================================================
4 H( T* e& M0 p& j Gproc MOM_thread_wire { } {; h' z1 k5 D6 ?1 y
#=============================================================- n; c7 e$ ^ q( V" X! P" a
}; f! X) h6 t3 G4 D# U
3 N, Y, c) D# `! z! x2 d% N
* I. J% T8 k. S) y: d" b
#=============================================================
$ S" X/ Y3 I/ w3 |0 s& P% Q% L+ uproc MOM_cut_wire { } {
/ l: ?4 G i/ Z7 p& @#=============================================================. B6 B% c% H/ z$ e
}
* U0 r, M! Y9 o$ }7 i \( ?
. K% L7 A0 H( y) I" x f" b! u. r" @
#=============================================================- K0 q. g; ~- l
proc MOM_wire_guides { } {7 B8 I. [$ d2 [7 o
#=============================================================
; k! J+ B$ w4 b! T3 m PB_CMD_work_coordinate
' j4 J! h/ \4 |4 I}- Y" G, U9 A6 C" Z0 |$ c0 v
) A+ V4 S! D6 a7 A0 c$ b) D% k' W
#=============================================================5 D3 r: K7 K" r+ r3 [ L; t
proc MOM_set_mode { } {
. D/ J+ ^* ^. y* R G#=============================================================! S* M. \. ?" l9 L* A3 l& y
}
/ Z' ^6 j+ ?* e& s$ F5 I' M7 X/ t9 S! f7 [9 f4 O3 K' J
- i+ `/ k" d+ E0 h
#=============================================================4 X- L5 [8 i, o. m8 V
proc MOM_cutcom_on { } {
% q* |0 J% H" P2 k! j#=============================================================0 ?: T+ z' h% R
CUTCOM_SET, a$ s) [; |* ?- S4 p. `. @+ N
PB_CMD_cutcom_on
2 o: `# k6 {9 h& N2 s}
2 }2 b" F @6 |# I( L( B) @* Z! P" ]& {2 ?0 l/ ^0 [8 H
) w4 z6 C7 I I7 C V#=============================================================% f$ x- E$ \# ?$ ~7 k
proc MOM_cutcom_off { } {
% L2 [& g( E8 b; h#=============================================================
J7 F8 q' X; ]7 K( q: `# V CUTCOM_SET
1 m/ c7 w1 a7 U" ] PB_CMD_cutcom_preoff
2 P. m6 w5 B+ _}2 t2 A9 H( y. L% b2 p' C
8 ]4 {- Q( _0 i
0 I( j/ x1 K1 X6 q0 n' D
#=============================================================2 C- g& @: s+ k
proc MOM_feedrates { } {$ Q; w7 q; c" x1 z, O/ d/ W; x
#=============================================================! V" B, L* _' G5 p8 {. |
}& H6 Y( ]6 D1 X9 W( L; q5 t) m
# g1 V8 M6 t" B& m+ b6 ~
( B& f6 x5 r1 M#=============================================================) }4 R: n2 @9 K/ {: U) W3 M o6 j) o
proc MOM_delay { } {
: N6 p& [4 b) e2 \. N; ]' ^2 X1 p#=============================================================/ `$ U# |+ k# }0 s
PB_DELAY_TIME_SET ~8 c- y0 Z7 }0 P+ W L
MOM_do_template delay
% f" V5 W1 X1 O8 l' s: L; c7 o}/ T9 s: [' @9 w& X
: E" ]" c o" C+ e3 Q
( o$ J- H; T4 `7 F#=============================================================
* `" e4 Z3 J8 A6 {/ `; Z* w6 Tproc MOM_auxfun { } {
( j, O! L, q' ~ Q- [#=============================================================) b) w- y! K0 ~1 D0 R
}/ Y9 S) O. |4 V6 A
# K8 k. X" h3 K5 F. u( e2 K+ M6 ~
#=============================================================
* {1 l) N) _6 C2 [) X9 E Rproc MOM_prefun { } {
/ l' K8 |. A$ `#=============================================================
8 Y# Y* ?3 s, s( h! }, j% c}
F" [+ V! i1 u8 J
( s% a! |! K& I
% Y0 b3 r; r3 E4 Q#=============================================================
$ U- e" T% b" |# o+ S+ K/ Tproc MOM_stop { } {" [. f z( Y& e( D/ K6 E
#=============================================================8 e5 d+ p7 {* u1 \5 ^/ {
MOM_force Once M
8 \5 B9 Y2 U4 S# f: L3 O6 e' s! i MOM_do_template stop
& n: J& }$ s. c5 ~' j}
" H( a# g' }/ u
2 w) w* q# `/ Y( ^0 D( C6 P2 y0 s, ^0 ]$ |6 e7 X9 u( \/ C6 _3 K
#=============================================================; W( a) }! Y$ K8 O3 ]/ ]5 |3 L
proc MOM_opstop { } {
; m! I/ `9 h! v6 V7 Q( `#=============================================================
, u% Y8 n/ J# i, [6 x( q' n MOM_do_template opstop) S- s7 U( W {7 j
}
: H, Q" \9 p% r# v d P3 d/ U- q& ~ N5 |4 \; i
1 w3 e0 P" g& C6 U! \' s
#============================================================= I0 c8 ` c4 C, s7 Y3 d. R. j! H
proc MOM_linear_move { } {, n% J* o7 W+ G8 N. Y; j( G& s8 p
#=============================================================
" K' X/ k9 V( @) Z N1 `+ e; ^ global feed_mode mom_feed_rate mom_kin_rapid_feed_rate
, B+ ]8 a6 _" p g# f7 ]: T6 s- N2 Z) q* m
if { $feed_mode == "IPM" || $feed_mode == "MMPM" } {( s$ `, S) `# O$ S c. {
if { [EQ_is_ge $mom_feed_rate $mom_kin_rapid_feed_rate] } {) N5 j7 X; f" Q$ {) ]* |
MOM_rapid_move
' z% f- p0 a7 \5 B4 B& H return) U" o1 O9 H+ f' C- r: U5 |' w- y N
}
6 t: Q4 T2 i, ]: M7 q }2 T2 c( I H5 i
/ |$ o( N1 Y5 d
PB_CMD_linear
& I% d+ l% t5 {}
5 y& P& X" C: C3 B8 R4 T) l# `# V: h# d ~; ?6 q* @, }
/ s# H0 n S' h9 q) C$ Q
#=============================================================
3 k2 a2 Q1 z( x* Vproc MOM_circular_move { } {
4 x8 r, R' u3 C# s) g#=============================================================: d4 U9 ]5 ^) ~) s; D
PB_CMD_circular
4 }' j. k: |) o( `6 h+ E4 I3 B}
3 T( E5 H1 O& J; P9 U. Q5 W; u, ~/ H' i3 }) l/ n" X( J4 ^# k
. }7 K1 H: y! H% c7 a* K7 Z
#=============================================================' x. w. ?+ C* J4 Y+ J: E5 d7 k
proc MOM_rapid_move { } {4 A; W4 @. d* p" p8 s
#=============================================================
! O, W2 o' K6 c8 W. l global rapid_spindle_inhibit rapid_traverse_inhibit
1 k y8 Y# h# o c/ S global spindle_first is_from" ]8 j; C( t5 _; q& M* W
global mom_cycle_spindle_axis traverse_axis1 traverse_axis23 r x- f9 O: R% e
global mom_motion_event: j; x, }: u" k% t( Q
f8 [$ K) c& H2 r8 j set aa(0) X ; set aa(1) Y ; set aa(2) Z+ a* P+ v3 L) Z5 ~4 X
RAPID_SET5 v: W/ `% L( e, {. d# B- d4 L& `
MOM_do_template rapid_move
- L- h: z9 l7 u}
, x* c& l, S2 \, a8 K% n3 B! a
$ m! y; |5 h" @+ P5 Z5 [9 E ?# j8 z2 g" B6 f
#=============================================================
9 j8 ]# P( l+ Z+ Z4 Xproc MOM_cycle_parameters { } {
7 {8 i$ Y2 \( d2 X& k#=============================================================/ D& D+ Z1 A5 ]+ p
}- G# Y' M! ]& p6 k. A
5 T3 |( A3 G: E- f5 g) Q# t+ A# O
#=============================================================
, h+ ?8 n( l; R5 [ l, S- `5 ~8 Mproc MOM_sequence_number { } {
8 H, R, j0 S3 A2 G, z9 o# v#=============================================================2 K6 V% ~. A% G. p0 ]9 C0 [0 l
SEQNO_SET
. m& x6 }6 c. @' q0 x6 ^% [}
# j% w6 g+ l' ~ y1 b2 p; l. o! G& ]
/ m' v6 I. ~3 _( G+ Z P9 N7 B# K w- t) Q
#=============================================================% d0 Q6 Q* l8 B% Z1 _/ G x j
proc PB_CMD_before_motion { } {1 t) Q* u2 J8 M% i
#=============================================================
6 F# b( f! x* v/ W oglobal mom_motion_type
- Q! ]* ?/ T- c$ r& Pglobal mom_current_motion- [* H1 e" r: }/ u* H
global mom_motion_distance8 V) x: u+ Q1 \% }, B7 w
global momPathLength
; K5 \. ?: ]) B( k1 M; s( i- e
MOM_reload_variable mom_motion_type1 D5 e0 E1 T8 e( _
MOM_reload_variable mom_current_motion. p/ @. r4 R* v- B% J# d6 r7 _1 [
5 F+ S' W y w; ~, U& P5 Q9 N
if { ($mom_current_motion == "first_move") && ($mom_motion_type == "RAPID") } {7 ~* U# \7 e, t6 ?# {" ^
## Set location point befor First Move:6 q( _4 v9 C* B( E2 X5 f& B
MOM_output_literal "/G05") o& `9 R$ x% W. m( C! a1 U
MOM_output_literal "/G06"' Y& `3 V, W [% @* q2 H" }$ n
MOM_output_literal "/G08"
( a* v! I. l, B/ \ MOM_do_template rapid_move* Y$ S4 R* C8 a% D. _; P
MOM_do_template location_start_point
2 I' ?6 p; q/ H2 o: V) e+ c- h) a return
1 a& ]( G, }7 q} elseif { $mom_motion_type == "RAPID" } {, }2 x l1 c" N7 ?/ O; b8 \
## When rapid move, insert and append pause activation:4 f# b5 r! R, u( _2 d
MOM_output_text " "
; d# O+ K" q/ d MOM_output_literal "M00"! }' ]+ d$ c4 Y$ z4 ^
MOM_do_template rapid_move
2 n1 |% q$ u% |/ m MOM_output_literal "M00"
) q, N( F- [7 B, H MOM_output_text " "4 r/ z% C! N0 y2 m1 v! m
return; y7 C9 U; u5 V3 t) g H' s
} elseif { $mom_motion_type == "CUT" } {
' d( x% a* Q9 c% H set momPathLength [expr $momPathLength + $mom_motion_distance]6 h$ t( X- f7 x" _ H
}% g1 n/ I6 m' v& C, ]) ~
}; V) K' c( u. B' |
! @6 X( T( Q0 {& ], t9 C# ?- A$ e w8 G1 P8 K: @) t, |* B
#=============================================================9 X' `; i! }9 }# G) S* L+ g
proc PB_CMD_calc_file_size { } {% m& ~# |9 V9 F- w: s2 D- j$ U
#=============================================================% v5 u, q4 X, R2 G
global ptp_file_name# Y+ [( [( E3 B' \7 [" r; V
' O. {) s, Y/ _# U
MOM_close_output_file $ptp_file_name
( B x& p/ k% K; f; ]5 A& E. Q3 S/ Xset ptp_size [file size $ptp_file_name]+ x0 _) R, c/ q0 R) M2 {
MOM_open_output_file $ptp_file_name
! M( k8 U i( Q7 H# W. Y1 M
# G& u6 P& ]/ |" ]4 K0 v+ FMOM_output_literal "( NC file size = $ptp_size bytes )"
2 ^' n& C! C( L5 @ f; ?# U- g}& K6 {% |( E% q4 j
8 F+ U( t* z8 u
1 g6 M: a* N4 @: I) o. X( m0 I) Y& {#=============================================================% A: M) q, Z# C/ c+ s
proc PB_CMD_calc_machine_time { } {
) s/ z; [% t" ~: Y( U" G1 d#=============================================================& ~& d: d' L0 Y. N( Z
global momPathLength
& W3 m7 L0 R& D$ Oglobal mom_wire_guides_lower_plane
( \$ e. S7 Y3 I7 {global mom_wire_guides_upper_plane4 v* p) ~1 g. D- k+ N, D0 f7 G% z
global mom_feed_rate. X8 S" n, \% ]8 W! q8 ~
global mom_wire_feed_rate: I$ O3 h8 H3 e: G+ w
3 U( L( d9 z2 @& R1 _
global mom_kin_machine_type9 Y+ q) p; d' L& j& i1 N
global mom_machine_mode5 D2 p/ N) z+ `& } v% }7 C
5 F; O$ R8 p) v5 B0 y$ c8 h) R y1 d& C0 x+ ^7 e, V! S
if {$mom_machine_mode == "WIRE" } {
2 C! W1 e) \! i MOM_output_literal "( Toolpath Length = [format "%6.2f" $momPathLength] mm )"
/ n- _- V, ^; Z0 y I set momMachineTime [expr $momPathLength * ($mom_wire_guides_upper_plane - $mom_wire_guides_lower_plane) / $mom_wire_feed_rate ]
7 ~: |2 P' z/ m0 ~ MOM_output_literal "( Machine Time = [format "%4.0f" $momMachineTime] min. )"7 h; b; g3 x/ t/ D8 C
) i4 g3 a: A$ H7 B, ?+ l
PB_CMD_calc_file_size5 {0 |3 p2 w* ]$ p
}
* S' c: T8 _ \4 w! @, N}5 k4 w9 o, y5 O- C: s
8 A7 A& S W) Z: m6 S
: T& a+ q: U* D6 @1 f
#=============================================================
$ a' Y" t" J4 e; U0 V0 U oproc PB_CMD_circular { } {
2 i6 ]" F% j. E' V/ y/ u6 `, @#=============================================================8 @" K7 U8 s2 f5 V3 ^9 P% _5 L
global mom_tape_status. i1 V! \5 f" r$ P" _ z' }% g+ f8 K
if { ($mom_tape_status == "ANGLE") || ($mom_tape_status == "NONE") } {
" g' o+ M. S. S6 x+ | MOM_force Once G_motion X Y I J' r3 H8 q. H* k0 ?4 T/ z
MOM_do_template circular_move! u* V8 p$ J' {: x2 s& P( |' c
} elseif { $mom_tape_status == "CONIC" } {
5 G2 R4 l" H+ a* h' c MOM_force Once G_motion X Y I J
T& e0 t0 n; g' N MOM_do_template circular_move_conic5 q2 G* `2 h: D8 X h1 Y' m$ ~$ f: Q" O6 Z
} else {
/ m$ z1 j, F0 G$ Q& I* E% l MOM_force Once G_motion X Y I J Text G_motion_upper X_upper Y_upper I_upper J_upper
' X# s0 J d8 |1 h# x! F1 s& A MOM_do_template circular_move_complex
& x6 |6 } N( F* t: g7 b}
, Y( u& ^5 `1 z; P/ s! R$ p9 m( [; S}
$ Q: z3 D% w: j% U4 Y- S! I& C3 P3 f5 ]
& P ^: p2 w- F/ t#=============================================================; t- c- A# C6 H5 W0 `2 J
proc PB_CMD_cutcom_off { } {
3 k) s; p, t2 e0 r- J; t; z% r' o3 n9 R#=============================================================9 Z+ I: e& T5 c% ]$ @
global mom_wire_guides_lower_plane$ P7 \, Q7 h$ {7 C
global mom_wire_guides_upper_plane) |4 V9 F" ?. G
global mom_tape_status
+ S6 r! n' @8 z1 i5 ^) c: xglobal mom_sys_cutcom_code(OFF)
/ I2 y. o, i; m9 W% Wglobal momComplex
- k' [1 h% ?$ W* H0 }; }! q5 ~" ?& g# T3 o- c$ K
if { $mom_tape_status == "CONIC" } {: D& q8 j. H2 W5 |
MOM_output_literal "G75"
, ]+ h8 f9 U, A' ]' H6 R}, M5 y& p9 ^) S6 B9 b
, Y/ c9 Z' g9 y% F8 Z* I* qif { $mom_tape_status == "COMPLEX" } {2 Z$ Y/ R5 d. f; P
if [info exists momComplex] { unset momComplex }0 m0 w" J! v: @* n4 [. d2 S' V
} else {9 e* j% a! z/ S. G! v6 W
if { $mom_tape_status == "ANGLE" } {9 A9 i* B8 z# {% u! }3 g+ r
MOM_output_literal "G40"
' H6 j- ~ v5 Z: j/ O+ p MOM_output_literal "G50"8 I! F' Y4 h# K) v2 a7 K
} else {
& F- h' q7 ^$ g% S$ k7 u* x MOM_output_literal "G40"
# F, N* m) _$ Z }
8 i g9 S5 b: e/ `}
' o- w+ i3 f3 `/ a3 J, K}
" ^2 w" p) V5 t6 ]6 k) S' H/ ~. O7 ~! i; s. M$ D
: r3 H# P& G8 l s9 C3 r5 \#=============================================================
0 C( h8 _( ?! i5 B4 w6 H0 sproc PB_CMD_cutcom_on { } {4 ?8 }% f+ a% q. D
#=============================================================2 z9 W k2 f, X# E; A4 E2 N
global mom_wire_guides_lower_plane
( c5 ]( T1 J1 F6 V# Y7 g( ^global mom_wire_guides_upper_plane6 O0 f1 |; g9 O" ~* L
global mom_tape_status4 \- m2 ]- |5 U
global mom_sys_cutcom_code
5 o. n" e; R! i3 R9 v# O. bglobal momComplex8 X: M8 D4 O5 i$ R! g* {
global momConic
, i9 |4 w( f2 pglobal mom_wire_angle_command0 D1 x2 X9 c! u5 @
4 N- [: E" E3 C
global mom_sys_cutcom_code(LEFT)3 X! T0 D% Z( g8 N
global mom_sys_cutcom_code(RIGHT)8 ?* K, ]* w* v9 l
global mom_sys_cutcom_code(OFF)
5 z5 v' H( S8 }4 y8 J g7 `0 s' } aglobal mom_wire_cutcom_mode/ J; Y: P9 ~$ y$ G: c3 H( l
global mom_wire_cutcom_status( h' E- P/ D. W4 |. L' c
global mom_wire_cutcom_adjust_register
, ^' \4 n. e; R" a% O0 lglobal mom_wire_cutcom_user_register
% ?3 k/ L8 \/ f' C0 G" V6 _0 _+ Z. V. l: c% Q
MOM_reload_variable mom_wire_cutcom_user_register: n ^. r: D5 V& ^$ V
MOM_reload_variable mom_wire_angle_command9 p4 p5 F! u: [. g, N/ B
MOM_reload_variable mom_wire_cutcom_adjust_register$ R. \3 R( P7 a4 q* O \6 @5 |: |
MOM_reload_variable mom_tape_status; h* I! |; H& |" ~
3 T! A+ I1 i+ A" Z. m |if { $mom_wire_cutcom_user_register != $mom_wire_cutcom_adjust_register } {
& S5 p' p! {) G+ i set mom_wire_cutcom_adjust_register $mom_wire_cutcom_user_register* a4 r' a3 H( r# x' `
}+ X' `2 t2 U* C5 A; ~" |
8 f2 v) \/ h( l' Y+ }
if { $mom_tape_status == "COMPLEX" } {
& n: }! o9 h/ d6 d MOM_do_template cutcom_on_complex
" v- A8 l* k6 p! ^$ A" G" h. R; h( g set momComplex 1
* K& t3 G6 J2 g# {' v# V8 S$ D, a$ p} else {
" W$ a6 \9 }. o; c' v! g if { $mom_tape_status == "ANGLE" } {
% _% [3 o1 i) Z, K if { ![info exist mom_wire_angle_command]} { set mom_wire_angle_command "G551 A0" }
- ~+ O3 Q; l( w% s6 K0 z8 j3 W( c! y MOM_output_literal $mom_wire_angle_command
5 c9 N0 \$ ]' T9 F- ]# l }
! I/ t/ x" R3 H" @) |* M. Y% H4 T if { $mom_tape_status == "CONIC" } {
; k9 x, h, n. y- d set momConic 1# ~. B/ _% e9 u; n1 X0 a
}
5 n. v4 B7 n. m" z9 F+ x MOM_do_template cutcom_on: ?, Q6 R7 X$ ?; Y" Y! e
}
% X8 G, _8 G+ \4 v9 d}
6 U: O, z, Z2 R W3 r+ P
4 f9 i8 [1 H$ m9 t4 t$ y# K
5 u2 u( y; n3 W2 a. \9 u0 J#=============================================================7 \# s2 s; Y1 u$ q* e+ {9 F$ i
proc PB_CMD_cutcom_preoff { } {
9 D7 E: U0 ?) a#=============================================================
' ], R: G: |! d: g( m; Z1 Uglobal mom_wire_guides_lower_plane
" K5 W8 y; K! G; sglobal mom_wire_guides_upper_plane& j- X/ z5 V% G/ ]2 r# R
global mom_tape_status
0 y1 E1 |: p: @/ [2 F; P% J: sglobal mom_sys_cutcom_code(OFF)# a' U! e; f' N7 [
5 i( {) A0 @# ]6 Y9 xMOM_output_literal "M00"
: @& x. P+ v* b- _if { $mom_tape_status == "ANGLE" } { MOM_output_literal "A0" }4 W. n# a$ F8 I# z
if { $mom_tape_status != "COMPLEX" } { MOM_output_literal "D000" }( c1 N+ s5 P" L/ Y3 _. b
}
1 c2 ^4 D2 [& a+ R. u& _, W4 Q7 a5 |8 P& Q9 T& l
3 }1 w- x. N( K2 ]* q#=============================================================/ V; V( {3 w1 g+ T
proc PB_CMD_drill { } {7 f' ?" u$ ?& s8 }( [) E6 P
#=============================================================1 u& ~; U/ z. b% G6 A& k) t U
uplevel #0 {
. p* f# T: l8 k6 B2 N- Q0 s) E" J' v, O
set mom_kin_wire_tilt_output_type "COORDINATES"
0 k- Y; t, T5 N8 a #MOM_reload_kinematics
9 k& ~- z; N4 G- `! B. |* z/ `3 U4 @; I# U+ c
proc MOM_drill_move {} {
' I u7 b- t8 P( p: R global mom_pos
' K% O6 G3 y& J* @7 h
/ g( h2 P1 \8 t8 v# S4 n5 Q1 R9 y# C MOM_output_text " "4 t4 [# V" U& c" s9 q
MOM_do_template rapid_move
1 ~# T: U& a' h. U& m MOM_output_literal "M00": r6 B6 p/ w4 s3 V1 q! D6 f. G$ }
MOM_output_literal "M98 P8888"
8 x% H6 S# C O% @: q2 Z }2 y$ E p- n7 z
8 r9 N) k9 x J
}- w9 X ], E: @" X9 _
}
o3 Z1 ` B3 ]- `8 b9 N D/ A# U8 o" X8 Z% e
! r) U4 u' B9 \
#=============================================================
5 g( h, E7 a/ {/ W) Bproc PB_CMD_end_of_file { } {( L+ S# ^5 {9 ]4 ~0 v' i
#=============================================================
; p# B$ @) {7 P4 Y" l6 y7 ?4 D3 }) L6 oMOM_output_text " "& p* x" r+ F3 I! m6 ~
MOM_output_literal "G40 G50 G75"3 n: c4 K( l/ M4 v3 ^+ a! A
MOM_output_literal "G90 G09"
4 d4 }" f+ J# \MOM_output_literal "T81"7 b3 z% Z' t# s7 ~0 j& A- ?
MOM_output_literal "T97"' h9 G: q5 r' p) Y g7 \' o
MOM_output_literal "M00"6 [2 |. p( _# e
MOM_output_literal "M02"+ c3 ?) x& q1 M4 b1 j" T$ J
MOM_output_literal "%": _" V9 B, g* Q- }' K2 s8 s% A
MOM_output_text " "
0 A8 l# |7 c& X" w}' U& [+ U3 o5 F/ r5 @1 I
$ N2 E0 c1 y0 H2 L& R* {( @7 H; g5 Q# }9 V
#=============================================================. k+ q% V- s3 j) T" o% c) I" E L4 |
proc PB_CMD_first_move { } {
, ]( \6 n) m1 ^4 O+ b6 [#=============================================================; m1 u* i' Q w' e
uplevel #0 {
6 I3 l5 {* j* r: S% ^ proc MOM_first_move { } {3 F% w) j5 t9 l8 y
MOM_output_text " ", C8 b+ I5 B% i: e. u; U% L
MOM_abort_event
: J4 A1 V! ?& x return$ l2 W ~ s6 w
}& b3 Z& m: w7 y2 o8 Q. f
}" a+ ^4 M Y; ]2 a, y1 o' j" S
}
4 `& r1 j+ f; K/ s5 i; I A8 y. n( W6 j0 n4 N8 z/ Y
; l! ?+ I, ~6 t# w* } w
#=============================================================
# v" Z$ z5 e- j2 U) y0 J3 c7 o0 Vproc PB_CMD_kin_before_motion { } {
! }) p% j4 L9 X9 W9 J#=============================================================) X. A; ]9 ~$ o, T. J( q0 t
}& ?& a" ?: f& A# ?' K" o
$ `) @3 w* v M( f# v
" x) t( c0 D5 Z! ]
#=============================================================' B3 n- q5 b$ }8 h
proc PB_CMD_kin_feedrate_set { } {
+ K# D! y- E/ d( d: B#=============================================================( }+ \( ]7 a ?
# This procedure supercedes the functionalites provided by the
$ P% u- [* h! ^$ _# FEEDRATE_SET in ugpost_base.tcl. Post Builder automatically
6 W) z+ D: _4 B) X# generates proper call sequences to this procedure in the+ U% Y0 Q4 [# k K
# Event handlers.
9 A3 N' u3 e! _" X4 ^#% L. j2 V! R) j5 k2 S
# This procedure must be used in conjunction with ugpost_base.tcl.6 \3 t; X) Z# b; T- _% u# S3 ^
#4 q/ T5 b& T2 x+ `
global feed com_feed_rate' l8 J2 U; d! V0 D& e$ O7 `; l. X5 M
global mom_feed_rate_output_mode super_feed_mode feed_mode+ U7 w3 l, c* A* H% x
global mom_cycle_feed_rate_mode mom_cycle_feed_rate
U1 B7 q2 Q1 ~- S% O global mom_cycle_feed_rate_per_rev
1 ?* _7 y- A- D global mom_motion_type
, {" \0 G3 C) E5 Q) S7 x; M1 K global mom_warning_info, i* o8 Q, ?, o4 q
global Feed_IPM Feed_IPR Feed_MMPM Feed_MMPR Feed_INV! W6 D; J) p1 |
global mom_sys_feed_param
T7 p' H3 u& q; }8 \( c global mom_sys_cycle_feed_mode
6 F7 ]7 g6 O. S- T
6 z7 C* {3 z: z$ ~/ R4 ]& e+ l5 D/ D: O y; S8 u1 f
set super_feed_mode $mom_feed_rate_output_mode
1 f4 W: v! o' B5 C4 n( R, H2 R: U7 F4 {0 G% O+ X
set f_pm [ASK_FEEDRATE_FPM] ; set f_pr [ASK_FEEDRATE_FPR]3 L% M, H; y8 j- a, ]. X
0 W4 d9 O) s7 L: c# b: }: Z/ o
switch $mom_motion_type {
6 X# s2 p2 l$ [: t+ C) n" [' X6 r4 b3 y# v
CYCLE {
( h( U8 Z6 e e$ H& E if [info exists mom_sys_cycle_feed_mode] {4 A2 B4 ]5 V8 Q- h
if { $mom_sys_cycle_feed_mode != "Auto" } {
* K* L& k4 _- `% J* W& Z4 s) A set mom_cycle_feed_rate_mode $mom_sys_cycle_feed_mode0 J9 \! a0 X% ]1 s# N
}
2 E' p& Y Q+ B; j; W. m }0 x/ E* v+ [$ i \! Q' c5 T
if {[hiset mom_cycle_feed_rate_mode]} { set super_feed_mode $mom_cycle_feed_rate_mode }3 W9 E" u+ W/ ^' A" A0 |
if {[hiset mom_cycle_feed_rate]} { set f_pm $mom_cycle_feed_rate }
: j' k8 ?% t8 ^: ` if {[hiset mom_cycle_feed_rate_per_rev]} { set f_pr $mom_cycle_feed_rate_per_rev }
- n- w$ Z+ I/ g# B, o }6 r# ~9 R2 `8 ~6 ^7 o
* a# C$ n8 [6 @4 X3 d9 u
FROM -9 I; ^/ D; j% W& T& |
RETRACT -% j$ k9 G* s: m; @/ q3 Y
RETURN -
7 ]3 t' ]: {7 ` ~! d" J( z S LIFT -
! K# p, \2 n1 b5 V TRAVERSAL -6 ?2 ~' \! S9 P
GOHOME -. c. w5 m4 o) r2 R
GOHOME_DEFAULT -* v7 v3 b: o+ b" ?
RAPID {9 q4 q$ ~5 l0 s8 a( H+ X
SUPER_FEED_MODE_SET RAPID/ C5 u/ W( Y K) k( O% S. a
}* v' N' Y" M4 s8 S
, I8 f" U: c. s* h# Y! L& ` default {6 ^+ y. t+ @1 }8 d" r
if {[EQ_is_zero $f_pm] && [EQ_is_zero $f_pr]} {
, u4 r2 K8 G' j9 o y$ x1 T SUPER_FEED_MODE_SET RAPID; M9 T$ i2 l6 B# z$ o5 V
} else {
) x& y$ v1 h5 m; C0 S3 ~ SUPER_FEED_MODE_SET CONTOUR" S n# m/ U$ d3 T9 G
}
: b4 V+ ? o5 `, x0 O8 q/ g }! a# Y; q7 x5 J0 N
}
, f7 s3 Q2 t3 B& [, h
9 v3 F3 n+ q$ O6 C( l3 \* B. m( d& w: o r
set feed_mode $super_feed_mode/ O4 a/ N X8 h
; a; m1 S9 E7 I6 ~3 D
# n! l1 M4 z1 e# Adjust feedrate format per Post output unit again.9 Z& P0 E; k1 R2 _
global mom_kin_output_unit) h# s2 E# [1 x- s- I
if { $mom_kin_output_unit == "IN" } {
7 c6 o# A6 @' L/ o1 R/ t' J- a switch $feed_mode {
" k* U9 x" B$ Z4 {3 G MMPM {) K2 V+ P `: M K
set feed_mode "IPM"
) a0 W& W/ C% v; A# e CATCH_WARNING "Feedrate mode MMPM changed to IPM"6 p( w! q+ B5 L
} n8 x) n. f& H8 g) J3 B7 {
MMPR {
) ^) z% r$ \9 z* U, Q3 _ set feed_mode "IPR"& Y! `/ G3 ?# _& p+ x) j/ f
CATCH_WARNING "Feedrate mode MMPR changed to IPR"
- K- u2 g& }7 X4 X' m1 _ }& X9 w7 w& T( {1 z
}
% P1 j* U9 ]5 W1 a; e } else {8 m0 b2 f7 B- z6 U' H: v% n
switch $feed_mode {
7 l9 }3 r. N% N IPM {( W8 N. d3 C/ Q) B9 U8 ]
set feed_mode "MMPM"* r0 W- L& I& j4 Z
CATCH_WARNING "Feedrate mode IPM changed to MMPM"7 P# o9 T4 s( \( b# r8 n
}
$ V( X" N" R- s5 Q/ w# L IPR {
' R/ q+ J$ B Y7 C5 N( F/ K* k set feed_mode "MMPR"4 u) U6 a# E8 L/ \- S
CATCH_WARNING "Feedrate mode IPR changed to MMPR"
X" Y0 t5 M: ~1 f$ G# n# b+ ]7 e }
V# A; x0 v3 n) g. i0 b1 z }% W( @& \6 L* A- }. M: S3 R9 f
} ^) K; t) q& M' B' z
( r: n! v4 @3 ^4 O4 z" y
2 p" _7 P, q* z% E switch $feed_mode {/ g# G' r. e" d1 f/ e9 Z" r v& X4 `
IPM -
8 @3 g0 f/ A0 n/ d. I9 Z MMPM { set feed $f_pm }
, X& e, y b# k5 q3 U' J& A' G IPR -: Q, Y) Y& a1 U/ b5 [- E$ O" Q- {6 O
MMPR { set feed $f_pr }% N$ @* t+ e5 S5 K8 ?. z' K7 U+ O3 G
DPM { set feed [PB_CMD_FEEDRATE_DPM] }$ r5 u: r. ^; G" b
FRN -
) R2 r! o3 Z/ w: s- D INVERSE { set feed [PB_CMD_FEEDRATE_NUMBER] }, Z) u% S$ ~( \/ f0 N" C% O) l
default { set mom_warning_info "INVALID FEED RATE MODE" ; MOM_catch_warning ; return }: j) R( |7 Y! {. u, E h9 K
}
. O- g7 [9 P/ L x, u$ c' {6 C. f; q) c. r
_; w) q( o* n5 i6 X# Post Builder provided format for the current mode:# V: K* c; [& {) I
if [info exists mom_sys_feed_param(${feed_mode},format)] {
6 u- y/ s( k# F* q& P MOM_set_address_format F $mom_sys_feed_param(${feed_mode},format)
1 l, K/ M1 O; T } else {3 `; T+ k( Q$ T
switch $feed_mode {
2 l5 ]. d) ^! Y! B: l3 u$ P IPM -8 x- s2 i6 s2 k' \
MMPM -: v$ }- q2 M: \7 Q+ f' M$ A
IPR -2 {5 z+ A& _4 s# W( A( v& F6 C
MMPR -- {! u' A3 j5 R- N5 c; r4 K8 o
DPM -
4 Z' T6 [3 A% D6 l9 a FRN { MOM_set_address_format F Feed_${feed_mode} }! Y7 U$ L8 `+ ?" B- \; o( u' Q
INVERSE { MOM_set_address_format F Feed_INV }. @4 W! ?; r) z$ b) w
}
& j: {/ o$ \, l$ ~" k }
5 Y6 U2 e9 x1 @* g }" t# ]2 Z: B+ ]) ]/ X" n% ]1 B. W
# Commentary output
4 V0 H/ ~, o" E2 n set com_feed_rate $f_pm
% Q( X4 G1 U( J& w/ I. \+ V
& s5 {( G2 X" c* N/ R9 S* K% C, o9 f3 ~6 w
# Execute user's commnad, if any.
1 w5 G: K( I0 _* K! O if [llength [info commands "PB_CMD_FEEDRATE_SET"]] {. `) G% Q* p: @/ C7 e4 [3 M
PB_CMD_FEEDRATE_SET9 _0 d i v% l1 y( [* j
}
) c& ]6 E0 V0 f) ^. x}0 J/ T, E& D6 o! ~
, q: _7 `9 ?$ N5 P2 Q, F$ c
6 s" _% l% t. l' E( _#=============================================================
9 F+ z0 O; b# `: h) dproc PB_CMD_kin_init_mill_turn { } {
+ B+ ?3 T+ L9 ]; u% X#=============================================================% |7 {8 e3 x$ i
}2 |8 k& k* X, Y: F B6 ]
5 O) [3 H( P: Y. z8 D/ l* G" `8 v1 O, i
#=============================================================
$ F" Z( J+ T7 I1 U8 n+ bproc PB_CMD_kin_init_mill_xzc { } {9 y/ U: D) J" \% A$ a* D0 N% c
#=============================================================" k" d, Z1 t$ [; v8 h% n
}
s9 N( _5 U0 X5 \; A4 {& c4 q3 k
4 y% [3 H1 g$ ~1 }9 d
#=============================================================
- c1 j6 A$ K* P! nproc PB_CMD_kin_init_rotary { } {
# d: a/ ~: b* F) R$ t( t: s#=============================================================
% N* I7 F& M6 y' n}# }+ z' h. e- Z) a& U `( X B
7 N, }& M; N' x" F0 f
6 F% n: D3 A% U5 y" x) s9 N#=============================================================0 d' P2 t$ U2 K/ z4 ?4 V
proc PB_CMD_kin_linearize_motion { } {/ j+ n7 d h5 p, g( e
#=============================================================
4 h6 S. ]$ m0 N# }8 Q& g}
- l% f2 e/ c' d0 \+ C7 I) d3 ]- X* \
7 @& g' K, X; o1 A; c, e6 P9 f0 i9 D#=============================================================
% L# r$ F7 a* b1 p! J Iproc PB_CMD_kin_mill_turn_initialize { } {
3 W5 U8 s7 Y4 A3 H2 t |/ e#=============================================================# t, g k# @2 x4 P, h- Q7 S% ]( U- G. B
}/ ]+ s2 h6 a& `
{- ]' ^- M# }2 n ^) h% S o, V- j
#=============================================================
# R5 c, |; `, g/ p; C: Z qproc PB_CMD_kin_mill_xzc_init { } {, r- i9 y1 G) U$ v6 l( [, G! w3 U
#=============================================================
5 R% w3 |$ d# ~: E}0 [0 x1 I8 s; ?# h) r
" w: @4 T. W( E2 L/ i+ T1 Z5 F# _# E
#=============================================================; z' d- R' A0 M/ s, w. V
proc PB_CMD_kin_set_csys { } {& P: H; v1 n: Y. r
#=============================================================2 P- Z/ G% @/ L$ ^
if [llength [info commands PB_CMD_set_csys] ] {
2 i. T7 `6 `9 o8 d2 f4 W4 p PB_CMD_set_csys3 e/ {2 G9 t7 ~
}
$ q8 s8 A& @4 P( ~}
( n, G( e3 g6 b ^8 {) `7 n) @# y3 |+ G) B" g8 S
$ s8 `) \$ Y4 [% H7 `; V: D#=============================================================
4 P. Y; U+ x& B9 F: \4 ~proc PB_CMD_kin_start_of_path { } {& Z% ^; S; u, X& O$ ^
#============================================================= `9 S F7 O" |1 }9 ^- B
#
4 Y* ~( u1 \9 u" c7 J# This procedure is executed at the start of every operation.
( n# S! B4 S! V/ s# It will check to see if a new head (post) was loaded and
9 _5 x% Z1 @0 I5 _8 a3 ^* Z# will then initialize any functionality specific to that post.- U" z) j; z/ m* I/ m
#
) d8 i4 i$ v* P+ h$ T/ F" E: ~# It will also restore the initial Start of Program or End' M% S* V0 x& f; ~& x
# of program event procedures.7 K4 q5 u7 X7 z
#2 S% }: Z4 w) m
# DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING.
8 u4 I% W' G8 k4 t0 Z% p: I& o2 C# DO NOT CALL THIS PROCEDURE FROM ANY OTHER CUSTOM COMMAND.$ \0 r9 t' _1 s% j) N& u7 L3 m
#
( I5 Y4 T& P1 S2 Q global mom_sys_head_change_init_program
, J% ~0 z" k" @ F K8 `" k! ]& ~) K$ F7 q
if [info exists mom_sys_head_change_init_program] {
% d. p- @2 Q: A% ~; W$ M# ^2 @0 [& {* A- k
PB_CMD_kin_start_of_program
. p4 f% @' V1 }. L, C unset mom_sys_head_change_init_program* G2 q. U+ `2 ?* W0 t
- S6 L5 x' Z' g. x
# Restore master start & end of program handlers
: ~' F M( p4 m8 w3 T if [llength [info commands "MOM_start_of_program_save"]] {
6 |' i/ i. J- N5 h4 z, S if [llength [info commands "MOM_start_of_program"]] {
% t/ E$ q6 h* ?4 k4 @ rename MOM_start_of_program ""
0 o6 t& N2 B/ b. D }: w7 ^$ O( O( q: U) R
rename MOM_start_of_program_save MOM_start_of_program * j2 o# X( G4 z u5 E+ Y
}* R3 l5 v* b0 V4 A! H
if [llength [info commands "MOM_end_of_program_save"]] {8 Y# D9 a6 Z, }4 ?
if [llength [info commands "MOM_end_of_program"]] {6 x: b; R3 u1 f1 S1 `3 C
rename MOM_end_of_program """ I4 |7 q% s: o$ V2 A
}& Q, {( N) w' B2 k! d; Q9 l# |
rename MOM_end_of_program_save MOM_end_of_program
- F2 a! Y7 U T) U% `( P- P }
7 _$ A2 M8 S. l) z8 ?% P7 E6 T& `0 x# _
# Restore master head change event handler
3 B2 h' A2 q( a$ f6 Y if [llength [info commands "MOM_head_save"]] {* B2 z3 Y' l4 {3 }* ^- H$ O
if [llength [info commands "MOM_head"]] {
* {* H* }1 Z6 \& o6 g0 e* F rename MOM_head ""
- J- K) g. s5 F9 w& v b6 \6 m2 m }
3 @5 J8 u; ]% g/ \0 _4 l% h* c8 J/ E rename MOM_head_save MOM_head
7 `: D$ R# h5 g" E }/ h* Y( P0 m! R: o9 Z6 f2 j" x$ S
}
/ q+ r' H5 y; i# w {! H: x}
8 v$ P! y1 R0 P1 \! u6 m7 I! N! i# s' q; T+ @
5 ~; O* z6 G3 F4 k, a, P& X
#=============================================================7 G9 D$ }9 S8 e7 t
proc PB_CMD_kin_start_of_program { } {8 J" c/ _+ D* ?- `. p
#=============================================================/ J( |; @! P9 _8 k
#
, c8 j2 U2 Y7 ?# This procedure will execute the following custom commands for
" L7 u. n& Y, B* I+ c# initialization. They will be executed once at the start of
+ }5 S; s; I+ _& h. _0 Q. U# program and again each time they are loaded as a linked post.
' ^0 z( s& M4 E1 \# After execution they will be deleted so that they are not / K7 W6 `1 n) R
# present when a different post is loaded. You may add a call 5 P3 k" K: |! T
# to a procedure that you want executed when a linked post is * L4 Y: Z$ O1 _/ J
# loaded. 0 X, e7 c3 u* P- x' X, `. Q
#
7 D( U4 y, c# J. _# Note that when a linked post is called in, the Start of Program# I5 p, c; V( }) U
# event marker is not executed again, only this procedure./ I. p) I3 \" _; `) q5 h
#8 g2 o( j6 l- r1 o0 ]0 U
# DO NOT REMOVE ANY LINES FROM THIS PROCEDURE UNLESS YOU KNOW
2 C' s( C% h0 a( B8 V# WHAT YOU ARE DOING. DO NOT CALL THIS PROCEDURE FROM ANY9 d2 r6 w I4 i( N5 j4 @
# OTHER CUSTOM COMMAND.1 E( e( t7 U5 u
#. J% T q, T3 Z, ~' g
' w$ R, |) m% R( n0 ^) t4 `) C/ I# k
global mom_kin_machine_type
! `+ |2 w0 `" G, |, l" I4 E. q. v7 Q
set command_list
0 X4 ]0 K# t0 ^, g' s1 A& f" p+ i/ X' i
if [info exists mom_kin_machine_type] {. v% J4 ~0 v( V& o8 Z
if { ![string match "*3_axis_mill*" $mom_kin_machine_type] && ![string match "*lathe*" $mom_kin_machine_type] } {
, T7 p- @1 c: q q2 t# k1 s! D! R9 L0 v
lappend command_list PB_CMD_kin_init_rotary
) g/ L& U1 e. h }! L: ]% S$ }+ H' E$ w; S
}
F( ~2 |( ^4 Z/ r) c( T' o7 A( j" t, q# p) n. W( m' n! T2 y
lappend command_list PB_CMD_init_auto_retract1 E) M( O% z6 j) P4 `2 G
lappend command_list PB_CMD_initialize_parallel_zw_mode
$ c* ~7 H3 U" S lappend command_list PB_CMD_init_parallel_zw_mode
. n3 ?- u9 H, ^0 h; q t lappend command_list PB_CMD_initialize_tool_list
9 M1 f6 h6 X E7 k lappend command_list PB_CMD_init_tool_list
$ E6 R% K7 ]0 d7 S& H" p- H lappend command_list PB_CMD_init_tape_break7 I; q; p. H/ T
lappend command_list PB_CMD_initialize_spindle_axis. C6 R6 A8 O* p
lappend command_list PB_CMD_init_spindle_axis
( F" o. o6 j: r, z% ?& ]1 z lappend command_list PB_CMD_initialize_helix
1 w" H3 V0 B- t* L- Y4 u$ m- x lappend command_list PB_CMD_init_helix
, O- p# m/ Q. ~6 p" X) u6 ? lappend command_list PB_CMD_pq_cutcom_initialize9 x3 w1 U5 b# V4 t) }
lappend command_list PB_CMD_init_pq_cutcom; z K; f4 ^7 U5 I
0 y8 y0 r0 [ m# V$ w2 ?0 f if [info exists mom_kin_machine_type] {. I4 B: d% e0 S- C* n* w
if { [string match "*3_axis_mill_turn*" $mom_kin_machine_type] } {/ q' I0 X' h/ F
9 h g l3 ?7 r0 t7 v, H" e3 k" c3 `
lappend command_list PB_CMD_kin_init_mill_xzc
2 C, O8 H* k3 d& v4 _ lappend command_list PB_CMD_kin_mill_xzc_init
$ U: ]5 I# [& ]* ^- @ lappend command_list PB_CMD_kin_init_mill_turn
# m% t. C0 ^* c7 c& S lappend command_list PB_CMD_kin_mill_turn_initialize
- P( ]7 n2 @3 Z9 M, J" d7 l; ] }
1 D2 A% D R! p: f" ]' f }- `' t7 K4 I( w3 R6 G
9 w; {5 Z4 \0 g
foreach cmd $command_list {! P. l4 i7 y) U+ ]( ~
4 ]' S Z# I0 ]1 D: p; r) ^ if [llength [info commands "$cmd"]] {; C5 a, c1 g8 |& Z v1 h7 E2 T% u
# Skip execution of commands that exist in v2 mill-turn posts.
' ]& Y4 U$ o* N) \ switch $cmd {& S: U0 [2 r! n) J, d: a
"PB_CMD_kin_mill_xzc_init" - K( a5 `" S1 m7 g
"PB_CMD_kin_mill_turn_initialize" {}
# ^6 b0 J, L, h default { $cmd }6 r2 ]( \) L5 j4 @/ K) ?/ t( \
}
2 G! C# H% ]4 D" ^$ [ rename $cmd ""& @8 f: E" w2 l# @' o# f
proc $cmd { args } {}
! E! C0 Y; o4 f7 | }! P& z8 h+ J: h: J( d) V5 L
}7 m( e u$ L. u! g* A, ]* B9 V+ k
}
6 `& ]! ^5 w- x3 y/ S
- d r$ O9 F" J& R4 F3 i
/ U" P: ^: W7 H#=============================================================
( G5 [# ?6 V9 ]# C" jproc PB_CMD_kin_wedm_engage_move { } {6 ]# y+ j/ z! ?- q$ ~" ?( l8 B
#=============================================================
9 I: j5 @. F5 F! ~#$ T0 ^, j7 q3 e6 ~
# This procedure is called automatically in MOM_before_motion5 o" Y) G# \6 q8 @
# to handle the Engage move for Wire EDM operations.7 W7 T: T" u! q: s* ~ c: o# H
#
$ I3 j% ~% ^8 u1 M* a global mom_sys_start_of_pass
3 I3 O: G3 ?' O) m
& x- v5 E V5 B if { [info exists mom_sys_start_of_pass] && $mom_sys_start_of_pass } {% ~3 _; ^" w9 k, r5 s
global mom_lead_in_cutcom_distance1 u2 o% ?0 f8 O9 f' r
global mom_lead_in_method; A, e( Z# J7 U0 P- h4 y+ V0 }2 Y
global mom_lead_in_cutcom_angle
: Y$ @* y* N) C, R* t( i! K if { $mom_lead_in_cutcom_distance == 0 || ($mom_lead_in_cutcom_angle == 0 && $mom_lead_in_method == 1) || $mom_lead_in_method == 0} { 9 n- h1 v; l8 ^& `
PB_lead_in_move3 x0 D" S" m. i. ~; C
} else {5 O: g/ E) J' K9 u6 V6 X
PB_cutcom_move
7 ~% j2 W* J0 b, s/ w" T }
$ b I x' W Y: f) n unset mom_sys_start_of_pass
+ A" _1 o! a* B5 P } else {
' p) u: f' v9 _' }3 {8 \% u PB_lead_in_move
$ F) B3 d X6 n. [ }
5 w3 u; |, |4 ^8 ^, ]( r}
7 Y: R% m2 I- K0 R: M/ }
8 o- h& F$ F: [9 U+ v# `
: E" `6 T7 e3 e( ]#=============================================================. L# H# s8 N5 w
proc PB_CMD_linear { } {# X4 G+ C6 _5 f' W; e9 I% j, ?
#=============================================================
+ l J! I& h! C( \' s! }global feed_mode mom_feed_rate
" `' T8 q6 }' I" ?& eglobal mom_kin_rapid_feed_rate
/ I0 i5 s$ n. {# cglobal mom_tape_status
8 d* B% N1 X" h' X( Cglobal suppress_output 7 \2 ?0 w+ u% b+ M! V1 _) i0 R
global mom_motion_type9 H0 i3 W s- n6 j% b$ M8 T9 A
global mom_current_motion
1 p! ^' h' }4 bglobal mom_pos1 q0 |% r3 k: i5 d
global momComplex+ C- g2 q1 d" I; c9 m4 P7 }# k+ s
global momConic& V: m" H T0 [" Z! c1 Y5 L/ ^7 a
& k/ v- _2 S7 P& o/ B
if { $feed_mode == "IPM" || $feed_mode == "MMPM" } {
o Y- Q" }; T5 ~' { if { [EQ_is_ge $mom_feed_rate $mom_kin_rapid_feed_rate] } {; V7 m6 s/ h9 m. f& o
MOM_rapid_move8 D. |& e; b: I* d7 O" M" ]
return% {, w0 b# W/ l- S) K% X
}$ R+ n s4 T' |1 W u4 @
}
7 F4 m6 l5 I5 e2 N# k( I* D- J; s) @
5 {# M4 }5 X6 U3 A' c( T8 Rif { $mom_tape_status == "ANGLE" } {1 D. E# S; B3 t1 e: V3 N& J4 ^
MOM_force Once G_motion X Y . ?3 I X* h$ j h; Y+ n
MOM_do_template linear_move# z! d7 [: Q2 ~ @4 ?# p
return
' D! e2 z6 Q* y0 q: ?: p} elseif { $mom_tape_status == "CONIC" } {
# Y. ?! G& L* ^( h8 c/ g MOM_force Once G_motion X Y
, z( ~/ O3 @) ^" b if { $mom_motion_type != "CUT" } {
( a5 g/ ~4 Z/ R& q& f! n: k set mom_pos(3) 0
0 b" f4 a) ]. ?9 j3 k6 W. p6 l7 ]/ Q set mom_pos(4) 0
/ z2 }! h8 b" q } " q7 ~+ v( I) a- Q
MOM_do_template linear_move_conic
$ |' _, p$ R- Y( x return
/ A. S) m2 l# H" Q} elseif { $mom_tape_status == "COMPLEX" } {
6 C7 R0 _! P6 [ if [info exists suppress_output] {MOM_abort_event}
9 S% Q# ?+ z8 {! O- a0 I if ![info exists momComplex] {
* z) l2 C' y+ i( e* G MOM_force Once G_motion X Y
2 W) L) C \, n7 R; p3 _2 }' _ if { $mom_motion_type == "RETRACT" } {2 K2 Z" }* G _- k& M5 p
set mom_pos(3) 0
: c3 E8 l" o9 i- N: t5 Q4 l set mom_pos(4) 0
; f5 {* ]8 t- k+ H7 Y/ q+ W MOM_do_template linear_move_complex7 n2 s% h4 b" u+ z0 |: u
MOM_output_literal "G140"
5 v+ L( _* K/ d O8 m- V' U } else { 4 t3 v n! j" n
MOM_do_template linear_move
" b) K! r5 E3 z; t7 l9 q }( \9 @; g2 q. u* [
} else {, u/ S) t0 u }9 {1 C6 q: w
MOM_force Once G_motion X Y Text G_motion_upper X_upper Y_upper
, c4 D, c* x+ H& [ MOM_do_template linear_move_complex' z, c) H( j0 _0 L3 K* U, s
}' f" k- C$ l2 V2 S* Z k
return
) r1 A' O6 M* G! b2 Z} elseif { $mom_tape_status == "NONE" } {
: ?& f' J8 w2 M) g MOM_force Once G_motion X Y
# Z! |1 I0 E, q: V) Y `: V- U MOM_do_template linear_move
: S! f6 s. ^9 n. w) i return
5 M* @( | e7 {1 B}: G# m; D# C1 j+ z2 W6 [
}
+ ^" b3 p/ F ]0 \- v" s! R0 P& `" E! ^
- h/ L4 u: O6 b
#=============================================================. q) R. Y T! G: k" I0 L
proc PB_CMD_output_tape_per_operation { } {
3 R$ I0 F: y0 V2 V9 S6 o#=============================================================& e, e7 H6 e6 ^! b6 y& s
#7 r" W$ G# I$ R8 {$ d4 m
# This procedure can be used to output an N/C tape with each operation.
) ~! [; r# e# r# Place this custom command at the VERY begining of the Start of Operation
0 b& u$ o! V. Y- D# event marker.
* j$ M- m5 X6 v( ]! i4 h#
7 v9 i5 l2 L; q8 s2 O: O5 M# This proc will also delete the initial program tape and rename it to
6 x3 q; k3 @; S' e3 E/ o% _# {operation_name}{sequence number}{extension}.- O8 `' M$ u: D) c3 d
# Any N/C code output with the Program Start sequence will be lost.+ s) R' y' n5 q; p: M: t
# , m& S) i: ?5 G. A, E
global ptp_file_name
' L# a: g# e. R+ H! h global mom_output_file_directory
0 P0 E5 \ w" O1 R" \2 E global mom_operation_name
- h6 a7 C' c2 p& m' d# h global mom_output_file_basename
' Y3 s3 ]8 h. Y: _ global mom_sys_output_file_suffix
) ]6 G$ j4 @: h0 ?0 C o
0 [, J: Z1 Q3 r" X9 l#
2 n0 d& a- i; C: b4 z! v# Remove next two lines of code if you don't want the original nc tape
( o; ^' G& F' e3 t# with the start of program info to be deleted., [" [5 l1 D7 b# C7 n4 A( y
#( Q- R& W7 w+ i& x7 P. k
set fn ${mom_output_file_directory}${mom_output_file_basename}.${mom_sys_output_file_suffix}) Z8 k9 G6 l+ a& I
if [file exists $fn] {MOM_remove_file $fn}1 j( V: V4 `: o4 Q5 n
7 A' {2 f+ r3 W0 L0 v5 @
MOM_close_output_file $ptp_file_name
1 L0 ?( O7 K5 N; {% }, k2 r
H! Q# S" Y1 {2 T9 J set ptp_file_name "${mom_output_file_directory}${mom_operation_name}.${mom_sys_output_file_suffix}"
# R; S$ A, k0 @! h( e3 z9 p MOM_remove_file $ptp_file_name) r1 j( {: Z# J a4 |* k' l
MOM_open_output_file $ptp_file_name7 u2 J) q$ a9 ?# D, @
}7 G) P q. O8 ]+ i; w6 x
" c$ G* X2 P( @
) ~1 p* F$ i* Y. r
#=============================================================9 {% v, m( k p2 a
proc PB_CMD_pause { } {
7 @ h' ^( e$ Z8 y6 D- S: f$ ?#=============================================================& ~; m8 p/ ~ O! z# z* g- K& G
# This command enables you to pause the UG/Post processing.5 ^) M; q$ D* q% q! e! N/ c
#
: u: N* {2 h9 v( E: f) F x' k PAUSE, ]& g* g. ~& \2 @; j2 ?
}/ M$ |5 `8 v z+ L9 ~& |- R& L
* G4 p9 G; }4 A. g
, m0 _1 [7 m Y#=============================================================4 N; Z, x) E( F" M
proc PB_CMD_start_of_conic { } {
& u+ S; I0 `3 M% }* B) K#=============================================================
3 _# i* {* A+ O9 Y" U+ w6 ^6 J3 Guplevel #0 {. q+ \0 V) M6 T$ E. ~6 W, ~
set mom_kin_wire_tilt_output_type "COORDINATES"% X1 x1 X, j2 S5 \9 g7 n
$ W# S( u9 p: t+ H( X
MOM_reload_kinematics1 P+ @9 M% w, T
5 n( _! d+ \- c7 f
proc MOM_start_of_conic {} {! c: j# z; `, l- F' j8 f) v
global mom_upper_arc_direction
! u. K, m X! O global mom_arc_direction+ p& e5 ~3 v, j- ]% G% k0 B: o
global suppress_output
1 b8 i4 J O7 i9 z6 h global mom_prev_pos( U3 q& ]9 A' e
global mom_conic_motion_type1 [0 Y5 w# J( J) j
global mom_tape_status! |& \; z! U( Q2 K" D* P
' P) {9 [5 W" p: W2 q set suppress_output 1
5 O6 O/ @' {+ V. A; K/ n/ | if ![info exist mom_upper_arc_direction] {set mom_upper_arc_direction CLW}
/ b) G+ ^: I1 M, n9 e6 Y& N" E# i3 e, F6 D
if { $mom_conic_motion_type == "LINEAR" } {- b' P7 S8 c$ Q( u# G
#if { $mom_tape_status != "COMPLEX" } { 5 |/ r: y" {; E6 Q1 L
PB_CMD_linear7 J$ a; f% \7 D( \9 S1 |
#} else {2 \ _( G4 ~& b8 Z) n. G7 i. [1 t
# if [info exists suppress_output] {MOM_abort_event}
& V" C) G! f' X2 A$ E7 [ # MOM_do_template linear_move_complex( K& `1 B9 G- k6 Z" O
#}# p/ t1 ?5 {. O# @6 D
} else {
$ s! u, n: y* S PB_CMD_circular
' h% ~) A- Q/ U3 m # MOM_do_template circular_move_complex: c* j7 L# G+ V6 @' ?, K- n2 s
} % }0 s/ m: p E) `* j
}" Y. N% ]$ z/ k% n6 K
; B6 A& ^: p. G
proc MOM_end_of_conic {} {
( m- Q/ |. y* P% r: {/ d: `0 ] global suppress_output$ t- K* ^9 X3 A6 Z
if [info exists suppress_output] { unset suppress_output }
) y! N1 z" @1 Q2 I1 y3 Y# _2 @4 S }
; B3 M* c0 l7 @" d}
% N. @# V2 B* ?}
. ?/ ~) M+ _2 m2 `+ n9 Q3 s; `/ B! l& K! R3 R2 {. d: ]
/ q7 m& j4 d& t; t/ c
#=============================================================
# Z8 w! q4 h5 F8 H1 S1 p6 u2 }proc PB_CMD_start_of_file { } {* e2 D0 l: n" L2 p2 U2 Y
#=============================================================
) C; E+ K) e( @global mom_ug_version& ?* [1 R6 |2 B2 a5 E! @1 s4 }
global mom_event_handler_file_name: C3 x% S& w6 K/ L8 }
global mom_path_name
* _8 \% R' }& f; }3 D2 t3 Qglobal mom_part_name
* @ e5 O( }0 D! r1 p; @$ ^global mom_output_file_basename. @3 G+ R% w3 z, C# k; n+ j
global mom_output_file_directory
! n0 I/ ?/ J jglobal mom_output_file_suffix1 t3 A$ C' a" Y$ e/ o* Z, j9 }
global mom_logname
( b5 }0 b& h0 Sglobal mom_date# q" Y% g, e: {2 r
global mom_machine_mode
+ L& {1 {$ E$ E1 E4 w* r' @global mom_power_value
: n0 A, `/ S% hglobal mom_auxfun
4 ] m( F( c" I8 K2 {global mom_wire_guides_lower_plane
8 \& ]6 `- W6 g$ rglobal mom_wire_guides_upper_plane
. C. G7 h6 K- S+ u+ lglobal momPathLength6 r6 l& C( |9 c3 z. K
global momPoster
6 H7 E1 [( o2 Q8 r( p7 V& Wglobal mom_cut_type
: \ [( [' D4 O8 \global momWorkstation
7 @" Y6 w9 Y9 h. G ?5 T/ ]global momLogonDomain
0 y, Q) O; I; Y0 }5 c7 M$ c1 k* S6 Zglobal momPathNext4 M5 m! H) H1 t3 V. F
global mom_kin_machine_type8 e, l1 A, }( P0 N: c
global momComplex+ ~ ~. w; q6 a0 L
; C; j: n/ u' Y9 F w
MOM_set_seq_off
( T/ M; G5 a2 `9 [+ g/ p+ A: }
% T( z; Y. [6 `set momPathNext 1001 j! o" O$ z- D4 x8 R
MOM_output_literal "( Unigraphics WirePost for Cheewah, Ver 1.1 )"
% v& P1 ], e9 X( jMOM_output_literal "( Design by Deaton, 2005/09/19. )"" k8 g/ }4 C, Y1 S& [
MOM_output_literal "( Email: deaton@21cn.com, Tel: 13923361400 )"
1 N4 P8 ^/ S+ q' E! w& N0 s+ A9 [set momPoster "CMDEATON"
- R$ J! j& S$ q9 j$ Uset momWorkstation [MOM_ask_env_var ComputerName]
; r" S) |/ D3 G2 u8 {set momLogonDomain [MOM_ask_env_var UserDomain]* p1 A1 h. i* }8 y9 I8 T
MOM_output_literal "(================================================================)"
9 ^/ i8 ]$ `9 m6 ]: RMOM_output_text "( Activate Version: $mom_ug_version )"7 d& W: {' J4 g
MOM_output_text "( PostFile: $mom_event_handler_file_name )"
6 j4 X( Y1 b: j5 d8 g0 G/ _MOM_output_literal "(================================================================)"
8 Z, K& w" H" |$ E& p8 m, [MOM_output_text " "& ~$ L! C4 M9 m& p* s- m: E, a
MOM_output_text "( Current Part File: $mom_part_name )"9 M8 Q+ j# c& i7 b7 N2 B( F# B! r) x
MOM_output_text "( Toolpath: $mom_path_name )"* |4 X/ }+ n1 E
MOM_output_text "( NC Output Directory: $mom_output_file_directory )"
: z0 F! ^0 T0 W0 _5 P' tMOM_output_text "( NC Filename: $mom_output_file_basename.$mom_output_file_suffix )" q: E7 T! J* I; Y# g" X, P3 }
MOM_output_text "( DNC Machinical: $mom_machine_mode )"$ R& W* ]' A9 F' b5 Q0 t
MOM_output_text "( DNC Machine Tool: $mom_kin_machine_type )"' [0 j7 W% O3 u. H W
; \; T8 t9 w, l0 q" ~* T+ w
if [info exists mom_cut_type] {
! n" f8 Z7 ~9 y( a. T switch $mom_cut_type {# p' y& W& e$ S1 P- ?. Z y
0 { MOM_output_text "( Toolpath method: External Trim )" }; O+ F9 D' q; E/ h: X
1 { MOM_output_text "( Toolpath method: Internal Trim )" }
& ]# R0 _$ `# d8 }+ h( Q 3 { MOM_output_text "( Toolpath method: Open Profile )" }
3 N N6 g: o ~1 x ~ \8 {5 e }5 g: t) Y4 Y- R. \( N: L. I
}
" k8 Q/ H8 f/ [* }. Z7 d: g' y9 ^" S6 A( y# p
MOM_output_literal "(================================================================)"
5 l4 P( _# \3 L6 J* e4 YMOM_output_text " "8 j8 e/ b5 ?1 M) t2 d& T% M
MOM_output_text "( CAM Workstation: $momWorkstation )"
" t. O( L4 c" E( D" BMOM_output_text "( NC Programmer: $mom_logname )"7 p2 H* I7 y; k5 c! V1 w
MOM_output_text "( Logon Domain: $momLogonDomain )", Z! y+ c! J8 K) T7 m+ E0 p
MOM_output_text "( Post Date: $mom_date )"* J6 C- h) f/ W: b7 z1 U. q
MOM_output_literal "(================================================================)"4 z! [6 e) x. h! L
MOM_output_text " "" O, j7 z) L( s4 X' M7 g( _# n
5 m: C4 e, {& ]* c& t& b* uMOM_output_literal "(NO = ON OFF IP HP MA SV V SF C WT WS WP WC)"
# G) `0 ^" V0 ]$ D. ]0 p) y, T2 _MOM_output_literal "C001 = 005 010 017 001 14 05 02 0004 00 000 000 000 000"1 C$ q: n7 t& e& C! L. h( Z' ]) j( _
MOM_output_literal "C991 = 004 015 017 001 17 06 02 0005 00 000 000 000 000". B6 {4 ^' l5 c! k( P) r3 q
MOM_output_literal "C992 = 000 019 017 001 19 05 03 0006 00 000 000 000 000"
3 n' l* y( W$ h/ h9 S# \! IMOM_output_literal "C993 = 003 016 017 001 17 03 03 0005 00 000 000 000 000"
4 |2 N* {" z8 zMOM_output_literal "C997 = 005 010 016 003 12 08 01 2004 00 000 000 000 000"; K; H* B, C6 v3 k, D# \
MOM_output_literal "C998 = 002 002 015 000 00 04 00 2004 02 000 000 000 000"
0 ?; I2 [8 C: F" B8 a& K: C1 ]MOM_output_literal "C999 = 005 012 016 003 12 05 01 2004 02 000 000 000 000"& { K3 C0 o8 J
MOM_output_literal "(================================================================)"4 y+ I1 R, o" o3 b5 \3 K- F) o" {+ @
MOM_output_text " "
9 h& \* @3 I+ n) s* F' k" c2 }$ L& R# c/ d! g
set momPathLength 0( p: k- }& M& ~# F4 l% u3 o
$ h4 E z; e* V* ^+ x
MOM_output_literal "G40 G50 G09 G75"
1 S4 u4 ~* a% `% bMOM_output_literal "G90 G11 G21"" V8 ]) v6 p' C4 O% L0 v
MOM_output_literal "G958"7 R, L3 B1 F! |' X
MOM_output_literal "G04 X+2500"
' B. i" g9 v @MOM_output_literal "G92 X0 Y0"
6 \ Q" D( A7 f: ^- O" I6 ?MOM_output_literal "G54"( W8 M2 Z$ {! L$ _ F/ I
MOM_output_literal "C890"! P4 M, x' s; `* s
MOM_output_literal "(================================================================)"/ k0 L- Y9 g [* Z% C2 c6 j4 y
MOM_output_text " "
2 b9 r; t% Q U6 x}% U! Q' C/ U; u1 {- Q
5 @- B& U* R7 a3 A5 | o* I _. M% n. V
/ S: e# A9 j7 a- @: d7 z# v! n- z. d T
#=============================================================, o3 H7 j5 a) w3 k! ^ q* _! I: Y5 a
proc PB_CMD_start_of_pass { } {
+ G1 V+ e" u# u#=============================================================
7 J2 ^' E8 ]6 S/ j tglobal mom_wire_guides_lower_gap
3 [ I7 s Q( Jglobal mom_wire_guides_upper_gap
5 E6 F. `* z8 j% s, wglobal mom_wire_guides_lower_plane
& \4 U5 j M4 }* Sglobal mom_wire_guides_upper_plane: T2 ]2 v+ ]4 q2 B8 J* f
global momPathNext: z7 A/ W& U( ^* Y2 x- p- _' a
global mom_tape_status+ n& j* _0 X$ f+ N7 _& r/ S
global mom_wire_angle_text" N6 ?- Y& W9 }+ c' M/ b' d' i
global mom_flush_pressure, @1 } S6 Z5 x$ k9 @6 I! T
global mom_power_value
+ W5 i( _* \* X/ i Xglobal momWorkstation
8 S4 M0 d. C. Bglobal momLogonDomain
, t7 ^% I) z6 E# wglobal momPoster
# \# I9 N5 S& o+ R0 vglobal mom_sys_cutcom_code(LEFT)% P6 e- x6 i1 f! ?* ]
global mom_sys_cutcom_code(RIGHT); j+ \4 q( H8 Y o; r8 H
global mom_sys_cutcom_code(OFF)/ g/ E2 R, b: a$ L
global mom_kin_arc_output_mode
/ C6 d N7 K- E. _% P4 W4 U8 ~global mom_kin_wire_tilt_output_type( ?4 [, T8 F: a; z' i
global mom_wire_cutcom_adjust_register
H1 Q+ D8 s' [( I: Nglobal mom_wire_cutcom_user_register) A: x4 g, j& ]
! i/ ]7 `$ Q$ ^: K" Q
if { $momWorkstation != $momPoster } {
4 x/ r/ I0 N! _9 b- @4 W; f5 s" i MOM_abort "Error occurred. No workgroup can be access, Postprocessing has been aborted"4 t/ H( b8 F: q
}
8 e$ j5 {# ?; D: P' I1 sif { $momLogonDomain != $momPoster } {+ \& E6 v0 @5 G' K+ [' q+ a+ ^; c
MOM_abort "Error occurred. Post server isn't supported, Postprocessing has been aborted"
+ m. M+ P, J( |& p" Z- R. I j# ~}: Y& w' ^( A$ W, T9 n; R
if { ($momWorkstation != $momPoster) | ($momLogonDomain != $momPoster) } {
/ A+ c& _, R2 T7 n MOM_abort "Error occurred. Postprocessing has been aborted"
0 l% o A5 e0 `2 i6 ]! b}7 n. i9 I3 v' [2 |
" l. a7 q4 [+ n4 q) e+ `2 ZMOM_reload_variable mom_wire_guides_lower_plane
! a' W3 C: \6 EMOM_reload_variable mom_wire_guides_upper_plane
+ I& E9 Y( T7 qMOM_reload_variable mom_wire_guides_lower_gap
3 b. |; n8 G8 ~, k; N' c* oMOM_reload_variable mom_wire_guides_upper_gap" n: V6 N5 B! e1 Q
MOM_reload_variable mom_tape_status
* h9 X% R: X4 o" w! {+ B) YMOM_reload_variable mom_wire_angle_text
$ L1 ]8 m) [% ?. w5 i. h& v: xMOM_reload_variable mom_flush_pressure/ I. j$ ~' h" k+ N& ^( ^- v% q' }
MOM_reload_variable mom_power_value
, Y8 Q- P9 A( P: |3 J9 [3 G" ?MOM_reload_variable mom_wire_cutcom_user_register
+ T$ P7 J" U/ o; e) M' z' a& F4 ?
MOM_output_text " "- \+ }, w5 R' V. r; Z" X5 f
8 t( D' Q9 _ O
if { [info exist mom_tape_status] } {
2 q/ I) e* p, T$ ~; x5 v- ] switch $mom_tape_status {
6 k0 g4 a7 u8 k "NONE" {
: k. V, z- v3 r5 D/ C set mom_kin_wire_tilt_output_type "COORDINATES"9 R J' W! D2 x( N: F
set mom_kin_arc_output_mode "FULL_CIRCLE": ]- m$ [4 A! [% O1 f! S$ j+ u
}
* C! x! V# C+ ?. L. @) R "ANGLE" {
' F! `; o* y# k8 A/ ? set mom_kin_wire_tilt_output_type "ANGLES" 5 O& d( }( E' k5 d0 {: d5 R" y
set momPathNext [expr $mom_wire_guides_upper_plane - $mom_wire_guides_upper_gap]
: E8 K3 D+ a5 g set mom_kin_arc_output_mode "FULL_CIRCLE"
0 X! B' J/ I8 d MOM_do_template tpset
: S8 I1 y4 s4 Q* X MOM_do_template tnset
. a6 D% N/ S: `$ \) r9 `# D3 L MOM_output_text " "
& V: \8 ?" v9 X' O" d* i) Y4 U }
! L; U* B" o3 C$ B "CONIC" {
: T5 Q% E. o; O7 ^# J set mom_kin_wire_tilt_output_type "COORDINATES"# W0 V6 q. ]: S0 W5 C
set mom_kin_arc_output_mode "LINEAR"& V: s' d+ Y3 p* ^( n% [" c
# set mom_kin_arc_output_mode "FULL_CIRCLE"
# ?& k: Z# Q+ F% _+ ^ M k& D set momPathNext $mom_wire_guides_upper_plane) m; C% q; ?2 B# R( c
MOM_do_template tpset+ r2 n% |5 C0 [0 o) n
MOM_do_template tnset
6 q9 N' r3 i! Z MOM_do_template tuset$ m A ?6 q2 y4 S2 l3 `5 s. L2 B; l
MOM_output_text " "2 O; d# g+ y, ^1 R( d ^% z
}
- R' B$ ?; `# o1 ?& o* {/ j5 \! S( } "COMPLEX" {
& X# @# O- Y( O4 j( j set mom_kin_wire_tilt_output_type "COORDINATES"
4 ?( b) H$ R3 }9 ^& `8 h set mom_kin_arc_output_mode "FULL_CIRCLE") V" i4 H- r! C! T
set momPathNext $mom_wire_guides_upper_plane
" X" R* L8 \' `" P6 V2 h9 L! r% A, I MOM_do_template tpset
( T$ j# m1 X T7 L! G, j0 ]7 \2 ?6 T MOM_do_template tnset9 e8 U9 ^9 e& M; S1 y4 n8 S
MOM_output_text " "
5 S1 k; \0 p L- E) Q set mom_sys_cutcom_code(LEFT) 141
/ ~* E, [' e! D: ~) |4 L( r; v set mom_sys_cutcom_code(RIGHT) 142% N2 E1 H7 ~/ F {
set mom_sys_cutcom_code(OFF) 140
+ y# }+ m! ]- T! {* m) o& {3 m( a }
" H) ^: G6 G$ V. C+ o+ S }
# C. s; S) K2 [3 c. T x$ H: p}
# h! X+ d6 _2 O6 f" u
) i3 _! V8 o5 H3 U) j* n: Vif { [info exist mom_flush_pressure] } {; X8 \7 F% l9 y6 i# D0 X, g
if { $mom_flush_pressure == "LOW" } {
( x5 J3 P/ v4 Y5 r! b ## Flush off 3 R$ }% h. g4 B! j1 e
MOM_output_literal "T89"/ v" O/ s& y* y/ [$ v3 t b
MOM_output_literal "M00"; C1 a; ]0 m9 c: |
MOM_output_literal "T85"
; o$ `7 m0 r+ g4 L; M6 I) X7 S } elseif { $mom_flush_pressure == "MEDIUM" } {
/ T) q& P9 o) l \" ?, M2 l ## Flush Low with tank
4 f+ i. u4 H9 g$ `2 w2 Y MOM_output_literal "T94"
2 g2 M- G8 I& Z* Q# f Q- a MOM_output_literal "T96"
/ m* `+ }4 R; Y) z; I! Q' B MOM_output_literal "M00"
6 i7 v% v7 ^! r/ B) [- c MOM_output_literal "T85"
- x( F: [' e: x0 G) ? } elseif { $mom_flush_pressure == "HIGH" } {
$ y% w! r& _3 f2 A ## Flush Low with tank1 ]% M1 n% |5 @$ N
MOM_output_literal "T94"
* V% P- ]# t4 Z' j MOM_output_literal "T96"
" ]- x X( {/ y5 ?$ P MOM_output_literal "M00"
! P, t" {1 L$ x2 g! h% G MOM_output_literal "T84"! Z- J8 r4 |! c7 F
}
9 }9 v/ n% d6 Q8 P}
( q# [' u, T" K1 I. [! @
1 k' w( p9 V( j6 x5 t7 V( r* kMOM_output_text " "
3 F' @" R* ]- aMOM_do_template condition- U0 ^8 _9 e& o, |
4 e2 L9 o4 d7 f' o' v/ ~if { [info exist mom_tape_status ]} {
$ k8 R: }( P" D6 F6 U3 A8 L- d! ] if { $mom_tape_status == "CONIC" } {
3 f5 E! k# H# `8 G8 m; A1 s5 ^ MOM_output_literal "G74"
+ H* d0 B2 x5 g$ f } elseif { $mom_tape_status == "ANGLE" } {+ c& g! p! ~4 E2 W. t- e
MOM_output_literal "G51 A0"( u3 m& [1 X% a2 W: |
} 8 E$ E$ E" L0 ~
if { $mom_tape_status != "COMPLEX" } { MOM_output_literal "G41 D000" }
4 n2 O( ~& ?# Q) g; D} m6 m+ O9 g: |# q9 w0 [9 D0 \5 T
}
: T- ?' ^; J4 G! R' L4 `
: D3 U' X/ C! ]8 h. T+ i! P6 J% M
#=============================================================' P( C5 G N: X% d5 D
proc PB_CMD_start_of_program { } {% f6 T( f% T+ c+ F! E3 I# |8 @' @4 a
#=============================================================3 i/ u. Y2 e a
global momWorkstation
: K+ r- s, d- ^ Cglobal momLogonDomain
( t5 h) H9 b5 R' _ c/ Uglobal momPoster: M B8 Q( I( t. V) r+ {
global mom_wire_guides_lower_plane' ^* D8 H! b$ c1 K+ _. \) w9 ]
global mom_wire_guides_upper_plane
0 a8 O1 G, D' A5 S( p3 n; l1 k4 a6 e$ K% p. B5 j3 b
if { $momWorkstation != $momPoster } {7 P; R( B b \9 k, X
MOM_abort "Error occurred. No workgroup can be access, Postprocessing has been aborted"% r% \" m8 ]% O1 H: q! c. y
}# y9 f @7 X8 Z! r
6 n0 g; p+ h0 ~9 V7 K1 a3 _if { $momLogonDomain != $momPoster } {
* f t' z0 M, A/ t( { MOM_abort "Error occurred. Post server isn't supported, Postprocessing has been aborted"
# }* K8 m) ~, E9 j8 O}
- o6 ^5 K/ A+ x% R
3 g1 V( S! C3 \* d3 [#PB_CMD_start_of_conic
. b0 I7 Z' W& i1 f4 j% R
- T7 A& c- u- x" B; N9 hif { ($momWorkstation != $momPoster) | ($momLogonDomain != $momPoster) } {
$ C1 M" H. k: o& X( ] E MOM_abort "Error occurred. Postprocessing has been aborted"# H0 T/ R, R" ]* o
}+ p/ U& R4 |/ @6 g/ ?" Q
}
* [7 R/ ?1 {. K Q
3 v- U6 Q6 R3 |5 p# G7 A- x% b0 o0 G6 [
#=============================================================
/ z, h* m: H! q2 {proc PB_CMD_suppress_output { } { ?% T1 b( g3 R- o# Q
#=============================================================. S7 n4 w4 u5 u5 O: x
Y4 ^" F' @5 X& x, }3 A' c
global suppress_output ~" U; ~! v) t: @ r
* V* z7 _7 i9 z, J+ n4 p' Pif [info exists suppress_output] {MOM_abort_event}
7 J: h0 ]7 |" j9 J9 A$ A* e}& M* w: r; K( I, ^: s4 T/ [
1 G7 J- b* g7 J7 E5 K/ N, d" o& A; Y/ X/ T3 f+ |3 h
#=============================================================
9 I8 {. \/ W3 K3 D+ Oproc PB_CMD_work_coordinate { } {
- }) n8 ~6 B, v#=============================================================
' P# F* J% x& k/ u. {0 I8 |global mom_work_coordinate_number, `' X2 J c a
. u" ~; |. a% B& k ?MOM_reload_variable mom_work_coordinate_number; t6 @+ c" D8 ~" Q
MOM_output_literal "G90 G$mom_work_coordinate_number"0 s8 c! I0 b5 f% x8 Q
}" U# p" H0 p. r/ [" x& z
- t6 p0 P4 K8 J; Y# C2 a; k {
, `! V8 ?5 ~3 K: ~ T
#=============================================================
- Y; p7 ~' N$ J# s! U( Sproc PAUSE { args } {3 Q) q7 |$ ~+ H2 G _3 s( g$ n
#=============================================================
( `9 G# v [9 y global env9 _3 N# W! l: f9 c n
9 ^5 a8 j! m7 b5 ~- c
if { [info exists env(PB_SUPPRESS_UGPOST_DEBUG)] && $env(PB_SUPPRESS_UGPOST_DEBUG) == 1 } {
# `2 Y/ V/ B: k7 f( Areturn
! D, T- a# g" | }
4 n, V: J8 T; a1 u% \% j
( f2 a- b3 a' w7 a! j* G0 `
" G1 v; g, a9 N# q: R* ? set cam_aux_dir [MOM_ask_env_var UGII_CAM_AUXILIARY_DIR]: i. Q. S8 ]- j& W B0 \! J
4 ]$ Y" m% p9 i# a9 |
global tcl_platform
H1 P! v# Q: a; M5 ?7 _; w# t, q6 B/ p) @( G! K- k
if [string match "*windows*" $tcl_platform(platform)] {+ k' h# `5 }; u, J/ C' P$ p/ E
set ug_wish "ugwish.exe"
- c( U; v) a9 G+ B# U; M. V } else {
0 y: V: k/ n- k# F5 v2 U set ug_wish ugwish* w- K) \. R- A7 |' u- f
}
# R5 W. W- Z3 c- G: Q" [3 i# x }7 x' s: }1 ^: c6 V
if { [file exists ${cam_aux_dir}$ug_wish] && [file exists ${cam_aux_dir}mom_pause.tcl] } {
v9 i& H; A9 B4 f' }- y a4 T' N! B" Q- h
set title ""
$ e \" F! \7 y& R1 J9 W set msg ""7 u9 n9 v' Y5 m6 q- \: }
* f8 w3 w* v9 F! ^) e( X
if { [llength $args] == 1 } {# K3 \2 b. o6 h c. C5 {
set msg [lindex $args 0]1 M4 b9 d9 ^6 d& H
}
+ |. D6 l0 ~) B8 x* n" y
7 u4 n0 h3 ]! u1 B2 @7 Z if { [llength $args] > 1 } {0 \ }& O& {% m8 c: g1 D
set title [lindex $args 0]5 z* L; x% ]9 N, y! `) Q% Z0 r
set msg [lindex $args 1]
; ^ P/ J; S1 e3 V( l4 g" v" w! A, a2 L }: U H- y% }! x, H# c
; S/ x* F6 k) H) V- f+ | exec ${cam_aux_dir}$ug_wish ${cam_aux_dir}mom_pause.tcl $title $msg& S: o) [& E+ T" b
}
( L; D% R, t1 X$ i' ?. O7 f& y4 E}
/ X! L7 T& `- E7 ?
7 i% D. W! f7 h, d1 d1 O
: Z* a* p o7 \; c#=============================================================/ Y# c( x% Q2 B
proc EQ_is_zero { s } {
. O$ p: f. V; `) B7 T) d$ a#=============================================================% P4 S# J1 }& m! c8 l6 ~5 _% Y: o& R
global mom_system_tolerance
% o K4 t' f' \5 Z9 a) k$ `
9 e8 X3 h' @& \' d$ ?, J if [info exists mom_system_tolerance] { I0 S5 x6 T0 Y. R {* h
if { [expr abs($s)] <= $mom_system_tolerance } { return 1 } else { return 0 }
: [) ~" W5 [3 Z A6 o- F2 T } else {
( n% B$ y0 Z7 H return 0
4 x) q' {' K+ ]8 N }
% r) N! r# _8 \}
- ~ M" u* e; s7 C1 I$ ?! Q' Z8 i. Q# _( `4 F! Z
/ i4 a3 `" j. x0 w+ Y) g' } E#=============================================================
8 g0 y# Y3 L) kproc CATCH_WARNING { msg } {
. y, F# {& f% `9 L1 {4 D/ S Q#=============================================================
- ^, e! H4 ?' t& H# Q global mom_warning_info l- D) Q# C( H& J' [$ s. b/ r
global mom_motion_event
8 ?* ~3 x: Y4 U global mom_event_number3 W9 P- t) D: c# l
; m0 Q7 P7 `7 p; {
set level [info level]
/ D" @, n. P* p3 M4 A set call_stack ""; v3 \! p# |, A: ]1 O. R6 v0 @4 y: U
for {set i 1} {$i < $level} {incr i} {
8 }6 I( o3 J; K- m( k8 X/ E& W set call_stack "$call_stack\[ [lindex [info level $i] 0] \]"0 V9 j0 w, F% h; u% R5 a
}
# u+ o7 h2 I, b0 X+ l; C2 [4 ^ set mom_warning_info "$msg ($mom_motion_event $mom_event_number) $call_stack". t5 s* R4 l7 R0 \/ T& p# ?
MOM_catch_warning! N, w4 n4 b: ?
}$ V" x0 d9 h3 d) F! S) \
% ~& C" U/ L( b) B
. W+ ?0 g! R8 t- [#=============================================================
E. @9 V! H7 V2 @ }proc WORKPLANE_SET { } {
2 F8 {1 f- H# K; Q- a#=============================================================
; }8 A+ E% {1 @, @7 \: N9 G global mom_cycle_spindle_axis
5 K. s$ N3 ]7 I global mom_sys_spindle_axis4 V6 Q. C/ o% w* n/ A1 @ X6 T
global traverse_axis1 traverse_axis2
* w0 l1 ?( u9 ~1 v6 m9 y) C y
( W2 i7 F7 a4 h if { ![info exists mom_sys_spindle_axis] } {$ s3 J$ ~& J1 P$ r+ b% G
set mom_sys_spindle_axis(0) 0.0
9 l( B4 m* q1 R2 Z+ y1 U5 K set mom_sys_spindle_axis(1) 0.0. q I) A5 ?$ P% S
set mom_sys_spindle_axis(2) 1.0( A1 L( f, |% T# k; \: U2 o
}
" _# j! N' F+ H l2 J
/ A3 j3 Q' A; i* x5 n7 e4 M if { ![info exists mom_cycle_spindle_axis] } {2 N8 k" f+ i3 s% e) u
set x $mom_sys_spindle_axis(0)
( q/ |+ d. }' q) s& m) O set y $mom_sys_spindle_axis(1)8 k; l9 d6 Q. b/ b' i% u+ |. s
set z $mom_sys_spindle_axis(2)6 P" I/ V, a7 L2 Q4 u+ c' E
- \! H, q7 y4 V3 k. w8 f, J0 o
if { [EQ_is_zero $y] && [EQ_is_zero $z] } {4 E! C. w: h. ~5 [8 d: N2 S4 o
set mom_cycle_spindle_axis 04 E. g; V7 K1 J* S, w
} elseif { [EQ_is_zero $x] && [EQ_is_zero $z] } {
/ g$ }3 J: e0 R. w8 p set mom_cycle_spindle_axis 1
2 R% ~5 J2 O: d- f" ] [" l0 V } else { ]* O5 J- l; c4 ^
set mom_cycle_spindle_axis 2
4 t# b9 Y, }2 l& t: T' P$ ] }
+ m$ g4 ]" z, u; |" C2 B1 t! Q }
$ V) n9 f; s2 A' T; x
8 T$ G6 D( e# @ if { $mom_cycle_spindle_axis == 2 } {2 a* E1 F/ k+ h$ f* @
set traverse_axis1 0 ; set traverse_axis2 18 U; w _9 a3 z' a2 D
} elseif { $mom_cycle_spindle_axis == 0 } {
7 x+ D% X2 u. ?& @ set traverse_axis1 1 ; set traverse_axis2 20 |" v! _5 _* u: o
} elseif { $mom_cycle_spindle_axis == 1 } {
/ W' C1 l- j0 m1 Q set traverse_axis1 0 ; set traverse_axis2 2
9 G6 {% K: ` y- m% P3 v }$ m0 T0 t" T! z5 {* L" D
}5 U) ^7 @' P+ @. h" l* P: E
2 @/ _6 H" u: ~2 a7 @) Q% A5 Q( l
2 U0 s9 `7 ^* k7 k#=============================================================+ j, h7 K n* p
proc EQ_is_equal { s t } {+ h1 R' \4 z) G' t7 H$ \* y8 y
#=============================================================
9 |# f) b/ p; C& k- _! Y global mom_system_tolerance
' z8 E. c- k0 N
6 i' o! a3 R) H1 ] if [info exists mom_system_tolerance] {
4 Z1 U1 m0 M8 C2 W! E# o if { [expr abs($s - $t)] <= $mom_system_tolerance } { return 1 } else { return 0 }
l2 s6 y% y& ^, B" M } else {4 t. \0 J( B1 F5 c
return 0, i* g, f4 r+ M
}9 y7 a) a6 O( e1 Y# K
}
7 [0 G [$ i, V' Z! f% d4 \
0 }; M% c0 D E, i I5 x; N9 f3 L O( X# ~
# b$ i$ }9 U+ |! X( Q8 o
- a$ U6 E% i! j9 z% v% B
/ F# }! E, [0 P0 J- D* o
, k: u) P' |, y& U# w0 q#=============================================================4 {+ p' F+ _ E& E7 ?2 F
proc TRACE { } {. |+ Y, W- k! ?5 N; G5 T
#=============================================================5 H" `0 n0 F8 L! D" m+ x1 B! }7 b
set start_idx 19 `! Q7 c: l* K6 k; `
* j+ b5 \: o _1 y+ L' m7 \
set str ""
5 H) @2 Y# k6 T, K! Z7 l6 N P$ M set level [info level]
: J7 ^8 H _+ \ for {set i $start_idx} {$i < $level} {incr i} {* r& b4 [# e/ x0 C% t+ j3 F
set str "${str}[lindex [info level $i] 0]\n"
% C' ?( W u; X% u$ w6 _ }
" K$ x2 F4 A5 S: C! f
" z" ~+ Q2 L1 U6 V% h4 c% @' Treturn $str6 P+ n( `+ b2 @6 R, n: j# c: H
}
" m7 O* s/ K- {; v. D
$ m/ ?& t9 n5 X8 u
) f `. m" {. L' U( lif [info exists mom_sys_start_of_program_flag] {
. ?* o* \' Q- j# q" g if [llength [info commands PB_CMD_kin_start_of_program] ] {
; L8 b' b1 {" u' o, N$ n PB_CMD_kin_start_of_program) @' J1 o" f. X3 [, U0 u
}
' _, U; U' K, T5 O$ i; l} else {
8 \2 [, Y; U2 n) @ set mom_sys_head_change_init_program 18 J! ]6 B) P9 f7 @
set mom_sys_start_of_program_flag 1
: \% t9 \8 Z, t, @7 p% }& I# `}
|
|