Java in the Factory

Newer technologies carry inherent potential to improve on what has gone before. A case in point is Sun Microsystems' 1995 introduction of Java software and programming language, ushering in advances like platform/operating-system independence, ability to reuse software applications, Web connectivity, and basis on industry standards.

By Frank J. Bartos April 1, 2005


Design for distributed architectures

Work with open-source software

Aid embedded control

Provide application programming interfaces (APIs)

Apply Web services

Sidebars: A taste of Java basics

This article contains online extra material.

Newer technologies carry inherent potential to improve on what has gone before. A case in point is Sun Microsystems’ 1995 introduction of Java software and programming language, ushering in advances like platform/operating-system independence, ability to reuse software applications, Web connectivity, and basis on industry standards.Measurable success followed, however, it has been the deployment of Internet and Web-based communications on a dramatic scale by industry that now makes Java technology so attractive for streamlining networked information flow between factory and business systems. To be fully successful, Java will need to solve some real-time and determinism concerns.

Java-based software offers several benefits to industrial users. Paul Bennison, business development, Schneider Electric-IAC Services, puts hardware- and operating-system independence at the top of the list, citing Java’s compatibility with the Microsoft Windows/Intel platform plus other popular alternatives, such as ARM and AMD 64-bit Opteron processor and Linux and VxWorks operating systems. Java’s ‘native support’ for IT enterprise connectivity standards—SQL, XML, Web services, open database links, etc.—also helps to bridge the factory floor to the business suite, he explains.

Another benefit is Java’s ‘scalable, modular deployment model.’ For example, it can improve a legacy PLC system’s ability to capture and deploy process/production data to the controlled equipment. ‘Additionally, information is instantly available to both local and remote users, enabling timely decision support presented visually to the operator via a handheld browser, or as an e-mail alert, or directly to the enterprise remote monitoring system,’ says Bennison.

‘In 1996, Schneider Electric was one of the first industrial automation suppliers to make Java software, Ethernet, and Web services core features embedded at the control tier of an automation architecture, now called Transparent Ready,’ he adds. Today, all its automation and control devices embed Java remote monitoring device diagnostic agents. Thereby, any enterprise user can obtain information via HTTP, Java-enabled browser diagnostics, and user-defined Web pages, while living within the company’s firewall constraint and IT security configuration, claims Schneider.

Integrate factory devices

Among new developments from Java originator Sun Microsystems is Java 2 Enterprise Edition (J2EE), incorporating Java Connector Architecture (JCA), which enhances the software’s ability to integrate with factory devices using different TCP/IP-based protocols, according to Dr. Bernard Traversat, senior engineering manager at Sun. Previously, J2EE applications gave users a Web-based interface via HTML and HTTP, but the very general interface with a thin-client browser was not robust enough for typical manufacturing environments. ‘With Java Server Faces, J2EE can now present richer user interfaces within the same thin-client approach,’ he says.

Web services protocols represent an emerging standard in B2B communication, which J2EE application servers must implement to ensure interoperability, notes Traversat. Moreover, Web services (WS) and its principles are compatible with distributed architectures of typical manufacturing facilities. Thus, WS becomes an effective model for communication between plants and the central office—for tasks like production order schedules/status, materials requirements, quality information, and logistics.

Traversat also mentions Sun’s J2SE (Standard Edition) version 5.0 and its new concurrency utility library. It enhances Java’s ‘thread constructs’ to enable effective use of core Java technology in complex process control algorithms, simulation, and automation. J2SE 5.0 also improves Java execution performance and scalability by reducing startup time and memory usage. These traits ‘increase the viability of Java on smaller computers typically used in manufacturing environments,’ adds Traversat.

John Baier, Rockwell Automation’s director of software architecture, refers to J2EE as a real advancement in Java technology mainly because it simplifies development of Web service interfaces, vital for developing distributed manufacturing applications. He sees among Java’s benefits the portability to different platforms that allows deployment of the same code in various configurations—along with the popularity of Java as an integration language for MES applications. Baier also notes Java’s ability to deploy in small devices (and portable computing units) as useful for industrial applications.

At GE Fanuc Automation, benefits of Java (and XML schemas) are key to the interoperability strategy with business systems and mobile devices, according to Bernie Anger, vice president, software development. Users benefit from reduced integration costs, improved functionality, and faster response times, he explains, when they can receive, analyze and respond to events from a variety of devices. This is an extension of GE Fanuc’s Proficy strategy.

