Easy. Example:
Find the start of file section:
psof$ #Start of file for non-zero tool number
pcuttype
toolchng = one
if ntools$ = one,
[
#skip single tool outputs, stagetool must be on
stagetool = m_one
!next_tool$
]
"%", e$
*progno$, e$
"(PROGRAM NAME - ", sprogname$, ")", e$
"(DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, ")", e$
M52 (DOOR CLOSE) ;<<<This line added
pbld, n$, *smetric, e$
pbld, n$, *sgcode, *sgplane, "G40", "G49", "G80", *sgabsinc, e$
sav_absinc = absinc$
if mi1$ <= one, #Work coordinate system
[
absinc$ = one
pfbld, n$, sgabsinc, *sg28ref, "Z0.", e$
pfbld, n$, *sg28ref, "X0.", "Y0.", e$
pfbld, n$, "G92", *xh$, *yh$, *zh$, e$
absinc$ = sav_absinc
]
pcom_moveb
c_mmlt$ #Multiple tool subprogram call
ptoolcomment
comment$
pcan
if stagetool >= zero, pbld, n$, *t$, "M6", e$
pindex
if mi1$ > one, absinc$ = zero
Then find the file end section:
peof$ #End of file for non-zero tool
pretract
comment$
#Remove pound character to output first tool with staged tools
#if stagetool = one, pbld, n, *first_tool, e
M53 (DOOR OPEN) ;<<<<This line added
n$, "M30", e$
mergesub$
clearsub$
mergeaux$
clearaux$
"%", e$
Now, I would actually add the door close command before each tool call since you might actually restart a program some place other than the beginning. Just my thoughts.


LinkBack URL
About LinkBacks





