Java/Web Manual
  SoftPLC    Font size:      

Modlets

Introduction

Modlets are the top most Java entry points within SoftPLC. All Java language execution within SoftPLC has its origin within a Modlet. A Modlet is somewhat like an Applet without a GUI. Although Modlets have the ability to print textual output to the screen, it is not GUI, and they cannot take keyboard or mouse input. Modlets are intended to interact mainly with the SoftPLC datatable. There is no limit to how many Modlets you can concurrently run under SoftPLC.

Modlets receive events from SoftPLC, indicating things like end of scan, operating mode transitions, installation or startup, and shutdown.

Modlets are often written to use command line parameters. Command line parameters are specified with a text editor just after the Modlet class name within the text file MODLET.LST.

Here is a sample MODLET.LST file:

com.softplc.Weblet C:\LST\SYS
com.softplc.ApplicationLauncher MyApp myparam1 myparam2
MyModlet

Modlets and their command line options must go on a single line. Blank lines are ignored, and anything to the right of a semicolon is ignored.

In this example we have three Modlets given, as shown in the table below.

Interpretation of sample MODLET.LST file:

Modlet Class NameCommand Line Parameters
com.softplc.WebletC:\LST\SYS
com.softplc.ApplicationLauncherMyApp myparam1 myparam2
MyModletnone

Each Modlet class file must be made accessible via the classpath option given to MACHJ.TLM. See the section on classpath.