|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。
5 }( i4 X% k, n7 v e: [7 v) T! S+ g- W
$ Y4 T1 v5 Y# ~5 M3 {% w$ o! x# --------------------------------------------------------------------------8 z* z. H0 F* ^" B' ?
# Parameter read postblocks:! P$ |% \; l. A9 ^0 B+ n+ V% r/ |
# --------------------------------------------------------------------------
8 b, b* N P0 |+ Zpprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.
: R& d9 R& ` c+ L8 u) ? param_read$ = 1 ----------------------------> here j; f. ]7 ~4 o4 c8 N. 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!
+ s1 @/ Y9 R7 R* ]4 ]3 { rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)6 ?% m& _6 O& N0 C# q" v9 q4 d4 D
rd_md$ ----------------------------> here #Read machine definition parameters7 w5 M) U+ j6 K9 x
/ `5 I( w0 \3 d2 _8 P" \
#debug# o% I2 O: K# v4 U
#error_msg$ = 0
7 N1 N) i! A" t4 v #err_file$ = 4
3 n# \. \$ C0 d! I #bug2$ = 40
& }1 ?1 @* L+ ~/ ^8 Q( @/ } #fastmode$ = no$
: A9 w) _7 P2 b+ z
9 J, u* X' P+ i4 ]0 o- q( v' A
: X; U( S1 P) h+ q& l1 O
# --------------------------------------------------------------------------
* }+ Z, _0 ]" {' e# g, g9 y) Ipsynclath$ #Read NCI Axis-Combination (950) line
5 j% B) v' |/ |1 L; E( P- D8 P pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters
2 W2 k9 E- x; D5 t, t/ s, D$ | #Rotaxtyp = 1 sets initial matrix to top4 o- W _) X; O4 d8 M5 c- J
#Rotaxtyp = -2 sets initial matrix to front- Q" Y; W- F: G ]& J
if vmc, rotaxtyp$ = one, Q; D0 h9 G. q/ K/ B1 m- _' p# {
else, rotaxtyp$ = -21 R& b( c; n2 q, h! _7 v+ z
) F. C: \$ Q3 c* ]1 e' |' npset_mach #Set post switches by reading machine def parameters& \" x2 a0 f) |3 H6 k& S
rot_ax_cnt = 0) T* v% \0 O7 F* Q" e6 }- h
rotaxerror = 0# B8 N! n! `* f. G
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines
( z5 u7 n# x( T$ R1 I' H8 [" j3 t( Y9 g( c0 p/ Z/ m3 t
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$
Z) B9 U# R6 H, k #Output error message if Write NC operation information is not enabled in CD3 U' D4 V/ f) M) ^: ]" N/ ~3 P& b6 c6 z1 R
#if write_ops = 0, result = mprint(swriteopserror,2), exitpost$
8 W& i* i, |5 p" H) c3 A7 z
% N+ i6 G, D' k# M if sof = 1,
$ b7 U7 R: b4 q+ x% q; w9 j5 n [2 p2 O* H" J, ]/ }, Q
maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
5 u* F6 u$ U, H: j+ ~+ l maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
7 @, Q* h, ~$ V/ d: W/ H% u #minfeedpm = 999999
2 d5 ^% B2 ?1 } x) B( r3 k0 j #minfeedpm_m = 999999
' B/ [5 i6 J! t !maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m) ]7 o% ?4 z c) u* t
rd_mch_ent_no$ = 0* J5 N# V* y$ o! j
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$ E% ]: ] u' n5 j. U% V& E: i# g
]; e/ x( A9 B9 L) X6 A$ Z$ I
3 q, s2 k/ a2 h. K
rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line
8 G- W* f" P6 C, t; N rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
5 {3 @8 J/ e) M' ` rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$
) l( v, x& Z% q& f: m4 B4 S" ^. i- _" `3 D. L
rd_prm_op_no$ = op_id$4 ]0 d% J8 K7 R% L# Y) m- e
rd_params$ ----------------------------> here #Read operaitons parameters; n; d# o3 Z, R- }9 ?4 D4 [
' T9 o; Y+ M) S# H% 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
$ {: ]' e0 }" E& W7 e" G4 H if sav_rot_on_x = zero, rot_on_x = zero
, N4 Z: C0 M2 t! Z else, rot_on_x = rot_axis* T0 Q( }8 i: S1 n; a. a/ J4 L
rot_cw_pos = rot_dir: f" g9 U! F3 p
index = rot_index
/ J0 t I# T+ M& h* P; B4 J if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD
# n) P3 b! i+ U% f& t( V else, ctable = rot_angle
. D9 ^% n! F) f4 s
/ h1 x$ d2 V/ N0 a$ x3 x if met_tool$ = 1,
1 `+ z8 z9 B6 J) j [# H! V* S8 l" W+ _3 n" h6 e
maxfrinv = maxfrinv_m #Set limit for feed inverse time. j! a1 d- ]0 U+ m4 Q3 l8 ^
minfrinv = minfrinv_m9 }( C8 x( v+ O; l% t5 {: j" y7 |
maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min
' s% ~* O# C, g0 \- A minfeedpm = minfeedpm_m
7 Y- N8 z S4 F ]
, p! V- P/ @/ i- ]+ j7 ~3 W0 k9 ]7 A# b' U0 T/ X! x1 h( }
if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label9 _4 w8 G {: {
) ]. O3 M* o! o X, Q
( }( e9 \! d3 t5 Z* o5 Q" P: t3 T3 ] u* e* y
|
|