|
|
发表于 2022-9-10 08:06:24
|
显示全部楼层
如下基础红色标记处。5 x1 X/ P2 w' }; h
; F% T }) r7 R% N
# --------------------------------------------------------------------------
4 C4 e0 p1 E! }! d1 S# Parameter read postblocks:
# ] _7 E8 h# z4 S& R# --------------------------------------------------------------------------# o& u1 G# u% H$ n5 r- [% S& B, d
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.
" t9 q' Z" ~) A* w& Y1 e* X param_read$ = 1 ----------------------------> here
, G1 T7 l2 A# i, x! d8 y# [ #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!0 P. ~, O c/ x; B( }" M! ?
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from CNC_MACHINE_TYPE)1 V# [" t4 h* M$ j8 Q) J& C( q# M
rd_md$ ----------------------------> here #Read machine definition parameters3 v5 [" ?/ V8 `. n
' l7 E* C5 s3 F; s2 U #debug
5 [$ w z: N1 B+ P6 u( X #error_msg$ = 0
2 c, L, q+ m F; U, N7 s( e8 e7 P #err_file$ = 4
6 G- r: ^3 i" t6 u4 [4 t) Y #bug2$ = 40
. k. I0 @- i# H4 l- W1 ]" p1 ?- Y #fastmode$ = no$
! f7 }; B# k0 e; a. N. z$ O) f" R+ O1 c7 M- j6 C7 E. V
( F, P) k/ X# @1 u$ s7 |( w- @2 h, {( v7 `& S& {# g# I
# --------------------------------------------------------------------------
* W S) B. p9 ^/ `psynclath$ #Read NCI Axis-Combination (950) line& \, H" R9 L) K; }, Y7 J( u
pset_mach ----------------------------> here#Set rotary switches by reading machine def parameters8 I X9 r: p" d# K% f3 ~' h2 t
#Rotaxtyp = 1 sets initial matrix to top9 ?3 g/ X( c6 |0 U
#Rotaxtyp = -2 sets initial matrix to front7 n$ U Q; ]6 l$ N# {
if vmc, rotaxtyp$ = one' J2 k: |! }( J6 V) K7 D. S" F# g
else, rotaxtyp$ = -2% _" U# d( J( `& o
# }0 ]0 A3 C" c3 spset_mach #Set post switches by reading machine def parameters
2 \ @. d7 S8 v) g$ u, F6 O, u& G; o rot_ax_cnt = 0
" J1 G: Y5 E% B9 k' `' T( m( h" \ rotaxerror = 0. @/ O; E" J5 X* ?& w) }; ], x
rot_on_x = 0 #Turn off rotary axis unless it is detected in machine read - supresses rotary output in 3 axis machines
1 o# `7 O9 }- Z, t) [( J" |$ A. U. i# t9 m
rd_cd$ ----------------------------> here #Read control definition parameters - calls pmachineinfo$" h) o* \( J! F/ n9 o1 \
#Output error message if Write NC operation information is not enabled in CD" x# F3 K. H) W) l% b" P
#if write_ops = 0, result = mprint(swriteopserror,2), exitpost$
" F2 w, I" m! x u# T
2 \5 e/ V0 s u: |3 j! d if sof = 1,
- M3 h! F' ?/ Y- L/ u6 o s+ g [
; {* g |5 G. ]5 {; g+ b maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest max feedrate value
$ m5 L% T6 X. h3 y maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
7 s2 }2 }% e( p5 q' a #minfeedpm = 999999
. S3 O' U1 K! H# W' G #minfeedpm_m = 999999( D( h& l5 _7 `* t2 ~
!maxfeedpm, !maxfeedpm_m #, !minfeedpm, !minfeedpm_m
% c' W/ A( f1 C$ [ rd_mch_ent_no$ = 0
9 z8 G; U2 \ I7 D. c' k7 V rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$3 X1 a* N' `2 s1 e2 p
]6 J( Q9 u( _* z
% X' A$ f% ?1 H/ n9 S: _ rd_mch_ent_no$ = syncaxis$ ----------------------------> here #Retrieve machine parameters based on current axis combination - read from .nci G950 line
% `6 T4 ~8 N6 ?& n rd_md$ ----------------------------> here #Read machine definition parameters - calls pmachineinfo$
6 h( ~, N2 E! S* s2 ]5 p# C2 G rd_tlpathgrp$ ----------------------------> here# Read toolpath group parameters - calls pmachineinfo$7 r. I% g$ z; c( Y' P( B7 l3 \. r
# w' }; [7 ~; ~4 \
rd_prm_op_no$ = op_id$
2 L% L j: I. N: r+ U rd_params$ ----------------------------> here #Read operaitons parameters" n0 E* V% d9 `; \* F
% A' v2 C' H1 L, G) f #We only need these set at toolchange (and start of file). No need to set them each time a user may call rd_md! Q! C; n, S5 i* n
if sav_rot_on_x = zero, rot_on_x = zero" S, w& _0 Q' i' D/ c( @
else, rot_on_x = rot_axis
3 D% k7 Y, A3 a rot_cw_pos = rot_dir5 O7 r9 m* O1 ]+ h- m
index = rot_index
! E; U z# a9 g5 [9 T if rot_angle = zero, ctable = one #ctable zero will produce a divide by zero error, so force to one if zero in MD
: l# P$ x) L$ c2 t6 r7 _ else, ctable = rot_angle
) D$ Q! `1 f5 Z; z3 B9 ~3 ^4 o. a5 D/ R1 q* i$ T
if met_tool$ = 1,
4 B, Q7 p, r4 N+ }% g [8 O C5 M+ Z9 c7 c9 {( |
maxfrinv = maxfrinv_m #Set limit for feed inverse time" {! b E; |! H1 F" r1 J# x
minfrinv = minfrinv_m
+ O- P6 D. c9 k8 {4 d maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min
& @8 N8 Y# m! k! o, Q) y minfeedpm = minfeedpm_m
7 D @; o& t# }/ k0 W7 }7 c$ h ]
/ M5 _5 U3 t: O- u) Y2 c5 j" R8 `1 w
9 h2 L% A6 A g1 U# o. y if use_md_rot_label, sav_srot_label = srot_label #Backup the original rotary axis label* P: a9 N3 T. T/ ?- u& [# v
: M, W3 ~8 j% x. R
6 f, h L+ [; z
- \6 }1 H$ z. U# |7 v |
|