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

I have another Okuma Macro that I thought I would share. This is designed for mill controls (E100 and newer). I also have a version for the Multus U series. It is basically a utility to record work offsets after you finish a setup. It is very common to preload work offsets for different fixtures/tombstones in a machine. This macro simplifies recording the data. Below is the Macro code. Save this code in a program called OFFSETS.MIN. When you have your offsets all touched off run the OFFSETS.MIN program. Note: before you run there are a few places to edit at the top of the macro code based on your specific machine. You need to set 1/0 for which rotary axis you have and set the total number of offsets the machine has (most Okuma have 100). Here is the code.

(OUTPUT OFFSETS)
CONT=0
MAX=100 (MAX NUMBER OF OFFSETS IN MACHINE)
AOUT=0 (TO OUTPUT A AXIS SET TO 1)
BOUT=1 (TO OUTPUT B AXIS SET TO 1)
COUT=0 (TO OUTPUT C AXIS SET TO 1)


CLOSE C
FWRITC MD1:ZERO-OFFSETS.TXT;C
PUT' '
WRITE C

NSTRT
CONT=CONT+1

PUT 'VZOFX['
PUT CONT,3
PUT ']='
PUT VZOFX[CONT],8
WRITE C
PUT 'VZOFY['
PUT CONT,3
PUT ']='
PUT VZOFY[CONT],8
WRITE C
PUT 'VZOFZ['
PUT CONT,3
PUT ']='
PUT VZOFZ[CONT],8
WRITE C

IF [AOUT EQ 0] GOTO NA
PUT 'VZOFA['
PUT CONT,3
PUT ']='
PUT VZOFA[CONT],8
WRITE C
NA

IF [BOUT EQ 0] GOTO NB
PUT 'VZOFB['
PUT CONT,3
PUT ']='
PUT VZOFB[CONT],8
WRITE C
NB

IF [COUT EQ 0] GOTO NC
PUT 'VZOFC['
PUT CONT,3
PUT ']='
PUT VZOFC[CONT],8
WRITE C
NC

G4 F.1
IF [CONT GT [MAX-1]] GOTO NEND
GOTO NSTRT
NEND
CLOSE C
M30

When you run the program it will create/overwrite a file in your MD1 directory named ZERO-OFFSETS.TXT. You can open the file and copy/paste the offset data you want to have your main program pre-load. Sample of .TXT file below. The sample below will populate X-Y-Z offsets number 1-6.

VZOFX[  1]=  9.3731
VZOFY[  1]=  0.3304
VZOFZ[  1]= -0.0928
VZOFX[  2]=  0.0000
VZOFY[  2]=  0.0000
VZOFZ[  2]=  0.0000
VZOFX[  3]=  0.0000
VZOFY[  3]=  0.0000
VZOFZ[  3]=  0.0000
VZOFX[  4]=  4.0000
VZOFY[  4]=  0.0000
VZOFZ[  4]=  0.0000
VZOFX[  5]=  0.0000
VZOFY[  5]=  0.0000
VZOFZ[  5]=  0.0000
VZOFX[  6]=  0.0000
VZOFY[  6]=  0.0000
VZOFZ[  6]=  0.0000

 

  • Like 5
Link to comment
Share on other sites
On ‎5‎/‎10‎/‎2017 at 9:46 AM, YoDoug® said:

I have another Okuma Macro that I thought I would share. This is designed for mill controls (E100 and newer). I also have a version for the Multus U series. It is basically a utility to record work offsets after you finish a setup. It is very common to preload work offsets for different fixtures/tombstones in a machine. This macro simplifies recording the data. Below is the Macro code. Save this code in a program called OFFSETS.MIN. When you have your offsets all touched off run the OFFSETS.MIN program. Note: before you run there are a few places to edit at the top of the macro code based on your specific machine. You need to set 1/0 for which rotary axis you have and set the total number of offsets the machine has (most Okuma have 100). Here is the code.


