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:

Another Okuma macro to share


Recommended Posts

Here is another Okuma macro I just finished. It is for twin turret/twin spindle machines but could be modified for any lathe. It will save work offsets for A/B turrets, both spindles, and all 64 load monitor values for both turrets in a format that can be read back into NC to preload saved values into machine. It will create a file in MD1 called SETUP-SAVE.TXT. Just need to uncomment the turret calls, (G13) and (G14) to read as G13 and G14 in the TXT file before you copy it into your main program. Note; it takes about 3 minutes to write the TXT file since it is looping 128 times for load monitor values. For those that are cycle time concerned, it takes about 12 seconds to read in the data. 

G13
G140
P1
(OUTPUT OFFSETS)

CLOSE C
FWRITC MD1:SETUP-SAVE.TXT;C
PUT' '
WRITE C

G140

PUT '(G13)'
WRITE C
PUT 'G140'
WRITE C
PUT 'P1'
WRITE C
PUT 'VSZOZ='
PUT VSZOZ,9
WRITE C

PUT 'VSZOC='
PUT VSZOC,9
WRITE C

PUT 'VSZOW='
PUT VSZOW,9
WRITE C

G141
PUT 'G141'
WRITE C
PUT 'VSZOZ='
PUT VSZOZ,9
WRITE C

PUT 'VSZOC='
PUT VSZOC,9
WRITE C

G140
CONT=0
NSTRA
CONT=CONT+1

PUT 'VLMB1['
PUT CONT,2
PUT ']='
PUT VLMB1[CONT],3
WRITE C

PUT 'VLMB2['
PUT CONT,2
PUT ']='
PUT VLMB2[CONT],3
WRITE C

PUT 'VLMBB['
PUT CONT,2
PUT ']='
PUT VLMBB[CONT],3
WRITE C

PUT 'VLMC1['
PUT CONT,2
PUT ']='
PUT VLMC1[CONT],3
WRITE C

PUT 'VLMC2['
PUT CONT,2
PUT ']='
PUT VLMC2[CONT],3
WRITE C

PUT 'VLMCB['
PUT CONT,2
PUT ']='
PUT VLMCB[CONT],3
WRITE C

PUT 'VLMM1['
PUT CONT,2
PUT ']='
PUT VLMM1[CONT],3
WRITE C

PUT 'VLMM2['
PUT CONT,2
PUT ']='
PUT VLMM2[CONT],3
WRITE C

PUT 'VLMMB['
PUT CONT,2
PUT ']='
PUT VLMMB[CONT],3
WRITE C

PUT 'VLMS1['
PUT CONT,2
PUT ']='
PUT VLMS1[CONT],3
WRITE C

PUT 'VLMS2['
PUT CONT,2
PUT ']='
PUT VLMS2[CONT],3
WRITE C

PUT 'VLMSB['
PUT CONT,2
PUT ']='
PUT VLMSB[CONT],3
WRITE C

PUT 'VLMX1['
PUT CONT,2
PUT ']='
PUT VLMX1[CONT],3
WRITE C

PUT 'VLMX2['
PUT CONT,2
PUT ']='
PUT VLMX2[CONT],3
WRITE C

PUT 'VLMXB['
PUT CONT,2
PUT ']='
PUT VLMXB[CONT],3
WRITE C

PUT 'VLMD1['
PUT CONT,2
PUT ']='
PUT VLMD1[CONT],3
WRITE C

PUT 'VLMD2['
PUT CONT,2
PUT ']='
PUT VLMD2[CONT],3
WRITE C

PUT 'VLMDB['
PUT CONT,2
PUT ']='
PUT VLMDB[CONT],3
WRITE C

PUT 'VLMZ1['
PUT CONT,2
PUT ']='
PUT VLMZ1[CONT],3
WRITE C

PUT 'VLMZ2['
PUT CONT,2
PUT ']='
PUT VLMZ2[CONT],3
WRITE C

PUT 'VLMZB['
PUT CONT,2
PUT ']='
PUT VLMZB[CONT],3
WRITE C

