SmartCAM
Published

VBA Macros Ease CAM Program Creation

Taking advantage of the open architecture of Esprit CAM software to write Visual Basic for Applications (VBA) macros simplifies CNC programming at this manufacturer of automotive presses.

Share

 

Machining a wide variety of complex, tight-tolerance parts that often involve special customer requirements can be time-consuming and expensive, but that doesn’t necessarily have to be the case for programming. Such has been the experience at Prensas Schuler, a Sao Paulo, Brazil-based manufacturer of automotive industry press systems. Using macros to program parts in Esprit CAM software from DP Technology (Camarillo, California) has helped manage complexity and significantly reduce programming times, in some cases from hours to minutes. Moreover, the software’s open-architecture design and use of the Visual Basic for Applications (VBA) programming language makes it easy to find and train new macro programmers, receive technical support, and customize the system to suit individual applications, says Fabio Avila, who heads Prensas Schuler’s machine shop.
 
Prensas Schuler is the second-largest subsidiary of the Schuler Group, a Goppingen, Germany-based supplier of metalforming presses that has plants throughout the world. The Brazilian operation distributes the parent company’s full product line, but its manufacturing resources are dedicated to press lines, servo presses, transfer presses, progressive die presses, blanking presses, try-out presses, forging presses and press automation solutions. Components for these systems are produced mostly on large gantry mills and horizontal machining centers.
 
Accommodating special customer requirements requires creating dozens of new CNC programs each month. The company reports that this task is especially challenging because parts tend to be geometrically complex, and they often require special programming touches to avoid damage. Tolerances tend to be tight, so programs must include built-in trial cuts and touch-offs. Finally, programs require detailed annotations to guide operators through setup and machining processes.
 
Mr. Avila says writing macros for each major category of press component helps simplify the programming process, reduce errors, reduce programming time and make special customer requests easier to accommodate. Prensas Schuler had been using macro-based programming for some time before adopting Esprit, and the process is similar with both the old software and the new. In essence, macros boil the programming process down to a series of questions about the part and the equipment and tooling used to produce it. Based on the programmer’s input, the system generates a finished G-code program.
 
However, Esprit enables programmers to write macros using the industry-standard VBA programming language. In contrast, the company’s previous software used its own language. According to the company, it was difficult to find people who knew that language, so it often had no choice but to train new programmers from scratch. “We looked for a program that uses a standard programming language,” Mr. Avila says. “There are many programmers who already know VBA, and Esprit provides an application programming interface that opens the door for communications with many Windows programs.”
 
The fact that so many programmers have already mastered VBA is a major benefit because they can readily write macros for a variety of applications, including those at Prensas Schuler. Compared to the previous system, this eases hiring and training. Additionally, Esprit’s application programming interface (API) provides seamless integration with VBA, the company reports. For example, all of the CAM software’s menus and toolbars are accessible from within a VBA macro. This enables programmers to use macros to adapt the Esprit interface according to the individual needs of an application or business.
 
Prensas Schuler has several VBA programmers who write Esprit macros. The process begins with parametric models in CATIA V5, the CAD software the shop uses to design presses. Once imported into Esprit, those CAD files serve as the basis for macros dedicated to specific families of parts. Then, the CNC programmer uses the macro to create programs for individual parts within the family. For example, a typical dialog box might ask the programmer to define a hole by entering parameters such as diameter, depth, X-Y-Z location and hole type. Once the programmer enters that information, the system automatically creates the holes, selects the cutting tools, creates the drilling operations and produces the G-code program, complete with a tool list and a tool setup diagram that shows the zero point for the tooling on the part.
 
In addition to macro programming with VBA, Mr. Avila says he appreciates Esprit’s simulation capabilities. The software provides a graphical representation of not only the programmed tool paths, but also the entire machining environment, all in dynamic 3D solids. Such simulation provides benefits in addition to simply preventing collisions. For example, simulation has helped programmers discover that the final part geometry does not match the design intent and requires tweaking prior to any actual cutting. In other cases, programmers have recognized opportunities to reduce machining time by cutting a feature with a different tool or changing the order of operations. 
 
“Esprit macros have improved the CNC programming process for forming press components, and its use of the VBA programming language makes it much easier to find and train programmers,” Mr. Avila concludes. “Our goal is to continue to improve our macro programming capabilities in order to further reduce programming time and eliminate machine setup errors.”

 

HCL CAMWorks 2024
Surface finishing in Fusion
SmartCAM
ProShop
SolidCAM
Thermo SL Brass EDM Wire
World Machine Tool Survey
Paperless Parts
Koma Precision
Techspex
OASIS Inspection Systems
Gardner Business Intelligence

Related Content

When Handing Down the Family Machine Shop is as Complex as a Swiss-Turned Part

The transition into Swiss-type machining at Deking Screw Products required more than just a shift in production operations. It required a new mindset and a new way of running the family-owned business. Hardest of all, it required that one generation let go, and allow a new one to step in.

Read More
Basics

5 Reasons Why Machine Shop Ownership Is Changing

Mergers, acquisitions and other ownership changes are an effect of Boomer-age shop owners retiring, but only in part. Also important: The way we think about machining has changed.    

Read More
Basics

6 Steps to Take Before Creating a CNC Program

Any time saved by skipping preparation for programming can be easily lost when the program makes it to the machine. Follow these steps to ensure success.

Read More

Understanding CNC Machine Accuracy and Repeatability

Properly evaluating machine tool capability requires understanding how the both user and the builder can influence precision.

Read More

Read Next

Basics

Obscure CNC Features That Can Help (or Hurt) You

You cannot begin to take advantage of an available feature if you do not know it exists. Conversely, you will not know how to avoid CNC features that may be detrimental to your process.

Read More
Large Part Machining

The Cut Scene: The Finer Details of Large-Format Machining

Small details and features can have an outsized impact on large parts, such as Barbco’s collapsible utility drill head.

Read More

3 Mistakes That Cause CNC Programs to Fail

Despite enhancements to manufacturing technology, there are still issues today that can cause programs to fail. These failures can cause lost time, scrapped parts, damaged machines and even injured operators.

Read More
SmartCAM