|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。" ^6 f% M, s. o
J( F" Y6 W$ y/ j' C
# --------------------------------------------------------------------------
/ _3 N7 _* U* B# Parameter read postblocks:
, Y3 {/ {2 n; `: {" F5 ]# --------------------------------------------------------------------------
+ e) U: @( o9 K2 mpprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.8 r* q5 q1 m: [; E
param_read$ = 1 ----------------------------> here
. U8 a3 o* S* M l B: M #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!$ [( }1 v i) |% f; m$ _8 o
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE), \5 T8 j# u% m F6 @
rd_md$ ----------------------------> here #Read machine definition parameters. E& T2 U2 p& A; w6 z
4 C+ z7 ?5 |! J
#debug
1 h! ~* i/ Y$ Y$ D2 V #error_msg$ = 0
/ V' [# m# E5 h( M4 t, b. m* s #err_file$ = 4
K$ f) [( K$ D! n3 A3 d! | #bug2$ = 40
|7 i A2 d1 ~ #fastmode$ = no$
, w) e7 D* ~3 a3 x, [( v
' L' ]0 \1 p5 p
5 D2 G% E" S* z/ r- P$ W3 L* T: h( J+ a9 z T# ~3 {- j$ o5 [
# --------------------------------------------------------------------------
& J3 d/ ], |9 ypsynclath$ #Read NCI Axis-Combination (950) line
0 p6 x V" Z6 B1 D2 n1 d+ d/ [& k pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters
7 t s+ F! ]! |0 E #Rotaxtyp = 1 sets initial matrix to top P3 V0 z, u, C% m
#Rotaxtyp = -2 sets initial matrix to front
5 @, ~$ j6 x3 o- {- G; X if vmc, rotaxtyp$ = one- q3 q8 }# E- ~* e8 Z! S) W
else, rotaxtyp$ = -2) ^, l3 S6 H& N3 v# X7 @
' E/ u7 M% P- Q3 W8 \+ Jpset_mach #Set post switches by reading machine def parameters
) a1 J: o' ]* M/ f4 T' s rot_ax_cnt = 0
& |+ w6 K$ ]7 t rotaxerror = 0
" }/ S$ Q! K7 S0 Q* m rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines
3 H& O' |% D3 N3 e% z% J+ {' l5 {4 x( K q. s! U+ P7 Z( c
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$) j! [; u4 a$ _6 P7 I7 K! e& q
#Output error message if Write NC operation information is not enabled in CD
- p1 r p% J( i# }; Q #if write_ops = 0, result = mprint(swriteopserror,2), exitpost$6 [3 o" n) u3 t( W
% E4 R+ O3 K! N( P# }
if sof = 1,
& G6 f8 E) p& b/ @# W# V% i- O [: U7 l/ q! C8 r. P U; J; r4 G0 R
maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value: `/ B! c: d2 M0 ^7 f4 q* N
maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
$ u7 C, L2 c* v& x/ v. _. o #minfeedpm = 9999994 I) P, w u; ^0 r" d1 b Y
#minfeedpm_m = 999999
' k( u3 N$ J4 l% c$ o7 b !maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m
6 }* _; N/ j9 u rd_mch_ent_no$ = 0
: W; z# {) t3 q4 O, S3 f rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
3 b! f s0 Q% C, |4 w) S ]7 H2 U6 _) j/ U7 k& v2 B
! w& v6 j! R/ v: n- u* Q: l
rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line4 I# f, M9 s5 T$ _5 u) y
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
1 y, I! J. t8 f: R/ ] rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$% k# H3 A$ R! _8 L0 l6 Q m. N
1 n$ N2 d+ P. M0 @4 V+ E- l/ k) r
rd_prm_op_no$ = op_id$- q5 e! V f* t! D
rd_params$ ----------------------------> here #Read operaitons parameters N6 r' y" s$ ^! b V" l8 }" k
) @5 |. v- y3 {& h6 l6 h) C
#We only need these set at toolchange (and start of file). No need to set them each time a user may call rd_md
! Z0 |, x7 ~& }# P, l/ _) o2 ?* j if sav_rot_on_x = zero, rot_on_x = zero
) c5 j6 A0 |" m/ q6 w, z& } else, rot_on_x = rot_axis
4 ~& l( z3 u( U rot_cw_pos = rot_dir
% S$ U5 T" |; L ]- }- ?2 X index = rot_index
- o( D% S z. z: X& x& [ if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD6 z5 {# U( c8 D! j1 n9 R6 @1 s
else, ctable = rot_angle
$ f, f' M9 k* w$ A' ^ P0 j- g8 ]! l
3 D. m$ E. f( h3 _* W if met_tool$ = 1,4 E2 f! p" q- G0 m
[1 u, K7 q$ o" _" g
maxfrinv = maxfrinv_m #Set limit for feed inverse time
, x9 E) m) O& y5 o6 ~2 q minfrinv = minfrinv_m" k2 \+ [. ~) T; ~$ q
maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min5 ?3 @% ^9 b* `
minfeedpm = minfeedpm_m F7 d0 F1 G; F; G( M; w6 W$ `
]" c1 f& P3 R# V3 C
. r1 ^2 M" e7 w, T& S X/ a
if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label1 Z* i- u! F$ u# D3 k
* ]8 ^. n& V) Y6 q1 P1 c
; i* J1 e4 E1 H* L9 u
2 m8 Z7 r1 b5 g+ F; Z# b P |
|