Lets see if I can instruct some post reading / writing basics
pbld=block skip, n$=sequence number, e$=end of line
note, the comma is critical.
look in your post for this area
the pheader is obvious
next, "lsof0" =lathe start of file 0, it has a branch to "lsof", followed by "ltlchg".
Can you follow this general structure ?
Code:
pheader #Start of file
"%", e$
*progno, e$
pbld, n$, *smetric, e$
"(PROGRAM NAME - ", progname, ")", e$
"(DATE=DD-MM-YY - ", date, " TIME=HH:MM - ", time, ")", e$
lsof0 #Start of file for tool zero, lathe
lsof
lsof #Start of file for non-zero tool number, lathe
sav_cc_1013 = cc_1013 #eap 1/17/03
ltlchg
ltlchg #Toolchange, lathe
toolchng = one
gcode = zero
copy_x = vequ(x)
pcc_capture #Capture LCC ends, stop output RLCC
c_rcc_setup #Save original in sav_xa and shif
now your changes relate to toolchanging befor and after running an operation with the same tool
find in your program the part that would output the G28
it would look like this
Code:
pbld, n$, *sg28ref, "U0.", "W0.", e$
now insert some sort of indicator and post
Code:
pbld, n$, *sg28ref, "U0.", "W0.", "...#1...", e$
The other is in the retract or endoftool section, use same method to find and then alter to suit
BTW -- these alterations will apply to every operation you post, every tool you use external and internal, I suggest using different codes in your program
ie
G28 U0. Z1. ( home in X and 1" off in Z0 )
it would also act as a check that tool has been set in Z or that the part origin has been set
Code:
pbld, n$, *sg28ref, "U0. Z1.",e$
my suggestion