|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。/ A: Z2 K/ Z# h$ {5 K# {
' z( y) | V; U+ U# --------------------------------------------------------------------------0 C i9 R7 v5 W" A9 I8 v! E3 N; U+ y
# Parameter read postblocks:
: q4 f8 A$ i d3 ?# --------------------------------------------------------------------------1 P1 C/ f/ [7 v9 Y
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.+ P5 r% k O! F! j' r X
param_read$ = 1 ----------------------------> here
# E+ n) d% |6 f #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!
5 v9 r/ v0 D' O rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)
- O% p* V4 _7 {" `* J2 ]% V rd_md$ ----------------------------> here #Read machine definition parameters" e) C5 h+ ^% G0 u, d6 {
: N) o& H% L+ w* |$ }# _; t2 u
#debug7 M' }* _" `. b2 R
#error_msg$ = 0
) s0 E. d/ C: S8 o( Z5 a) a, i: Y v #err_file$ = 4
9 O* p; l B* D# B! N #bug2$ = 40
( X4 ?3 A f( e* @3 N: d #fastmode$ = no$9 T6 ?% h z8 T# ^: x; Q0 N
& u% D- V% J; c' a
; D4 p6 N: \2 B/ F# [0 W
; J4 A# W4 X9 t* Y$ |/ K# --------------------------------------------------------------------------
$ Y3 d, q+ ]3 x3 ^3 A6 Wpsynclath$ #Read NCI Axis-Combination (950) line4 J- U" k* T) ]
pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters
* F2 ]' {2 w. Y+ N0 a #Rotaxtyp = 1 sets initial matrix to top: S# a- |$ D. q
#Rotaxtyp = -2 sets initial matrix to front) ]( q% q9 I2 X# e; u
if vmc, rotaxtyp$ = one" s- n' J( R: C8 o0 A
else, rotaxtyp$ = -2( O$ {/ ^0 x1 F5 K* w) b# R: F7 a
( H% t7 J5 F$ R8 rpset_mach #Set post switches by reading machine def parameters4 ?. t1 ~+ X& I
rot_ax_cnt = 0
5 f# `3 }7 D: t L rotaxerror = 0
( @. w7 \, Z2 M6 s6 u" H rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines' c- c/ `6 ^, q. q
6 R' P9 ?# ?. q$ @: n, U
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$
7 [) c, K2 s$ z/ q: w #Output error message if Write NC operation information is not enabled in CD
, c7 i: t# }3 |6 i- R+ q/ o! d/ j #if write_ops = 0, result = mprint(swriteopserror,2), exitpost$
# t* r( P! Q3 Q _ G, b2 j
1 o a) ~; m% @& J/ E+ Q9 P! a if sof = 1, Q+ w( ]) c% W) A5 ]
[: W! M) |2 a- v, D# D: ?' W9 I& O
maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value1 ~6 Z, H+ q, Z- i1 E
maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
2 N: Q% \6 Z5 y# q #minfeedpm = 9999992 n7 e$ q3 G: j. b4 \5 `9 ?% e
#minfeedpm_m = 999999
s& U1 q$ @$ k. N" l0 b !maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m' x8 S; n3 ~. A: e4 k: p L a
rd_mch_ent_no$ = 00 i, ?! l# Q7 f
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
A! S2 a! G( P$ } ]) {( W( b- z# m, |, m$ K* U) Z
! B0 s+ `7 x# f; _ I% }
rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line
( i) j- V1 d2 q$ D7 Y rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
# I" ^ i: N0 X8 \* ]: ` rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$5 F& D% p' X4 y' ^' k: E: V$ v2 B, q
) |3 G9 p( ?# P# v1 W rd_prm_op_no$ = op_id$
, m( J- q1 P" U8 y$ S rd_params$ ----------------------------> here #Read operaitons parameters
/ V8 Y. ?% O" P- ~/ O9 r
" l. X3 W C2 Z #We only need these set at toolchange (and start of file). No need to set them each time a user may call rd_md
1 ^* T0 p: B2 i, l5 } if sav_rot_on_x = zero, rot_on_x = zero
7 m6 K F: ~7 Y9 _ else, rot_on_x = rot_axis
: F- t6 L1 ^' ?0 p! M( b rot_cw_pos = rot_dir
, J) r3 j! N, n6 C index = rot_index& r+ R- E0 ~/ s" _, J5 p: _
if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD
) u+ b& d9 q- c- T/ `0 ]* V else, ctable = rot_angle1 A+ b( s* L) I/ f0 v
1 d4 S6 o/ ]2 l if met_tool$ = 1,
6 A& T! }- k/ U; Z. ^) X6 ]6 | [
1 M S, q8 Y9 s6 X# @% E4 H T maxfrinv = maxfrinv_m #Set limit for feed inverse time$ @, ]$ _' x5 s! i) n. `9 J
minfrinv = minfrinv_m
* @! D: N) `; q# B: N. f" r: B maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min
/ R* c5 W1 r% P% l7 m4 D/ N5 t minfeedpm = minfeedpm_m; C* B, L4 K! Z3 _6 |9 j) v
]/ O" @0 V+ L9 W. C3 ?) d
0 u2 f/ |5 w( q' T2 j2 M
if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label+ g, i) f/ g7 @ \
, r' x5 Y, r9 J" K5 j; z6 o7 u
' I$ |) n. X, ^* e- T) ?& M
' i, R% n! i& S% [ |
|