United Business Media EE Times


Search

HOMEMARKET INTELLIGENCE UNITFORUMSDESIGNNEW PRODUCTSCAREERSBLOGSCONTACTEVENTSSIGN UP!RSSMost Popular contentTrusted Sources

 


JVM and class file fit industrial space








EE Times


Can industrial automation vendors use Java to produce systems that perform more reliably, improve programmer productivity, reduce time-to-market and even provide binary compatibility across hardware platforms? Like many in the embedded systems industry, industrial automation vendors have watched and waited for the validation of Java in their domain.

At the top of their list of concerns are performance problems caused by simplistic implementations of the Java virtual machine (JVM) and garbage collection algorithm. However, with a new generation of Java virtual machines sporting real-time garbage collection algorithms and throughput speeds approaching that of C++ on many common operations, the time is ripe for industrial automation to reap the benefits of the Java programming language.

What makes Java fit the industrial automation world are the concepts of the JVM and class file, which are essential to the Java programming language. A class file is a sequence of machine-independent instructions interpreted by the JVM running on a host computer. JVMs and class files have been used on the Internet for several years to download and execute programs inside Web browsers.

Typically, a class file is sent over a network or loaded by other media and into the JVM via a Java class loader, which then reads the class file, validates it and loads it into memory ready for the JVM to execute. Because class files are machine-independent, the class loader and JVM combine to load and execute Java files in exactly the same manner, with the same results, on any hardware platform.

That powerful idea, which has driven Web development and, more recently, business-to-business electronic commerce, provides one of the most compelling reasons to move industrial automation applications running on a variety of hardware platforms toward Java; the same binary code may be used on a variety of hardware control platforms.

Over the years, the industrial automation industry moved from platforms that were designed specifically to perform a single task in hardware to programmable logic controllers (PLCs) that use general-purpose processors and software to perform their tasks. The migration to programmable controllers did not begin with general-purpose processors.

Instead, companies made use of ladder logic, a programming language based on relay logic. Eventually, ladder logic was included in the IEC 1131 specification, a collection of programming languages designed specifically for PLCs, and became one of the principal languages for programming PLCs. As microprocessors became widely available, manufacturers began to use them in their PLCs.

Although development environments exist that translate IEC 1131 code into C and assembly language and operate under embedded real-time operating systems, many companies and developers now use direct C coding to implement control algorithms. Thus, they inherit all the software-engineering concerns associated with writing low-level C and assembly language, concerns that Java was developed to address.

With the advent of Java, the opportunity exists to create truly revolutionary tools for PLC programmers and users. As mentioned, one of the primary advantages of Java is its ability to run programs on different hardware platforms without recompiling the source code.

For the industrial automation industry, this has several benefits. First, as hardware is updated and newer hardware controllers replace older ones, no change in the binary software is necessarily required. For example, if a PLC that fully utilizes a 40-MHz Intel processor is upgraded to a 100-MHz Power PC processor, then the same binary class files can be used for both controllers, assuming that hardware ports and external interfaces are programmed for portability. Second, hardware independence allows developers to simulate the run-time environment on a desktop computer, greatly reducing development time.

With the simple addition of low-level hardware simulation, the same application class files that run on the target PLC can also execute on a desktop computer for development and debugging. Once the code is completed, the class files can be executed on the target hardware for final testing and quality assurance. This saves valuable time during the development process, since standard Java development environments may be used. Familiar debugging tools and development environments that are not tied to specific hardware platforms are easier for developers to learn and use; also, testing does not require the constant downloading and setup of the target PLC. Another benefit is that debugging is required only on a single version of source code, once for all platforms. This reduces the project overhead and maintenance by greatly simplifying project build configurations, reducing coding errors and simplifying bug tracking and change requests.

In addition to cross-platform compatibility, the Java programming language provides the means for seamlessly downloading new or revised code to PLCs without any type of reset of the hardware or JVM. This ability, called dynamic downloading, was designed into the Java language from the beginning with this in mind. Today, it is primarily used in Web browsers to run applets, but the full potential of this capability has yet to be completely exploited by any industry. Imagine a factory with PLCs controlling the production of parts for a car and connected via wireless company intranet. Using a Web browser, the production controller changes the configuration of a PLC in the factory to produce cam shafts for six-cylinder engines instead of four-cylinder engines without intervening with the machine physically. While such behavior could be accomplished using another programming language, Java makes this type of system architecture easy and intuitive to program. The benefits are clear when considering the movement toward just-in-time delivery of products.

Not only can dynamic downloading change the behavior of the hardware, but it can also be used to "patch" existing code or add additional functions. The ability to change a single source file, recompile it and then dynamically download only the changed class file and link it with a running JVM provides added flexibility for software maintenance. When that technique is used, software in an entire factory can be upgraded remotely, thereby avoiding costly on-site maintenance requests.

The idea of remote administration has already proved to be effective in the computer server market, where high-end servers are remotely managed through a Web interface. Developers could also use dynamic downloading to diagnose hardware failures. For example, in the event of a hardware fault, a developer could write Java classes that monitor a set of sensors on the hardware, determine specific conditions that cause the fault and return results by e-mail. Those Java classes could be generic to cover a wide range of potential problems, or custom-designed to diagnose a specific problem. Combining the ability to patch files on the fly with remote debug and fix, the Java environment provides a powerful and compelling tool for software development, for industrial automation and other industries with similar requirements.

A good example of the efficiency of a Java-enabled factory can be seen in a scenario where desktop computers, database servers, Web servers and PLCs are networked via Ethernet cable and wireless Ethernet devices.

Statistics review

In an office, a production manager uses a Web browser to review the production statistics for the morning. Each PLC reports data through the network to a central database, where it is organized and made available to users through a Web browser interface. The manager notices an unusually high number of defective parts from PLC 1042. Since those parts are time-critical and scheduled for delivery the next morning, he transfers production of that part to another milling machine and PLC using a Web interface.

The defective PLC is then marked unavailable and scheduled for servicing. That night, technicians receive a problem report over the network detailing the symptoms of the defective hardware. A technician immediately sends a set of Java diagnostic programs to the hardware for execution.

The results are returned by e-mail to the technician, who then calls for a senior technician to write custom test code to check the temperature of the motor drive under certain conditions. The test code is also sent to the hardware for execution, which then finds that the motor is overheating under certain conditions. Service personnel are then dispatched to check the motor, which turns out to have a bad bearing. The hardware and PLC are back on line the next day.











  Free Subscription to EE Times
First Name Last Name
Company Name Title
Email address
  Click here for your Free Subscription to EETimes Europe
 
CAREER CENTER
Ready to take that job and shove it?
SEARCH JOBS
SPONSOR

RECENT JOB POSTINGS
CAREER NEWS
With Acquisition Delayed, Sun Cutting 3,000 Jobs
With its proposed acquisition by Oracle being delayed by regulators, Sun plans to cut 3,000 jobs across several regions over the next 12 months.

For more great jobs, career related news, features and services, please visit EETimes' Career Center.


All White Papers »   

 
Education and
Learning


Learn Now:












Home | About | Editorial Calendar | Feedback | Subscriptions | Newsletter | Media Kit | Contact | Reprints|  RSS|   Digital|  Mobile
Network Websites
International
Network Features




All materials on this site Copyright © 2009 TechInsights, a Division of United Business Media LLC All rights reserved.
Privacy Statement | Terms of Service | About