|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。3 |7 }& t! V X1 M& B% y1 G
: }7 P/ L, L4 j0 w; M# --------------------------------------------------------------------------
{2 V( {! h6 i- U# Parameter read postblocks:
! j, g- g* Y/ h2 P# --------------------------------------------------------------------------
! W, r9 D- e% O; b/ D0 jpprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.' m/ O! a# p" ~
param_read$ = 1 ----------------------------> here, Q; I0 c+ @- \8 y# d
#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!4 S5 U! B! V, d) u( J) R5 C+ [. R7 J) @
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)
/ |$ z6 ]0 }5 Y, ~9 j: G5 c rd_md$ ----------------------------> here #Read machine definition parameters
. z3 N& X$ N6 ]2 a( A; w3 N' ]6 }: e, C, w* j% b; t# N
#debug& \2 R0 ~2 m2 g- s% d5 e) G
#error_msg$ = 0
% i* i! Q/ X5 P* Q& i6 b #err_file$ = 4
: y1 C G% m! @ c #bug2$ = 40. E n; W% ~1 I7 l
#fastmode$ = no$9 o0 O% D- P4 {7 a' }/ r% ^
/ P0 @1 H# `& t5 G# N+ l# P. w9 q( D8 r* V7 {1 x3 V* P5 Z6 k
) ^# n# Z& b. {: a2 M
# --------------------------------------------------------------------------/ x2 I0 P- r1 L. ]& V
psynclath$ #Read NCI Axis-Combination (950) line) ?- U% ] Z5 M
pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters
5 L4 `- }; W* b2 U7 C! B0 q #Rotaxtyp = 1 sets initial matrix to top6 p: d* T/ O* a: k; Z2 k: V6 ~% M
#Rotaxtyp = -2 sets initial matrix to front
7 l' Z& u2 C9 x, Z/ E if vmc, rotaxtyp$ = one
5 n3 C6 K: `* t* s q else, rotaxtyp$ = -2# f+ N/ p; k" U3 W& ^
& R S" e3 e! V) t; j
pset_mach #Set post switches by reading machine def parameters% N0 w+ K; I8 e: N- q7 a
rot_ax_cnt = 0! K. B/ ^7 t( v+ \
rotaxerror = 0
7 E7 t3 g) j+ ~, z9 Z+ | e0 i; `& P/ ^ rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines8 d' I+ e# ~: ^& f9 b$ C4 v
l2 Q/ q4 H. V
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$: U8 {2 k, n0 w; R0 k' _
#Output error message if Write NC operation information is not enabled in CD9 M0 p" H3 D: m6 f# H+ X6 T/ \4 b
#if write_ops = 0, result = mprint(swriteopserror,2), exitpost$
3 g, V$ S7 g7 g7 u7 U" q3 a, H- p$ G/ t
if sof = 1,
% H+ G; T; A' h1 o* @ [
9 s; k# Z5 r; o2 z3 b% k% m maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
6 f5 b; w" q B maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
/ f" b1 J0 N8 b' y( _ #minfeedpm = 9999997 \1 M* o$ l( B
#minfeedpm_m = 999999! j1 o, y+ [; e% A
!maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m
0 i0 j' q8 }3 \% [& G* \ rd_mch_ent_no$ = 0
! C$ ~& h; d7 `; J4 v rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
3 E8 r7 Q" f$ M ]
# F" }5 J4 M( ?4 l8 `: a6 C6 @- N
rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line8 F9 w- [7 D5 e+ a& R7 g
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
) H( S. U6 E" G) u0 d V rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$
- |+ o/ _/ B. z& ?4 {. I/ z
! Y& [4 i" ]: O' L1 |0 H* Z rd_prm_op_no$ = op_id$% G1 w6 M) p; n6 `: c/ T1 C
rd_params$ ----------------------------> here #Read operaitons parameters
! w6 ]' C6 \0 h$ v s- X \2 `( X2 q1 b3 x5 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
% a( Q# Y0 z. c7 d$ k7 w if sav_rot_on_x = zero, rot_on_x = zero) S, H8 F' P: I
else, rot_on_x = rot_axis4 n4 _! m. j J0 {& H" x
rot_cw_pos = rot_dir4 J8 u5 ^* Y7 S4 u& E
index = rot_index
: D+ v& q' \" N$ j# ?+ v if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD
M* }. d" i2 }* j7 {3 S1 t8 H else, ctable = rot_angle9 y8 F4 ?: L. Q; H
, q( x: w/ l8 a) F2 W( Q) `: M if met_tool$ = 1,! ]5 }5 o8 ^) o; Y
[
3 H/ t& o; Y$ y" H, G maxfrinv = maxfrinv_m #Set limit for feed inverse time
; A* Q$ i {2 x7 W3 l8 n0 _ minfrinv = minfrinv_m+ B' \: h0 L+ H, }- @2 C R2 y( G) H
maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min* z( W/ z# _. ?0 a9 C5 V- U
minfeedpm = minfeedpm_m
# p0 t# s5 }8 p# `0 \ ]* Q9 X4 I. d) f, b
4 i, e# f# w" W5 i if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label
6 \* u0 z# l8 M. P2 V. d; ]. R! g
$ y1 S8 R' P4 O# i0 e
" z4 ?4 _' o! d6 Y; m/ z% O2 i: q! Z1 N6 n; u
|
|