New software to be introduced by GE Fanuc will, for example, enable downloading of work orders to Java-enabled phones with two-way communication that links users with the work order and provides update status to the Proficy server, says Anger.

Mike Houston, application architect for Visiprise Inc.—a production management software provider—concurs that platform independence, consistent application environment of J2EE, and support for standards add up to new, beneficial features of Java. Platform independence gives users a choice of desired hardware and operating system, while J2EE offers a working environment with a consistent application programming interface (API) and common development language.

‘Most commercial application J2EE servers provide fast, reliable environments for the manufacturing software to execute in,’ says Houston. ‘Java is a fairly open development platform that has built-in support for many standards.’ Application servers typically support standards, such as XML, HTTP, WS, etc., to ease integration with machine control, ERP, and other systems. Visiprise Manufacturing, the company’s J2EE-based MES software, intends to serve as a bridging tool between shop-floor systems and enterprise systems.

Visiprise also notes that customizing and maintaining software modules written in Java is easier compared to a less open environment. ‘Working with Java code is quicker and, in most cases, less expensive,’ adds Houston.

Real-time issues, security

When implementing any manufacturing control system, real-time (RT) considerations are not far behind. In the simplest sense, RT means that control system responses must be predictably completed within definite time limits set by the application.

Rockwell’s Baier mentions the development of RT applications using Java, but advises special care in the process, citing two main concerns. First, real-time applications often use compiled Java to allow for faster execution times. Here, trustworthy Java code needs to be written close to the operating system, since Java virtual machine (JVM) interpretation cannot be used in the RT part of the program, he explains. Second, Java’s memory management (garbage collection) feature may require adding a real-time layer, available from software suppliers. (See ‘Java basics’ sidebar for more on JVM and garbage collection.) ‘One needs to consider the entire application environment for real-time developments—language concerns are only a subset of the overall picture,’ adds Baier.

Sun Microsystems focuses its Java offerings for RT applications on secure handling of highly decentralized data vital to manufacturing and enabling various advanced functions for sensor devices, such as time synchronization to sub-microsecond levels. Java Distributed Data Acquisition and Control (JDDAC)—an API in Sun’s Java System RFID software—interfaces ‘virtually any sensor device’ with Sun’s RFID Event Manager. ‘JDDAC ensures that sensors and actuators are self-describing and readily supported as networked entities on networks,’ says Traversat.

Also on the real-time front, an expert group of software vendors under the Java Community Process (JCP) organization is developing Real-Time Specification for Java (RTSJ), which includes RT threads and asynchronous events among its features. Sun Microsystems has recently released an implementation of RTSJ. Still, more development is needed for RT applications of Java, especially for embedded systems. An example area is deterministic garbage collection. The Open Group is another organization active in RT Java development (see Online Extra to this article).

A factory-floor network is less accessible and more secure than business networks, though still vulnerable to cyber attacks. Protection from unauthorized access requires multiple defenses—among them, digital certification, secure socket layer (SSL) encryption and, of course, appropriate levels of legitimate user access, explains Schneider Electric’s Bennison. Characteristics of Java technology can help.

‘The Java platform allows security to be embedded at the granularity of the specific control device,’ he says. ‘The embedded Java server and Virtual Machine (or secure gateway) limit access at the source.’ Because all traffic passes through the secure gateway, no direct access exists to individual control devices. Information is served from secure Web servers, made available to the appropriate access rights. ‘Web page views provide access, enabling operator intervention with a full audit trail of changes,’ states Bennison.

He classifies Java technology’s scalable security configuration in three levels. Secure means use of a secure gateway that limits traffic, with no direct access to the device, no access without authorization, and all access logged. Only necessary ports are open; all unused ports secured. ‘Java ‘sandbox’ model [secure runtime environment] ensures no downloading of malicious code, no buffer overflows or similar exploits,’ he adds.

Securer refers to the ‘Web-services’ model, where access is confined to one protocol (HTTP), limiting attack options, according to Bennison. The ‘sandbox’ model works as above. Patch management is needed only for very infrequent events. Securest means encrypted access is applied to any part of the system. Secure HTTP, physical/ biometric identification, fingerprints, and other methods may be activated.

Full enterprise connection and just-in-time manufacturing leave the factory vulnerable, according to Sun, requiring enhanced security and connectivity measures. Traversat suggests several possibilities. Explicitly limiting an executing Java program’s capabilities to a desired profile (‘sandbox’) helps limit potential damage to a computing system. Rigorous authentication of users—and controlling their access to specific functions and data—is another step, along with having an accurate audit trail available. Providing APIs for all major channel and message-based encryption methods also raises the level of data privacy during communication.

