|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。* z L8 E' G+ O$ |! O7 B6 n
$ V. D, j& A$ i, c9 d$ i+ k7 @# --------------------------------------------------------------------------
! ]' ^2 Z9 Y! a7 _$ A) y+ B# Parameter read postblocks:, ?3 Y: K! V/ G" D4 |3 t" {
# --------------------------------------------------------------------------$ r, a' j8 s6 P* H: p
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.& T; M8 K2 ~$ f4 M8 h6 s
param_read$ = 1 ----------------------------> here
, d/ a m7 i0 r7 ?. {5 N4 F+ t #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!
% m0 G% `; y# [) a6 N9 F& e$ c rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)
8 `; C. T' A- E o" m% y rd_md$ ----------------------------> here #Read machine definition parameters
! l- E* ?4 d- f4 {* [3 I
! i) Z3 J% T% p5 k6 f #debug
, `1 p+ e' }# H+ K' r$ Z #error_msg$ = 0
@3 b7 x' A2 s #err_file$ = 4
4 S* c3 J) g4 Q+ J& H #bug2$ = 40
7 @8 c) b/ _5 r. ^3 L' q7 {# \+ C1 l #fastmode$ = no$
6 r {: j+ u Y! w) [0 U
- n% g {# P J) W* v2 B
$ L- P N# T& G7 m/ d* S: |2 e9 ^" e# @& B9 {
# --------------------------------------------------------------------------
1 g4 r4 O P g; c F5 m* Opsynclath$ #Read NCI Axis-Combination (950) line& l( z( N& B! h8 ~
pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters
9 J4 `( r; K: S2 s #Rotaxtyp = 1 sets initial matrix to top- E, ]: z4 f) D- ?
#Rotaxtyp = -2 sets initial matrix to front
5 i5 W' `/ L0 C% V9 l4 S8 C if vmc, rotaxtyp$ = one, J3 B1 H. e4 A2 y& @
else, rotaxtyp$ = -2
7 k1 ]" ?" m& T2 d3 O3 ]5 s: h0 _% L! Y
pset_mach #Set post switches by reading machine def parameters% b$ i1 b2 a& X( ^
rot_ax_cnt = 08 q, x. r- T9 M* L" ]7 @
rotaxerror = 0
0 |! g' K3 H9 i3 u q3 M. Y rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines6 o/ J2 ~- _; U% f% J- P. ]
) q. x5 H/ R5 ~4 Z" _+ Y
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$/ d1 _' T# L5 z
#Output error message if Write NC operation information is not enabled in CD
4 o$ D! L: Z# ]) i# y7 ?) t #if write_ops = 0, result = mprint(swriteopserror,2), exitpost$
8 {1 @$ ~8 U1 {+ \1 E- ?* Q! P7 t+ I; }9 ~$ v) j! W
if sof = 1,
4 V, Z# @' T+ ^+ F/ f1 g( i [
9 g1 X* m% ?0 Y5 K maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
, R$ a3 u- v& h maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
- n8 z5 b. \0 H2 ?" {- L+ e) V9 } #minfeedpm = 999999- N: B. u/ N) b8 I/ w4 b
#minfeedpm_m = 999999
+ ^2 M( k4 H2 s T !maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m
' b1 z: m6 b! P! A& A' O. W: _7 O rd_mch_ent_no$ = 0
1 ~) A! ~7 c3 J# a+ {# Q rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$6 E0 d* D3 Z8 a
]
) F( n* T* r& p, ^
! S; k6 A4 @* n7 m, N; S. ]7 p rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line0 d9 V" E+ l" j% Z% a7 ~
rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$+ A9 d/ U. A, b2 b6 P6 }* I7 g/ K
rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$3 J7 G% a# l5 P( X
8 m3 {" d1 n* o+ l rd_prm_op_no$ = op_id$" O# R! u2 d9 O6 K+ V
rd_params$ ----------------------------> here #Read operaitons parameters* k% B: f& Q1 x6 n
2 E4 Y$ T, v0 c( t; [$ t
#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- D4 `6 [3 v& b p! S if sav_rot_on_x = zero, rot_on_x = zero
7 q0 G. C5 u2 J$ m, h" u else, rot_on_x = rot_axis( U2 U2 e' [+ D5 b6 f2 Y4 s, S
rot_cw_pos = rot_dir. P1 X8 t3 G, T. Q/ z5 ~7 W
index = rot_index9 s& t. a( j8 o1 E" l# Y" V) y+ e
if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD9 C6 K# z( m3 |$ f7 _8 o
else, ctable = rot_angle
' f8 F9 { j8 n; a8 @0 U
' b2 |; H( j0 O7 e6 D if met_tool$ = 1,: z0 x2 Q: R1 T+ a5 S2 T
[
" M2 u n% x1 r K& t* p+ y! v4 i maxfrinv = maxfrinv_m #Set limit for feed inverse time
: E, o6 K1 L8 W7 y( k8 v6 o minfrinv = minfrinv_m
0 N0 H; T# E* a: j$ V3 C: [ maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min/ j1 A* x# M& P8 O: z
minfeedpm = minfeedpm_m
( U* |* `8 o( K9 w/ [4 q' _ ]
: L6 ]7 p: r% a8 r, C8 x: S5 H& @ r8 x! d M
if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label
( S% d* d) \; F3 i! x" ?6 m" S, K' F2 z
6 {3 P% U |2 M+ }* G
( g1 B" n4 @0 h% K2 g6 W+ g3 N7 @ |
|