|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。9 _5 K4 s, {+ S+ P
2 H+ w9 h' o; @/ y) F
# --------------------------------------------------------------------------
0 Q" c! V9 u- w `+ z' Y6 B# Parameter read postblocks:
7 H3 @- y- q! U, I- \' y# --------------------------------------------------------------------------0 R4 h& }( [9 H. V
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.' J' V W$ y$ |3 _! E U0 x$ b
param_read$ = 1 ----------------------------> here; i* g2 y# T7 }) c
#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 G( p( y* j( F
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)# @* ~ R* @ R% b. I
rd_md$ ----------------------------> here #Read machine definition parameters4 J/ @/ F5 h) b9 R J# {/ L+ Y
% b3 ^- O$ ?6 S4 R( {7 b& u #debug
+ k) C# f' |$ K' F/ W* U& i$ v #error_msg$ = 0
2 T1 Z$ z" @! q+ C$ H2 z #err_file$ = 4
2 G+ b9 P8 y; d4 U0 e #bug2$ = 405 z, a# g6 p* n3 V2 N
#fastmode$ = no$
4 ~; q [6 m% Z( A) z# s x, {' n2 |2 f
4 H# U. C4 I( M: _0 ]# E' m! P+ v: ?. l+ J4 @5 O
# --------------------------------------------------------------------------& Z# X) P& G# h) w
psynclath$ #Read NCI Axis-Combination (950) line
- q- \. z1 c( }5 S7 `0 q pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters4 O5 C' i% t. T! x/ ~
#Rotaxtyp = 1 sets initial matrix to top
" Z. M1 }6 u: O$ P #Rotaxtyp = -2 sets initial matrix to front$ ?" G4 h7 D1 x7 {
if vmc, rotaxtyp$ = one! b$ n7 e5 B D) N3 B
else, rotaxtyp$ = -2
, e2 z- W" Q( `. \5 ^$ ~1 @) g0 {- ]8 o( a1 M5 T' o' s( @- }) B {3 t
pset_mach #Set post switches by reading machine def parameters$ O) e( B- J9 W( B1 e0 y
rot_ax_cnt = 01 L: Q" g3 c7 @9 A
rotaxerror = 0+ F% I" s; I' t+ T
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines- n) C4 v6 o& Q6 P" R$ l4 s
/ q7 S& l# r* U4 W( x# d+ v2 w
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$) I1 w1 C" L* Y) i/ d
#Output error message if Write NC operation information is not enabled in CD
. I, D2 o9 D7 T: {* M% Q5 q #if write_ops = 0, result = mprint(swriteopserror,2), exitpost$# n* P: s& n8 ?$ @
0 I7 Z! x& i6 d' [: U% P
if sof = 1,; Q) s0 s! m1 V$ C
[6 K5 I0 q& S7 S
maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value% m- I- W( n3 q& o: z2 X2 B3 P
maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
0 o6 w7 s5 F% T' C #minfeedpm = 999999! F8 Z b1 z) e
#minfeedpm_m = 9999991 g/ t3 j- C$ | R
!maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m6 \" C8 t" V U7 d- _* @0 t
rd_mch_ent_no$ = 0
8 y$ g8 O4 U# t! r* d! D7 _+ N6 S# A; C rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
# \( Q7 w- P9 p; n ]7 Y( x. `0 m# Q3 X. X1 k0 g$ C
* v7 g, K( W/ a rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line" {$ V& }% q r# L8 Y
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$( j+ S* n8 Z9 k
rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$
8 m( b: m+ v- R8 p0 \3 _0 s3 Q4 I# q- ^4 E6 {" E- t6 j( ^
rd_prm_op_no$ = op_id$ o. m6 }) e" K6 S% v' T \( C. e1 z
rd_params$ ----------------------------> here #Read operaitons parameters9 l% }. [* v" y8 D3 B* c i4 e
5 ?* R" Q0 d9 X9 |- t7 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
/ K( Z _( U+ i2 ~ if sav_rot_on_x = zero, rot_on_x = zero9 q c3 J( |/ w9 G8 s: W
else, rot_on_x = rot_axis
! b$ i% I+ Y" y- J7 ]" T- l rot_cw_pos = rot_dir" M t0 M* T( H; A
index = rot_index A# X6 F( E1 I! P: w, @1 {2 t
if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD$ n- K3 ]6 c; Z# p' P2 j" g, ]7 \2 M
else, ctable = rot_angle. B- k0 M: Y1 c; K4 w* X% N
9 X$ {2 k! G; j/ p if met_tool$ = 1,: y W5 h# Z7 Q) n
[
9 i9 e; J) p9 K& G7 n2 r maxfrinv = maxfrinv_m #Set limit for feed inverse time
! U' Z( q6 P+ \ Y. c3 y, H% M minfrinv = minfrinv_m& K1 w& E! W$ h6 t2 C, L( Z% M
maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min$ A7 f; a* b" W2 h0 |- f
minfeedpm = minfeedpm_m
2 y/ y( G9 ^: ]" c, n+ Y1 B( n' Z L ]8 M4 g8 p6 n' Y8 T( ^
) p/ h0 Z }4 L5 v7 y S if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label9 ?- l% M7 }3 V& C# Y- G
B' `/ o5 ^- y9 g* n) ^
h0 b8 l/ c3 O! G" s) I
2 g2 U7 k& l4 A1 R, U |
|