|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。
$ X2 j8 X' N- @ b; z0 W( B: l. @: }) R7 o6 q* r, w- f1 h/ l
# --------------------------------------------------------------------------9 l8 z8 U- t: }5 v7 J
# Parameter read postblocks:
$ S* F# ^2 w5 t6 ?7 z4 @# --------------------------------------------------------------------------2 j7 G$ L8 p2 B' G! g( O: u
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.+ P& Z- Q% z/ f$ I8 x& M
param_read$ = 1 ----------------------------> here
; c6 d2 I0 P7 w3 G) |+ n #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!9 e3 q r/ }4 I5 {
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE) ?- P" D6 [* q k, o. s
rd_md$ ----------------------------> here #Read machine definition parameters9 ]+ X( T. T; Q4 t z
% D C' |6 ]% r. ~# L& b
#debug% N8 Z8 Q) _* c3 h) Q2 U. M
#error_msg$ = 0
* I" x; r* l% h% i4 A% q #err_file$ = 4/ t# O5 d9 _$ J+ B6 S
#bug2$ = 40# B; s3 c9 O0 c$ B6 K* }
#fastmode$ = no$
: W f5 L! F: |* ?! u7 [
9 R# |1 R" m7 m [" B5 H }# \
9 d0 {3 f2 F% H. F: ?$ A: Y7 m. O) o# p+ b8 S4 s
# --------------------------------------------------------------------------1 l& l) M0 T* Q
psynclath$ #Read NCI Axis-Combination (950) line
! A1 T' c- F0 t% ], m pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters5 v" q/ s! g- h2 ^9 m3 d( V
#Rotaxtyp = 1 sets initial matrix to top
* N; ]; q0 m8 K; [2 b #Rotaxtyp = -2 sets initial matrix to front# H( U* G9 \" O* ~+ n' [: `5 p
if vmc, rotaxtyp$ = one
6 i; h5 Z2 `& l; C else, rotaxtyp$ = -2
$ ]( v+ Q/ z3 j# _4 K, D6 W
* Y- n/ `! \/ ?: ^; x# F1 Apset_mach #Set post switches by reading machine def parameters: U7 X* E3 S' {& O( L3 z
rot_ax_cnt = 00 o- n1 }! A& Z5 {4 Q6 F& ~
rotaxerror = 0
; ^, h6 W& z; [! A* _% Y rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines
; L b+ d. Q' r5 P% q0 M6 ~
* l- t2 t& U* d# V" n: a0 R2 S" Z7 R rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$
6 D+ x6 T+ A) u; Q #Output error message if Write NC operation information is not enabled in CD1 ^9 M8 ]5 b4 h% m' z" S
#if write_ops = 0, result = mprint(swriteopserror,2), exitpost$ m X: q0 i) @
% M S$ K; `7 R( v# d
if sof = 1,
& g# a3 I/ L1 f6 g- h5 t/ w [' y' E4 M4 T" p* R" d2 \* F
maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
0 X8 W# @* d* J6 b maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value9 ~5 J" Q+ R7 {7 Y
#minfeedpm = 9999990 A+ u% k. l; [" S
#minfeedpm_m = 999999 r0 X* w0 j& i1 S: o7 m
!maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m8 p1 `: {# u8 P$ o9 |
rd_mch_ent_no$ = 0
* u0 J% ^% D$ c# ~9 L rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
+ l/ j0 L- I( p- ?( m ]- M" v( d. f. w+ m7 e" Y- i* s6 F
2 T( H( q0 o% l: D8 t# _! w( A: }
rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line9 z6 {" ]. {- k) m. l' q
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$4 X# [/ U$ K+ x
rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$
0 S6 h9 U2 h4 |" }1 X
5 e3 j1 `& a, S0 }6 \9 _ rd_prm_op_no$ = op_id$, }; y. y+ ]) n: f
rd_params$ ----------------------------> here #Read operaitons parameters* l% v- R8 f2 F) n4 H; m$ t1 j
$ \! e5 Z' [0 N7 E/ K+ L! 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
2 M0 V6 J/ e% v0 n$ y9 x% K if sav_rot_on_x = zero, rot_on_x = zero& ^& D- G% I. A
else, rot_on_x = rot_axis
. J4 b( A9 [+ P/ S: s rot_cw_pos = rot_dir1 `; z" b7 h; T: j
index = rot_index
1 l) \5 o( s2 @# E if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD' i9 V4 l8 n9 ]! m& W2 X! i; k
else, ctable = rot_angle
+ N! n$ U7 C7 k, b9 Y. x E
+ I* w6 H/ s5 [( H( t; p5 o if met_tool$ = 1,
' b- v6 N4 s7 w% g- r2 Z [
5 t/ S R- _( x; I$ C. u. j& w maxfrinv = maxfrinv_m #Set limit for feed inverse time# X0 t7 c7 a+ t& o6 D$ q% M* e) O* Z: o
minfrinv = minfrinv_m
2 Q% c2 F1 {5 x3 ] maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min
, f2 T0 i8 z0 I7 v+ |7 H minfeedpm = minfeedpm_m% c" E: d3 K+ {* ~) D6 G& ~ M$ o
]6 G& z0 k; K! s1 x
& G2 C+ q( [& U
if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label
/ e1 s. E/ I0 e. j6 s. q- n
# V" Y6 v- r- p A* e+ x
/ e; o# s9 W6 k- @! p2 [( S' l# [; t1 u+ ?: o- c v
|
|