Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

G10 Conflict


Recommended Posts

Hi guys,

I'm having a post conflict with the "pwrtt$". I like to list all of my G10 work offsets and I got from the instructions of this forum. I got stuck because my M11 G0 G90 G54 does not include B0. Below here, you can see what I'm having trouble with. I believe that I'm almost ready to go but only does not out put the B-Axis for me. I know I ask a lot of questions and I really need help just on this one.

 

**********************************

%

O0001 (HORIZONTAL)

(****** Setup Instructions ******)

(PROGRAMMER ABC WANTS SETUP-MAN MUST PERFORM:)

(1. SQUARE PARTS FROM VERTICAL PRIOR MACHINE IN HORIZONTAL)

(2. BRING SQUARED PARTS TO QC AND WAIT FOR APPROVAL)

()

(THIS PROGRAM IS MEANT FOR ABC.)

(Approved By - , Machine Name - A88 Makino)

(AUG.15.2012**At-2:52 PM)

 

(********** Work Offset List **********)

G10 L2 P0 X0 Y0 Z0 B0 (G53 Zero)

G10 L20 P1 X-10. Y0. Z-22.965

G10 L20 P2 X-5. Y0. Z-27.965

G10 L20 P3 X0. Y0. Z-17.965

T1 (4" FACE MILL)

M6

N1 G0 G40 G80 G90 S4000 M3 T2

M8 ( FACING )

M11 G0 G90 G54 B0. <=============== B0. suppose to appear like this but I can't make it help please

M10 X-4.4 Y-1.0001

M56 H1 D9

G43 H1 Z2. D9

Z.2

G1 Z-.0001 F5.

X12.4 F50.

Y-2.6667

X-2.4

Y-4.3333

X12.4

Y-5.9999

X-4.4

G0 Z2.

G0 G80 M9

G91 G28 Z0 M5

G90 G49

M1

T2 M6

N2 ( 3/4 FLAT ENDMILL)

G0 G40 G80 G90 S7000 M3 T3

M8(CONTOUR)

M11 G0 G90 G54

M10 X-.525 Y.75

M56 H1 D9

G43 H1 Z2. D9

Z.2

G1 Z-5.025 F5.

G41 X0. F25.

X10. F40.

G2 X10.75 Y0. I0. J-.75

G1 Y-7.

G2 X10. Y-7.75 I-.75 J0.

G1 X0.

G2 X-.75 Y-7. I0. J.75

G1 Y0.

G2 G40 X0. Y.75 I.75 J0.

G1 Z.2 F100.

G0 Z.25

X-.525 Y.375

Z.2

G1 Z-5.025 F5.

G41 X0. F25.

X10. F40.

G2 X10.375 Y0. I0. J-.375

G1 Y-7.

G2 X10. Y-7.375 I-.375 J0.

G1 X0.

G2 X-.375 Y-7. I0. J.375

G1 Y0.

G2 G40 X0. Y.375 I.375 J0.

G1 Z.2 F100.

G0 Z2.

G0 G80 M9

G91 G28 Z0 M5

G90 G49

M1

T3 M6

N3 ( 3/4 DRILL)

G0 G40 G80 G90 S7000 M3 T2

M8(PECK DRILL)

M11 G0 G90 G54

M10 X5.0432 Y-3.4878

M56 H1 D9

G43 H1 Z2. D9

G98 G83 Z-1. R.1 Q.225 F10.

G0 G80 M9

G91 G28 Z0 M5

G90 G49

M1

  • Like 1
Link to comment
Share on other sites

I tried that, but it would show up. Here is my partcial codes to make you understand more, thankful for your help.

***************************

 

# --------------------------------------------------------------------------

# General Output Settings

# --------------------------------------------------------------------------

hel_2100 : no$ #Acramatic 2100 style helical moves, 0=no, 1=yes

force_dpts : no$ #Force XY output on all drilling lines including cycle call?

haas : 0 #Haas style peck drill and extended offsets, 0=no, 1=yes

wcstype : 2 #0 = G92 at start, 1 = G92 at toolchanges, 2 = G54, 3 = Off

force_wcs : yes$ #Force WCS output at every toolchange?

tool_table : 1 #Tool table, 0=no, 1=yes, 2=Predator VCNC, 3=MetaCut View

output_z : yes$ #Output Z Min and Z Max values (yes or no)

cool_zmove : yes$ #Coolant off with last move

########## Feed Tap ##########

use_pitch : 0 #0 = Use feed for tapping, 1 = Use pitch for tapping

########## Feed Tap ##########

########## Rigid Tap M29 ##########

rigid_tap : 1 #0 = Floating tap output, 1 = Rigid tap output (suppress spindle output and output M29)

########## Rigid Tap M29 ##########

use_gear : 0 #Output gear selection code, 0=no, 1=yes

frdegstp : 10 #Step limit for rotary feed in deg/min

ret_on_indx : 1 #Machine home retract on rotary index moves, (0 = no, 1 = yes)

one_rev : 0 #Limit rotary indexing between 0 and 360? (0 = No, 1 = Yes)

lock_codes : 0 #Use rotary axis unlock/lock M-Codes? (0 = No, 1 = Yes)

rot_feed : 1 #Use calculated rotary feed values, (0 = no, 1 = yes)

frc_cinit : 1 #Force C axis reset at toolchange

ctol : 225 #Tolerance in deg. before rev flag changes

ixtol : 0.01 #Tolerance in deg. for index error

miscerror : 0 #Error out if Misc Values button is disabled, 0=no, 1=yes

tseqno : 0 #Output sequence number at toolchanges when omitseq = yes

#0=off, 1=seq numbers match toolchange number, 2=seq numbers match tool number

use_rotmcode : 0 #Output M-Code for Axis direction (sindx_mc)

#0 = Signed direction (only valid when rot_type = 1)

#1 = M-Code for direction

force_output : 1 #0 = Modal G code output at toolchanges, 1 = Force output of all G codes (see also force_wcs)

safe_index : 0 #Currently hooked up to misc int 4, remove safe_index = mi4$ from pmiscint$ to make this switch permanent

########## Stock To Leave On Wall And Floor 2D Note ##########

stockleft : 0 #Output stock to leave information on 2d contour/pocket/facing (0 = No, 1 = Yes)

########## Stock To Leave On Wall And Floor 2D Note ##########

#Rotary Axis Label options

use_md_rot_label : yes$ #Use rotary axis label from machine def? - Leave set to 'no' until available

srot_x : "A" #Label applied to rotary axis movement - rotating about X axis (mill top toolplane) - used when use_md_rot_label = no

srot_y : "B" #Label applied to rotary axis movement - rotating about Y axis (mill top toolplane) - used when use_md_rot_label = no

srot_z : "B" #Label applied to rotary axis movement - rotating about Z axis (mill top toolplane) - used when use_md_rot_label = no

sminus : "-" #Address for the rotary axis (signed motion)

use_g10wcs : yes$ #Output G10 work offsets

use_g10tloff : no$ #Output G10 Tool offsets

 

 

# --------------------------------------------------------------------------

# Start of File and Toolchange Setup - Start Of Program

# --------------------------------------------------------------------------

psof0$ #Start of file for tool zero

psof$

psof$ #Start of file for non-zero tool number

*e$

"(********** Work Offset List **********)", e$

########## Work Offset List ##########

#pbld, n$, *sgcode, *sgplane, *smetric, "G40", "G49", "G80", *sgabsinc, e$

"G10 L2 P0 X0 Y0 Z0 B0 (G53 Zero)", e$

#Read buffer 2 and write out preload work offsets

if use_g10wcs = yes$, preloadwcs

# " ", e

if use_g10tloff = yes$, preloadtloff

########## Work Offset List ##########

*e$,

ptravel

pwritbuf5

pcuttype

toolchng = one

 

 

 

# --------------------------------------------------------------------------

# Additional General Output Settings

# --------------------------------------------------------------------------

tooltable$ : 1 #Read for tool table and pwrtt - use tool_table to disable

 

# --------------------------------------------------------------------------

# G10 tool offset (L11) preloads & cancel write, read, output routines

# --------------------------------------------------------------------------

#This section is designed to allow the user to output the many different G10 L10 - L13

#Tool offset settings for preload and cancel. By default the L11 is supportted but can

#be replaced or additional L output can be added. Additional variable data can be written to

#The buffer and extracted from it. If you do not know how to use buffers, please contact your

#Mastercam dealer or CNC Software's post Department

wc3 : 1 #Initial count for write buffer 3

rc3 : 1 #Initial count for read buffer 3

size3 : 0 #Buffer 3 size

fmt P 4 offset3 #Buffer 3

offsetn : 0 #Next buffer variables

fbuf 3 0 1 0 0 #Buffer 3 definintion

preloadtloff #Read tool offset buffer and write to NC file

#This postblock is called from the PSOF and PEOF postblocks and only if the use_g10tloff flag is on.

#This postblock is responsible for reading the tool offset buffer and outputting the preloads or cancel

#to the NC output file.

pg10sortl12

rc3 = 1

size3 = rbuf (3, 0)

"G90", e$

while rc3 <= size3,

[

offset3 = rbuf (3, rc3)

pbld, n$, sgabsinc, "G10", "L12", *offset3, "R0"

]

pg10sortl12 #Sort preload work offsets in accending order

#This postblock is designed to sort the tloffno preload buffer in accending order. This postblock is called

#from the preloadtloff postblock. DO NOT MODIFY this post block unless you are absolutely sure of what you

#are doing.

rc3 = 1

size3 = rbuf (3, 0)

cnt1 = 1 #intialize counters

cnt2 = 1 #intialize counters

while cnt1 < size3, #loop 1 - loop 1 time less than the size of the buffer

[

size3 = rbuf (3, 0)

while cnt2 <= size3 - cnt1, #loop 2 - loop 1 less every time

[

rc3 = cnt2 #set buffer read counter to current loop counter value (Current record to read)

offset3 = rbuf (3, rc3) #Read current and next record from buffer

offsetn = rbuf (3, rc3)

if offsetn < offset3, #Check and swap records if next offset is less than current

[

wc3 = cnt2 #initalize write counter to current loop counter value (current record to write)

offsetn = wbuf (3, wc3) #Swap records by writing back into buffer. Next into current, current into next

offset3 = wbuf (3, wc3)

]

cnt2 = cnt2 + 1 #increment loop counter 2

]

cnt2 = 1 #Reset loop counter 2 to start at record 1

cnt1 = cnt1 + 1 #increment loop counter 1

]

 

pg10tloff_writbuf #Buffer 2 works offset preload buffer

#This postblock is called from pwrtt and only if the use_g10tloff variable is on.

#This postblock is designed to write out the tool offsetinformation to buffer 3 the

#preload buffer. The preload buffer will be scanned and checked to see if the tloffno was already

#written to the buffer, if not the wcs is written to the buffer.

test = 0

size3 = rbuf(3, 0) #Get size of buffer

#read buffer and compare current tloffno value with one read from buffer.

#If current tloffno matches one already in buffer set flag to not process.

while rc3 <= size3,

[

offset3 = rbuf (3, rc3)

if tloffno$ = offset3, test = 1

]

#If tloffno doesn't match one in the buffer, write it to the buffer

if test = 0,

[

offset3 = tloffno$

offset3 = wbuf (3, wc3)

]

rc3 = 1 #reset read counter for next pass

# --------------------------------------------------------------------------

# G10 work offset preloads write, sort, read, output routines

# --------------------------------------------------------------------------

#This section is designed to write the work offsets preloads to a buffer file, then sort them

#into accesding order and eventually output the preloads to the NC output files. These sections

#only get called if the use_g10wcs flag is on.

# Work offset preload buffer

test : 0 #Result variable

cnt1 : 0 #Loop counter number 1 for sort

cnt2 : 0 #Loop counter number 2 for sort

wc2 : 1 #Initial count for write buffer 2

rc2 : 1 #Initial count for read buffer 2

size2 : 0 #Buffer 2 size

toz3 = toz2 - 27.965 #Figures Z Offset from machine zero

fmt W 4 workofs2 #Buffer 2

fmt P 4 pofs2 #Buffer 2

fmt X 2 tox2 #Buffer 2

fmt Y 2 toy2 #Buffer 2

fmt Z 2 toz2 #Buffer 2

#fmt B 2 cout2 #Buffer 2

fmt Z 2 toz3 #Writes Z Offset from machine zero

 

workofsn : 0 #Temporary data for swap in buffer2

pofsn : 0 #Temporary data for swap in buffer2

toxn : 0 #Temporary data for swap in buffer2

toyn : 0 #Temporary data for swap in buffer2

tozn : 0 #Temporary data for swap in buffer2

coutn : 0 #Temporary data for swap in buffer2

fbuf 2 1 6 0 0 #Buffer 2

# --------------------------------------------------------------------------

preloadwcs #Output G10 preloads from Buffer2

#This postblock is called from the PSOF postblock and is designed to output the WCS

#preloads to the beggining of the NC output file and only if the use_g10wcs flag is active.

pg10sort #Sort preload buffer in accesnding order before output

#read preload buffer and output preloads

rc2 = 1

size2 = rbuf (two, 0)

while rc2 <= size2,

[

workofs2 = rbuf (two, rc2)

if workofs2 > 53, pbld, n$, sgabsinc, "G10", "L2", *pofs2, *tox2, *toy2, *toz3, e$ #Offsets G54 - G59

else, pbld, n$, sgabsinc, "G10", "L20", *pofs2, *tox2, *toy2, *toz3, e$ #Extended offsets g54.1 P1 - P48

]

 

# [

# workofs2 = rbuf (two, rc2)

# if workofs2 > 53, pbld, n, sgabsinc, "G10", "L2", *pofs2, *tox2, *toy2, *toz3, *cout2, e #Offsets G54 - G59

# else, pbld, n, sgabsinc, "G10", "L20", *pofs2, *tox2, *toy2, *toz3, *cout2, e #Extended offsets g54.1 P1 - P48

# ]

 

pg10sort #Sort preload work offsets in accending order

#This postblock is designed to sort the wcs preload buffer in accending order. This postblock is called

#from the preloadwcs postblock. DO NOT MODIFY this post block unless you are absolutely sure of what you

#are doing.

rc2 = 1

size2 = rbuf (two, 0)

cnt1 = 1 #intialize counters

cnt2 = 1 #intialize counters

while cnt1 < size2, #loop 1 - loop 1 time less than the size of the buffer

[

size2 = rbuf (two, 0)

while cnt2 <= size2 - cnt1, #loop 2 - loop 1 less every time

[

rc2 = cnt2 #set buffer read counter to current loop counter value (Current record to read)

workofs2 = rbuf (two, rc2) #Read current and next record from buffer

workofsn = rbuf (two, rc2)

if workofsn < workofs2, #Check and swap records if next offset is less than current

[

wc2 = cnt2 #initalize write counter to current loop counter value (current record to write)

workofsn = wbuf (two, wc2) #Swap records by writing back into buffer. Next into current, current into next

workofs2 = wbuf (two, wc2)

]

cnt2 = cnt2 + 1 #increment loop counter 2

]

cnt2 = 1 #Reset loop counter 2 to start at record 1

cnt1 = cnt1 + 1 #increment loop counter 1

]

 

pg10wcs_writbuf #Buffer 2 works offset preload buffer

#This postblock is called from pwrtt and only if the use_g10wcs flag is active.

#This postblock is designed to write out the WCS and tool origin information to the

#preload buffer. The preload buffer will be scanned and checked to see if the WCS was already

#written to the buffer, if not the wcs is written to the buffer.

test = 0

size2 = rbuf(2, 0) #Get size of buffer

#read buffer and compare current workofs value with one read from buffer.

#If current workofs matches one already in buffer set flag to not process.

while rc2 <= size2,

[

workofs2 = rbuf (2, rc2)

if workofs$ = workofs2, test = 1

]

#If workofs doesn't match one in the buffer, write it to the buffer

# with the P value and tool origin.

if test = 0,

[

# cout2 = atan2 (m7$, -m8$)

workofs2 = workofs$

pofs2 = workofs$ - 53

########## G10 L20 P1 Xx Yx Zx ##########

if workofs2 < 54, pofs2 = workofs$ +1 #Extened offsets P1 - P48

tox2 = tox$

toy2 = toy$

toz2 = toz$

workofs2 = wbuf (2, wc2)

]

rc2 = 1 #reset read counter for next pass

pwrtt$ #Buffer toolchange information

# Call to save work offset and tool origin to buffer for output at SOF.

if use_g10wcs = yes$, pg10wcs_writbuf

if use_g10tloff = yes$ & opcode$ <> 3, pg10tloff_writbuf #don't output for drilling tools

 

 

*****************************************

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...