G4 F.01
IF [CONT GT 63] GOTO NENA
GOTO NSTRA
NENA

PUT 'P2'
WRITE C
PUT 'M331'
WRITE C
PUT 'G140'
WRITE C
PUT 'P-99'
WRITE C
CLOSE C

P2
M331

G14
G140
P2

CLOSE C
FWRITC MD1:SETUP-SAVE.TXT;A
PUT' '
WRITE C

PUT '(G14)'
WRITE C
PUT 'G140'
WRITE C
PUT 'P1'
WRITE C
PUT 'VSZOZ='
PUT VSZOZ,9
WRITE C

PUT 'VSZOC='
PUT VSZOC,9
WRITE C

PUT 'VSZOW='
PUT VSZOW,9
WRITE C

G141
PUT 'G141'
WRITE C
PUT 'VSZOZ='
PUT VSZOZ,9
WRITE C

PUT 'VSZOC='
PUT VSZOC,9
WRITE C

G140
CONT=0
NSTRB
CONT=CONT+1

PUT 'VLMB1['
PUT CONT,2
PUT ']='
PUT VLMB1[CONT],3
WRITE C

PUT 'VLMB2['
PUT CONT,2
PUT ']='
PUT VLMB2[CONT],3
WRITE C

PUT 'VLMBB['
PUT CONT,2
PUT ']='
PUT VLMBB[CONT],3
WRITE C

PUT 'VLMC1['
PUT CONT,2
PUT ']='
PUT VLMC1[CONT],3
WRITE C

PUT 'VLMC2['
PUT CONT,2
PUT ']='
PUT VLMC2[CONT],3
WRITE C

PUT 'VLMCB['
PUT CONT,2
PUT ']='
PUT VLMCB[CONT],3
WRITE C

PUT 'VLMM1['
PUT CONT,2
PUT ']='
PUT VLMM1[CONT],3
WRITE C

PUT 'VLMM2['
PUT CONT,2
PUT ']='
PUT VLMM2[CONT],3
WRITE C

PUT 'VLMMB['
PUT CONT,2
PUT ']='
PUT VLMMB[CONT],3
WRITE C

PUT 'VLMS1['
PUT CONT,2
PUT ']='
PUT VLMS1[CONT],3
WRITE C

PUT 'VLMS2['
PUT CONT,2
PUT ']='
PUT VLMS2[CONT],3
WRITE C

PUT 'VLMSB['
PUT CONT,2
PUT ']='
PUT VLMSB[CONT],3
WRITE C

PUT 'VLMX1['
PUT CONT,2
PUT ']='
PUT VLMX1[CONT],3
WRITE C

PUT 'VLMX2['
PUT CONT,2
PUT ']='
PUT VLMX2[CONT],3
WRITE C

PUT 'VLMXB['
PUT CONT,2
PUT ']='
PUT VLMXB[CONT],3
WRITE C

PUT 'VLMD1['
PUT CONT,2
PUT ']='
PUT VLMD1[CONT],3
WRITE C

PUT 'VLMD2['
PUT CONT,2
PUT ']='
PUT VLMD2[CONT],3
WRITE C

PUT 'VLMDB['
PUT CONT,2
PUT ']='
PUT VLMDB[CONT],3
WRITE C

PUT 'VLMZ1['
PUT CONT,2
PUT ']='
PUT VLMZ1[CONT],3
WRITE C

PUT 'VLMZ2['
PUT CONT,2
PUT ']='
PUT VLMZ2[CONT],3
WRITE C

PUT 'VLMZB['
PUT CONT,2
PUT ']='
PUT VLMZB[CONT],3
WRITE C

G4 F.01
IF [CONT GT 63] GOTO NENB
GOTO NSTRB
NENB

PUT 'P2'
WRITE C
PUT 'M331'
WRITE C
PUT 'P-99'
WRITE C
CLOSE C

M30
 

 

  • Like 4
Link to comment
Share on other sites
  • 3 weeks later...

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...