-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBZT_PFX500H.tcl
3543 lines (2767 loc) · 101 KB
/
BZT_PFX500H.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
########################## TCL Event Handlers ##########################
#
# BZT_PFX500H.tcl -
#
# Created by Toni @ Dienstag, 28. Oktober 2014 02:00:42 Mitteleuropäische Zeit
# with Post Builder version 9.0.0.
#
########################################################################
set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR]
if { ![info exists mom_sys_post_initialized] } {
if { ![info exists mom_sys_ugpost_base_initialized] } {
source ${cam_post_dir}ugpost_base.tcl
set mom_sys_ugpost_base_initialized 1
}
set mom_sys_debug_mode OFF
if { ![info exists env(PB_SUPPRESS_UGPOST_DEBUG)] } {
set env(PB_SUPPRESS_UGPOST_DEBUG) 0
}
if $env(PB_SUPPRESS_UGPOST_DEBUG) {
set mom_sys_debug_mode OFF
}
if { ![string compare $mom_sys_debug_mode "OFF"] } {
proc MOM_before_each_add_var {} {}
proc MOM_before_each_event {} {}
proc MOM_before_load_address {} {}
proc MOM_end_debug {} {}
} else {
set cam_debug_dir [MOM_ask_env_var UGII_CAM_DEBUG_DIR]
source ${cam_debug_dir}mom_review.tcl
}
MOM_set_debug_mode $mom_sys_debug_mode
#### Listing File variables
set mom_sys_list_output "OFF"
set mom_sys_header_output "OFF"
set mom_sys_list_file_rows "40"
set mom_sys_list_file_columns "30"
set mom_sys_warning_output "OFF"
set mom_sys_group_output "OFF"
set mom_sys_list_file_suffix "lpt"
set mom_sys_output_file_suffix "nc"
set mom_sys_commentary_output "ON"
set mom_sys_commentary_list "x y z feed speed"
set mom_sys_pb_link_var_mode "OFF"
set mom_sys_use_default_unit_fragment "ON"
set mom_sys_alt_unit_post_name "BZT_PFX500H__IN.pui"
#=============================================================
proc MOM_before_output { } {
#=============================================================
# This command is executed just before every NC block is
# to be output to a file.
#
# - Never overload this command!
# - Any customization should be done in PB_CMD_before_output!
#
if { [llength [info commands PB_CMD_kin_before_output]] &&\
[llength [info commands PB_CMD_before_output]] } {
PB_CMD_kin_before_output
}
######### The following procedure invokes the listing file with warnings.
global mom_sys_list_output
if { [string match "ON" $mom_sys_list_output] } {
LIST_FILE
} else {
global tape_bytes mom_o_buffer
if { ![info exists tape_bytes] } {
set tape_bytes [string length $mom_o_buffer]
} else {
incr tape_bytes [string length $mom_o_buffer]
}
}
}
if { [string match "OFF" [MOM_ask_env_var UGII_CAM_POST_LINK_VAR_MODE]] } {
set mom_sys_link_var_mode "OFF"
} else {
set mom_sys_link_var_mode "$mom_sys_pb_link_var_mode"
}
set mom_sys_control_out "("
set mom_sys_control_in ")"
set mom_sys_post_initialized 1
}
########## SYSTEM VARIABLE DECLARATIONS ##############
set mom_sys_rapid_code "0"
set mom_sys_linear_code "1"
set mom_sys_circle_code(CLW) "2"
set mom_sys_circle_code(CCLW) "3"
set mom_sys_delay_code(SECONDS) "4"
set mom_sys_delay_code(REVOLUTIONS) "4"
set mom_sys_cutcom_plane_code(XY) "17"
set mom_sys_cutcom_plane_code(ZX) "18"
set mom_sys_cutcom_plane_code(XZ) "18"
set mom_sys_cutcom_plane_code(YZ) "19"
set mom_sys_cutcom_plane_code(ZY) "19"
set mom_sys_cutcom_code(OFF) "40"
set mom_sys_cutcom_code(LEFT) "41"
set mom_sys_cutcom_code(RIGHT) "42"
set mom_sys_adjust_code "43"
set mom_sys_adjust_code_minus "44"
set mom_sys_adjust_cancel_code "49"
set mom_sys_unit_code(IN) "70"
set mom_sys_unit_code(MM) "21"
set mom_sys_cycle_start_code "79"
set mom_sys_cycle_off "80"
set mom_sys_cycle_drill_code "81"
set mom_sys_cycle_drill_dwell_code "82"
set mom_sys_cycle_drill_deep_code "83"
set mom_sys_cycle_drill_break_chip_code "73"
set mom_sys_cycle_tap_code "84"
set mom_sys_cycle_bore_code "85"
set mom_sys_cycle_bore_drag_code "86"
set mom_sys_cycle_bore_no_drag_code "76"
set mom_sys_cycle_bore_dwell_code "89"
set mom_sys_cycle_bore_manual_code "88"
set mom_sys_cycle_bore_back_code "87"
set mom_sys_cycle_bore_manual_dwell_code "88"
set mom_sys_output_code(ABSOLUTE) "90"
set mom_sys_output_code(INCREMENTAL) "91"
set mom_sys_cycle_ret_code(AUTO) "98"
set mom_sys_cycle_ret_code(MANUAL) "99"
set mom_sys_reset_code "92"
set mom_sys_feed_rate_mode_code(FRN) "93"
set mom_sys_spindle_mode_code(SFM) "96"
set mom_sys_spindle_mode_code(RPM) "97"
set mom_sys_return_code "28"
set mom_sys_feed_rate_mode_code(MMPM) "94"
set mom_sys_feed_rate_mode_code(MMPR) "95"
set mom_sys_program_stop_code "0"
set mom_sys_optional_stop_code "1"
set mom_sys_end_of_program_code "30"
set mom_sys_spindle_direction_code(CLW) "3"
set mom_sys_spindle_direction_code(CCLW) "4"
set mom_sys_spindle_direction_code(OFF) "5"
set mom_sys_tool_change_code "6"
set mom_sys_coolant_code(ON) "8"
set mom_sys_coolant_code(FLOOD) "8"
set mom_sys_coolant_code(MIST) "8"
set mom_sys_coolant_code(THRU) "26"
set mom_sys_coolant_code(TAP) "27"
set mom_sys_coolant_code(OFF) "9"
set mom_sys_rewind_code "30"
set mom_sys_4th_axis_has_limits "1"
set mom_sys_5th_axis_has_limits "1"
set mom_sys_sim_cycle_drill "0"
set mom_sys_sim_cycle_drill_dwell "0"
set mom_sys_sim_cycle_drill_deep "0"
set mom_sys_sim_cycle_drill_break_chip "0"
set mom_sys_sim_cycle_tap "0"
set mom_sys_sim_cycle_bore "0"
set mom_sys_sim_cycle_bore_drag "0"
set mom_sys_sim_cycle_bore_nodrag "0"
set mom_sys_sim_cycle_bore_manual "0"
set mom_sys_sim_cycle_bore_dwell "0"
set mom_sys_sim_cycle_bore_manual_dwell "0"
set mom_sys_sim_cycle_bore_back "0"
set mom_sys_cir_vector "Vector - Arc Start to Center"
set mom_sys_spindle_ranges "0"
set mom_sys_rewind_stop_code "\#"
set mom_sys_home_pos(0) "0"
set mom_sys_home_pos(1) "0"
set mom_sys_home_pos(2) "0"
set mom_sys_zero "0"
set mom_sys_opskip_block_leader "/"
set mom_sys_seqnum_start "10"
set mom_sys_seqnum_incr "10"
set mom_sys_seqnum_freq "1"
set mom_sys_seqnum_max "9999"
set mom_sys_lathe_x_double "1"
set mom_sys_lathe_i_double "1"
set mom_sys_lathe_y_double "1"
set mom_sys_lathe_j_double "1"
set mom_sys_lathe_x_factor "1"
set mom_sys_lathe_y_factor "1"
set mom_sys_lathe_z_factor "1"
set mom_sys_lathe_i_factor "1"
set mom_sys_lathe_j_factor "1"
set mom_sys_lathe_k_factor "1"
set mom_sys_leader(N) "N"
set mom_sys_leader(X) "X"
set mom_sys_leader(Y) "Y"
set mom_sys_leader(Z) "Z"
set mom_sys_leader(fourth_axis) "B"
set mom_sys_leader(fifth_axis) "B"
set mom_sys_contour_feed_mode(LINEAR) "MMPM"
set mom_sys_rapid_feed_mode(LINEAR) "MMPM"
set mom_sys_cycle_feed_mode "MMPM"
set mom_sys_feed_param(IPM,format) "Feed_IPM"
set mom_sys_feed_param(IPR,format) "Feed_IPR"
set mom_sys_feed_param(FRN,format) "Feed_INV"
set mom_sys_vnc_rapid_dogleg "1"
set mom_sys_prev_mach_head ""
set mom_sys_curr_mach_head ""
set mom_sys_feed_param(MMPM,format) "Feed_MMPM"
set mom_sys_feed_param(MMPR,format) "Feed_MMPR"
set mom_sys_post_description "BZT PFX 500H - FAU FabLab - Michael Jäger"
set mom_sys_ugpadvkins_used "0"
set mom_sys_post_builder_version "9.0.0"
####### KINEMATIC VARIABLE DECLARATIONS ##############
set mom_kin_4th_axis_ang_offset "0.0"
set mom_kin_4th_axis_center_offset(0) "0.0"
set mom_kin_4th_axis_center_offset(1) "0.0"
set mom_kin_4th_axis_center_offset(2) "0.0"
set mom_kin_4th_axis_direction "MAGNITUDE_DETERMINES_DIRECTION"
set mom_kin_4th_axis_incr_switch "OFF"
set mom_kin_4th_axis_leader "B"
set mom_kin_4th_axis_limit_action "Warning"
set mom_kin_4th_axis_max_limit "360"
set mom_kin_4th_axis_min_incr "0.001"
set mom_kin_4th_axis_min_limit "0"
set mom_kin_4th_axis_plane "ZX"
set mom_kin_4th_axis_point(0) "0.0"
set mom_kin_4th_axis_point(1) "0.0"
set mom_kin_4th_axis_point(2) "0.0"
set mom_kin_4th_axis_rotation "standard"
set mom_kin_4th_axis_type "Table"
set mom_kin_4th_axis_vector(0) "0.0"
set mom_kin_4th_axis_vector(1) "1.0"
set mom_kin_4th_axis_vector(2) "0.0"
set mom_kin_4th_axis_zero "0.0"
set mom_kin_5th_axis_center_offset(0) "0.0"
set mom_kin_5th_axis_center_offset(1) "0.0"
set mom_kin_5th_axis_center_offset(2) "0.0"
set mom_kin_5th_axis_incr_switch "OFF"
set mom_kin_5th_axis_max_limit "0.0"
set mom_kin_5th_axis_min_incr "0.0"
set mom_kin_5th_axis_min_limit "0.0"
set mom_kin_5th_axis_point(0) "0.0"
set mom_kin_5th_axis_point(1) "0.0"
set mom_kin_5th_axis_point(2) "0.0"
set mom_kin_5th_axis_vector(0) "0.0"
set mom_kin_5th_axis_vector(1) "1.0"
set mom_kin_5th_axis_vector(2) "0.0"
set mom_kin_5th_axis_zero "0.0"
set mom_kin_arc_output_mode "FULL_CIRCLE"
set mom_kin_arc_valid_plane "XYZ"
set mom_kin_clamp_time "2.0"
set mom_kin_cycle_plane_change_per_axis "0"
set mom_kin_cycle_plane_change_to_lower "0"
set mom_kin_flush_time "2.0"
set mom_kin_linearization_flag "1"
set mom_kin_linearization_tol "0.01"
set mom_kin_machine_resolution ".0025"
set mom_kin_machine_type "3_axis_mill"
set mom_kin_machine_zero_offset(0) "0.0"
set mom_kin_machine_zero_offset(1) "0.0"
set mom_kin_machine_zero_offset(2) "0.0"
set mom_kin_max_arc_radius "99999.999"
set mom_kin_max_dpm "10"
set mom_kin_max_fpm "10000"
set mom_kin_max_fpr "100"
set mom_kin_max_frn "100"
set mom_kin_min_arc_length "0.20"
set mom_kin_min_arc_radius "0.001"
set mom_kin_min_dpm "0.0"
set mom_kin_min_fpm "0.01"
set mom_kin_min_fpr "0.01"
set mom_kin_min_frn "0.01"
set mom_kin_output_unit "MM"
set mom_kin_pivot_gauge_offset "0.0"
set mom_kin_pivot_guage_offset ""
set mom_kin_post_data_unit "MM"
set mom_kin_rapid_feed_rate "4500"
set mom_kin_rotary_axis_method "PREVIOUS"
set mom_kin_spindle_axis(0) "0.0"
set mom_kin_spindle_axis(1) "0.0"
set mom_kin_spindle_axis(2) "1.0"
set mom_kin_tool_change_time "12.0"
set mom_kin_x_axis_limit "385"
set mom_kin_y_axis_limit "600"
set mom_kin_z_axis_limit "220"
if [llength [info commands MOM_SYS_do_template] ] {
if [llength [info commands MOM_do_template] ] {
rename MOM_do_template ""
}
rename MOM_SYS_do_template MOM_do_template
}
#=============================================================
proc MOM_start_of_program { } {
#=============================================================
global mom_logname mom_date is_from
global mom_coolant_status mom_cutcom_status
global mom_clamp_status mom_cycle_status
global mom_spindle_status mom_cutcom_plane pb_start_of_program_flag
global mom_cutcom_adjust_register mom_tool_adjust_register
global mom_tool_length_adjust_register mom_length_comp_register
global mom_flush_register mom_wire_cutcom_adjust_register
global mom_wire_cutcom_status
set pb_start_of_program_flag 0
set mom_coolant_status UNDEFINED
set mom_cutcom_status UNDEFINED
set mom_clamp_status UNDEFINED
set mom_cycle_status UNDEFINED
set mom_spindle_status UNDEFINED
set mom_cutcom_plane UNDEFINED
set mom_wire_cutcom_status UNDEFINED
catch {unset mom_cutcom_adjust_register}
catch {unset mom_tool_adjust_register}
catch {unset mom_tool_length_adjust_register}
catch {unset mom_length_comp_register}
catch {unset mom_flush_register}
catch {unset mom_wire_cutcom_adjust_register}
set is_from ""
catch { OPEN_files } ; #open warning and listing files
LIST_FILE_HEADER ; #list header in commentary listing
global mom_sys_post_initialized
if { $mom_sys_post_initialized > 1 } { return }
# Load parameters for alternate output units
PB_load_alternate_unit_settings
rename PB_load_alternate_unit_settings ""
#************
uplevel #0 {
#=============================================================
proc MOM_sync { } {
#=============================================================
if [llength [info commands PB_CMD_kin_handle_sync_event] ] {
PB_CMD_kin_handle_sync_event
}
}
#=============================================================
proc MOM_set_csys { } {
#=============================================================
if [llength [info commands PB_CMD_kin_set_csys] ] {
PB_CMD_kin_set_csys
}
}
#=============================================================
proc MOM_msys { } {
#=============================================================
}
#=============================================================
proc MOM_end_of_program { } {
#=============================================================
MOM_do_template end_of_program_3
MOM_do_template end_of_program_4
MOM_do_template end_of_program
MOM_set_seq_off
MOM_do_template rewind_stop_code
#**** The following procedure lists the tool list with time in commentary data
LIST_FILE_TRAILER
#**** The following procedure closes the warning and listing files
CLOSE_files
if [llength [info commands PB_CMD_kin_end_of_program] ] {
PB_CMD_kin_end_of_program
}
}
incr mom_sys_post_initialized
} ;# uplevel
#***********
}
#=============================================================
proc PB_init_new_iks { } {
#=============================================================
global mom_kin_iks_usage mom_kin_spindle_axis
global mom_kin_4th_axis_vector mom_kin_5th_axis_vector
set mom_kin_iks_usage 1
# Override spindle axis vector defined in PB_CMD_init_rotary
set mom_kin_spindle_axis(0) 0.0
set mom_kin_spindle_axis(1) 0.0
set mom_kin_spindle_axis(2) 1.0
# Unitize vectors
foreach i { 0 1 2 } {
set vec($i) $mom_kin_spindle_axis($i)
}
VEC3_unitize vec mom_kin_spindle_axis
foreach i { 0 1 2 } {
set vec($i) $mom_kin_4th_axis_vector($i)
}
VEC3_unitize vec mom_kin_4th_axis_vector
foreach i { 0 1 2 } {
set vec($i) $mom_kin_5th_axis_vector($i)
}
VEC3_unitize vec mom_kin_5th_axis_vector
# Reload kinematics
MOM_reload_kinematics
}
#=============================================================
proc PB_DELAY_TIME_SET { } {
#=============================================================
global mom_sys_delay_param mom_delay_value
global mom_delay_revs mom_delay_mode delay_time
# Post Builder provided format for the current mode:
if { [info exists mom_sys_delay_param(${mom_delay_mode},format)] != 0 } {
MOM_set_address_format dwell $mom_sys_delay_param(${mom_delay_mode},format)
}
switch $mom_delay_mode {
SECONDS { set delay_time $mom_delay_value }
default { set delay_time $mom_delay_revs }
}
}
#=============================================================
proc MOM_before_motion { } {
#=============================================================
global mom_motion_event mom_motion_type
FEEDRATE_SET
switch $mom_motion_type {
ENGAGE { PB_engage_move }
APPROACH { PB_approach_move }
FIRSTCUT { catch {PB_first_cut} }
RETRACT { PB_retract_move }
RETURN { catch {PB_return_move} }
default {}
}
if { [llength [info commands PB_CMD_kin_before_motion] ] } { PB_CMD_kin_before_motion }
if { [llength [info commands PB_CMD_before_motion] ] } { PB_CMD_before_motion }
}
#=============================================================
proc MOM_start_of_group { } {
#=============================================================
global mom_sys_group_output mom_group_name group_level ptp_file_name
global mom_sequence_number mom_sequence_increment mom_sequence_frequency
global mom_sys_ptp_output pb_start_of_program_flag
if { ![hiset group_level] } {
set group_level 0
return
}
if { [hiset mom_sys_group_output] } {
if { ![string compare $mom_sys_group_output "OFF"] } {
set group_level 0
return
}
}
if { [hiset group_level] } {
incr group_level
} else {
set group_level 1
}
if { $group_level > 1 } {
return
}
SEQNO_RESET ; #<4133654>
MOM_reset_sequence $mom_sequence_number $mom_sequence_increment $mom_sequence_frequency
if { [info exists ptp_file_name] } {
MOM_close_output_file $ptp_file_name
MOM_start_of_program
if { ![string compare $mom_sys_ptp_output "ON"] } {
MOM_open_output_file $ptp_file_name
}
} else {
MOM_start_of_program
}
PB_start_of_program
set pb_start_of_program_flag 1
}
#=============================================================
proc MOM_machine_mode { } {
#=============================================================
global pb_start_of_program_flag
global mom_operation_name mom_sys_change_mach_operation_name
set mom_sys_change_mach_operation_name $mom_operation_name
if { $pb_start_of_program_flag == 0 } {
PB_start_of_program
set pb_start_of_program_flag 1
}
# For simple mill-turn
if { [llength [info commands PB_machine_mode] ] } {
if { [catch {PB_machine_mode} res] } {
CATCH_WARNING "$res"
}
}
}
#=============================================================
proc PB_FORCE { option args } {
#=============================================================
set adds [join $args]
if { [info exists option] && [llength $adds] } {
lappend cmd MOM_force
lappend cmd $option
lappend cmd [join $adds]
eval [join $cmd]
}
}
#=============================================================
proc PB_SET_RAPID_MOD { mod_list blk_list ADDR NEW_MOD_LIST } {
#=============================================================
upvar $ADDR addr
upvar $NEW_MOD_LIST new_mod_list
global mom_cycle_spindle_axis traverse_axis1 traverse_axis2
set new_mod_list [list]
foreach mod $mod_list {
switch $mod {
"rapid1" {
set elem $addr($traverse_axis1)
if { [lsearch $blk_list $elem] >= 0 } {
lappend new_mod_list $elem
}
}
"rapid2" {
set elem $addr($traverse_axis2)
if { [lsearch $blk_list $elem] >= 0 } {
lappend new_mod_list $elem
}
}
"rapid3" {
set elem $addr($mom_cycle_spindle_axis)
if { [lsearch $blk_list $elem] >= 0 } {
lappend new_mod_list $elem
}
}
default {
set elem $mod
if { [lsearch $blk_list $elem] >= 0 } {
lappend new_mod_list $elem
}
}
}
}
}
########################
# Redefine FEEDRATE_SET
########################
if { [llength [info commands ugpost_FEEDRATE_SET] ] } {
rename ugpost_FEEDRATE_SET ""
}
if { [llength [info commands FEEDRATE_SET] ] } {
rename FEEDRATE_SET ugpost_FEEDRATE_SET
} else {
proc ugpost_FEEDRATE_SET {} {}
}
#=============================================================
proc FEEDRATE_SET { } {
#=============================================================
if { [llength [info commands PB_CMD_kin_feedrate_set] ] } {
PB_CMD_kin_feedrate_set
} else {
ugpost_FEEDRATE_SET
}
}
############## EVENT HANDLING SECTION ################
#=============================================================
proc MOM_auxfun { } {
#=============================================================
MOM_do_template auxfun
}
#=============================================================
proc MOM_bore { } {
#=============================================================
global cycle_name
global cycle_init_flag
set cycle_init_flag TRUE
set cycle_name BORE
CYCLE_SET
}
#=============================================================
proc MOM_bore_move { } {
#=============================================================
global cycle_init_flag
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
MOM_do_template cycle_bore
set cycle_init_flag FALSE
}
#=============================================================
proc MOM_bore_back { } {
#=============================================================
global cycle_name
global cycle_init_flag
set cycle_init_flag TRUE
set cycle_name BORE_BACK
CYCLE_SET
}
#=============================================================
proc MOM_bore_back_move { } {
#=============================================================
global cycle_init_flag
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
MOM_do_template cycle_bore_back
set cycle_init_flag FALSE
}
#=============================================================
proc MOM_bore_drag { } {
#=============================================================
global cycle_name
global cycle_init_flag
set cycle_init_flag TRUE
set cycle_name BORE_DRAG
CYCLE_SET
}
#=============================================================
proc MOM_bore_drag_move { } {
#=============================================================
global cycle_init_flag
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
MOM_do_template cycle_bore_drag
set cycle_init_flag FALSE
}
#=============================================================
proc MOM_bore_dwell { } {
#=============================================================
global cycle_name
global cycle_init_flag
set cycle_init_flag TRUE
set cycle_name BORE_DWELL
CYCLE_SET
}
#=============================================================
proc MOM_bore_dwell_move { } {
#=============================================================
global cycle_init_flag
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
MOM_do_template cycle_bore_dwell
set cycle_init_flag FALSE
}
#=============================================================
proc MOM_bore_manual { } {
#=============================================================
global cycle_name
global cycle_init_flag
set cycle_init_flag TRUE
set cycle_name BORE_MANUAL
CYCLE_SET
}
#=============================================================
proc MOM_bore_manual_move { } {
#=============================================================
global cycle_init_flag
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
MOM_do_template cycle_bore_manual
set cycle_init_flag FALSE
}
#=============================================================
proc MOM_bore_manual_dwell { } {
#=============================================================
global cycle_name
global cycle_init_flag
set cycle_init_flag TRUE
set cycle_name BORE_MANUAL_DWELL
CYCLE_SET
}
#=============================================================
proc MOM_bore_manual_dwell_move { } {
#=============================================================
global cycle_init_flag
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
MOM_do_template cycle_bore_manual_dwell
set cycle_init_flag FALSE
}
#=============================================================
proc MOM_bore_no_drag { } {
#=============================================================
global cycle_name
global cycle_init_flag
set cycle_init_flag TRUE
set cycle_name BORE_NO_DRAG
CYCLE_SET
}
#=============================================================
proc MOM_bore_no_drag_move { } {
#=============================================================
global cycle_init_flag
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
MOM_do_template cycle_bore_no_drag
set cycle_init_flag FALSE
}
#=============================================================
proc MOM_circular_move { } {
#=============================================================
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
CIRCLE_SET
MOM_force Once G_motion
MOM_do_template circular_move
}
#=============================================================
proc MOM_coolant_off { } {
#=============================================================
COOLANT_SET
MOM_do_template coolant_off
}
#=============================================================
proc MOM_coolant_on { } {
#=============================================================
COOLANT_SET
MOM_do_template coolant_on
}
#=============================================================
proc MOM_cutcom_off { } {
#=============================================================
CUTCOM_SET
MOM_do_template cutcom_off
}
#=============================================================
proc MOM_cutcom_on { } {
#=============================================================
CUTCOM_SET
global mom_cutcom_adjust_register
set cutcom_register_min 1
set cutcom_register_max 99
if { [info exists mom_cutcom_adjust_register] } {
if { $mom_cutcom_adjust_register < $cutcom_register_min ||\
$mom_cutcom_adjust_register > $cutcom_register_max } {
CATCH_WARNING "CUTCOM register $mom_cutcom_adjust_register must be within the range between 1 and 99"
}
}
}
#=============================================================
proc MOM_cycle_off { } {
#=============================================================
MOM_do_template cycle_off
}
#=============================================================
proc MOM_cycle_plane_change { } {
#=============================================================
global cycle_init_flag
global mom_cycle_tool_axis_change
global mom_cycle_clearance_plane_change
set cycle_init_flag TRUE
}
#=============================================================
proc MOM_delay { } {
#=============================================================
PB_DELAY_TIME_SET
MOM_do_template delay
}
#=============================================================
proc MOM_drill { } {
#=============================================================
global cycle_name
global cycle_init_flag
set cycle_init_flag TRUE
set cycle_name DRILL
CYCLE_SET
}
#=============================================================
proc MOM_drill_move { } {
#=============================================================
global cycle_init_flag
global mom_sys_abort_next_event
if { [info exists mom_sys_abort_next_event] } {
if { [llength [info commands PB_CMD_kin_abort_event]] } {
PB_CMD_kin_abort_event
}
}
MOM_do_template cycle_drill
set cycle_init_flag FALSE
}
#=============================================================
proc MOM_drill_break_chip { } {
#=============================================================
global cycle_name
global cycle_init_flag
set cycle_init_flag TRUE
set cycle_name DRILL_BREAK_CHIP
CYCLE_SET
}
#=============================================================
proc MOM_drill_break_chip_move { } {
#=============================================================
global cycle_init_flag