(OUTPUT OFFSETS)
CONT=0
MAX=100 (MAX NUMBER OF OFFSETS IN MACHINE)
AOUT=0 (TO OUTPUT A AXIS SET TO 1)
BOUT=1 (TO OUTPUT B AXIS SET TO 1)
COUT=0 (TO OUTPUT C AXIS SET TO 1)


CLOSE C
FWRITC MD1:ZERO-OFFSETS.TXT;C
PUT' '
WRITE C

NSTRT
CONT=CONT+1

PUT 'VZOFX['
PUT CONT,3
PUT ']='
PUT VZOFX[CONT],8
WRITE C
PUT 'VZOFY['
PUT CONT,3
PUT ']='
PUT VZOFY[CONT],8
WRITE C
PUT 'VZOFZ['
PUT CONT,3
PUT ']='
PUT VZOFZ[CONT],8
WRITE C

IF [AOUT EQ 0] GOTO NA
PUT 'VZOFA['
PUT CONT,3
PUT ']='
PUT VZOFA[CONT],8
WRITE C
NA

IF [BOUT EQ 0] GOTO NB
PUT 'VZOFB['
PUT CONT,3
PUT ']='
PUT VZOFB[CONT],8
WRITE C
NB

IF [COUT EQ 0] GOTO NC
PUT 'VZOFC['
PUT CONT,3
PUT ']='
PUT VZOFC[CONT],8
WRITE C
NC

G4 F.1
IF [CONT GT [MAX-1]] GOTO NEND
GOTO NSTRT
NEND
CLOSE C
M30

When you run the program it will create/overwrite a file in your MD1 directory named ZERO-OFFSETS.TXT. You can open the file and copy/paste the offset data you want to have your main program pre-load. Sample of .TXT file below. The sample below will populate X-Y-Z offsets number 1-6.


VZOFX[  1]=  9.3731
VZOFY[  1]=  0.3304
VZOFZ[  1]= -0.0928
VZOFX[  2]=  0.0000
VZOFY[  2]=  0.0000
VZOFZ[  2]=  0.0000
VZOFX[  3]=  0.0000
VZOFY[  3]=  0.0000
VZOFZ[  3]=  0.0000
VZOFX[  4]=  4.0000
VZOFY[  4]=  0.0000
VZOFZ[  4]=  0.0000
VZOFX[  5]=  0.0000
VZOFY[  5]=  0.0000
VZOFZ[  5]=  0.0000
VZOFX[  6]=  0.0000
VZOFY[  6]=  0.0000
VZOFZ[  6]=  0.0000

 

Thanks Doug. I appreciate this! :)

Link to comment
Share on other sites

I just wrote one the other day to record the points for the gantry on an Okuma 2SP-250H after you finish setting up. That way you can copy/paste them into your main program so the gantry always has point data that matches the part program. It's a real time saver if you run a lot of different size parts. There is a lot of cool ways to use READ/WRITE/GET/PUT function in Okumas. 

On the flipside to writing data out, we can also open a text file in the memory, parse out data and load it into variables or offsets in the machine. If your CMM or gauge can output to a text file we can read that file in and update offsets, etc. If you have multiple Renisahw probes in a mill their macros use this functionality to store calibration data for each probe in a text file. 

All this though is actually very basic compared to what you can do with the open API with a little .NET coding. I am working on a project now that has machine accessories that are temperature sensitive. If they overheat they can seize bearings. They can be rebuilt when they wear out if they are not run in an overheated condition. We are adding pt100 temp sensors to the accessories and using the API we will read in the temp to a control variable and the machine will alarm if the temp exceeds max values. 

 

  • Like 3
Link to comment
Share on other sites
13 minutes ago, YoDoug® said:

I just wrote one the other day to record the points for the gantry on an Okuma 2SP-250H after you finish setting up. That way you can copy/paste them into your main program so the gantry always has point data that matches the part program. It's a real time saver if you run a lot of different size parts. There is a lot of cool ways to use READ/WRITE/GET/PUT function in Okumas. 

