|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。
. o7 @9 t* \( Y* M1 T- \7 ^) W
5 c, F. j6 H9 _$ k8 Y) [5 M3 M# --------------------------------------------------------------------------1 V! B3 B9 d( {# U g
# Parameter read postblocks:
. y0 d {# |' k- L8 ]# --------------------------------------------------------------------------7 i/ K0 w; L2 u. ?/ k" i
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.: g$ s0 l- w8 B* T6 k
param_read$ = 1 ----------------------------> here
1 {- ~& ^5 M# B, j9 o4 i #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!
; D" j6 l) l3 _9 U rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)& @" v/ W! W& m$ M/ q4 \) c. W
rd_md$ ----------------------------> here #Read machine definition parameters( x& R% T2 c8 n
) _ p: [0 q" G5 i
#debug. Q9 s! c; k( e* O% M: m! X
#error_msg$ = 0% G. K$ ^7 O1 R8 N) w- L" v0 h
#err_file$ = 4. I f* |- ^3 ~2 N
#bug2$ = 40
. ], S4 |, l, @4 b #fastmode$ = no$! V: s% A: y x9 J9 u+ x
% Q( p% ~/ W/ g" l: D Q
3 H5 M& P( g5 [5 a, V U& m6 J7 Q5 C) `6 a; T) m
# --------------------------------------------------------------------------
& ^0 u8 J. k/ h. p8 lpsynclath$ #Read NCI Axis-Combination (950) line* u' m( C) G7 Q% H
pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters- B, N$ R( p+ E& b: N
#Rotaxtyp = 1 sets initial matrix to top
1 a$ \! p" j) f1 ` #Rotaxtyp = -2 sets initial matrix to front
+ u" b( @4 {7 e# x* p! K if vmc, rotaxtyp$ = one* k. e. S9 x. C$ L4 z& z! W, a [& L
else, rotaxtyp$ = -2# h8 B3 B. ]# h) [; L
^* f0 }# b+ T3 Lpset_mach #Set post switches by reading machine def parameters
* @$ e. \2 W. A/ D" ?; {4 q rot_ax_cnt = 0
* |$ W4 S7 p! A rotaxerror = 04 b: O6 i! D; i' C8 U2 p
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines1 D0 m& M2 u+ h
( |* P7 C% J- Q8 S( |
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$
" l9 Z, M! z% \* S5 g @% y #Output error message if Write NC operation information is not enabled in CD
* f" o1 w( b2 F$ m #if write_ops = 0, result = mprint(swriteopserror,2), exitpost$
: H5 n% e& z. V" p$ Q+ W9 ~- i/ Z* e6 B. O, M
if sof = 1,. {& X& U8 a/ o& I
[. J3 c# b* i$ Q
maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
5 \ Y0 z1 G" a. f maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value2 I! ?( ]2 ]0 g) ~1 `
#minfeedpm = 999999 d: n; P i; K7 h8 L3 |6 m- L: u
#minfeedpm_m = 999999
* R2 q* A5 p$ z4 p !maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m/ B6 m0 z+ G( F0 s6 ~
rd_mch_ent_no$ = 0" Q4 M3 X# T- y8 o3 s
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
$ I; u& K, c. u* c) f ]
) |( F: I6 f/ f2 s( [. v4 Q5 i2 y M" ^
rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line
0 q7 f9 q* `* @ rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$# y8 [" Z. I H
rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$5 U, ~" v* c1 o$ g% D$ r l$ O
# d8 J, S$ G9 e; b+ k2 ~! a9 @
rd_prm_op_no$ = op_id$4 c) [, | V; J8 {
rd_params$ ----------------------------> here #Read operaitons parameters
4 I( y5 \( z3 i9 c9 ?& w6 i/ M8 Q; _" M/ U+ H u/ m7 |
#We only need these set at toolchange (and start of file). No need to set them each time a user may call rd_md
$ z7 ~- D+ g1 V* P" U# A h if sav_rot_on_x = zero, rot_on_x = zero
5 ?5 ^* G1 d7 q' n0 g else, rot_on_x = rot_axis7 c; A5 \, e8 t4 s
rot_cw_pos = rot_dir
8 v' [5 ~$ ^4 J0 [ index = rot_index3 q+ B" g5 x8 q, m* K
if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD
# H! c, |: J9 e; ~ else, ctable = rot_angle
5 d* E$ N- q- A& A$ {
2 z1 N, T; ~- K" Z. d if met_tool$ = 1,. P. }& a2 F4 F0 [$ d% w- _
[
' K2 \0 o2 b4 n; Q maxfrinv = maxfrinv_m #Set limit for feed inverse time
( F6 W- Z- W: ]' c1 |6 _9 t0 c: m$ L v minfrinv = minfrinv_m' S: e2 W6 H; F* X
maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min1 [3 @+ _4 k7 Z& w3 B {0 p/ O- u
minfeedpm = minfeedpm_m
+ [, v) ?: } B7 W& f ]
; Y* L7 Y& b8 v; T9 S4 s& G1 e# w; @. Y' c' P5 i3 ~8 Z
if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label
0 O0 x) A+ {0 W( m0 u0 |4 d
`. c: S5 g2 n( Y$ }* z5 j1 f0 ~) Y8 v+ _% W& \
) X! y# {; W) C: C! n |
|