|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。1 E" D. |% b' p/ ]3 i+ `' u) C
! [0 j1 ^+ O7 k# --------------------------------------------------------------------------( W E' V3 k: X4 h% [+ z D" i$ A
# Parameter read postblocks:
5 ]; ?, a: W9 x$ |7 h# --------------------------------------------------------------------------- t, |) a+ B6 A, y0 p
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.
. `+ q- y/ g3 g: S2 Y param_read$ = 1 ----------------------------> here1 Y1 x% n# N# T6 u9 l6 s. F
#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!! x8 ? r1 _4 s& U
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)
; F8 I% d8 R" g* \6 _% j- w rd_md$ ----------------------------> here #Read machine definition parameters! j% r$ z( c% g! [' y, X1 ^
" P1 C8 k9 }7 n. V #debug. Y: B. U7 L/ a9 g1 C1 J2 d
#error_msg$ = 0- N" F8 @$ |4 f5 _7 K( n1 ]
#err_file$ = 41 y& I7 H7 }; d$ E7 m4 f9 P) ~
#bug2$ = 40
; o: Q/ J+ L( @) x/ c #fastmode$ = no$) K# S5 s& F2 i- N
/ e& o2 `! ]" T2 f2 z7 o# j5 N8 \( g9 I" y/ O! v. j8 K1 V( u
% N' W. V0 I/ G5 [1 g8 M/ V- G' N# --------------------------------------------------------------------------
2 N9 ^; D5 _" |5 E+ cpsynclath$ #Read NCI Axis-Combination (950) line
( n1 v3 w6 \8 Y8 c, B pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters8 x7 c1 e$ R5 L# I3 m1 M* g5 ^
#Rotaxtyp = 1 sets initial matrix to top
1 T2 q o1 S/ x0 z& M" |) | #Rotaxtyp = -2 sets initial matrix to front N/ N& N. l* j" A+ P
if vmc, rotaxtyp$ = one
; W) @( S0 ?3 Z8 p7 Z else, rotaxtyp$ = -2
2 U! @$ i& Q6 I2 [% H% B
3 J1 Q$ ?2 e' m. S! a, m. l2 Epset_mach #Set post switches by reading machine def parameters# }2 y' S( n# w- _/ H8 `0 J
rot_ax_cnt = 07 Y0 i1 z. E6 ~2 t6 h/ S7 ~
rotaxerror = 0/ o) [" c/ ?) N3 t) N* E
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines
0 K5 d, [4 E, a% Y- G, ^( U. o' R3 X1 j/ g& V$ G! y4 L2 B
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$
$ P# `. D. u3 x0 J #Output error message if Write NC operation information is not enabled in CD0 R" w7 G n3 F1 @
#if write_ops = 0, result = mprint(swriteopserror,2), exitpost$
* ?0 r8 B2 t3 j, a7 R& N9 [9 f
if sof = 1,
/ K8 Y% _3 c p: O4 ^5 [ [' n% w" R) e/ `0 `, s
maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value$ s. n' c( M+ s8 B( N- l
maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
2 J# [7 f! x4 e; p- D% G, H #minfeedpm = 999999
]8 Q0 h) O4 O# R' [3 c# H- L) D #minfeedpm_m = 999999
4 l9 V. ]1 b1 l9 F* _2 c8 W !maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m1 A' U7 }8 G6 W% a+ h! u' B1 K
rd_mch_ent_no$ = 0 c1 p8 ~7 }4 s9 E
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$7 M9 \# ?0 N: X; O3 m2 P/ m3 \
]' H6 L0 t2 _& y0 e; V6 q" f+ E
4 B7 Y- M$ F( n0 q. P rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line
. A) A+ t* B" Y rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
9 V" Q8 J' X7 L) p rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$) M/ s7 ~* u3 e9 B' b
9 a$ C! [/ |6 t5 Q- f- X( O rd_prm_op_no$ = op_id$5 U- u1 g& G! B
rd_params$ ----------------------------> here #Read operaitons parameters" U4 v- @( q/ B3 J5 o. }
0 ~" y( t' ]1 d, H4 V4 c! ~- S #We only need these set at toolchange (and start of file). No need to set them each time a user may call rd_md, x5 x7 g$ W; m6 L
if sav_rot_on_x = zero, rot_on_x = zero
; b$ k0 Y' \$ c; H& G2 {- ]( ]- w2 h else, rot_on_x = rot_axis
7 F5 e9 b$ Q$ H. S7 k! Q+ } rot_cw_pos = rot_dir
5 t+ m, ?; p2 T( F4 r3 P5 X: G; p index = rot_index4 ]1 O- Q7 @8 P) h6 ?0 L
if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD
% K% @% ]: V( f& ~) ? else, ctable = rot_angle
$ d3 h s7 @7 C. Q0 m
/ X4 m, n4 b& s( V if met_tool$ = 1,
( q/ u5 t2 J% C0 `7 u2 l+ @ [6 v' J$ Q4 k( u0 p5 n. w
maxfrinv = maxfrinv_m #Set limit for feed inverse time
0 \/ S% E' D6 c: G$ Z; I4 [ minfrinv = minfrinv_m8 _: g" k0 M; e9 G/ T# W
maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min
- F1 e6 f" L- S1 m' n, z" v minfeedpm = minfeedpm_m
" y* x L: v+ {3 v! W3 e- @ ]
7 s+ h f2 s; c8 B" w' R- W& Q
8 `2 a0 _* m5 _4 D! ]2 Y+ q if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label
) p- L% P" ~! w! v \0 J; Q! ]4 h& [0 {' \8 e! O8 n4 j* [
4 p# b$ ]( m$ a3 Y6 L
# g# r5 f [$ D1 {+ m/ ?# F8 S4 t
|
|