|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。
9 Y! N* @6 Q0 s0 z8 {
$ j4 `7 c7 u, C1 G0 D- n# --------------------------------------------------------------------------
c5 p4 c# ~7 F2 |/ U% u# Parameter read postblocks:: u, Q! T' k v. M- B4 D
# --------------------------------------------------------------------------& B1 H) R6 H$ ]; Y+ x# F
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.2 {4 D/ {& P/ @9 R/ {* a9 ~
param_read$ = 1 ----------------------------> here
$ f7 O- H, I9 m #DO NOT ATTEMPT TO OUTPUT TO THE NC FILE IN THIS POSTBLOCK (OR ANY POSTBLOCKS YOU MAY CALL FROM HERE) BECAUSE THE NC OUTPUT FILE IS NOT YET OPENED!/ t% m( U0 ]7 x2 y8 Z2 c. K1 R" Q8 j
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)
: B2 O# ]/ c2 B9 \1 j3 V/ }9 I# h rd_md$ ----------------------------> here #Read machine definition parameters
8 T5 Z% }; ^5 d( V2 e+ r- ?- G( K) a
#debug' u" a. k9 C/ M; M3 R3 B
#error_msg$ = 08 y9 b; o0 ~8 i- c6 R# l
#err_file$ = 4
+ r0 D9 X% O; }& r# w* @ #bug2$ = 40
3 \+ y+ S; Y4 `- O& Z8 W' f: S #fastmode$ = no$
4 a0 w+ o5 Y. J4 d& ?) ?2 q# G( l$ v$ H% [- C. M
7 k. H3 ^7 a4 O8 g; ?
0 X" x b' d- J8 m% f/ e# --------------------------------------------------------------------------; D6 N* r0 l) D6 H4 _3 M
psynclath$ #Read NCI Axis-Combination (950) line# j+ E2 I$ O; R* X2 V; [& I% v
pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters7 A) F8 U! o u) e( o; _7 I) p6 f& Q
#Rotaxtyp = 1 sets initial matrix to top
2 u3 _1 }, A, C1 S0 a# U1 A #Rotaxtyp = -2 sets initial matrix to front
$ v9 k) O8 S; |" ? @ if vmc, rotaxtyp$ = one9 |" r% N+ D2 { ~$ c
else, rotaxtyp$ = -2$ C8 [/ o/ q( A0 I: ?
- m4 S7 _9 Y" d8 n: r$ u2 u
pset_mach #Set post switches by reading machine def parameters
# Z5 C0 D" P# ?) q$ P9 [ rot_ax_cnt = 0
% u5 m2 x/ b. y; ~) _& b" `3 y rotaxerror = 0, D7 F* d$ N0 R% r
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines; o: \ E% m1 Y& l6 K; l/ q2 Q; ?0 ]. A
( `# I3 {* k# s- M rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$
# V1 e& `9 j9 a6 P% b i. s9 \- `: x #Output error message if Write NC operation information is not enabled in CD& Q; X' M! F1 x( \6 g
#if write_ops = 0, result = mprint(swriteopserror,2), exitpost$
; h+ s" F4 |8 F$ E1 w3 v3 k7 v9 u. O
if sof = 1,- m; n/ t6 u/ z) p% T
[
3 s- C {2 e. C% J$ c# l maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
6 K$ W0 \( [6 g# j+ l maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
1 E+ O3 a8 y1 R; @ #minfeedpm = 999999
, u5 q7 l% k9 o$ K. f/ G) y #minfeedpm_m = 999999
8 I$ k! J9 E( }3 r2 ? !maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m
$ p; [7 b& F4 g( u rd_mch_ent_no$ = 0
; u& o- x' [- ~9 ?, d6 A) q0 ? rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$6 J4 O& [0 X8 R8 H* W' |5 X
]
# p: C; ]% A( h& G/ W: e& r: c4 {) Y8 _( ?, y% U
rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line4 z: j7 Q: w; I. O3 {
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$0 Q% ]) m+ Z; {+ b$ Q( R. Z. Q) h
rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$
! ~$ j" ]/ ^, L7 }$ i. |8 S; N+ N+ ~. U
rd_prm_op_no$ = op_id$# U1 E5 g( m5 v- ]* D
rd_params$ ----------------------------> here #Read operaitons parameters6 j/ H2 F! [4 X/ {/ A6 G& `
( ]' V9 g4 y- f6 ?# G1 ~
#We only need these set at toolchange (and start of file). No need to set them each time a user may call rd_md$ L. C) {* D- Z) f: A- ~. T7 o
if sav_rot_on_x = zero, rot_on_x = zero
Q+ `5 l4 l9 I& n4 ^( x) w( l2 X5 j5 W else, rot_on_x = rot_axis
7 G9 G- D# _/ ^3 l rot_cw_pos = rot_dir- u5 l5 h( v' j/ t7 `0 q' j! {
index = rot_index
* i$ I8 f& b* X, V" `: k: Q! u- } if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD
8 G6 g1 v- s4 E, h9 {4 \1 B else, ctable = rot_angle
, s5 f; ]: K& a' A' G* ~; ?/ f
; G1 l1 e+ ~: _ if met_tool$ = 1,+ D# X% T% y( f* E G) b
[/ v F8 `8 T8 f/ w) `( G( b/ {; d0 I4 h$ B
maxfrinv = maxfrinv_m #Set limit for feed inverse time( L, Q+ s4 ^, H1 j) @) O. {
minfrinv = minfrinv_m
) f! ^5 S \% q; e maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min4 [% |/ H9 u" p5 M% q
minfeedpm = minfeedpm_m
1 O( o' N2 ~7 s" Q: w9 x8 x& F ]
- `! x" g7 ? G
3 l* M, N5 }! B4 Z& w' d- J if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label6 J* N, E% L' V# e) ?
' [# q- h* d3 i. s" M- a7 z0 ^* W ~0 r M6 x, u, H
3 u0 E" y& D2 c; E- H# K3 [' l
|
|