|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。$ _" P/ y7 L G7 N3 |. G
" b" Z! v, M0 m# --------------------------------------------------------------------------
# d1 |# Z K5 _3 c( Y# Parameter read postblocks:/ C5 y5 \' n9 M* s$ y1 a7 s
# --------------------------------------------------------------------------% h+ @4 G. C0 G! ]
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened./ U0 S2 D$ ]# H+ H. Q+ L
param_read$ = 1 ----------------------------> here
; v3 U+ ^/ G+ m: Y7 H) U" t( K #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!
6 A' G- l$ G8 {# `0 w/ f! [' t- i rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)
% e- P7 l5 \% D8 U+ ] rd_md$ ----------------------------> here #Read machine definition parameters3 g% B1 h6 @5 u! \
( A9 W4 a+ v, i, |! | #debug# d, _4 O ^, p
#error_msg$ = 0
3 q! J# j. G1 D q, ^ i #err_file$ = 4
2 y4 {8 J! x# r* | }! P& i+ b! V #bug2$ = 40
" [3 A: ^ _, h% d* o- N( o #fastmode$ = no$
& e! K% c" R2 M. n# Q
3 m/ t4 ?9 ?5 i
1 F; c( N( P+ D2 x7 d( S s2 }0 |/ r# l. Y
# --------------------------------------------------------------------------
9 _* L. E5 i- f, apsynclath$ #Read NCI Axis-Combination (950) line; F' ]: l @6 }
pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters2 Q! K7 [) v7 o& ?/ C
#Rotaxtyp = 1 sets initial matrix to top
8 u1 a# H- m) e% U2 T: h& L- Q #Rotaxtyp = -2 sets initial matrix to front9 O( X# M5 Z8 Q& I( N
if vmc, rotaxtyp$ = one. k$ W5 f0 F; U3 c
else, rotaxtyp$ = -22 V: f- |: s8 o
3 d5 D1 Y' N/ U
pset_mach #Set post switches by reading machine def parameters
& Q7 |+ E6 R0 I- ^5 N" } rot_ax_cnt = 0
/ C# y% W' Y: p5 d( I rotaxerror = 01 i1 @* Y- }9 _8 }
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines2 |/ R6 R& b7 x; n$ D
, _8 R- E y& w5 ^, z- v3 E1 ~2 S rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$
4 U; L( o9 Q" K1 D* B, R #Output error message if Write NC operation information is not enabled in CD6 _; R! w9 @- B2 J. J" D
#if write_ops = 0, result = mprint(swriteopserror,2), exitpost$+ G e! f! f; O
$ l* K, e9 n$ t) Y% E/ E if sof = 1,
8 W! |8 w6 k+ | [
/ k7 E1 O9 d$ i; O1 U' G! x* L% h maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
% f; i0 d8 Q( p' L maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
- D- m6 p: r% I5 p #minfeedpm = 999999
, i3 t% M' |2 e2 ~ #minfeedpm_m = 999999
7 w1 p) e$ y( C- W! D; t: u !maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m- ?) y& I9 \3 s) O2 a# F. u: u0 ~
rd_mch_ent_no$ = 0 E" G/ T a3 E' `, W* l
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$0 D4 h% E% k( U5 t8 q
]
+ ]3 o, M$ v1 `! ]8 {1 ]" Q1 t; Z: c" \" D( Z
rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line
3 u/ G4 _+ X; G7 {8 m( C rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
7 s0 u" v3 ^9 y1 |1 ]2 ]- q3 I% c+ P rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$
1 E0 \2 Y, t8 O, Q& E
1 Q3 i% q1 d' v0 _2 k& p rd_prm_op_no$ = op_id$
0 E" t* I" q- V t0 D2 Z! s rd_params$ ----------------------------> here #Read operaitons parameters5 l6 g, n ]" c' L! u
3 n3 H4 q9 v" u, [/ K# _" g- I #We only need these set at toolchange (and start of file). No need to set them each time a user may call rd_md
8 Z! q) R# u) B( N0 T4 Y if sav_rot_on_x = zero, rot_on_x = zero
- i" h2 K3 I1 a/ k else, rot_on_x = rot_axis
3 X0 x$ x! G" R* o# j; u6 A$ A rot_cw_pos = rot_dir
7 J5 M( t. S: F1 I; p index = rot_index
: H' I/ f) m/ x; q7 F if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD
$ W9 Q( V; b+ z( c2 v0 G/ ` else, ctable = rot_angle
- ^/ Y! d# s! v7 o5 Q( y7 G W( W+ L/ w
if met_tool$ = 1,( C: `! u1 V& z2 }1 ^ H: S
[
5 ?9 y3 f) q1 G; W maxfrinv = maxfrinv_m #Set limit for feed inverse time5 C2 p$ w/ b7 j) Y& `" I
minfrinv = minfrinv_m8 W2 F' m2 F! @7 S; L
maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min% }& R0 T8 o; _8 O9 {
minfeedpm = minfeedpm_m' H! [0 w5 M# K. ^
]7 W) B3 V; G5 e5 B& k
' \# K f* `8 O' b4 l
if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label/ }1 {6 @& P2 P. t! E" B# }
. ?" o: @* ?$ y: V4 z
' v |: u+ i" g& J% b/ O
% _: v% g/ c* [ E, I |
|