“Hidden” CNC Control Functions Simplify Procedures (Part 1)

Paul Russell

Your Okuma CNC control may have hidden powers you’ve never discovered. The OSP control contains several advanced functions that provide added versatility and help simplify procedures in your shop, so I’d like to introduce you to them. Of course usage can vary depending on your particular machining processes, but here I’ll share just a couple of the “best kept secrets” you can use on your control.

READ/WRITE/GET/PUT

This function enables you to create an external file and write data to it. This file could then be opened in a text editor, or even in Excel, as a .CSV file. A popular way of using this function is to measure parts after machining them using a spindle probe and then save the data using R/W/G/P. Having this capability allows the user to graph the measured data and apply statistical analysis on them, to see trends. You can also output part numbers with their associated time and date stamps to simplify traceability procedures. The R/W/G/P is standard on Okuma OSP-P300 CNC controls. Below is a sample showing how to use the READ/WRITE/GET/PUT function to output time and date to the DATA.CSV file. (This is the header information.)

FWRITC MD1:DATA.CSV;A

WRITE C

PUT $0D0A

WRITE C

PUT 'PROBE DATA'

WRITE C

PUT '****************'

WRITE C

PUT 'DATE:'

PUT VC151,4

PUT '-'

PUT VC152,2

PUT '-'

PUT VC153,2

PUT '    TIME: '

PUT VC154,2

PUT ':'

PUT VC155,2

PUT ':'

PUT VC156,2

WRITE C

PUT '****************'

WRITE C

CLOSE C

Using CNC Control Variables

Variables can be used to simplify certain processes in your shop. We have “System” variables (for info like tool length offsets, cutter compensation data, work offsets, active position, time, date and many others), “Local” variables (which can be found on your main operation screen – see image above), and “Common” variables (such as VC1). Local variables are temporary and clear at the end of the program. Common variables are stored in a table and can easily be read and written to. They’re typically used for doing math calculations.

If you’re doing math calculations in a program, there’s something called parametric programming where you could have one program to make a part and you may also have a family of parts that are very similar. So if you’re drilling a hole in all these parts, but the hole sizes might be different, you could define a variable for the tool number and it’ll make the hole different for each of the parts, and yet still use the one main program. By simply changing the variable in the program you can make multiple different parts. That’s one situation. Another case may be when you make a part, and then measure it, and if it’s off you can use a variable to compensate for that error. Then you go back in and re-machine the part to get it within the tolerance you need.

Below we’re outputting the part probe measurements (previously stored in the common variables VC1-VC3) to the DATA.CSV file:

G01 F500.

FWRITC MD1:DATA.CSV;A

WRITE C

PUT 'Z '

PUT ','

PUT VC1

WRITE C

PUT 'Z '

PUT ','

PUT VC2

WRITE C

PUT 'Z '

PUT ','

PUT VC3

WRITE C

CLOSE C

M30

You can also use variables to check that the correct tool is in the spindle. A command such as the following can eliminate alarms if the wrong tool is in the spindle:

IF[VTLCN EQ 1] NSKIP

T1 M06

NSKIP

There are many ways these functionalities can be used; above are just a couple examples. How would you put these to use? Please feel free to comment below and share your ideas. If you have specific questions about how to access or use these functions please contact us, or your local distributor.

Paul Russell is Applications Engineer, Okuma America Corporation.

More: Check out Part 2 of this series, where I share more ideas and examples.

Sign Up For Updates
Thank you for signing up for Okuma updates. We look forward to sharing our content with you.

We offer a variety of ways for you to stay informed about our events, and to receive general Okuma updates. Fill out the form below to let us know the type of information you'd like to receive.

Find Your Distributor
Sign Up For Updates
Thank you for signing up for Okuma updates. We look forward to sharing our content with you.

We offer a variety of ways for you to stay informed about our events, and to receive general Okuma updates. Fill out the form below to let us know the type of information you'd like to receive.