|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。" W- g2 u# ~8 Y( u% t
3 o$ C! ^9 U: D6 Z6 X6 j) X
# --------------------------------------------------------------------------+ ]' {$ ~( H7 X6 r% e
# Parameter read postblocks:! b9 M/ M I' Y( F$ D" l
# --------------------------------------------------------------------------
1 z1 y/ X% u4 n7 l# D% Ppprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.
7 n8 ~1 K1 P4 W* S! `: {7 _- Q/ _ param_read$ = 1 ----------------------------> here
) M/ K, F* ^7 | #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!
' {3 s2 |2 X9 t3 o rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)( R) Z4 A5 ]# h- X0 r
rd_md$ ----------------------------> here #Read machine definition parameters
; F* |; d4 P; d3 R3 F! n
/ I* z6 e/ e1 i1 w- l% H# u6 |5 b #debug1 k9 `$ @* w$ @
#error_msg$ = 0
( Z) M) x4 c9 S #err_file$ = 4
7 ~9 T3 y8 C. ?( r+ g #bug2$ = 40
$ S. I1 q; h; F6 \' T- r( G #fastmode$ = no$, y, z4 W4 I% ]0 K$ U# [ z7 b: p
4 H" H. t. [/ C* T
s- v6 J( [' S/ g
9 J& h' e5 Z8 B7 r+ q) }, p d# --------------------------------------------------------------------------
* k0 f0 a8 W+ ?6 Xpsynclath$ #Read NCI Axis-Combination (950) line
) M+ @* S+ d J: _ pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters
" p: [' e5 _1 _; e! t( \: M #Rotaxtyp = 1 sets initial matrix to top
J* p/ j! W0 r6 U* x7 @6 F% { #Rotaxtyp = -2 sets initial matrix to front8 E- [* |& B# F3 O$ \
if vmc, rotaxtyp$ = one
" L1 G3 L2 _5 \* c8 K else, rotaxtyp$ = -2
2 V8 I5 F( H! m- W! i4 z
( u( Z0 O z h" I% J' q6 \3 R% w, _pset_mach #Set post switches by reading machine def parameters% ]& w- R( O3 P& m7 j+ I
rot_ax_cnt = 0+ a' d8 S0 X! }8 i8 a: u. H
rotaxerror = 08 c) T& c7 P) e" M0 [9 G( E
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines5 _% Z+ f0 Q8 I) ~7 J, B/ v, G6 y, T
8 `& R4 w# W9 T
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$' Z. t2 X+ d& s) F4 t
#Output error message if Write NC operation information is not enabled in CD# r' o7 T/ Z# A3 ]9 t6 R
#if write_ops = 0, result = mprint(swriteopserror,2), exitpost$
/ Z9 J% ^1 M/ Z% \3 G
8 A- D4 b8 D/ g5 L: s8 a if sof = 1,9 e! m, G4 m$ |
[* V6 Q6 L1 b4 z! Y/ J
maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
3 q8 z* F p& `6 V maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value, O$ P8 k) ~1 n1 h/ P2 Q9 H4 }
#minfeedpm = 999999. ~4 Q# K4 }! i3 i& O
#minfeedpm_m = 999999) a. e# c: z4 C% A/ s+ s* o
!maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m; e* p5 S4 U3 G0 b% D! S) T
rd_mch_ent_no$ = 0
$ V! T& U- q( @ rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
3 K6 S8 Z* C2 A3 O ]
* Y) U0 K: t/ Y2 t$ e& O( [+ N1 [) X* h
rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line) ?5 W2 f8 k1 B6 ]; }
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
8 [9 V' d3 r& s rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$& Z, N4 C) }( m- _7 T6 J8 J& c* T7 u
6 _4 D# x! h" j8 ~2 m1 w/ R: U rd_prm_op_no$ = op_id$( o6 S4 U9 |& g+ k+ K; u
rd_params$ ----------------------------> here #Read operaitons parameters
Z b: C" {8 @" B M; |( ?3 m
) z: d. R# Q5 E; z, K6 L7 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; {- m) y5 F' s# m
if sav_rot_on_x = zero, rot_on_x = zero
1 @. D+ z( Y# a+ I2 x2 b5 {1 i4 f else, rot_on_x = rot_axis
" g8 C* v) q# T) J2 C; m7 e rot_cw_pos = rot_dir
9 S: `( p0 h4 ~' S' h index = rot_index
0 d6 ^5 E. Y; C1 H1 O7 {# i. X3 s if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD
( U% ~& H3 I: i. r$ g, P else, ctable = rot_angle
( O* E, d6 Z+ ^5 {! B2 r
2 m# J! U' {' n* g/ Z; D9 y+ d if met_tool$ = 1," v7 f: s% x5 r! ~' L( O
[
e( L. b7 l$ u) V+ m5 C maxfrinv = maxfrinv_m #Set limit for feed inverse time
. C3 h3 R7 }( x5 f5 ~- g minfrinv = minfrinv_m' o4 _1 y {2 M. e* i3 p
maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min
4 ?$ O' c" q6 D; W( k# l minfeedpm = minfeedpm_m$ N% b7 ?# ]. ]( _
]
" h. }+ r; l! X
0 w# `7 o: U* M5 u4 P if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label. _) `7 Z' K- T' n
) p2 q: S9 g$ x9 H' c
# Y+ ~5 f( {) ]! H5 H5 q' G( f2 K J. C: w! j7 x+ z( W N
|
|