Modern Machine Shop

AUG 2017

Modern Machine Shop is focused on all aspects of metalworking technology - Providing the new product technologies; process solutions; supplier listings; business management; networking; and event information that companies need to be competitive.

Issue link: https://mms.epubxp.com/i/850702

Contents of this Issue

Navigation

Page 64 of 172

62 MMS August 2017 mmsonline.com CNC TECH TALK Columnist Here is a little-known technique that can help you query a large number of values with just a few custom macro commands. It can be used with any series of consecutively numbered vari- ables, such as offset-related system variables, axis-related system variables, common variables and permanent common variables. Examples of when this technique can be helpful include: • Af ter using a spindle probe to determine how much raw material is on a sur face to be machined. Maybe the probe has touched along a series of points on a rough casting and you wish to determine the high point. With this infor- mation, you can determine how many roughing passes to take. • When querying a group of tool offset regis- ters to determine whether any are inappropriately set. Perhaps the operator forgot to enter a value or the value is outside an acceptable range. The trick lies in understanding how custom macro variables can be second-referenced. Consider these commands: #100 = 3.25 (Set common variable #100 to a value of 3.25) # 3 3 = 10 0 (S e t l o c al va r i a b l e # 3 3 t o a val u e of 100) # 32 = #[# 33] (Set local variable # 32 the value of #100, which is 3.25) In the third command, the first hashtag char- acter (#) of #[#33] tells the CNC that a variable will be referenced; the #33 inside the brackets tells the CNC which variable will be referenced. Variable #33 is currently set to a value of 100, so the CNC currently evaluates #[#33] as #100. In custom macro terms, this is called second- referencing a variable, and by itself, it may not seem to have helpful implications. Consider, however, that the value of the second-referencing variable (#33 in our example) can be changed, meaning a different variable will be in play. If a loop is used that steps the second-referencing variable number, a large number of variables can be que- ried with but a few custom macro commands. Consider this more realistic example: You have a large casting to machine, but you are unsure of how much raw material must be removed from a surface, and that amount of material may change with each new casting. Say the material to be removed is on the right side (X plus) of the casting, and this side is 20 inches long. If you use a spindle probe to find the most positive position in the X axis on the right side of the casting, the high point, you will be able to calculate the worst-case condition in terms of the amount of raw material to be removed. With this information, you will be able to determine how many roughing passes to take. You then h ave th e s p i n d l e p ro b e p e r fo r m a s e r i e s of touches, say 40 of them at 0.5-inch increments. You make the probe store the results of these touches (40 X positions) in common variables #101 through #140. Now you need to determine the high point (largest value). Here is a series of commands that will do so: Second-Referencing Variables in Custom Macro This technique allows operators to query a large number of values using only a few CNC commands. MIKE LYNCH FOUNDER AND PRESIDENT CNC CONCEPTS INC.

Articles in this issue

Links on this page

Archives of this issue

view archives of Modern Machine Shop - AUG 2017