|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。) R, d) C( L; X7 I
: T$ H6 S* Q; ^$ M1 H" E0 A! d7 D# --------------------------------------------------------------------------% ^% b6 n6 x/ ^, |. @& @/ T0 S
# Parameter read postblocks:
/ ?& R, W& s$ U5 q' T: h( }' X. |# --------------------------------------------------------------------------
; C& K. M2 i* D4 \5 J- G1 Wpprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.2 q; \2 c- ^) X! S
param_read$ = 1 ----------------------------> here
( v" o2 c( E# X' U3 `8 f& b #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!: D0 }8 {, i/ q
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)5 C2 O/ \# F5 \( S6 w" W
rd_md$ ----------------------------> here #Read machine definition parameters. g/ ^6 g( W7 f7 J" ^" @( W. q8 X* r% ]2 d
1 a0 s Y) |* P4 f0 i0 {# R+ f$ R #debug
1 c) j$ T5 E1 x% L% O' }% I$ a+ Y #error_msg$ = 0; u: {5 C3 s1 w) l
#err_file$ = 4
# q0 G/ k$ Z% |/ H b #bug2$ = 40$ t, A, `/ o( E4 F
#fastmode$ = no$
4 [/ L' [& D- E' c; `3 C& d6 Q+ ?/ s$ N* }9 j
" S, X4 g# `6 i% p% U
1 k4 P3 J @0 G9 ~7 j+ N# --------------------------------------------------------------------------
+ Y" L, D% |0 H2 |psynclath$ #Read NCI Axis-Combination (950) line
$ `/ H% I4 `# q# {% S% v pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters% i0 g6 Q/ x) N$ `4 I
#Rotaxtyp = 1 sets initial matrix to top) K% G+ P* ?( _8 S1 N
#Rotaxtyp = -2 sets initial matrix to front$ C5 b) ^7 s; V: `% Q! b5 M( P
if vmc, rotaxtyp$ = one
4 K! h6 C; x, _6 P0 C- [- x n else, rotaxtyp$ = -2. _' Q u$ I' q) B. ^: l
* B m! R/ h9 v: tpset_mach #Set post switches by reading machine def parameters
- ~! r- f8 C) V, R2 k9 f rot_ax_cnt = 0% n o2 j7 c8 h" E( b# q. b4 v
rotaxerror = 0% N5 L+ J! ~% g5 T9 d& ]" o8 Z* U
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines
- A2 Z' L) P8 G w' J/ q _. t+ y3 [: i m/ h+ }" G
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$9 ?5 Y& V* ~/ X: O4 j3 z7 g! j
#Output error message if Write NC operation information is not enabled in CD
+ _5 z7 _( \: Y #if write_ops = 0, result = mprint(swriteopserror,2), exitpost$5 H5 b$ P2 w* a$ p1 D
9 m8 E; Z' M) Y* q' \ if sof = 1,
( a/ Y0 H* ]9 ~- U/ x* Z p. b; L I# E [4 U, L1 z0 `# T& |6 l" @ N
maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
2 E7 U) p( p9 m/ i, i2 g! P maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
, E0 u6 a) Y& @& P' c# _ #minfeedpm = 999999' `/ N6 O! ]9 y+ R( N( |
#minfeedpm_m = 999999$ c5 Y, [8 \5 Z
!maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m
+ U# S7 E7 g+ \6 {( y1 ^9 L2 E rd_mch_ent_no$ = 05 `4 K l4 r2 D& c) }
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
r6 [7 d" i) l- O3 k0 [ ]
- a. u+ X' G& F, ~% C+ S/ L
/ q/ F) J. _8 n: R6 p$ n rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line7 e6 D; V2 j1 Z
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$7 x3 @. V0 u6 O3 D3 I, {
rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$+ x" f: a0 S2 b' n4 S' X& u
# ]: G9 }. {; h# R% L
rd_prm_op_no$ = op_id$3 _- O+ {: w# F4 O" e
rd_params$ ----------------------------> here #Read operaitons parameters
# [! m+ I- m% q1 M3 }, M/ }9 h
3 t0 v# } k% o7 e. \% q3 ]- s: B. X4 o #We only need these set at toolchange (and start of file). No need to set them each time a user may call rd_md! v( f$ H- M+ d: _0 @6 H; s8 ?
if sav_rot_on_x = zero, rot_on_x = zero. v% l6 a7 m6 K3 H2 ?9 o
else, rot_on_x = rot_axis% w; l7 u x: ?6 Q' V
rot_cw_pos = rot_dir
& `9 b% ? e) z" L# ` index = rot_index
; C j$ L! H) o& D6 V( @9 d if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD* l7 m- N- B4 o" j) ?
else, ctable = rot_angle
2 E- e4 u/ ^* H. i+ b. I
: P8 C# d' [* I if met_tool$ = 1,6 F; H( F& C2 }: M z4 W% d% j- k3 T8 {
[
4 l) L# x- y1 p- I: F3 y3 Z8 r% W maxfrinv = maxfrinv_m #Set limit for feed inverse time
3 h7 F/ p7 {5 E! U8 v2 \, ]0 [' B minfrinv = minfrinv_m
4 T' r+ L0 \, c5 s" C, Y maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min/ Y4 f6 {( S+ \: \9 y) W
minfeedpm = minfeedpm_m% m6 E4 A, o* G ?
]0 |- J$ ?. v0 D5 f5 |" @5 c
% b% s2 G# _5 H' M
if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label
! D3 p) ~6 ~; ~5 w6 D; J$ C s3 m" s
) F6 o( I9 T2 Y* \- ?% k0 W
0 S0 V: [ U- H' A) E- @* f
- }1 I* B% k7 l. j' Q |
|