|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。
5 A; T* _. D& O* X" k0 F& T% c0 N3 ]
# --------------------------------------------------------------------------
1 R2 N/ D8 @/ X; k8 P, a# Parameter read postblocks:, @) g; x |% j- e0 S6 Y6 Z0 y) e
# --------------------------------------------------------------------------
1 L( y: c2 o5 ^1 p/ Hpprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.1 B5 t- z! d9 W6 Z: j0 g9 M0 s' O
param_read$ = 1 ----------------------------> here& J2 `) L) U5 N& d/ d0 f4 x Z
#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! f& G' q! ~& }) G
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)
' ]5 @. F& M# |" i5 ~9 O rd_md$ ----------------------------> here #Read machine definition parameters
. F+ R9 C! h, n( r7 w! u6 D% g
$ M; Z7 m! j! {9 W# ~$ P #debug
; C. U2 d; U# L( H6 E; M #error_msg$ = 0
8 D& S: O8 n' i- p+ u #err_file$ = 4: I# P0 j6 s! B6 R9 O9 h* {( r x
#bug2$ = 40
) {+ g) {# k+ R" _+ K #fastmode$ = no$9 J' V1 ?6 }; `/ @6 ^8 y+ ~; x
$ i9 Q9 [. q. z. h# k5 Q0 `6 `, f) {8 a
1 i8 T; B. W( I7 z4 v, x( t( C- _7 m# --------------------------------------------------------------------------
7 O: X8 Z# Z4 I6 P. j, u9 fpsynclath$ #Read NCI Axis-Combination (950) line+ i, j+ O' s- A* c
pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters7 V5 @ W" G" R z5 c8 m6 J5 B- p( p
#Rotaxtyp = 1 sets initial matrix to top& ]5 u& t* V2 `, A6 f
#Rotaxtyp = -2 sets initial matrix to front/ P7 U# A: O) z$ \2 d6 X
if vmc, rotaxtyp$ = one8 u0 U2 v O4 j9 [9 T( {
else, rotaxtyp$ = -2# v+ f6 _& x9 w+ H7 B6 z/ ^+ o& g
9 x! ~" H8 r% Z1 g5 o. C* l6 r, ]
pset_mach #Set post switches by reading machine def parameters- o) y$ Q: X/ e# d1 O) M1 N
rot_ax_cnt = 0
; s9 f3 c! @3 Y# x, A, y rotaxerror = 0. c6 g5 C* M. O' R' h$ z
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines1 W" W% z: B" l5 w
2 G8 D0 W# i/ z4 M* U6 i) I. j
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$ `0 u" K. T9 M3 b
#Output error message if Write NC operation information is not enabled in CD
4 Z2 F, I& r: F. m/ d) Y6 h #if write_ops = 0, result = mprint(swriteopserror,2), exitpost$5 k' S; o7 j9 E v
( }; ~ J6 x3 U S2 @9 c; o# }0 N
if sof = 1,5 p) v+ t8 e2 T Q: a
[
% x' ]# e$ s# M2 ^" Y3 G0 N maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value+ w' f* J. O& a
maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
) d+ a$ p( `% b #minfeedpm = 9999994 u* s8 l7 `9 X0 `8 ^6 y) j
#minfeedpm_m = 9999993 G5 d @8 g" Q
!maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m
/ j; Z; H& V$ L3 n rd_mch_ent_no$ = 0* c1 I6 [/ m8 C1 M7 x
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
% i+ V( ^5 H/ z) H6 L ]
0 o# x$ G3 ?$ |$ L
5 ]1 p/ v' P9 G6 H rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line
$ o5 k! W5 V1 b1 V' G rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
- k) @4 k. s; {2 Y8 r& V; h rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$
4 g& x$ z$ B# w# r$ b3 N: A! j- V
" x- K6 `% E. M% r8 f, ] u rd_prm_op_no$ = op_id$
r3 j$ a" H% \3 u6 ~* N- `, w9 h rd_params$ ----------------------------> here #Read operaitons parameters+ e; ]* Q5 n: h3 \
! f1 q) y. c5 H: s7 X
#We only need these set at toolchange (and start of file). No need to set them each time a user may call rd_md( I# n( B- {+ H4 E/ c" S2 L: U
if sav_rot_on_x = zero, rot_on_x = zero
0 y: n# ~! ~. U6 M5 k else, rot_on_x = rot_axis; R2 w' C2 ?9 W, F" x* U; O9 O8 v
rot_cw_pos = rot_dir
8 o4 B5 m/ c' n1 k5 _" C; j: Q index = rot_index
% U$ V8 K7 y+ j if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD9 A1 p; K1 r: P$ x
else, ctable = rot_angle
, ^# B9 A, n5 g9 n5 L7 O8 z, v' S1 \$ o
if met_tool$ = 1,
+ Z' o. G- Z6 r/ h) f+ U [
# U5 }+ s" q; v maxfrinv = maxfrinv_m #Set limit for feed inverse time6 T4 S0 U+ v3 C; S* H$ |7 K
minfrinv = minfrinv_m
4 }8 _. P1 A2 J/ o! N: t' B maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min
0 X* e0 }% N9 [7 T& _7 \ minfeedpm = minfeedpm_m6 J$ \7 |- ~. q; f1 v
]. j8 A1 y. W8 F9 W0 U6 ^
. [( M8 @/ Y- S. Z9 `4 G) } if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label
6 ~+ T: N+ F9 |
. R2 e' {$ `3 K* n" W' z- {1 ~/ P. t7 o' ^+ }3 b6 H3 D
4 r/ O+ D# i1 }( L2 @* h |
|