Products, applications

Partnering is a necessity for today’s technology developments. Sun’s partner, Mitsubishi Electric Corp. of Japan, has created a Java-based Automation Controller (JAC) in collaboration with U.S. technology company Cyberonix Inc. Now in production, JAC uses communication drivers/adapters written in Java to connect various factory automation devices, and link a plant with the back office or other upstream application. One 10/100 Mbps Ethernet port handles upstream communication while four serial ports (3 for RS-232, 1 for RS-485) ensure downstream data flow. Messages are passed using XML or other common formats. This article’s first photo shows a demo of integrating Java into the manufacturing supply-chain, with JAC acting as an embedded real-time information gateway to replenish depleted CD inventory and communicating with a Mitsubushi RV-1A robot, Q-Platform controllers, J2 servo controllers, and upstream devices.

Schneider Electric mentions a Java-based solution in use at Heinkel USA, a manufacturer of pharmaceutical centrifuges that operate under regulatory control. A Quantum embedded PLC module with JVM reportedly helps extend the operating life of Heinkel’s single-node SCADA system to 10 years versus three- to five-year maximum life for a traditional SCADA system. Replacing a validated SCADA application carries high cost. ‘The secure Web application reduces the cost of validation and extends the life of the SCADA application, thus reducing lifecycle cost of operating and maintaining the centrifuge,’ says Schneider.

Java technology ‘brewed’ significant publicity from numerous factory applications a few years ago. More recently, it’s been quiet on the manufacturing front—or perhaps Java has moved under cover. With new Java technology developments and progress on real-time issues, it may soon be time to ‘pour another round.’

Online Extra

More Industrial Use of Java on the Way Frank J. Bartos, Control Engineering

“What’s in a name?” you might ask. Depending on your age, the term “Java” may conjure up images of the tropical main island of Indonesia, or a steaming cup of the coffee variety that originated there. This software technology actually was named after the slang word for the “office brew”—but only by default. The original name of the project to develop this unique software language, “Oak,” already had been trademarked. A 1995 brainstorm meeting of about a dozen people at Sun Microsystems came up with the name that has lasting flavor: “Java.”

Being a programming language and environment for networked applications, Java technology may be ideally aligned for the next-phase of the “factory of the future.” Networking—whether Web-, Internet-, or intranet-based—is key to any new automated industrial facility that comes online from now on. Web services in particular will be important in these plants on both sides of the manufacturing firewall.

As pointed out in the main article, some real-time application concerns exist for Java technology. These are being worked out and, as a result, industrial usage of Java may likely accelerate, soon.

One illustration of things to come in the near future was the “first demonstration of hard real-time Java,” hosted by Aonix at Embedded Systems Conference 2005 in San Francisco, in March. The demo used a precommercial release of JRTK—which is a hard real-time, mission-critical subset of the Real-Time Specification for Java (RTSJ) as defined by the Java Community Process (JCP, see later section of this article, below).

JRTK is said to immediately meet the needs of safety- and mission-critical applications. It also targets broader defense and aerospace, transportation, energy, and medical markets. Aonix expects to show that JRTK can achieve the performance of C language and run at approximately twice the speed of traditional Java. “JRTK includes many efficiencies over standard Java offerings. No garbage collection is used on objects in the real-time heap,” says the company.

Markets, applications Paul Bennison, business development, Schneider Electric -IAC Services, sees Java-based industrial applications growing. In the company’s recent experience, Java users have targeted four areas: Real-time data and back-end database integration, overall equipment efficiency, HMI system replacement, and SCADA system replacement. The first two target areas appear most promising and are covered here; the last area is discussed briefly in the main article.

Real-time data and back-end database integration

This sector focuses on full-time (24/7) deployment and configuration of application servers for tasks such as time synchronization, real-time data gathering and alarm monitoring, and factory-floor production or diagnostics alerts. “Typically, this information is logged at high frequency to a remote SQL database; the application may also include exception-driven e-mail alerts, PDF, or XML reports,” says Bennison. “Usually, these applications have minimal visualization requirements.” As for connectivity to a legacy system, serial drivers and “headless” embedded systems (without disks) running a JVM/Linux/ARM platform are commonly used.

Overall equipment efficiency

