Java/Web Manual
  SoftPLC    Font size:      

Overview

Introduction

This document describes how to use the SoftPLC Web Server and embedded Java language support. The SoftPLC Web Server is a chargeable software option to any SoftPLC based controller. All SoftPLC controllers include the embedded Java language support at no charge.

With the SoftPLC Web Server you can use a web browser as an HMI, or as a user-friendly way to view files (eg: pdf files) stored on the SoftPLC flash disk.

With Java language support, you can run the SoftPLC Web Server (which was written in Java by SoftPLC Corp.). You can also run programs written in Java language, using the Java Application Program Interface (API) described in the SoftPLC Programmer's Toolkit. Additionally, you can use TOPDOC Loadable Modules (TLM's) written in Java such as the free ladder instructions "SendEmail" and "SQL Database Read", both of which are described in this manual.

More than one Java application can run at the same time on SoftPLC.

Note
This document does not attempt to describe how to develop programs in Java, nor does it attempt to describe HMTL programming. Free documentation on both these topics is available from a number of sources. This document also assumes that you are familiar with SoftPLC configuration via TOPDOC NexGen and .LST files.

Important Concepts

Java is a programming language. Java program code is called "bytecode". In order to run Java bytecode, a Java Virtual Machine (JVM) is required.

SoftPLC uses a JVM called "MachJ", which has been implemented as a TOPDOC Loadable Module (TLM) that runs in SoftPLC. You must load and configure MachJ.TLM in SoftPLC in order to run Java bytecodes or the SoftPLC Web Server. This is described in Chapter 2.

You also need to install the Sun Microsystems version 1.1 Java Runtime Environment (JRE), called RT.JAR. This is included with SoftPLC. Installation is described in the Installation section.

Java Developer Concepts

Java bytecode is developed with any Java compatible compiler or Integrated Development Environment (IDE). The output from the IDE is bytecode that may be executed on SoftPLC.

To develop bytecode, you may use any third party IDE or Java Development Kit (JDK) which produces Java compatible bytecode. Some IDE’s to consider are:

  • Borland’s JBuilder
  • Sun's Forte
  • NetBeans Developer
  • IBM's Visual Age for Java
  • Symantec's Visual Café
  • KAWA by Tech-tools

There are many others that you can use too. However, users must be cautioned when considering Microsoft's Visual J++. Although it is possible to generate Java compatible bytecode with Visual J++, it is also possible to generate bytecode which is not Java compatible. Only Java compatible bytecode is supported by SoftPLC.

SoftPLC Corp.'s definition of "Java compatible" is given by Sun Microsystem's Java Virtual Machine specification, Sun's Java Language Specification, and Sun’s JDK 1.1 API's, including JNI.

Supported Java

The Java language environment supported on SoftPLC will run most non-GUI programs that Java 1.1.x will run. AWT is not supported, but most all other classes from the Java 1.1 environment are fully supported.

You can use all the classes in the following Java language packages:

  • java.lang
  • java.lang.reflect
  • java.util
  • java.util.zip
  • java.net
  • java.io
  • java.text

More than one Java application can run at the same time on SoftPLC or SoftWIRES.

Note
Because of the short filename constraint, bytecode running on SoftPLC must be in *.JAR format. SoftPLC supports compressed or non-compressed JAR files.