On the flipside to writing data out, we can also open a text file in the memory, parse out data and load it into variables or offsets in the machine. If your CMM or gauge can output to a text file we can read that file in and update offsets, etc. If you have multiple Renisahw probes in a mill their macros use this functionality to store calibration data for each probe in a text file. 

All this though is actually very basic compared to what you can do with the open API with a little .NET coding. I am working on a project now that has machine accessories that are temperature sensitive. If they overheat they can seize bearings. They can be rebuilt when they wear out if they are not run in an overheated condition. We are adding pt100 temp sensors to the accessories and using the API we will read in the temp to a control variable and the machine will alarm if the temp exceeds max values. 

 

Yes very slick job you did on that sir. Ben was talking about it and nice when you can see things all tied together like you did on that machine. ;)

Link to comment
Share on other sites
  • 1 year later...

I am very interested in the program from Doug. We have Okuma Lathe machines osp500L.

The question is if I have an text file then how can I transfer values from the file to the machine.

For example I want to update some common variables in the machine via the pc which is connected to the machine.

Thanks for your help

Link to comment
Share on other sites

I have a Special functions manual book for Okuma CNC lathes with osp500L-G/osp5000L-G system and there is a chapter which talks about  read/write/get/put commands.

But I am confused about where the text file is supposed to write/save. I think about creating the text file in a pc, connect the pc to machine and transfer data from pc to machine.

We have all LB10, LB12,LB15 ...I would like to write a program so that when the operator checks the diameter with the mic which is hooked up into a pc via Bluetooth, press the button the value will be transferred to pc then pc to common variables or offset...since we can not do that on our old machines. I came across to your program and found the chapter in the book.

Thanks

Link to comment
Share on other sites

Yes, On the older controls the actual data transfer would be through RS232 to an external PC. The PC would need a DNC software capable of listening for file transfer initiation. You will need to make sure you have two options; 1. On 5000 controls User Task II was an option. 2. READ/WRITE/GET/PUT was also an option on 5000 controls. Your machines may not have the capability to do what you want to do. 

Link to comment
Share on other sites

Could you tell me more details about creating the text file with the values then transfer that from pc to machine. Where am I suppose to store the text file?

I have no experience of transferring programs from pc to machine. I am just the guy who develops macro for our lathe program.

Thanks

 

Link to comment
Share on other sites
26 minutes ago, vann said:

Could you tell me more details about creating the text file with the values then transfer that from pc to machine. Where am I suppose to store the text file?

I have no experience of transferring programs from pc to machine. I am just the guy who develops macro for our lathe program.

Thanks

 

Your request is a pretty involved project to do over an internet forum. I would suggest that you contact your Okuma distributor and hire them to help get it going. 

  • Like 2
Link to comment
Share on other sites
  • 7 months later...
On 2/18/2020 at 6:54 PM, ABC HEAVY said:

hello Yodoug, I don't suppose you could help a fella out with a external hexagon macro for machining bolt heads? on a OSPE100?

 

 

Please be more specific. Is this for a mill or lathe with milling capabilities? Do you need multiple passes or just a single contour pass? Any other specifics you are looking for this macro to accomplish?

Brad

Link to comment
Share on other sites
  • 8 months later...
On 11/27/2020 at 7:52 AM, Aaron Burhoe said:

I would love to see a similar program for a Multus U series.  Can you share?  Thanks!

Below is code for Multus U with lower turret. Note: in the output file the G13/G14 will be output with () around them. It is a limitation of the READ/WRITE that won't allow it to output a G13/G14, the workaround is to output them with (). Just delete the () when you paste the offset code into your program. 

Quote

(OUTPUT OFFSETS)

CLOSE C
FWRITC MD1:ZERO-OFFSETS.TXT;
PUT' '
WRITE C


P1
G13
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
PUT 'P2'
WRITE C
PUT 'M331'
WRITE C
PUT 'G140'
WRITE C
PUT 'DRAW'
WRITE C

P2
M331


G14
P2
G140

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
PUT 'P2'
WRITE C
PUT 'M331'
WRITE C


CLOSE C
M30

 

  • Like 1
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...