In the past, high licensing and implementation costs have made it difficult for small- to medium-sized manufacturers to afford traditional MES software. Today, implementation and licensing costs are no longer an issue. “Using open-source SQL databases, Java software makes it possible to create the $10k MES application,” adds Bennison. “Java application libraries optimized to address machine downtime, SPC, and overall equipment efficiency (OEE) are providing payback justification measured in a few days or weeks.”

Sun Microsystems mentions a further capability of Java technology. “Using Java in combination with a knowledge base of performance information about a machine or process, it’s possible to create real-time predictive maintenance solutions for a variety of industrial applications.”

Java in motion It should come as no surprise that the utility of Java technology is at work in motor and motion control areas. The following is a quick overview.

Yaskawa Electric applies Java technology in its DriveWizard 6.0, a PC software program, said to simplify installation, parameter record keeping, and maintenance of ac variable-frequency drives (VFDs) manufactured by the company. Various Yaskawa VFDs are supported, including GDP515/G5, E7, F7 and G7 series. Among DriveWizard’s numerous features are:

Online drive parameter monitoring for diagnostics and troubleshooting;

Up/download, retrieve, or modify drive data to and from a drive or file;

‘Digital scope’ for graphing of drive data;

Fault history; and

Ability to perform basic online control of the VFD to test parameter adjustments, simulate events, and auto-tune motors.

Copley Controls Corp. has recently introduced Java software components (Java beans) that allow automated, complex motion sequencing of equipment in response to a simple “go” command. Java components are reportedly easily programmed to create a menu of positioning sequences (pick-place, step-repeat, etc.), embedded directly into the flash memory of the servo drive amplifier. The machine/system control computer then selects a desired production sequence for execution from the amplifier’s command menu. The local amplifier also sets parameters and performs fault handling.

In contrast, the traditional motion sequencing approach requires sophisticated indexers, writing software, programming the host computer, and poring over large user manuals. A Copley Virtual Machine that runs on the drive amplifier’s multitasking operating system is key to obtaining the new advanced motion sequencing.

The Java-based sequencing software is incorporated into Copley’s newest “universal” system setup and commissioning software (CME 2, version 4) that works with the company’s wide range of servo and stepper motor drives. By the way, this sequencing software comes free with a Copley motor drive.

Information sources An active community of organizations supports Java technology. They form valuable sources of information for developers and users of this technology. Here’s a sampling of resources.

Java Community Process (JCP) represents an international developer community having the charter to develop and evolve Java technology specifications, reference implementations, and technology compatibility kits.

Open Web Application Security Project (OWASP) , a not-for-profit organization, produces free, open-source documentation, tools, and standards. The OWASP community participates in a variety of activities, including conferences, local chapters, articles, papers, and message forums.

On OWASP’s Web site, an article on Java security, by Jeff Williams of Aspect Security Inc., is particularly notable.

The Open Group is an industry consortium sponsored by Fujitsu, Hewlett-Packard, Hitachi, IBM, and Sun Microsystems. Its charter is to develop de facto standards for software engineering, with emphasis on application programming interfaces (APIs). Specific work areas of Open Group include real-time (RT) Java, RT security, and safety-critical systems.

A taste of Java basics

Java technology is a multithreaded application-development environment that uses an object-oriented language similar in syntax to C or C++, but simplifies and improves on features of those languages. Programs written in Java are scalable and portable to different hardware platforms and operating systems. Java’s design favors highly distributed architectures based on use of the Web and Internet. It works basically as a server, downloading applications to client request. Java also supports various encryption and authentication protocols.

A distinct feature of Java is that programs do not run directly on a native operating system (OS). Instead, a Java Virtual Machine (JVM) sits between a platform and OS as an ‘interpreter,’ allowing programs to run on any computer system having a specific JVM. A Java compiler first translates a program into byte code, then the JVM interprets it for the specific platform. This feature adds a measure of security to the system, since Java applets are screened in a protected memory space or sandbox before passing to the CPU. For applications in need of higher performance, such as real-time (RT) systems, it’s possible to bypass the JVM. Here, a just-in-time compiler translates programs directly into machine code while the application runs. However, less portability becomes a tradeoff.

Another special Java feature is automatic garbage collection (GC) or memory management that reclaims any memory space unused by a program. While relieving developers from this substantial task, it introduces uncertainty into RT applications because the GC algorithm’s time cycles are not predictable. Various dynamic and deterministic GC methods, thread scheduling issues, and other refinements are being pursued in support of real-time Java applications.