You are on page 1of 94

MicroSCADA Pro SYS 600 9.

3
Java Programming Interface (Java-API)
1MRS756648 MicroSCADA Pro SYS 600 9.3
Issued: 31.3.2010
Java Programming Interface (Java-API)
Version: A/31.3.2010 Users Guide

Contents
Copyrights .....................................................................................5
1. Introduction ...............................................................................7
1.1. This manual ...................................................................................7
1.2. Use of symbols ..............................................................................8
1.3. Related documents .......................................................................9
1.4. Document revisions .......................................................................9
2. Safety information ...................................................................11
2.1. Backup copies .............................................................................11
2.2. Fatal errors ..................................................................................11
3. Instructions ..............................................................................13
3.1. IP Address ...................................................................................13
3.2. Hardware and software requirements .........................................13
3.3. Installation ...................................................................................14
3.4. Environment Settings ..................................................................17
3.5. Configuration ...............................................................................20
3.6. Configuring Java API for several products ..................................22
3.7. Using Java classes, applications and applets .............................22
3.7.1. Java classes ....................................................................22
3.7.2. Java applications .............................................................23
3.7.3. Examples .........................................................................24
4. Technical reference ................................................................31
4.1. Java classes ................................................................................31
4.1.1. SCIL_Connection .............................................................31
4.1.2. SCIL_SSL_Connection ....................................................32
4.1.3. SCIL_Interface .................................................................32
4.1.4. SCIL_Object .....................................................................35
4.1.5. Objects inherited from the SCIL_Object ..........................36
4.1.5.1. SCIL_BaseSystemObject ...................................36
4.1.5.2. SCIL_CommandProcedureObject ......................37
4.1.5.3. SCIL_DataObject ...............................................37
4.1.5.4. SCIL_EventChannelObject ................................38
4.1.5.5. SCIL_EventObject ..............................................38
4.1.5.6. SCIL_ProcessObject ..........................................38
4.1.5.7. SCIL_ScaleObject ..............................................39
4.1.5.8. SCIL_SystemObject ...........................................39
4.1.5.9. SCIL_TimeChannelObject .................................40
4.1.6. SCIL_FreeTypeObject .....................................................40

3
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

4.1.7. SCIL_Value ..................................................................... 43


4.1.8. SCIL_Message ................................................................ 49
4.1.9. EventLog ......................................................................... 50
5. Example application ............................................................... 53
5.1. Using the example application .................................................... 53
5.1.1. First page (main.html) ...................................................... 53
5.1.2. General info (generalinfo.html) ........................................ 54
5.1.3. Configuration & diagnostics (configuration.html) ............. 56
5.1.3.1. Applications (apl.html) ....................................... 57
5.1.3.2. Monitors (mon.html) ........................................... 60
5.1.3.3. Nodes (nod.html) ............................................... 60
5.1.3.4. Printers (pri.html) ............................................... 61
5.1.3.5. Links (lin.html) .................................................... 61
5.1.3.6. Stations (sta.html) .............................................. 62
5.1.3.7. Nets (net.html) ................................................... 62
5.1.3.8. Memory (memory.html) ...................................... 62
5.1.3.9. Time (time.html) ................................................. 64
5.1.3.10.Queues (queuemeters.html) .............................. 65
5.1.3.11.Bar-chart (diagram.html) .................................... 65
5.1.3.12.Line-diagram (linediagram.html) ........................ 66
5.1.3.13.Remote Communication Client Server
communication (main2.html) .............................. 67
6. Terminology ............................................................................ 71
7. Abbreviations ......................................................................... 73
8. Index ........................................................................................ 75

4
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Copyrights
The information in this document is subject to change without notice and should not
be construed as a commitment by ABB Oy. ABB Oy assumes no responsibility for
any errors that may appear in this document.
In no event shall ABB Oy be liable for direct, indirect, special, incidental or
consequential damages of any nature or kind arising from the use of this document,
nor shall ABB Oy be liable for incidental or consequential damages arising from use
of any software or hardware described in this document.
This document and parts thereof must not be reproduced or copied without written
permission from ABB Oy, and the contents thereof must not be imparted to a third
party nor used for any unauthorized purpose.
The software or hardware described in this document is furnished under alicense and
may be used, copied, or disclosed only in accordance with the terms of such license.
Copyright 2010 ABB Oy
All rights reserved.

Trademarks
ABB is a registered trademark of ABB Group. All other brand or product names
mentioned in this document may be trademarks or registered trademarks of their
respective holders.

Guarantee
Please inquire about the terms of guarantee from your nearest ABB representative.

5
6
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

1. Introduction

1.1. This manual


This manual provides thorough information on Java API for SYS 600 and needed
information related to it. This manual gives instructions for installation and
describes how to configure Java and SYS 600 for a client-server communication.
Explanations for the abbreviations used in this manual can be found in the Glossary
chapter.
Java API
Java API for SYS 600 is kind of a client-server application. A Java applet or
application communicates with the server, which in turn communicates with SYS
600. Java applets work inside the Web browsers on PCs and applications run on the
PC itself. The server is designed to be used in both the Intranet and the Internet.
When used in the Internet, some of the functionalities may have to be restricted to
only certain hosts or users.
Figure 1.1.-1 shows a diagram describing the Java API. In case of the HSB system,
only the application in Hot state can be contacted. More information about the
application state (AS attribute) can be found in Chapter 5 (APL Objects for Base
System) of SYS 600 System Objects.

Java_API

Fig. 1.1.-1 The applets, as well as the applications, are connected to SYS 600 via
the Java API and Java classes complementing the API.
Benefits
The main advantage is to provide an easy-to-use programming environment for the
development of the application extension programs. In this environment, dynamic
data types (vectors, lists etc.) are handled in a safe way. The temporarily allocated

7
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

memory in the SYS 600 memory pool will be automatically released, if it is not
needed any more. One purpose to use Java API is to get information from SYS 600
to the office computers without opening SYS 600 monitors.
Java API functions
The main purpose for Java API is to provide the same functionality as in C-API, but
in the Java environment. The functions in the C-API are grouped into several Java
classes. The Java classes which handle the communication with SYS 600 are located
in the SCIL.jar file.
The SCIL_Interface functions can be used to read/write variables, execute SCIL
commands, read SYS 600 events etc. When the SCIL_Interface class has been
created, a new SCIL_Context is also created. The context remains the same until the
SCIL_Interface is destroyed. When there is more than one SCIL_Interface, each of
the SCIL_Interfaces have their own SCIL context. The variables used in one
SCIL_Context cannot be accessed in another context.
The data is transferred between Java and SYS 600 mainly using the SCIL_Value
class. The SCIL_Value encapsulates the SCIL data types. The SCIL_Message class
is used when working with the SYS 600 events. The EP messages from SYS 600 can
be used by methods in the SCIL_Interface. The user can select which events to order
by using the methods in SCIL_Interface. The message can be read by using the
getAepMessage function. Depending on the timeout value, the function will be
blocked infinitely until the message is found or the time limit is reached.

1.2. Use of symbols


This publication includes warning, caution, and information icons that point out
safety related conditions or other important information. It also includes tip icons to
point out useful information to the reader. The corresponding icons should be
interpreted as follows:

The caution icon indicates important information or warning related


to the concept discussed in the text. It might indicate the presence of
a hazard which could result in corruption of software or damage to
equipment or property.

The information icon alerts the reader to relevant facts and


conditions.

Although warning hazards are related to personal injury, and caution hazards are
associated with equipment or property damage, it should be understood that
operation of damaged equipment could, under certain operational conditions, result
in degraded process performance leading to personal injury or death. Therefore,
comply fully with all warning and caution notices.

8
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

1.3. Related documents


Other useful or related manuals are:

Name of the manual MRS Number


SYS 600 9.3 System Objects 1MRS756662
SYS 600 9.3 Programming Language SCIL 1MRS756661
SYS 600 9.3 Installation and Administration Manual 1MRS756634

1.4. Document revisions

Version Revision number Date History


A 9.3 31.3.2010 New document

9
10
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

2. Safety information
This chapter gives information about the prevention of hazards.

2.1. Backup copies


We suggest that you take backup copies before making any changes, especially the
ones that might have side effects. Software and data need to be copied to another
place, usually to a CD or a backup tape. A writable CD and DAT tape are commonly
used.
Backup copies make it easier to restore the application software in case of a disk
crash or any other serious failure when the stored data is lost. It is therefore
recommended that backup copies are taken regularly.
There should be at least two system backup copies and two application copies. A
new backup is copied over the oldest backup. This way the latest version is always
available, even if the backup procedure fails.
Detailed information on how to take backup copies should be delivered to the
customer with the application.
System backup
Usually a system backup is taken after the application is made. A backup should be
taken again when changes are made to the SYS 600 system. For example, if the
driver configuration or the network set-up is changed.
Application backup
An application backup is also taken simultaneously with the system backup, after the
application is made. A backup should be taken again when changes are made to the
application. For example, if pictures or databases are edited or new pictures are
added.

2.2. Fatal errors


A fatal error is an error that causes a break-down or a locked situation in the SYS
600 program execution.
Handling
In case of a fatal error:
1. Write down the possible SYS 600 error messages.
2. Shut down the SYS 600 main program. If this cannot be done in the SYS 600
Control Panel, try to end the task in Windows1 Task Manager.

Shutting down the base system computers by switching off the


power might damage the files.

1. Windows is a trademark of Microsoft Corporation

11
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

3. In Windows, the data kept in the main memory at the moment of a fatal error is
placed in the drwtsn32.log file. It is placed in a system folder, for example,
Winnt. Analyse and copy the data in this file.
4. Restart the system.
Report the program break-down together with the possible SYS 600 error messages
and the information from drwtsn32.log file to the SYS 600 supplier.
Status codes
Error messages in SCIL are called status codes. A list of status codes and short
explanations can be found in SYS 600 Status Codes.

12
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

3. Instructions
All of the Java classes are packaged in an archive file. Since all browsers do not
support the same archive format, there are both SCIL.jar and SCIL.cab files.
The latest version of the JDK can be found (at least) at the WWW-sites of the Sun
Microsystems (http://www.sun.com, http://java.sun.com). Sun also provides very
useful information about the Java programming language.
Java Secure Socket Extension is used to handle sequred TCP/IP connections. The
latest version of JSSE can be found at the WWW site http:/java.sun.com/products/
jsse/ .
The numbering of the SYS 600 application is dependent on the application that the
AEPs have been started from. More information about the numbering can be found
from Application Mapping in Chapter 5 of SYS 600 System Objects.

3.1. IP Address
Each node or host in a TCP/IP network has a unique identifier, an IP address. The
IP address is composed of four numbers which range from 0 to 255. The numbers
are separated with dots:
aaa.bbb.ccc.ddd
The IP address is requested during the configuration of the LAN software, i.e.,
during the installation of the Windows operating system in the base system and
workplace computers, and during the installation of the PC/TCP software in front-
ends.
The IP addresses of the SYS 600 base system, workplace and front-end computers
must comply with the addresses of other nodes on the network. Consult your local
area network administrator for valid IP addresses and other LAN configuration
issues. More information on configuring SYS 600 for LAN can also be found from
SYS 600 Installation and Administration Manual.

3.2. Hardware and software requirements


Minimum memory needed on the server computer is 64 Mb, but the recommenda-
tion is 128 Mb. The installation needs approximately 5 Mb hard disk space.
The following software is required for a client computer:
An operating system - Windows.
A WWW-browser with Java support. For example, IE version 4.01 (includes
service pack 1) or Netscape 4.x.
The following software is required for a server computer:
In case of Java applets, a WWW-server. For example, Peer Web-server (NT
Workplace) or IIS (NT Server).
One of the following software is required:
SYS 500 8.4.3 or newer.
COM 500 3.0 or newer.

13
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

SMS 510 1.0 or newer.


CAP 501 2.0 or CAP 505 2.0 or newer.
Java 2 Runtime Environment or Software Development Kit, version 1.3.1 or
higher.
Java Secure Socket Extension, version 1.0.2 or higher.

3.3. Installation
This section describes the main steps of the installation of the Java API for SYS 600
with the help of figures describing the informative dialog boxes seen during the
installation. The Java API for SYS 600 is installed into a computer which already
has SYS 600, a WWW server and the JRE/JDK. More information of installing SYS
600 can be found in SYS 600 Installation and Administration Manual. If Peer Web-
server is installed to the server computer after installing SYS 600, odbc32.dll and
odbcint.dll files are replaced with older versions of the same files. If this happens,
the newer files can be found in the SYS 600 Java API installation disk and should
be copied to the Windows system32 directory. Windows administrator rights are
required before the installation of Java API can be started.
The main steps for installing the Java API for SYS 600 are as follows:
1. When the installation execution file is run from the installation disk, the first to
appear on the screen is the Welcome - SYS 600 Java API Installation dialog
box, shown in Figure 3.3.-1.

Welcome

Fig. 3.3.-1 The Welcome dialog box is the first to appear when the installation
program is started.
2. The Welcome dialog box gives two options, OK and Cancel. If you click the OK
button, the installation will continue. If you click the Cancel button instead, the
Install dialog box will appear on the screen, with an option for terminating the
installation.
3. The installation program will check which SYS 600 products have been
installed already. The checking is done in the following order:
3.1. SYS 600 9.0 or newer
3.2. SYS 500 8.4.3 or newer
3.3. COM 500 3.0 or newer

14
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

3.4. SMS 510 1.0 or newer


3.5. CAP 501 2.0 or newer
3.6. CAP 505 2.0 or newer
3.7. SYS 500 8.4.2
Java API is installed in context with the first found SYS 600 product. For example,
if SYS 600 has been installed on D-drive and SMS 510 on C-drive, Java API will be
installed on D-drive. The installation drive and path can be changed by clicking the
Change Directory button, see Figure 3.3.-2.
4. When you have selected to continue with the installation from the Welcome
dialog box, the next one to appear is the Select dialog box, shown in Figure 3.3.-
2. The Select dialog box is for customising the installation. It contains four
installation options:
Java API. This module contains the application extension program and the
Java package (it includes the files scil_jni.dll, scil2java.exe, SCIL.jar and
SCIL.cab). The default installation path is C:\MS_Interfaces\Java\.
Java Runtime Libraries. This module contains JRE 1.3.1-02, JSSE 1.0.2 and
some ODBC drivers. Files will be copied to the selected drive in
MS_Interfaces\Java\Setup\Drivers\ directory.
Documentation for Java API. This module contains the Java API manual in
PDF-format and the documentation of Java API classes in HTML-format. The
default installation path on the selected drive is MS_Docs\MS_Tech\Java\.
Java Demo. This module contains a demo application, which can be used to
show some basic information about. Java Demo refers to the example
application introduced in the Chapter 5 of this manual. The default installation
path on the selected drive is MS_Interfaces\Java\ms_java_demo\.
The Select dialog box gives also information on the hard drive space required for the
installation and the space available on the destination drive.

15
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

Java_API_Inst

Fig. 3.3.-2 The Select dialog box contains options for customizing the
installation.
5. At the bottom of the Select dialog box there are again two options for starting
and exiting the installation. If you click the Start command button, extraction of
the files from the source disk to the destination drive will be started. An
installation progress indicator dialog box will also appear on the screen. You can
terminate the installation by clicking Exit, or after having started the extraction
of files, by clicking Cancel on the installation progress indicator dialog box. By
clicking Help you will get information about the installation. Back returns to the
previous dialog box.
6. After all the files have been extracted from the disk to the destination drive, a
dialog box will appear on the screen with a text Your MicroSCADA system has
been successfully installed.
The files scil_jni.dll, scil2java.exe, SCIL.jar and SCIL.cab are placed in
C:\MS_Interfaces\Java\. The scil2java.exe is an application extension program and
must be started from the SYS 600 by the aep_start function. It is possible to start the

16
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

scil2java from the command prompt by giving NO_AEP as the first argument.
This may be useful when testing the Java programs. When the scil2java is started
from the command prompt, it is not possible to use the SYS 600 messages.

The JRE or the JDK and JSSE must be installed on the host before
this Java API can be used.

The JRE and JSSE are included in the Java API package, but the modules need to be
installed separately. The JRE installation execution file, j2re-1_3_1_02-win-i.exe
and the JSSE installation file is jsse-1_0_2-gl.zip, can be found under
sc\MS_INterfaces\Java\Drivers\ on the hard drive, after the Java API package has
been installed. After JRE is installed JSSE archive should be unzipped and added to
JRE as an extension library (see installation instructions in the JSSE package).
Java API Server needs to load JVM.DLL file from the JRE package. Before it can
be started the path to this DLL must be added to the system PATH variable. The
DLL location depends on the JRE/JDK version. If 1.3.x version is used, the path is
<JRE_HOME>\BIN\HOTSPOT\. If 1.4.x version is used, the path is
<JRE_HOME>\BIN\CLIENT\. Here <JRE_HOME> is the root folder of JRE.

3.4. Environment Settings


The following procedure describes how to establish Client server communication:
1. Verify that the file system is NTFS:
Open My Computer.
Right click on the C drive icon.
Select Properties.
Click the General tab.
The file system type is displayed.
2. Install JAVA-API package 1.0.
3. Install SP1 for JAVA-API 1.0. Use the installation package file.
4. Install JAVA development environment, for example,
j2sdk1.4.2_13.exe or the latest JDK.
5. Add the following paths to the system variable CLASSPATH:
Drive:\j2sdk1.4.2_13\lib
Drive:\ms_interfaces\java\SCIL.jar
Select CLASSPATH from the System variables pane.
Click Edit.
Enter new paths. Separate each path entry with a semicolon (;).
6. Add the following paths to the system variable PATH:
Drive:\j2sdk1.4.2_13\bin
Drive:\j2sdk1.4.2_13\jre\bin\client

17
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

Drive:\j2sdk1.4.2_13\jre\bin
Select PATH from the System variables pane.
Click Edit.
Enter new paths. Separate each path entry with a semicolon (;).

scil2java.exe will not start automatically if this environment


is not set.

7. Click OK.
8. Restart the PC.
9. Verify that MicroSCADA user can access the defined environment variables:
@t_Classpath = environment("CLASSPATH")
@t_Path = environment("PATH") from the test dialog of
MicroSCADA.
10.Edit the file C:\sc\sys\active\sys_sys_java.ini as follows:
[Config]
Default_Access = READ_WRITE

The default key value is no_access if the access key name is


missing.

To set the JAVA Server to start automatically:


11.Open the Microscada Object Navigator.

18
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Fig. 3.4.-1 Object Navigator


12.Add the command AEP_START to APL_INIT_1 and/or APL_INIT_H
command procedures.
For example:
@i_Aep_Nr =
aep_start("c:\ms_interfaces\java\scil2java.exe")
13.Edit the Command Procedure for APL_INI_1:
In the field Instruction (IN), enter:
;COM 500 application initialization
#DO COM_COMMINI:C

@i_Aep_Nr=AEP_START("C:\MS_INTERFACES\JAVA\SCIL2JAVA:
EXE")

19
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

Fig. 3.4.-2 Editting the Command Procedure for APL_INI_1


14.Click OK.
15.Edit the Command Procedure for APL_INIT_H:
In the field Comment (CM), enter: Executed after take-over in hot stand-by.
In the field Instruction (IN), enter:
;This is executed after take-over in hot stand-by
system
@i_Aep_Nr=aep_start("C:\MS_Interfaces\Java\scil2java.
exe")
16.Click OK.
17.Restart Microscada.
18.Open the login page with the path:
C:\MS_Interfaces\Java\ms_java_demo

3.5. Configuration
The configurations described in this section will be necessary to perform only if
remote applets or applications are used.

20
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Access control
The configuration for Java API is stored in \sc\sys\active\sys_\sys_java.ini. There
must be at least the following lines:
[Config]
Default_Access = READ_WRITE

The Default_Access can also be READ. If there is no configuration file at all, the
default access will be NO_ACCESS. More information concerning the
configurations can be found in the following two sections of this manual.

Java API server


The configuration file is sys_java.ini and it is located in SYS_ directory. It is a
normal text file in the same format as other Windows INI-files. When the server is
started it will read the configuration. The following items are configurable:
Max_Connections The maximum number of simultaneous connections. This
is the total number of clients (Java applets and
applications). Default value is 100.
Server_Port TCP port used by the Java API Server. The server
listens this port and accepts client connections.
Default value is 1501.
Default_Access The default access level if nothing else is specified by the
user or the IP number. The access level can be
FULL_ACCESS, NO_ACCESS, READ or
READ_WRITE. Default is NO_ACCESS.
Log_Enable This key indicates whether the connections should be
logged in or not. It can have values TRUE or FALSE. If
this is TRUE, the logging messages will be written to the
NT event log. The default value is TRUE.
SSL_Enabled If SSL encoding is required this parameter should be set
to TRUE otherwise - FALSE.
Authentication_Type The type of client authentication mechanism. Possible
values: NONE - client authentication is not required;
INI_FILE - all user names and passwords are kept in
sys_java.ini file within the [Passwords] section in the
following format: user_name = password , the password is
case sensitive; SCIL_FILE - client is authenticated by a
SCIL program. The SCIL program file name is specified
in Auth_SCIL_File_Name parameter. The name and
password are passed to this program in the SCIL variables
- CLIENT_NAME, CLIENT_PASSWORD. The result of
authentication should be placed into SCIL variable
AUTHETICATED, 0 - if the authentication failed and 1 -
if the authentication successful.
Auth_SCIL_File_Name This key specifies the full file name of SCIL program. It
is used only when Authentication_Type = SCIL_FILE.

21
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

Instead of the access level defined in the default access field, the host(s) may have
its (their) own access level(s) defined in the following way:
Number_Of_Hosts The number of host sections. If there are N hosts, there
must be corresponding sections [Host1],
[Host2][HostN].
[Host<X>] Section for host specific information (IP number, access
level etc.). The <X> is the number of the host entry.
IP_Number The IP number for the host.
Access_Level The access level for this IP address. It can be one of the
access levels mentioned above in the Dafault_Access
paragraph.
Clients names and passwords can be defined in the following way:
[Passwords] Section for storing client names and passwords. Its used
only when the Authentication_Type = INI_FILE.
<Client name> Specifies the password for the <Client name>.

SYS 600
The scil2java can be started, for example, from the command procedure apl_init
which will be executed automatically when the SYS 600 application is started. The
following command line can be added to the command procedure:
@ret=aep_start(c:\MS_Interfaces\Java\scil2java.exe)

3.6. Configuring Java API for several products


If several products are installed on the same computer, Java API can be configured
to work with all of them. For example, if you have SYS 600 and SMS 510 installed,
Java API will be installed and configured for SYS 600. The following tasks should
be done to configure Java API for the SMS:
1. Copy the SYS_JAVA.INI from \sc\sys\active\sys_ directory to \SMS
510\sys\active\sys_.
2. Copy the EMSG.DLL from \sc\prog\exec to \SMS 510\prog\exec only if the
EMSG.DLL in SMS is an older one.
3. Start Java API from the SMS with the following command line:
@ret=aep_start(c:\MS_Interfaces\Java\scil2java.exe)

3.7. Using Java classes, applications and applets


This section describes the using of Java classes, applications and applets, both
locally and remotely. Some short examples will also be included.

3.7.1. Java classes


There are two possibilities to use the Java classes. They can be used locally (in the
same host as SYS 600 itself) or remotely. The usage of the Java classes is almost the
same in both local and remote cases. The main difference is that when the classes
are used remotely, there must be a SCIL_Connection class which handles the actual
connection to SYS 600 at a remote host.

22
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

3.7.2. Java applications


There can be both local and remote Java applications, also at the same time. Local
applications can actually be used in the same way as other application extension
programs. There can be more than one local Java programs started from one or more
SYS 600 applications.
The remote Java applications/applets are connected to SYS 600 through a server
process which will be started when the scil2java is started without any class name.

There can be only one server process in the same host at the same
time.

The API can be used on the local host also by creating a Java application whose
name is then given as an argument to the scil2java program. Details about the usage
of the related objects will be given in the following chapters and sections of this
manual.

If you are using the applets, a WWW-server is required. The files


SCIL.jar and SCIL.cab must also be in the same directory where the
applets are placed.

Local applications
It is possible to create a Java application and run it using the scil2java.exe. In this
case the Java class is given as an argument to the scil2java program. The name of
the Java class should be without the .class extension. Because this Java class is an
application, the main(String [])method is required.
The scil2java and the Java class make an application extension program. together.
The number of the application extension program (from SYS 600) is given as the
first argument to the Java class. The second argument is the application number from
where the application extension program was started.
The Java application is started in the following way:
@aepn = aep_start(c:\MS_Interfaces\Java\scil2java.exe, prg_name)

The prg_name is the name of the Java class.

Remote applets and applications


First of all, a SCIL_Connection must be created. The SCIL_Connection must be
given as an argument to the constructors of other SCIL_Interface and SCIL_Object
classes to give them access to SYS 600. In case of a Java applet, the address of the
SYS 600 host must be the same as the address where the applet itself was loaded.
The address of the SYS 600 host is given as an argument to the constructor of the
SCIL_Connection.

23
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

Remote_Appl

Fig. 3.7.2.-1 Description of a browser based remote application, similar to the


one described in the Example Application chapter of this manual
1. The URL information is sent to the WWW-server.
2. The WWW-server returns the HTML-page and the applet.
3. Communication between the Applet and SYS 600 via the Java API server.

3.7.3. Examples
The following six sections include small examples of SCIL Interface, SYS 600
events, SCIL objects, free type objects, a Java application and a Java applet.

The SYS 600 interface classes must be imported before they can be
used (add Import SCIL.*; to the Java code).

SCIL interface
Here is a simple example of how to use the SCIL Interface to execute SCIL
commands, read variables etc.
This example also demonstrates the use of the SCIL_Connection.
public void test() {

SCIL_Interface iface;
SCIL_Connection con;
SCIL_Value v;

// 127.0.0.1 is simply the local host.


// You can define your own host here.
// If you are creating an applet, there are methods for getting the host
// where they were loaded from.

con = new SCIL_Connection(127.0.0.1);

// Connection to the default application.

iface = new SCIL_Interface(con);

// Now there is a SCIL context created.


// Lets simply define a variable by using a SCIL command

iface.executeCommand(@XYZ=100);

24
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

// The variable is now defined and the value of the variable can
// be received by getVariable() method.
// Note that variables in other SCIL_Interfaces can not be seen
// from here because of the different contexts.

v = iface.getVariable(XYZ);

if (v != null)
System.out.println(v.toString());
// Writes the value to the standard output
}

SYS 600 events


This example creates a SCIL Interface connection to SYS 600 and waits for the
events.
public void test() {

SCIL_Interface iface;
SCIL_Message msg;

// Connection to the default application

iface = new SCIL_Interface();

// The event(s) to be received is/are defined here.


// Replace the event_name with the name of the event to be
// subscribed.

iface.subscribeEvent(event_name,
SCIL_Message.SCIL_ALL_OBJECT_INDEX);

msg = iface.getAepMessage(100000);
// Block until timeout or until a message is received.
}

The following example is applet, which works until exit event is received and
handles different type of events:
import java.awt.*;
import java.applet.*;
import SCIL.*;

public class ExitEvent extends Applet implements Runnable{


SCIL_Interface iface;
SCIL_Connection con;
String s="";
Thread
test_thread;
public void start(){
String s1 = getCodeBase().getHost();
System.out.println("Connecting to " + s1);
con = new SCIL_Connection(s1); // Connects to the local host
iface = new SCIL_Interface(con);
iface.subscribeExitEvent();
iface.subscribeEvent(event_name,
SCIL_Message.SCIL_ALL_OBJECT_INDEX); // subscribe to some event
test_thread = new Thread(this);
test_thread.start();
}
public void run() {
SCIL_Message Msg;

25
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

System.out.println("Reading message...");
do{
Msg = iface.getAepMessage(10000);
if(Msg != null)
{
if(Msg.message_type == 3)
exitEventHandler(); // Handles the exit event
else
eventHandler(Msg); // Handles all other events
}
} while(Msg == null || Msg.message_type != 3);
}
public void exitEventHandler()
{
s="Exit event received!";
System.out.println("Exit event received!");
}
public void eventHandler(SCIL_Message Msg)
{
// handles all subscribed MicroSCADA events except the exit event.
}
public void paint(Graphics g) {
g.drawString(s,10,10);
}
}

SCIL Objects
This example shows how to access the SYS 600 objects.
public void test() {

SCIL_DataObject data;
SCIL_Value v,
tmp;
int i;

data = new SCIL_DataObject(data1, 1);

/ Connect to datalog object data1,


// in application 1.

v = data.getAttribute(OV, 1, 10);

// Returns a vector with 10 elements.

if (v.getValueType() == v.SCIL_VECTOR_TYPE)
for (i=0; i<10; i++) {
tmp = v.elementAt(i);
System.out.println(tmp.toString());
}
}

Free type objects


The free attributes of the free type process objects must be read and written in the
same order as they are defined. First of all, the attributes are read from SYS 600 into
the Java object. After that the individual attributes can be accessed.
The following example demonstrates the use of the free type objects. The code is a
simple example about inheritance. In most cases it is reasonable to inherit your own
object type from SCIL_FreeTypeObject.

26
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

public class MyObject


extends SCIL_FreeTypeObject {

public int XX; // Attribute XX

public MyObject(String name, int apl_num) {


super(name, apl_num);

// Add your constructor code here


}

// The readAttributes() method can be overloaded to simplify the


// access to the different attributes e.g. in the following way.

public void readAttributes() {

// First the attributes are read to the byte array.

super.readAttributes();

// The first attribute is read as integer.


// Now it is easier to access the attribute XX by simply
//writing:

obj_name.XX = 123;

// To make it really work, also the writeAttributes() method must be


//overloaded
XX = getInt();
}

public void writeAttributes() {


setInt(XX);
}
}

The new object can now be used e.g. in the following way:
public void test() {

MyObject obj;

obj = new MyObject(test, 0);

obj.readAttributes();
obj.XX = 100;
obj.writeAttributes();

// Now the value of the attribute XX in MyObject test is 100.


}

Java application
This simple Java application example demonstrates the use of the classes in the
SCIL package.
import java.awt.*;
import java.applet.Applet;
import SCIL.*;

/*
This is a very simple Java application which demonstrates the use of
the classes in the SCIL package. This application reads the current time from
MicroSCADA and shows it on a window.
*/

27
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

public class test_application


implements Runnable {

public Frame MainWindow;


Thread thr_Thread1;
SCIL_Interface ifc_Iface1;
SCIL_Value val_Value1=null;
Label lbl_Txt1;
Font fnt_Font;
String s_txt1;

public test_application() {

//
// A window is created.
//
MainWindow = new Frame();
MainWindow.show();
MainWindow.setSize(150, 100);

fnt_Font=new Font("Courier",Font.PLAIN,14);

lbl_Txt1=new Label("Reading...");
lbl_Txt1.setForeground(Color.blue);
lbl_Txt1.setFont(fnt_Font);
MainWindow.add(lbl_Txt1);

//
// The MicroSCADA must be on the same host than this application
//
ifc_Iface1 = new SCIL_Interface();
}

void getTime() {

SCIL_Value val_Value1;

if (ifc_Iface1 == null)
return;

val_Value1 = ifc_Iface1.evaluateExpression("tods");
if (val_Value1.getValueType() == val_Value1.SCIL_TEXT_TYPE) {
s_txt1 = val_Value1.getString();
}
else
s_txt1 = "???";

lbl_Txt1.setText("Time: " + s_txt1);


}

public void start() {

if (thr_Thread1 == null) {
thr_Thread1 = new Thread(this);
thr_Thread1.start();
}
}

public void run() {

while (thr_Thread1 != null) {


try {
Thread.sleep(1000);

28
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

}
catch (InterruptedException e) {
}

getTime();
}
thr_Thread1=null;
}

public void stop(){

if (thr_Thread1 != null) {
thr_Thread1.stop();
thr_Thread1 = null;
}
}

public static void main(String argv[]) {

test_application apl;

apl = new test_application();


apl.start();
}
}

Java applet
This simple Java applet example demonstrates the use of the classes in the SCIL
package.
import java.awt.*;
import java.applet.Applet;
import SCIL.*;

/*
This is a very simple applet which demonstrates the use of the classes in the
SCIL package. This applet reads the current time from MicroSCADA.
*/

public class test_applet extends Applet


implements Runnable {

Thread thr_Thread1;
SCIL_Connection con_Connection;
SCIL_Interface ifc_Iface1;
SCIL_Value val_Value1=null;
Label lbl_Txt1;
Font fnt_Font;
String s_txt1;

public void init(){


setBackground(Color.white);
fnt_Font=new Font("Courier",Font.PLAIN,14);

lbl_Txt1=new Label("Reading...");
lbl_Txt1.setForeground(Color.blue);
lbl_Txt1.setFont(fnt_Font);
add(lbl_Txt1);
//
// Connect to the host where this applet was loaded from.
//
con_Connection=new SCIL_Connection(getCodeBase().getHost());

29
SYS 600 9.3 MicroSCADA Pro 1MRS756648

Java Programming Interface (Java-API)


Users Guide

ifc_Iface1 = new SCIL_Interface(con_Connection);


}
void getTime() {

SCIL_Value val_Value1;

if (ifc_Iface1 == null)
return;

val_Value1 = ifc_Iface1.evaluateExpression("tods");
if (val_Value1.getValueType() == val_Value1.SCIL_TEXT_TYPE) {
s_txt1 = val_Value1.getString();
}
else
s_txt1 = "???";

lbl_Txt1.setText("Time: " + s_txt1);


}

public void start(){

if (thr_Thread1 == null) {
thr_Thread1 = new Thread(this);
thr_Thread1.start();
}
}

public void run() {

while (thr_Thread1!=null) {
try {
Thread.sleep(1000);
}
catch (InterruptedException e) {
}

getTime();
}
thr_Thread1=null;
}

public void stop(){

con_Connection.closeSCIL_Connection();

if (thr_Thread1 != null) {
thr_Thread1.stop();
thr_Thread1 = null;
}
}
}

30
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

4. Technical reference
This chapter gives technical reference information about the Java Classes.

4.1. Java classes


The Java classes can be used as follows:
1. The user creates a Java application.
2. The scil2java program is started as any other application extension program.
3. The name of the Java application can be given as an argument to the scil2java
program. If there is no special name given, the server program is the default
program to be executed.
4. The Java interpreter which is included in the scil2java will execute the Java
code.
The specific Java classes will be introduced in the following sections.

4.1.1. SCIL_Connection
The SCIL_Connection class is the basic element in a client/server connection. It
provides remote programs with an interface to SYS 600. When the other classes are
used remotely, the SCIL_Connection handles the data transfer over the TCP/IP
network. The idea of using the SCIL_Connection class between the
SCIL_Object(s)/SCIL_Interface(s) is that the SCIL_Connection works like a
multiplexer. There is no need for a separate connection for each object Instead, there
is only one connection to the server for each applet/application. The commands are
executed in the same order as they are requested by the objects on the client.
The server is a multithread Java application that listens to a TCP/IP socket waiting
for object(s) to connect. The server creates a new thread for each connection. The
server itself communicates with SYS 600 using JNI which is actually a program
written in C. The functions handle translations of SYS 600 data types to Java data
types. Special care has been taken to make this multi-thread safe (both Java and C
codes).
The server listens to a TCP/IP port (the default is 1501). When a method is called in
the client side, the class sends only the id of the method and the arguments to the
server. The server will execute the actual code and send the return values if they are
available.

Constructors
public SCIL_Connection(String address)
Creates a new SCIL_Connection.
Parameter:
'address' The address of the SYS 600 host.

31
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

public SCIL_Connection(String address, int port)


Parameter:
'port' The port of the SYS 600 server
public SCIL_Connection(String address, String name, String password)
Parameters:
'name' The client name used for authentication
'password' The client password used for authentication
public SCIL_Connection(String address, int port, String name, String
password)

Methods
public void closeSCIL_Connection()
This method must be run after the SCIL_Connection is not needed anymore. In case
of an applet, this method must be run in the stop method of the applet in order to stop
the receiver thread in the SCIL_Connection.
public boolean isConnected()
This method returns the connection state: true - if connection is established and false
otherwise.

4.1.2. SCIL_SSL_Connection
The SCIL_SSL_Connection class is the child class of the SCIL_Connection. The
only difference between these classes is that SCIL_SSL_Connection class handles
the data transfer with SSL encoding.
Constructors
public SCIL_SSL_Connection(String address)
public SCIL_SSL_Connection(String address, int port)
public SCIL_SSL_Connection(String address, String name, String password)
public SCIL_SSL_Connection(String address, int port, String name, String
password)
Methods
The same as in the SCIL_Connection class.

4.1.3. SCIL_Interface
This is the interface to the SYS 600 SCIL interpreter. By using this interface it is
possible to read and set variables, execute SCIL commands, get events etc.

Local Constructors
public SCIL_Interface()
Creates a new SCIL_Interface for the default application.

32
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

public SCIL_Interface(int apl)


Creates a new SCIL_Interface.
Parameter:
'apl' The number of the SYS 600 application.
public SCIL_Interface(int apl, int program_number)
Creates a new SCIL_Interface.
Parameters:
'apl' The number of the SYS 600 application.
'program_number' The number of the application extension program.

Remote Constructors
public SCIL_Interface(SCIL_Connection conn)
Creates a new SCIL_Interface reference for the default application and connects it
to SYS 600 using the SCIL_Connection.
Parameter:
'conn' The SCIL_Connection that has been connected to SYS
600.
public SCIL_Interface(SCIL_Connection conn, int apl)
Creates a new SCIL_Interface reference and connects it to SYS 600 using the
SCIL_Connection.
Parameters:
'conn' The SCIL_Connection that has been connected to SYS
600.
'apl' The number of the SYS 600 application.

Methods
The methods are the same for both local and remote constructors.
public int getStatus()
This function reads the status from SYS 600.
Returns:
The status value.
public void executeCommand(String command)
Executes the SCIL command in SYS 600.
Parameter:
'command' The SCIL command to be executed.

33
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

public SCIL_Value evaluateExpression(String expression)


Evaluates the given expression in SYS 600 and returns the result as a SCIL_Value.
Parameter:
'expression' The SCIL expression.
Returns:
The result of the evaluation.
public void setVariable(String name, SCIL_Value value)
This function sets the SCIL variable to the given value.
Parameters:
'name' The name of the variable.
'value' The new value of the variable.
public SCIL_Value getVariable(String name)
Retrieves the value of the given SCIL variable.
Parameter:
'name' The name of the variable.
Returns:
The value of the variable (or null if the variable does not exist).
public void subscribeEvent(String name, int index)
This procedure makes a subscription to one or more events. You may specify the
event name and index, event name and SCIL_ALL_OBJECT_INDEX (for all
indexes of the name) or event name '*' and SCIL_ALL_OBJECT_INDEX (for all
events of the application).
Parameters:
'name' The name of the event.
'index' The index of the event.
public void cancelEventSubscription(String name, int index)
Cancels the subscription that has been made for the event and index.
Parameters:
'name' The name of the event.
'index' The index of the event.
public void subscribeExitEvent()
This procedure makes a subscription to the exit event. It can be used only with
remote interface. The exit event is sent to java programs when the scil2java.exe is
stopped.
public void cancelExitEventSubscription()
Cancels the subscription for the exit event.

34
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

public SCIL_Message getAepMessage(int timeout)


Reads a message from SYS 600 or waits for the message until it comes or the
timeout exceeds.
Parameter:
'timeout' The timeout value in milliseconds.
public void sendAepMessage(int aep_num, SCIL_Message msg)
Sends a message to another application extension program.
Parameters:
'aep_num' The number of the application extension program.
'msg' The message to be sent.

4.1.4. SCIL_Object
This class is used only as a superclass for the SCIL object classes described in
Section 4.1.5.

Methods
public int getStatus()
Reads the status from SYS 600.
Returns:
The status code from SYS 600.
public String getName()
Returns the name of the object.
Returns:
The name of this object.
public void setAttribute(String name, SCIL_Value value)
Sets the value of the given attribute.
Parameters:
'name' The name of the attribute.
'value' The value of the attribute.
public void setAttribute(String name, int start, int end, SCIL_Value value)
Sets the value of the given attribute. This method is used when there is more than
one index in the SYS 600 object.
Parameters:
'name' The name of the attribute.
'start' The start index of the attribute.
'end' The end index of the attribute.
'value' The value of the attribute. The type is vector if startend.

35
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

public SCIL_Value getAttribute(String name)


The value of the named attribute is fetched from SYS 600.
Parameter:
'name' The name of the attribute.
Returns:
The value of the attribute.
public SCIL_Value getAttribute(String name, int start, int end)
The value of the named attribute is fetched from SYS 600. This method is used when
there is more than one index in the SYS 600 object.
Parameters:
'name' The name of the attribute.
'start' The start index of the attribute.
'end' The end index of the attribute.
Returns:
The value of the attribute. The value is type vector if startend.
public void activateObject(int index)
Activates an object. This function works only for datalogs, command procedures,
event channels and event objects.
Parameter:
'index' The index of the object to be activated.

4.1.5. Objects inherited from the SCIL_Object


The following objects have inherited the same methods that are available in the
objects already mentioned in the section above.

4.1.5.1. SCIL_BaseSystemObject
This object can be used to access a base system object in SYS 600.

Constructors
public SCIL_BaseSystemObject(String name, int apl)
This constructor initialises a local base system object.
Parameters:
'name' The name of the object (in SYS 600).
'apl' The number of the SYS 600 application.
public SCIL_BaseSystemObject(String name, SCIL_Connection conn, int apl)
This constructor initialises a remote base system object.
Parameters:
'name' The name of the object (in SYS 600).

36
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

'conn' The SCIL_Connection that has been connected to SYS


600.
'apl' The number of the SYS 600 application.

4.1.5.2. SCIL_CommandProcedureObject
This object can be used to access a command procedure object in SYS 600. It is also
possible to activate an object of this type.

Constructors
public SCIL_CommandProcedureObject(String name, int apl)
This constructor initialises a local command procedure object.
Parameters:
'name' The name of the object (in SYS 600).
'apl' The number of the SYS 600 application.
public SCIL_CommandProcedureObject(String name, SCIL_Connection
conn, int apl)
This constructor initialises a remote command procedure object.
Parameters:
'name' The name of the object (in SYS 600).
'conn' The SCIL_Connection that has been connected to SYS
600.
'apl' The number of the SYS 600 application.

4.1.5.3. SCIL_DataObject
This object can be used to access a datalog object in SYS 600. It is also possible to
activate an object of this type.

Constructors
public SCIL_DataObject(String name, int apl)
This constructor initialises a local data object.
Parameters:
'name' The name of the object (in SYS 600).
'apl' The number of the SYS 600 application.
public SCIL_DataObject(String name, SCIL_Connection conn, int apl)
This constructor initialises a remote data object.
Parameters:
'name' The name of the object (in SYS 600).
'conn' The SCIL_Connection that has been connected to SYS
600.
'apl' The number of the SYS 600 application.

37
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

4.1.5.4. SCIL_EventChannelObject
This object can be used to access an event channel object in SYS 600 . It is also
possible to activate an object of this type.

Constructors
public SCIL_EventChannelObject(String name, int apl)
This constructor initialises a local event channel object.
Parameters:
'name' The name of the object (in SYS 600 ).
'apl' The number of the SYS 600 application.
public SCIL_EventChannelObject(String name, SCIL_Connection conn, int
apl)
This constructor initialises a remote event channel object.
Parameters:
'name' The name of the object (in SYS 600).
'conn' The SCIL_Connection that has been connected to SYS
600.
'apl' The number of the SYS 600 application.

4.1.5.5. SCIL_EventObject
This object can be used to access an event object in SYS 600. It is also possible to
activate an object of this type.

Constructors
public SCIL_EventObject(String name, int apl)
This constructor initialises a local event object.
Parameters:
'name' The name of the object (in SYS 600).
'apl' The number of the SYS 600 application.
public SCIL_EventObject(String name, SCIL_Connection conn, int apl)
This constructor initialises a remote event object.
Parameters:
'name' The name of the object (in the SYS 600).
'conn' The SCIL_Connection that has been connected to SYS
600.
'apl' The number of the SYS 600 application.

4.1.5.6. SCIL_ProcessObject
This object can be used to access a process object in SYS 600.

38
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Constructors
public SCIL_ProcessObject(String name, int apl)
This constructor initialises a local process object.
Parameters:
'name' The name of the object (in SYS 600).
'apl' The number of the SYS 600 application.

public SCIL_ProcessObject(String name, SCIL_Connection conn, int apl)


This constructor initialises a remote process object.
Parameters:
'name' The name of the object (in SYS 600).
'conn' The SCIL_Connection that has been connected to SYS
600.
'apl' The number of the SYS 600 application.

4.1.5.7. SCIL_ScaleObject
This object can be used to access a scale object in SYS 600.

Constructors
public SCIL_ScaleObject(String name, int apl)
This constructor initialises a local scale object.
Parameters:
'name' The name of the object (in SYS 600).
'apl' The number of the SYS 600 application.
public SCIL_ScaleObject(String name, SCIL_Connection conn, int apl)
This constructor initialises a remote scale object.
Parameters:
'name' The name of the object (in SYS 600).
'conn' The SCIL_Connection that has been connected to SYS
600.
'apl' The number of the SYS 600 application.

4.1.5.8. SCIL_SystemObject
This object can be used to access a system object in SYS 600.

Constructors
public SCIL_SystemObject(String name, int apl)
This constructor initialises a local system object.

39
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Parameters:
'name' The name of the object (in SYS 600).
'apl' The number of the SYS 600 application.
public SCIL_SystemObject(String name, SCIL_Connection conn, int apl)
This constructor initialises a remote system object.
Parameters:
'name' The name of the object (in SYS 600).
'conn' The SCIL_Connection that has been connected to SYS
600.
'apl' The number of the SYS 600 application.

4.1.5.9. SCIL_TimeChannelObject
This object can be used to access a time channel object in SYS 600.

Constructors
public SCIL_TimeChannelObject(String name, int apl)
This constructor initialises a local time channel object.
Parameters:
'name' The name of the object (in SYS 600).
'apl' The number of the SYS 600 application.
public SCIL_TimeChannelObject(String name, SCIL_Connection conn, int
apl)
This constructor initialises a remote time channel object.
Parameters:
'name' The name of the object (in SYS 600).
'conn' The SCIL_Connection that has been connected to SYS
600.
'apl' The number of the SYS 600 application.

4.1.6. SCIL_FreeTypeObject
This object is usually used as a parent class for some inherited objects. The free type
process objects can be defined by the user, and that is why it is useful to create your
own object which handles the user-defined attributes in a useful way. The basic idea
of this object is that first all of the user-defined attributes are read from SYS 600 to
a byte array by using the readAttributes method. The data in the byte array is then
handled by the get*** -functions in order to get the attribute. The attributes must be
read in the same order in which they have been defined in SYS 600. It is the users
responsibility to read the attribute as the same data type as it was defined in SYS
600.
When the values of the attributes are set using the set*** -methods (in the right
order), they must be written to SYS 600 by using the writeAttributes method.

40
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Constructors
public SCIL_FreeTypeObject(String name, int apl_num)
Creates a new SCIL_FreeTypeObject.
Parameters:
'name' The name of the free type object.
'apl_num' The number of the application.
public SCIL_FreeTypeObject(String name, SCIL_Connection conn, int
apl_num)
Creates a new (remote) SCIL_FreeTypeObject.
Parameters:
'name' The name of the free type object.
'conn' The connection to the SYS 600.
'apl_num' The number of the application.

Methods
public void readAttributes()
Reads the attributes from SYS 600.
public void writeAttributes()
Writes the attributes to SYS 600.
public int getInt()
Reads the next attribute as integer.
public String getString(int length)
Reads the next attribute as string.
Parameter:
'length' The length of the string.
public float getFloat()
Reads the next attribute as float.
public boolean getBoolean()
Reads the next attribute as boolean.
public Date getTime()
Reads the next attribute as scil time value.
public BitSet getBitString(int length)
Reads the next attribute as bit string.
Parameter:
'length' The length of the bit string.

41
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

public byte[] getBytes()


Returns all attributes as a byte array. The attributes are still in little endian format.
public void setInt(int value)
Sets the next attribute. The attribute must be of type integer.
Parameter:
'value' The value of the attribute.
public void setString(String str, int length)
Sets the next attribute. The attribute must be of type string.
Parameters:
'str' The value of the attribute.
'length' The length of the string (specified in the definition of the
free type object. Note that this is not always the same as
the actual length of the string (str)).
public void setFloat(float value)
Sets the next attribute. The attribute must be of type float.
Parameter:
'value' The value of the attribute.
public void setBoolean(boolean value)
Sets the next attribute. The attribute must be of type boolean.
Parameter:
'value' The value of the attribute.
public void setTime(Date value)
Sets the next attribute. The attribute must be of type scil time.
Parameter:
'value' The value of the attribute.
public void setBitString(BitSet bset, int length)
Sets the next attribute. The attribute must be of type bit string.
Parameters:
'bset' The value of the attribute.
'length' The length of the bit string.
public void setBytes(byte bytes[], int count)
Sets the values of all the free attributes. The bytes in the byte array must be in little
endian format.
Parameters:
'bytes[]' The attributes as a byte array.
'count' The number of bytes in the array.

42
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

4.1.7. SCIL_Value
This class encapsulates the SCIL data types. Before the value of this object is read,
it is very wise to check the data type by using the getValueType method before the
actual get*** method, unless you are sure about the current data type of the object.
Trying to read a wrong data type can cause an unwanted result. Methods that return
an object, throw a runtime exception in case of a wrong data type. Methods like
getInt() throw a runtime exception in case it is a sensible value and can cause
misunderstandings in some cases.

Constants
The constants listed below indicate the different types of SCIL_Values. They are
simply integers. The return value of the getValueType -function can be compared to
these constants to find out the actual type of the SCIL_Value.
SCIL_BIT_STRING_TYPE
The SCIL_Value is of type bit string. The bits in the bitstring can be handled with
functions bitSet() and bitClear().
SCIL_BOOLEAN_TYPE
The SCIL_Value is of type boolean. The valid values are true and false.
SCIL_BYTE_STRING_TYPE
The SCIL_Value is of type byte string.
SCIL_INTEGER_TYPE
The SCIL_Value is of type integer.
SCIL_LIST_TYPE
The SCIL_Value is of type list.
SCIL_NO_TYPE
There is actually no value in the SCIL_Value. The setValue(***) functions can be
used for this type of SCIL_Value, but it is not possible to read this type of
SCIL_Value.
SCIL_REAL_TYPE
The SCIL_Value is of type real.
SCIL_TEXT_TYPE
The SCIL_Value is of type text.
SCIL_TIME_TYPE
The SCIL_Value is of type SCIL time. The time is handled as a Date object in Java.
Note that if you are using the time as seconds from the specified year, there is a
difference between SYS 600 and Java. In SYS 600 the seconds start from the year
1978 but in Java the start is earlier, in 1970.
SCIL_VECTOR_TYPE
The SCIL_Value is of type vector.

43
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Constructors
public SCIL_Value()
Creates a SCIL_Value object of SCIL_NO_TYPE.
public SCIL_Value(String value)
Creates a SCIL_Value object of SCIL_TEXT_TYPE.
Parameter:
'value' Sets a String type value for the created object.
public SCIL_Value(int value)
Creates a SCIL_Value object of SCIL_INTEGER_TYPE.
Parameter:
'value' Sets an int type value for the created object.
public SCIL_Value(float value)
Creates a SCIL_Value object of SCIL_REAL_TYPE.
Parameter:
'value' Sets a float type value for the created object.
public SCIL_Value(boolean value)
Creates a SCIL_Value object of SCIL_BOOLEAN_TYPE.
Parameter:
'value' Sets a boolean type value for the created object.
public SCIL_Value(Date value)
Creates a SCIL_Value object of SCIL_ TIME _TYPE.
Parameter:
'value' Sets a Date type value for the created object.
public SCIL_Value(BitSet value)
Creates a SCIL_Value object of SCIL_BIT_STRING_TYPE.
Parameter:
'value' Sets a BitSet type value for the created object.
public SCIL_Value(byte value[])
Creates a SCIL_Value object of SCIL_BYTE_STRING_TYPE.
Parameter:
'value[]' Sets a byte type value for the created object.

44
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

public SCIL_Value(Vector value)


Creates a SCIL_Value object of SCIL_ VECTOR _TYPE.
Parameter:
'value' Sets a Vector type value for the created object. If an
element is not of SCIL_Value type, a runtime exception
will be thrown.
public SCIL_Value(Hashtable value)
Creates a SCIL_Value object of SCIL_ LIST _TYPE.
Parameter:
'value' Sets a Hashtable type value for the created object. If an
element is not of SCIL_Value type, a runtime exception
will be thrown.

Methods
public void setValue(String value)
Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_TEXT_TYPE.
Parameter:
'value' Resets a String type of value for an earlier created
SCIL_Value object.
public void setValue(int value)
Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_INTEGER_TYPE.
Parameter:
'value' Resets an int type of value for an earlier created
SCIL_Value object.
public void setValue(float value)
Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_REAL_TYPE.
Parameter:
'value' Resets a float type of value for an earlier created
SCIL_Value object.
public void setValue(boolean value)
Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_BOOLEAN_TYPE.
Parameter:
'value' Resets a boolean type of value for an earlier created
SCIL_Value object.

45
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

public void setValue(Date value)


Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_TIME_TYPE.
Parameter:
'value' Resets a Date type of value for an earlier created
SCIL_Value object.
public void setValue(BitSet value)
Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_BIT_STRING_TYPE.
Parameter:
'value' Resets a BitSet type of value for an earlier created
SCIL_Value object.
public void setValue(byte value[])
Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_BYTE_STRING_TYPE.
Parameter:
'value[]' Resets a byte type of value for an earlier created
SCIL_Value object.
public void setValue(Vector value)
Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_VECTOR_TYPE.
Parameter:
'value' Resets a Vector type of value for an earlier created
SCIL_Value object. If an element in the vector is not of
SCIL_Value type, a runtime exception will be thrown.
public void setValue(Hashtable value)
Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_LIST_TYPE.
Parameter:
'value' Resets a Hashtable type of value for an earlier created
SCIL_Value object. If an element in the vector is not of
SCIL_Value type, a runtime exception will be thrown.
public void setTime(int seconds)
Sets the value of the SCIL_Value. The type of the SCIL_Value will be
SCIL_TIME_TYPE.
Parameter:
'seconds' The time value in seconds from 1.1.1970.

46
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

public int getValueType()


Gets the type of the SCIL_Value. This function should be called before calling any
of the Get functions.
Returns:
The type of the SCIL value (SCIL_NO_TYPE ... SCIL_ LIST_TYPE).
public String getString()
If the object is of type SCIL_TEXT_TYPE, this function will return the text string.
Otherwise it throws a runtime exception.
public int getInt()
If the object is of type SCIL_INTEGER_TYPE, this function will return the integer
value. Otherwise it throws a runtime exception.
public float getFloat()
If the object is of type SCIL_REAL_TYPE, this function will return the real value.
Otherwise it throws a runtime exception.
public boolean getBoolean()
If the object is of type SCIL_BOOLEAN_TYPE, this function will return the
boolean value. Otherwise it throws a runtime exception.
public Date getTime()
If the object is of type SCIL_TIME_TYPE, this function will return the SCIL time
as a date object. Otherwise it throws a runtime exception.
public int getSeconds()
If the object is of type SCIL_TIME_TYPE, this function will return the SCIL time,
converted to seconds from 1970, as an integer. Otherwise it throws a runtime
exception.
public BitSet getBitString()
If the object is of type SCIL_BIT_STRING_TYPE, this function will return the bit
string object. Otherwise it throws a runtime exception.
public byte[] getByteString()
If the object is of type SCIL_BYTE_STRING_TYPE, this function will return the
byte string object. Otherwise it throws a runtime exception.
public Vector getVector()
If the object is of type SCIL_VECTOR_TYPE, this function will return the vector
object. Otherwise it throws a runtime exception.
public Hashtable getList()
If the object is of type SCIL_LIST_TYPE, this function will return the list object as
a Hashtable where the name of the attribute is the key. Otherwise it throws a runtime
exception.

47
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

public SCIL_Value elementAt(int index)


Returns the selected SCIL_Value from SCIL_Value of type vector. If the type of the
SCIL_Value is not SCIL_VECTOR_TYPE, this method will throw a runtime
exception.
Parameter:
'index' The index of the element in the vector.
Returns:
The value of the element or null.
public void addElement(SCIL_Value v)
Sets the selected item in the vector.
Parameter:
'v' The SCIL_Value to be added to the vector.
public void setElementAt(SCIL_Value v, int index)
Sets the selected item in the vector.
Parameters:
'v' The SCIL_Value to be added to the vector.
'index' The place where the value will be added.
public SCIL_Value getAttribute(String name)
Returns the value of the selected attribute from SCIL_Value of type list. If the type
of the SCIL_Value is not SCIL_LIST_TYPE, this method will throw a runtime
exception. If the attribute does not exist it returns null.
Parameter:
'name' The name of the attribute.
Returns:
The value of the attribute.
public Enumeration listAttributes()
Lists the attributes of a SCIL_Value of type list.
Returns:
The names of the attributes. If the type of the SCIL_Value is not of
SCIL_LIST_TYPE, this method will throw a runtime exception.
public void setAttribute(String name, SCIL_Value v)
Sets the selected attribute in the list.
Parameters:
'name' The name of the attribute.
'v' The new value of the attribute.

48
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

public void bitSet(int bit)


Sets the selected bit in the bit string.
Parameter:
'bit' The number of the bit to be set.
public void bitClear(int bit)
Clears the selected bit in the bit string.
Parameter:
'bit' The number of the bit to be cleared.

4.1.8. SCIL_Message
These messages are sent to the application extension program by using the scil
function aep_send, a process object or another application extension program.

Variables
public SCIL_Value arguments[]
The arguments as an array of SCIL_Values. This value is valid when the type of the
message is SCIL_EP_MESSAGE_SCIL.
public int count
The number of the arguments. This value is valid when the type of the message is
SCIL_EP_MESSAGE_SCIL.
public byte data[]
The message data. This value is valid when the type of the message is
SCIL_EP_MESSAGE_EP.
public int index
The index of the event. This value is valid when the type of the message is
SCIL_EP_MESSAGE_EVENT.
public int length
The length of the message data. This value is valid when the type of the message is
SCIL_EP_MESSAGE_EP.
public int message_type
The type of the message. The value can be one of the types defined above
(SCIL_EP_MESSAGE_NONE...SCIL_EP_MESSAGE_EP).
public String name
The name of the event. This value is valid when the type of the message is
SCIL_EP_MESSAGE_EVENT.

49
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Event Indicating Constants


The following constants indicate the different types of SYS 600 events.
SCIL_ALL_OBJECT_INDEX
This can be used in the subscription and cancelling of events. It indicates that all
indices of the specified object will be subscribed or cancelled.
SCIL_EP_MESSAGE_EP
This type of messages are sent by another application extension program. When the
message is created with the default constructor, the message is of this type to be able
to send it to another application extension program.
SCIL_EP_MESSAGE_EVENT
This type of messages are generated by process objects when the value of the object
is changed.
SCIL_EP_MESSAGE_EXIT
When this message is received, SYS 600 wants to shut down this application
extension program. After this message it is not possible to receive any other
messages.
SCIL_EP_MESSAGE_NONE
There is no data in the message object.
SCIL_EP_MESSAGE_SCIL
This type of message can be sent by SCIL function aep_send.
SCIL_MAX_EP_MESSAGE_ARGUMENTS
This is the maximum number of arguments of type SCIL_Value in case the message
type is SCIL_ EP_MESSAGE_SCIL.

Constructors
public SCIL_Message()
Creates a new SCIL_Message of type SCIL_EP_MESSAGE_EP.
public SCIL_Message(int type)
Creates a new SCIL_Message.
Parameter:
'type' The type of the message.

EventLog
This class is used to write messages to the NT event log. It can be used only in a local
Java application loaded by AEP_START(scil2java.exe, <java_class>) command.
Remote applications and applets cannot use this class.

50
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Constructors
public EventLog()
Creates a new EventLog object.
Methods
public void writeUserError(int userErrorCode, String errorStr)
Writes external application event of type Error to the NT event log.
Parameters:
'userErrorCode' The error code.
'errorStr' The error message.
public void writeUserInformation(int userInfoCode, String infoStr)
Writes external application event of type Information to the NT event log.
Parameters:
'userInfoCode' The information code.
'infoStr' The information message.
public void writeUserWarning(int userWarningCode, String warningStr)
Writes external application event of type Warning to the NT event log.
Parameters:
'userWarningCode' The warning code.
'warningStr' The warning message.
public void writeUserAuditSuccess(int userAuditCode, String auditStr)
Writes external application event of type Audit Success to the NT event log.
Parameters:
'userAuditCode' The audit success code.
'auditStr' The audit success message.
public void writeUserAuditFailure(int userAuditCode, String auditStr)
Writes external application event of type Audit Failure to the NT event log.
Parameters:
userAuditCode' The audit failure code.
'auditStr' The audit failure message.

51
52
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

5. Example application
This chapter describes an example implementation of Java API. It also describes
how the applets communicate with each other and how they function in general. The
installation of the example application is described in Section 3.3. of this manual.
The purpose of the implementation is to show how Java can be used to present data,
fetched directly from SYS 600, in the Internet.
A small demonstration of a typical System Diagnostics program has been made with
Java, HTML and SCIL.
Use Microsoft Internet Explorer 4.01, or a later version, to get the right layout on the
pages.

Abbreviations
The following abbreviation will be used in this chapter:
'labeltype' An applet which displays information of text or numbers
in labels, choices and textfields.

5.1. Using the example application


In this section you will be given instructions and information which concern the
configuration and diagnostics of the example application.

5.1.1. First page (main.html)


The first page is just a normal HTML-page like any other in the Internet. It includes
a picture in jpg-format, an applet and an animated link.
An applet was made to speed up the next page (General info). The applet imports the
SCIL.* , java.awt.* and the java.applet.*. classes.This has been proved to speed up
the initialisation time for the bigger applets. The applet name is preload.java.
The following line, which can be found at the top of the source code, loads the page
main2.html after about 5 - 10 seconds, depending on the transmission.
<META HTTP-EQUIV="refresh" CONTENT="10;URL=main2.html">

53
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Frontpage

Fig. 5.1.1.-1 SYS 600 System Diagnostics is the first page to appear on the screen when the web connection to
SYS 600 is established. After 5-10 seconds this page will automatically change into General
System Information page (see Figure 5.1.2.-1).

5.1.2. General info (generalinfo.html)


This applet is of label type and it displays:
Net-, Tool- and Librevision
System machine name
Hardware, Software and License information
Customer and site information
The applets on this page are called generalinfo.java and logo.java.

54
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

General_Sys_Info

Fig. 5.1.2.-1 The General System Information page

About the code


In these applets, a function has often been made to view the labels. Here it is called
addLabel(Label, String, int, int, GridBagConstraints, GridBagLayout, Font).
'Label' The label to add
'String' The caption of the label
'int' X-coordinates
'int' Y-coordinates
'GridbagConstraints' Constraints
'GridbagLayout' Layout
'Font' The name of the font
The function that reads the information from SYS 600 and shows it on the right
labels is called getValues(). This applet does not require any updating so the
getValues() function is called only once, after the initialisation.

55
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

5.1.3. Configuration & diagnostics (configuration.html)


The page which is shown after this selection is made, is the System basic
configuration and a link-frame. Basic system configuration (sysconfiguration.java)
on the page info.html contains information about:
Node number
Station address
Enable routing
Timeout length
File sync criteria
This applet is of label type.
A link frame (links.html) can be found at the top of the page. Small gif-pictures are
used as links to get a nice-looking layout, see Figure 5.1.3.-1. Two gif-animations
have also been made for the diagrams. This frame is visible only if Configuration &
Diagnostics has been chosen.

Basic_Sys_Conf

Fig. 5.1.3.-1 The Basic System Configuration page

56
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

5.1.3.1. Applications (apl.html)


On these pages you will find two applets (a listapplet and an infoapplet)
communicating with each other.
The applets use the aplcom class to communicate.

Fig. 5.1.3.1.-1 Applet - applet communication


The aplcom.class uses public static variables to enable the communication.
Here is a sample of the source-code:
public static synchronised void sendValues
(String par1,String par2,String par3,String par4,String par5,String
par6,String par7,String par8,String par9,String par10,String par11, String
par12,String par13,String par14,String par15)
{
s_Par1=par1;
s_Par2=par2;
s_Par3=par3;
s_Par4=par4;
s_Par5=par5;
s_Par6=par6;
s_Par7=par7;
s_Par8=par8;
s_Par9=par9;
s_Par10=par10;
s_Par11=par11;
s_Par12=par12;
s_Par13=par13;
s_Par14=par14;
s_Par15=par15;
}

public static String fetchPar1(){


if(b_Sendflag==true){
return s_Par1;
}
else return s_Empty;
}

57
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

The basic idea in the communicating applets is that:


Applets initialise the layout
They connect to SYS 600 and call the function getValues()
They evaluate the expressions made by the textfile
They loop, trim the text with trimText(String) and add each item to the list
When an item is selected from the list:
1. Find out which item is selected.
2. Fetch the information from SYS 600.
3. Send the information to aplcom.class and set the b_Sendflag variable true.
Now the infoapplet can fetch the information from aplcom and place it on the screen.
The application page includes the applets apllist and aplinfo to display the
following information:
Application number
Application name
Type, State
Node number
Translated object number
Alarm signal size
History buffer
Parallel queues
This page contains also two links, diagnostics (apldiagnostics.html) and mapping
(mapping.html). The applets on these pages also communicate with the listapplet.
These applets communicate via an applet called pagecom, which is placed in the
link-frame. So when a selection is made from the list, a parameter (in this case the
application number) is sent to the pagecom applet and the b_Sendflag variable is set
to true. The other applets can then get information from SYS 600 with this
parameter.

58
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Applications

Fig. 5.1.3.1.-2 The Applications page. Links to Diagnostics and Mapping pages can be found here.

Application diagnostics (apldiagnostics.html)


Here you can find two applets, aplshadow and apldiag, which work in the same way
as the generalinfo applet explained in Section 5.1.2. However, these applets are a bit
special because they get the application number from the pagecom.class.
To display the diagnostic counters, apldiag.class uses the attribute APLn:BSD.
The aplshadow.class shows the following information by:
Shadowing connection time
Shadowing flush time
Shadowing diagnostic interval
Shadowing number
Shadowing phase
Shadowing the Event channel queue
Shadowing receive timeout
Shadowing state

59
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Shadowing watchdog
Time synchronisation interval

Application mapping (mapping.html)


Four applets are placed on this page, and they all display a list with a logical and a
physical number. STA-, MON-, APL- and PRI-mappings are listed.
They get the application number from the pagecom.class and the vector from a
specific attribute. The vector is then looped through, and the items are trimmed and
added to the list. The attributes are as follows:
APLn:BST Station
APLn:BMO Monitor
APLn:BAP Application

5.1.3.2. Monitors (mon.html)


Similar applets to the ones on apl.html are placed on this page (monlist.class and
moninfo.class).
The file mon.txt in the temp directory is read and after that the information is fetched
from SYS 600.
The information displayed is:
Monitor number
Translation type
Logged in / APL
Input locked
Type
Device connection
System device name
Diagnostic interval
Colour allocation policy
Semigraphic

5.1.3.3. Nodes (nod.html)


Identical applets as in apl.html (nodlist.class and nodinfo.class).
The file nod.txt in the temp directory is read and the information is fetched from SYS
600.
Information displayed is:
Node number
Station address
Registration date and time
LAN node name
Last transaction number
Link number

60
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Diagnostic interval
Diagnostic timeout
Node type

5.1.3.4. Printers (pri.html)


Identical applets as in apl.html (prilist.class and priinfo.class).
The file pri.txt in the temp directory is read and the information is fetched from SYS
600.
Information displayed is:
Printer number
Device type
Translation type
State
Open on job basis
Translated object number
Device connection
System device name
Line per page
Output destination
Log length
Log flush timeout
Log directory

5.1.3.5. Links (lin.html)


Identical applets as in apl.html (linlist.class and lininfo.class).
The file lin.txt in the temp directory is read and the information is fetched from SYS
600.
Information displayed is:
Link number
Link type
LAN transport
System device name
Redundancy
Timeout length
Fairness count
NAK limit
ENQ limit
Start command
There is also a link to a diagnostics page called lindiagnostics.html.on this page.

61
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Link diagnostics (lindiagnostics.html)


This applet reads a parameter from the pagecom.class and displays the link
diagnostic counters. The same principle is used here: the list sends the parameter to
both the aplcom and pagecom.
The attribute used for the Links diagnostic counters is LINn:BDC.

5.1.3.6. Stations (sta.html)


Only one applet is displayed on this page (stalist.class). The applet uses System Self
Supervision to get information about the stations. The applet does not function, if
System Self Supervision is not installed. It is provided in the LIB 500 package.
Information displayed in the station list:
(LN) Logical Name
(OI) Object Identity
(OX) Object text
(OV) Object value

5.1.3.7. Nets (net.html)


This page contains an applet which is almost identical to the Station applet. The
query here is BSWNETINET.
When a selection has been made, the applet checks which item has been selected.
With another query (BSWNETILIN) it produces a new query and uses the
SELECT-function (described in the SCIL-manual) to get information about the
lines.
Information displayed in the net list:
(LN) Logical Name
(OI) Object Identity
(OX) Object text
(OV) Object value

5.1.3.8. Memory (memory.html)


The memory page contains two applets (memory.class, vumeter.class) and two links
(memblocks.html, memmeters.html).
Memory.class is a labeltype applet and it displays information about:
Total memory size
Picture cache size
Report cache size
Vumeter.class is an applet which contains graphics. The applet monitors the total
memory usage and displays the current value in a numerical and graphical form.
Furthermore, it has a green warning label which turns into red when a specific value
is reached.

62
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Vu_Meter

Fig. 5.1.3.8.-1 The Vu-meter applet


This is how the applet works:
The layout is set
A connection to SYS 600 is made
The memory usage is calculated
It checks the warning limit
It scales the value to fit on the picture
It draws the picture
Points 3-6 are updated once in every 2 seconds.

The used picture and report caches (memmeters.html)


This page contains two applets (picmeter.class, repmeter.class). These applets
monitor the picture cache and report cache used by the system.
The current value is displayed both numerically and graphically. The functions are
the same as in the Vu-meter in the section above.

63
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Memorymeter

Fig. 5.1.3.8.-2 The Memorymeter

Memoryblocks (memblocks.html)
This is also a graphical applet. It shows the memory block sizes and memory blocks
used as a diagram.
Almost everything in this applet is painted. One special thing is that the applet reads
the file sc\temp\memblocks.txt every time it is started and when the x-axis scale
needs to be updated. A loop is made through a vector which contains the current
values of the memoryblocks being used. The value is calculated as SYS:BMS *
SYS:BMU.

5.1.3.9. Time (time.html)


This page contains two applets (time.class, Clock.class). The first applet,
time.class, is a labeltype applet and it shows information about:
External clock address
Clock read frequency
External clock
Clock status
Time zone
Time season
Current date
Current time
This applet is updated once every half a second, but because of the many attributes
this applet displays, the time is updated every fourth or fifth second.
The second applet, Clock.class, shows an analog clock and it is updated every
second. The clock is painted in two steps: first the base, then the numbers and the
current time. Calculation is taken care of by the method drawClock(Graphics).

64
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Clock

Fig. 5.1.3.9.-1 The clock

5.1.3.10. Queues (queuemeters.html)


This page contains two applets (printermeter.class, eventmeter.class).
The used attributes are:
APL:BPM Printer spooler queue length maximum
APL:BPU Printer spooler queue length used
APL:BEM Event channel queue length maximum
APL:BEU Event channel queue used
Printermeter.class has also a choice-component with two options, process printouts
and SCIL printouts.

5.1.3.11. Bar-chart (diagram.html)


This page shows an applet which displays a bar-chart (diagram.java) with data from
a specific data-object, see Figure 5.1.3.11.-1. The dataobject source is configurable
from the applet.
The Interval-time and the Max-value are configurable from the HTML-page.
This is how the applet works:
The layout is set
Parameters are read from the HTML-page
The base is drawn
When the Start button is selected a connection to SYS 600 is made
The applet fetches the values from SYS 600
The values are calculated to fit in the window
The diagram is drawn
This applet is updated with the interval configured from the HTML-page.

65
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Bar_Chart

Fig. 5.1.3.11.-1 An example of a bar-chart with data from a specific data object

5.1.3.12. Line-diagram (linediagram.html)


This is an applet which shows line diagrams (linediagram.class) with information
fetched from two data objects, see Figure 5.1.3.12.-1. The data object source is
configurable from the HTML-page. The maximum value of the Y-axis is also
configurable. If you click the Help-button, a small frame will open showing a help-
text.
This is how the applet works:
Parameters are read from the HTML-page
The layout is set
A connection to SYS 600
is made
A base is drawn
The first graphs minimum and maximum values are sorted out
The first graph is painted

66
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

The second graphs minimum and maximum values are sorted out
The second graph is painted
This applet is updated every second

Line_Diagram

Fig. 5.1.3.12.-1 Line diagrams with information fetched from two data objects

5.1.3.13. Remote Communication Client Server communication


(main2.html)
This example explains how to install and set up the WWW-server 9 used for remote
setup. It uses the Jakarta-tomcat-5.5.11 as a web server.
Copy the MS_JAVA_DEMO folder to the WWW-server pages.
Use the following procedure to install and configure Tomcat Server 5.5:
1. Execute the file jakarta-tomcat-5.5.11.
2. In the Open File security warning dialog, select Run.
3. In the Apache Tomcat setup wizard dialog, click Next.
4. Check all of the available options and click Next.

67
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

5. Enter the destination folder path: C:\Program Files\Apache


Software Foundation\Tomcat 5.5. Click Next.
6. Set the HTTP/1.1 connector port number to an available port number on the host
PC.
7. Enter a User Name and Password.
8. Click Next.
9. Enter the path to the JVM: C:\Program Files\Java \j2rel.4.2_03
Alternatively, browse to the folder location.
10.Click Finish.
11.Create the folder WEB-INF: C:\Program Files\Apache Software
Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF.
12.Create new .xml file.
13.Copy the file C:\MS_Interfaces\Java\ms_java_demo to the folder
C:\Program Files\Apache Software Foundation\Tomcat
5.5\webapps.
To set the path:
1. Right click My Computer and select Properties.
2. Open the Advanced tab and click Environment variables.
3. Click Edit.
4. In the Variable name field, enter Path.
5. In the Variable value field, enter:
C:\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.5\
webapps\ROOT\WEB-INF\web.xml.
6. To accept the changes, click OK to close the dialogs.

68
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Fig. 5.1.3.13.-1 Edit User Variable dialog


Use the following procedure to start communication between Microscada and the
Tomcat server:
1. Start Microscada.
2. To start the Tomcat Server, go to Start > Programs > ApacheTomcat5.5
>Monitor Tomcat. Click Start.

69
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Fig. 5.1.3.13.-2 Starting the Apache Tomcat server


3. Start Internet Explorer.
4. Enter the URL:
For local communication: http://localhost:8989/ms_java_demo/
main2.html
When the application is running in Remote PC: http://
IPaddress:8989/ms_java_demo/main2.html
The Microscada General Information page will be displayed.

70
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

6. Terminology

Term Description

ENQ limit Enquire limit.

EP message (Application) Extension Program message.

INI-file Initialisation-file.

IP address Internet Protocol address. The transport layer which describes


a packet format for data to pass on a TCP/IP network and on
the Internet.

Java API Java Application Programming Interface.

SYS 600 A computer-based, programmable and distributed Supervisory


Control And Data Acquisition (SCADA) system.

NAK limit Negative Acknowledge limit.

71
72
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

7. Abbreviations

Abbreviation Description

AEP Application Extension Program.

DAT Digital Audio Tape.

GIF Graphics Interchange Format. CompuServes graphics file


format.

HSB Hot Stand-by.

HTML Hypertext Markup Language.

IE Microsoft Internet Explorer.

IIS Internet Information Server.

JDK Java Development Kit.

JNI Java Native Interface.

JRE Java Runtime Environment.

LAN Local Area Network. A network spanning a small physical area,


for example, a building. LAN operates at high speed (10-100
Mbit/s).

LIB 500 The LIB 500 Application Software Library consists of product
packages for building the applications in a SYS 600 application.

SCIL Supervisory Control Implementation Language.

SPR SYS 600 System Progress Report.

TCP/IP Transmission Control Protocol/Internet Protocol.

URL Uniform Resource Locator. A standard method for defining the


location of the resource for remote access, for example, by a
WWW-browser.

WWW World Wide Web. A networked information service using the


HTML for its formatting and interfaces.

73
74
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

8. Index
A
Access level .............................................................................................. 21
Access levels ............................................................................................ 22
AddLabel .................................................................................................. 55
Administrator rights .................................................................................. 14
AEP ........................................................................................................... 13
Aep_send .................................................................................................. 50
Aep_start function .................................................................................... 16
Alarm signal size ...................................................................................... 58
Animated link ........................................................................................... 53
Animations ............................................................................................... 56
Apl_init ..................................................................................................... 22
APL:BEM ................................................................................................. 65
APL:BEU ................................................................................................. 65
APL:BPM ................................................................................................. 65
APL:BPU .................................................................................................. 65
Apl.html .............................................................................................. 60, 61
Aplcom ..................................................................................................... 62
Aplcom.class ...................................................................................... 57, 58
Apldiag ..................................................................................................... 59
Apldiagnostics.html .................................................................................. 58
Aplinfo ...................................................................................................... 58
Apllist ....................................................................................................... 58
APL-mapping ........................................................................................... 60
APLn:BAP ................................................................................................ 60
APLn:BMO .............................................................................................. 60
APLn:BSD ................................................................................................ 59
APLn:BST ................................................................................................ 60
Aplshadow ................................................................................................ 59
Aplshadow.class ....................................................................................... 59
Applet ............................................................................... 24, 32, 53, 55, 62
Applet - applet communication ................................................................ 57
Application ............................................................................................... 60
Extension program ................................................................................ 7
Name ................................................................................................... 58
Number ............................................................................................... 58
Page .................................................................................................... 59
State ...................................................................................................... 7
Application extension program .................................................... 23, 31, 50
Application mapping ................................................................................ 13
Archive format .......................................................................................... 13
Argument .................................................................................................. 31
Arguments ................................................................................................ 31

75
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Array ......................................................................................................... 49
AS attribute ................................................................................................ 7
Audit failure message ............................................................................... 51
Audit success code ................................................................................... 51
Audit success message ............................................................................. 51
Auth_SCIL_File_Name ........................................................................... 21
authentication mechanism ........................................................................ 21
Authentication_Type ................................................................................ 21
AUTHETICATED ................................................................................... 21
B
B_Sendflag ............................................................................................... 58
Bar-chart ............................................................................................. 65, 66
Base .................................................................................................... 65, 66
Base system object ................................................................................... 36
Basic System Configuration ..................................................................... 56
Benefits ...................................................................................................... 7
Bit string ....................................................................................... 41, 42, 43
Bit string object ........................................................................................ 47
BitSet type of value .................................................................................. 46
BitSet type value ...................................................................................... 44
Boolean ........................................................................................ 41, 42, 43
Boolean type of value ............................................................................... 45
Boolean type value ................................................................................... 44
Boolean value ........................................................................................... 47
Browsers ................................................................................................... 13
BSWNETILIN ......................................................................................... 62
BSWNETINET ........................................................................................ 62
Byte array ........................................................................................... 40, 42
Byte string ................................................................................................ 43
Byte type of value .................................................................................... 46
Byte type value ......................................................................................... 44
C
Cancelling of events ................................................................................. 50
C-API ......................................................................................................... 8
Caption of the label .................................................................................. 55
Choice-component ................................................................................... 65
Class aplcom ............................................................................................ 57
Classes ...................................................................................................... 27
Client ........................................................................................................ 31
Client name .............................................................................................. 32
Client password ........................................................................................ 32
Client use .................................................................................................. 13
CLIENT_NAME ...................................................................................... 21
CLIENT_PASSWORD ............................................................................ 21

76
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Client/server connection ........................................................................... 31


Clients ....................................................................................................... 21
Clients names and passwords ................................................................... 22
Clock ......................................................................................................... 65
Read frequency ................................................................................... 64
Status .................................................................................................. 64
Clock.class ................................................................................................ 64
Colour allocation policy ........................................................................... 60
Command line .......................................................................................... 22
Command procedure ................................................................................ 22
Command procedure object ...................................................................... 37
Command prompt ..................................................................................... 17
Configuration ...................................................................................... 21, 53
Configuration & Diagnostics .................................................................... 56
Configuration file ..................................................................................... 21
connection state ........................................................................................ 32
Constraints ................................................................................................ 55
Constructors .............................................................................................. 23
Current
Date ..................................................................................................... 64
Time .................................................................................................... 64
Customer information ............................................................................... 54
Customizing the installation ..................................................................... 16
D
Data
Object ..................................................................................... 65, 66, 67
Data object ................................................................................................ 37
Data transfer ............................................................................................. 31
Date object .......................................................................................... 43, 47
Date type of value ..................................................................................... 46
Date type value ......................................................................................... 44
Default access field ................................................................................... 22
Default_Access ................................................................................... 21, 22
Description of a browser based remote application ................................. 24
Destination drive ...................................................................................... 16
Device
Connection .................................................................................... 60, 61
Type .................................................................................................... 61
Diagnostic
Interval ................................................................................................ 60
Timeout ............................................................................................... 61
Diagnostics page ....................................................................................... 59
Diagram.java ............................................................................................ 65
Dialog boxes ............................................................................................. 14
Dynamic data types .................................................................................... 7

77
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

E
Easy to use programming environment ...................................................... 7
Enable routing .......................................................................................... 56
ENQ limit ................................................................................................. 61
EP messages ............................................................................................... 8
Error code ................................................................................................. 51
Error message ........................................................................................... 51
Event
Channel queue length maximum ........................................................ 65
Channel queue used ............................................................................ 65
Event channel object ................................................................................ 38
Event object .............................................................................................. 38
EventLog .................................................................................................. 50
EventLog object ....................................................................................... 51
Eventmeter.class ....................................................................................... 65
Events ............................................................................................. 8, 25, 32
Example application ........................................................................... 15, 53
Example implementation of Java API ...................................................... 53
Examples .................................................................................................. 24
exit event .................................................................................................. 34
Exit event handler ..................................................................................... 25
External clock ........................................................................................... 64
External clock address .............................................................................. 64
F
Fairness count ........................................................................................... 61
FALSE ...................................................................................................... 21
Fatal error ................................................................................................. 11
File sync criteria ....................................................................................... 56
Float .................................................................................................... 41, 42
Float type value ........................................................................................ 44
Font .......................................................................................................... 55
For customising the installation ............................................................... 15
Free attributes ..................................................................................... 26, 42
Free type objects ....................................................................................... 26
Free type process objects .................................................................... 26, 40
G
General info .............................................................................................. 53
General System Information .............................................................. 54, 55
Generalinfo ............................................................................................... 59
Generalinfo.java ....................................................................................... 54
Get functions ............................................................................................ 47
Get*** -functions ..................................................................................... 40
Get*** method ......................................................................................... 43
GetAepMessage function ........................................................................... 8

78
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

GetBytes() ................................................................................................. 42
GetByteString() ........................................................................................ 47
GetInt() ..................................................................................................... 43
GetValues() function ................................................................................ 55
GetValueType method .............................................................................. 43
Gif-pictures ............................................................................................... 56
Graphical applet ........................................................................................ 64
GridBagConstraints .................................................................................. 55
GridBagLayout ......................................................................................... 55
H
Hard drive space ....................................................................................... 15
Hard drive space available ........................................................................ 15
Hardware .................................................................................................. 54
Hardware requirements ............................................................................ 13
Hashtable .................................................................................................. 47
Hashtable type of value ............................................................................ 46
Hashtable type value ................................................................................. 45
Help-text ................................................................................................... 66
History buffer ........................................................................................... 58
Host ........................................................................................................... 22
Host entry ................................................................................................. 22
Host sections ............................................................................................. 22
Host specific information ......................................................................... 22
Hot application state ................................................................................... 7
HSB ............................................................................................................ 7
HTML ....................................................................................................... 53
HTML page .............................................................................................. 24
HTML-page ........................................................................................ 65, 66
I
IE .............................................................................................................. 13
IIS ............................................................................................................. 13
Import SCIL.* ........................................................................................... 24
Index ......................................................................................................... 48
Index of the event ..................................................................................... 49
Individual attributes .................................................................................. 26
Info.html ................................................................................................... 56
Infoapplet .................................................................................................. 57
Information code ...................................................................................... 51
Information message ................................................................................ 51
Inheritance ................................................................................................ 26
Inherited .................................................................................................... 36
Inherited objects ....................................................................................... 40
INI_FILE ............................................................................................ 21, 22
Initialisation .............................................................................................. 55

79
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Initialisation time ..................................................................................... 53


Input locked .............................................................................................. 60
Installation .......................................................................................... 14, 53
Installation disk ........................................................................................ 14
Installation progress indicator .................................................................. 16
Int ............................................................................................................. 55
Int type of value ........................................................................................ 45
Int type value ............................................................................................ 44
Integer ..................................................................................... 41, 42, 43, 47
Integer value ............................................................................................. 47
Integers ..................................................................................................... 43
Internet ....................................................................................................... 7
Interval-time ............................................................................................. 65
Intranet ....................................................................................................... 7
IP address ........................................................................................... 13, 22
IP number ................................................................................................. 21
IP-Number ................................................................................................ 22
J
Java
Applet ................................................................................................... 7
Application ........................................................................................... 7
Class ..................................................................................................... 8
Environment ......................................................................................... 8
Java API ................................................................................................... 14
Java applet ................................................................................................ 29
Java applets ........................................................................................ 13, 21
Java application ........................................................................................ 31
Java applications ...................................................................................... 21
Java class .................................................................................................. 23
Java classes ............................................................................................... 13
Java code ............................................................................................ 24, 31
Java data types .......................................................................................... 31
Java interpreter ......................................................................................... 31
Java object ................................................................................................ 26
Java program ............................................................................................ 23
Java programming language ..................................................................... 13
Java support .............................................................................................. 13
Java.applet.* ............................................................................................. 53
Java.awt.* ................................................................................................. 53
Java.awt.*- ................................................................................................ 53
JDK .................................................................................................... 13, 17
JNI ............................................................................................................ 31
Jpg -format ............................................................................................... 53
JRE ........................................................................................................... 17
JSSE ......................................................................................................... 14

80
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

L
Label ............................................................................................. 55, 56, 64
Labeltype .................................................................................................. 53
LAN
Node name .......................................................................................... 60
Transport ............................................................................................. 61
Last transaction number ........................................................................... 60
Layout ....................................................................................................... 55
LIB 500 package ....................................................................................... 62
Librevision ................................................................................................ 54
License ...................................................................................................... 54
Lin.txt ....................................................................................................... 61
Lindiagnostics.html .................................................................................. 61
Line diagrams ..................................................................................... 66, 67
Line per page ............................................................................................ 61
Linediagram.class ..................................................................................... 66
Lininfo.class ............................................................................................. 61
Link
Diagnostic counters ............................................................................ 62
Diagnostics ......................................................................................... 58
Number ......................................................................................... 60, 61
Type .................................................................................................... 61
Link-frame .......................................................................................... 56, 58
Links.html ................................................................................................. 56
Linlist.class ............................................................................................... 61
LINn:BDC ................................................................................................ 62
List ........................................................................................................ 7, 43
Listapplet ............................................................................................ 57, 58
Little endian format .................................................................................. 42
LN ............................................................................................................. 62
Local ................................................................................................... 22, 33
Local Applications .................................................................................... 23
Log
Directory ............................................................................................. 61
Flush timeout ...................................................................................... 61
Length ................................................................................................. 61
Log_Enable ............................................................................................... 21
Logged in / APL ....................................................................................... 60
Logging messages .................................................................................... 21
Logical Name ........................................................................................... 62
Logo.java .................................................................................................. 54
M
Main2.html ............................................................................................... 53
Mapping pages .......................................................................................... 59
Mapping.html ........................................................................................... 58

81
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Max_Connections .................................................................................... 21
Max-value ................................................................................................. 65
Memblocks.html ....................................................................................... 62
Memblocks.txt .......................................................................................... 64
Memmeters.html ...................................................................................... 62
Memory
Block sizes ......................................................................................... 64
Page .................................................................................................... 62
Memory.class ........................................................................................... 62
Memorymeter ........................................................................................... 64
Message data ............................................................................................ 49
Microsoft Internet Explorer ...................................................................... 53
Mon.txt ..................................................................................................... 60
Moninfo.class ........................................................................................... 60
Monitor ..................................................................................................... 60
Monitor number ....................................................................................... 60
Monlist.class ............................................................................................. 60
MON-mapping ......................................................................................... 60
Multiplexer ............................................................................................... 31
Multithread Java application .................................................................... 31
N
NAK limit ................................................................................................. 61
Name of the font ....................................................................................... 55
Net list ...................................................................................................... 62
Netrevision ............................................................................................... 54
Netscape ................................................................................................... 13
New object ................................................................................................ 27
New value ................................................................................................. 34
NO_ACCESS ........................................................................................... 21
NO_AEP .................................................................................................. 17
Nod.txt ...................................................................................................... 60
Node number ................................................................................ 56, 58, 60
Node type ................................................................................................. 61
Nodinfo.class ............................................................................................ 60
Nodlist.class ............................................................................................. 60
NONE ....................................................................................................... 21
NT event log ....................................................................................... 21, 50
NT Server ................................................................................................. 13
Number of the application extension program ......................................... 33
Number of the arguments ......................................................................... 49
Number of the MicroSCADA Pro application ......................................... 33
Number_Of_Hosts ................................................................................... 22
Numbering of the MicroSCADA Pro application .................................... 13

82
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

O
Object
Identity ................................................................................................ 62
Text ..................................................................................................... 62
Value ................................................................................................... 62
Object type ................................................................................................ 26
Objects Inherited From the SCIL_Object ................................................. 36
OI .............................................................................................................. 62
Open on job basis ..................................................................................... 61
Operating system ...................................................................................... 13
Output destination .................................................................................... 61
OV ............................................................................................................ 62
OX ............................................................................................................ 62
P
Pagecom ............................................................................................. 58, 62
Pagecom.class ..................................................................................... 59, 62
Parallel queues .......................................................................................... 58
Parent class ............................................................................................... 40
............................................................................................................ 21, 22
Passwords section ..................................................................................... 21
Peer Web-server ....................................................................................... 13
Picmeter.class ........................................................................................... 63
Picture cache ............................................................................................. 63
Picture cache size ..................................................................................... 62
Preload.java .............................................................................................. 53
Prg_name .................................................................................................. 23
Pri.txt ........................................................................................................ 61
Priinfo.class .............................................................................................. 61
Prilist.class ................................................................................................ 61
PRI-mapping ............................................................................................. 60
Printer
Number ............................................................................................... 61
Spooler queue length maximum ......................................................... 65
Spooler queue length used .................................................................. 65
Printermeter.class ..................................................................................... 65
Process object ........................................................................................... 39
Process printouts ....................................................................................... 65
Public BitSet getBitString() ...................................................................... 47
Public BitSet getBitString(int length) ...................................................... 41
Public boolean getBoolean() .............................................................. 41, 47
public boolean isConnected() ................................................................... 32
Public byte data(( ...................................................................................... 49
Public Date getTime() ........................................................................ 41, 47
Public Enumeration listAttributes() .......................................................... 48
public EventLog() ..................................................................................... 51

83
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Public float getFloat() ........................................................................ 41, 47


Public Hashtable getList() ........................................................................ 47
Public int count ........................................................................................ 49
Public int getInt() ............................................................................... 41, 47
Public int getSeconds() ............................................................................ 47
Public int getStatus() .......................................................................... 33, 35
Public int getValueType() ........................................................................ 47
Public int index ........................................................................................ 49
Public int length ....................................................................................... 49
Public int message_type ........................................................................... 49
Public SCIL_BaseSystemObject(String name, int apl) ........................... 36
Public SCIL_BaseSystemObject(String name, SCIL_Connection conn, int
apl) ............................................................................................................ 36
Public SCIL_CommandProcedureObject(String name, int apl) .............. 37
Public SCIL_CommandProcedureObject(String name, SCIL_Connection
conn) ......................................................................................................... 37
public SCIL_Connection(String address, int port, String name, String pass-
word) ........................................................................................................ 32
public SCIL_Connection(String address, int port) ................................... 32
public SCIL_Connection(String address, String name, String password) 32
Public SCIL_Connection(String address) ................................................ 31
Public SCIL_DataObject(String name, int apl) ........................................ 37
Public SCIL_DataObject(String name, SCIL_Connection conn, int apl) 37
Public SCIL_EventChannelObject(String name, int apl) ........................ 38
Public SCIL_EventChannelObject(String name, SCIL_Connection conn, int
apl) ............................................................................................................ 38
Public SCIL_EventObject(String name, int apl) ...................................... 38
Public SCIL_EventObject(String name, SCIL_Connection conn, int apl) 38
Public SCIL_FreeTypeObject(String name, int apl_num) ....................... 41
Public SCIL_FreeTypeObject(String name, SCIL_Connection conn, int
apl_num) .................................................................................................. 41
Public SCIL_Interface() ........................................................................... 32
Public SCIL_Interface(int apl, int program_number) .............................. 33
Public SCIL_Interface(int apl) ................................................................. 33
Public SCIL_Interface(SCIL_Connection conn, int apl) ......................... 33
Public SCIL_Interface(SCIL_Connection conn) ..................................... 33
Public SCIL_Message getAepMessage(int timeout) ............................... 35
Public SCIL_Message() ........................................................................... 50
Public SCIL_Message(int type) ............................................................... 50
Public SCIL_ProcessObject(String name, int apl) ................................... 39
Public SCIL_ProcessObject(String name, SCIL_Connection conn, int apl)
39
Public SCIL_ScaleObject(String name, int apl) ...................................... 39
Public SCIL_ScaleObject(String name, SCIL_Connection conn, int apl) 39
public SCIL_SSL_Connection(String address, int port, String name, String
password) ................................................................................................. 32

84
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

public SCIL_SSL_Connection(String address, int port) .......................... 32


public SCIL_SSL_Connection(String address, String name, String pass-
word) ......................................................................................................... 32
Public SCIL_SSL_Connection(String address) ....................................... 32
Public SCIL_SystemObject(String name, int apl) .................................... 39
Public SCIL_SystemObject(String name, SCIL_Connection conn, int apl)
40
Public SCIL_TimeChannelObject(String name, int apl) .......................... 40
Public SCIL_Value arguments(( .............................................................. 49
Public SCIL_Value elementAt(int index) ................................................ 48
Public SCIL_Value evaluateExpression(String expression) .................... 34
Public SCIL_Value getAttribute(String name, int start, int end) ............. 36
Public SCIL_Value getAttribute(String name) .................................. 36, 48
Public SCIL_Value getVariable(String name) ......................................... 34
Public SCIL_Value() ................................................................................ 44
Public SCIL_Value(BitSet value .............................................................. 44
Public SCIL_Value(boolean value) .......................................................... 44
Public SCIL_Value(Date value) ............................................................... 44
Public SCIL_Value(float value) ............................................................... 44
Public SCIL_Value(Hashtable value) ...................................................... 45
Public SCIL_Value(int value) .................................................................. 44
Public SCIL_Value(String value) ............................................................. 44
Public SCIL_Value(Vector value) ........................................................... 45
Public static variables ............................................................................... 57
Public String getName() ........................................................................... 35
Public String getString() ........................................................................... 47
Public String getString(int length) ............................................................ 41
Public String name ................................................................................... 49
Public Vector getVector() ......................................................................... 47
Public void activateObject(int index) ....................................................... 36
Public void addElement(SCIL_Value v) .................................................. 48
Public void bitClear(int bit) ...................................................................... 49
Public void bitSet(int bit) ......................................................................... 49
Public void cancelEventSubscription(String name, int index) ................. 34
Public void cancelExitEventSubscription() .............................................. 34
Public void closeSCIL_Connection() ....................................................... 32
Public void executeCommand(String command) ..................................... 33
Public void readAttributes() ..................................................................... 41
Public void sendAepMessage(int aep_num, SCIL_Message msg) .......... 35
Public void setAttribute(String name, int start, int end, SCIL_Value value)
35
Public void setAttribute(String name, SCIL_Value v) ............................. 48
Public void setAttribute(String name, SCIL_Value value ....................... 35
Public void setBitString(BitSet bset, int length) ...................................... 42
Public void setBoolean(boolean value) .................................................... 42
Public void setElementAt(SCIL_Value v, int index) ............................... 48

85
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Public void setFloat(float value) .............................................................. 42


Public void setInt(int value) ..................................................................... 42
Public void setString(String str, int length) .............................................. 42
Public void setTime(Date value) .............................................................. 42
Public void setTime(int seconds .............................................................. 46
Public void setValue(BitSet value) .......................................................... 46
Public void setValue(boolean value) ........................................................ 45
Public void setValue(Date value) ............................................................. 46
Public void setValue(float value) ............................................................. 45
Public void setValue(Hashtable value) .................................................... 46
Public void setValue(int value) ................................................................ 45
Public void setValue(String value) .......................................................... 45
Public void setValue(Vector value) ......................................................... 46
Public void setVariable(String name, SCIL_Value value) ...................... 34
Public void subscribeEvent(String name, int index) ................................ 34
Public void subscribeExitEvent() ............................................................. 34
Public void writeAttributes() .................................................................... 41
public void writeUserAuditFailure(int userAuditCode, String auditStr) . 51
public void writeUserAuditSuccess(int userAuditCode, String auditStr) 51
public void writeUserError(int userErrorCode, String errorStr) .............. 51
public void writeUserInformation(int userInfoCode, String infoStr) ...... 51
public void writeUserWarning(int userWarningCode, String warningStr) 51
R
READ ....................................................................................................... 21
Read variables .......................................................................................... 24
READ_WRITE ........................................................................................ 21
ReadAttributes method ............................................................................. 40
Real .......................................................................................................... 43
Real value ................................................................................................. 47
Receiver thread ......................................................................................... 32
Redundancy .............................................................................................. 61
Registration date and time ........................................................................ 60
Remote ............................................................................................... 22, 33
Remote Java applications/applets ............................................................. 23
Remote programs ..................................................................................... 31
Repmeter.class .......................................................................................... 63
Report cache ............................................................................................. 63
Report cache size ...................................................................................... 62
Requirements ............................................................................................ 13
Runtime exception ........................................................... 43, 45, 46, 47, 48
S
Scale object .............................................................................................. 39
SCIL ................................................................................................... 53, 62
Commands ............................................................................................ 8

86
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Printouts .............................................................................................. 65
SCIL commands ....................................................................................... 24
SCIL data types ........................................................................................ 43
SCIL expression ....................................................................................... 34
SCIL Interface .......................................................................................... 24
SCIL package ..................................................................................... 27, 29
SCIL time ........................................................................................... 43, 47
Scil time .................................................................................................... 42
Scil time value .......................................................................................... 41
SCIL variable ............................................................................................ 34
SCIL_ EP_MESSAGE_SCIL .................................................................. 50
SCIL_ LIST _TYPE ................................................................................. 45
SCIL_ LIST_TYPE .................................................................................. 47
SCIL_ TIME _TYPE. ............................................................................... 44
SCIL_ VECTOR _TYPE ......................................................................... 45
SCIL_ALL_OBJECT_INDEX ........................................................... 34, 50
SCIL_BIT_STRING_TYPE ................................................... 43, 44, 46, 47
SCIL_BOOLEAN_TYPE ...................................................... 43, 44, 45, 47
SCIL_BYTE_STRING_TYPE ..................................................... 43, 44, 46
SCIL_Connection ......................................................................... 23, 24, 31
SCIL_Connection class ............................................................................ 22
SCIL_Context ............................................................................................. 8
SCIL_EP_MESSAGE_EP ....................................................................... 50
SCIL_EP_MESSAGE_EVENT ......................................................... 49, 50
SCIL_EP_MESSAGE_EXIT ................................................................... 50
SCIL_EP_MESSAGE_NONE ........................................................... 49, 50
SCIL_EP_MESSAGE_SCIL ............................................................. 49, 50
SCIL_FILE ............................................................................................... 21
SCIL_FreeTypeObject ....................................................................... 26, 41
SCIL_INTEGER_TYPE ........................................................ 43, 44, 45, 47
SCIL_Interface ............................................................................... 8, 23, 32
Scil_jni.dll ................................................................................................ 16
SCIL_LIST_TYPE ....................................................................... 43, 46, 48
SCIL_MAX_EP_MESSAGE_ARGUMENTS ........................................ 50
SCIL_Message ..................................................................................... 8, 50
SCIL_NO_TYPE .......................................................................... 43, 44, 47
SCIL_Object classes ................................................................................. 23
SCIL_REAL_TYPE ............................................................... 43, 44, 45, 47
SCIL_SSL_Connection ............................................................................ 32
SCIL_TEXT_TYPE ............................................................... 43, 44, 45, 47
SCIL_TIME_TYPE ...................................................................... 43, 46, 47
SCIL_Value .............................................................................. 8, 34, 45, 48
SCIL_Value object ............................................................................. 45, 46
SCIL_Values ............................................................................................ 43
SCIL_VECTOR_TYPE ......................................................... 43, 46, 47, 48
SCIL.* ...................................................................................................... 53

87
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

SCIL.cab ....................................................................................... 13, 16, 23


SCIL.jar .................................................................................... 8, 13, 16, 23
Scil2java ....................................................................................... 22, 23, 31
Scil2java.exe ...................................................................................... 16, 23
Seconds ........................................................................................ 43, 46, 47
Select dialog box ................................................................................ 15, 16
SELECT-function .................................................................................... 62
Semigraphic .............................................................................................. 60
Sensible value ........................................................................................... 43
Server ................................................................................................... 7, 21
Server process .......................................................................................... 23
Server use ................................................................................................. 13
Service pack ............................................................................................. 13
Set*** -methods ....................................................................................... 40
SetValue(***) functions ........................................................................... 43
Shadowing
Connection time ................................................................................. 59
Diagnostic interval ............................................................................. 59
Event channel queue ........................................................................... 59
Flush time ........................................................................................... 59
Number ............................................................................................... 59
Phase .................................................................................................. 59
Receive timeout .................................................................................. 59
State .................................................................................................... 59
Watchdog ........................................................................................... 60
Simultaneous connections ........................................................................ 21
Site information ........................................................................................ 54
Software ................................................................................................... 54
Software requirements .............................................................................. 13
Source -code ............................................................................................. 53
Source disk ............................................................................................... 16
SSL encoding ..................................................................................... 21, 32
SSL_Enabled ............................................................................................ 21
Stalist.class ............................................................................................... 62
STA-mapping ........................................................................................... 60
Start button ............................................................................................... 65
Start command ......................................................................................... 61
State .................................................................................................... 58, 61
Station ...................................................................................................... 60
Address ......................................................................................... 56, 60
Applet ................................................................................................. 62
List ...................................................................................................... 62
Status code ......................................................................................... 12, 35
Status value .............................................................................................. 33
Stop method ............................................................................................. 32
String .................................................................................................. 41, 55

88
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

String type of value .................................................................................. 45


String type value ....................................................................................... 44
Subscription .............................................................................................. 34
Subscription of events .............................................................................. 50
Sun Microsystems .................................................................................... 13
SYS 600 ...................................................................................................... 7
Memory pool ........................................................................................ 8
System Diagnostics ............................................................................ 54
SYS 600 application ................................................................................. 22
SYS 600 data types ................................................................................... 31
SYS 600 interface classes ......................................................................... 24
SYS 600 messages .................................................................................... 17
SYS 600 objects ....................................................................................... 26
SYS 600 port ............................................................................................ 32
SYS 600 Pro ............................................................................................... 8
SYS 600 Pro events .................................................................................. 50
SYS 600 Pro host ................................................................................ 23, 31
SYS 600 Pro object .................................................................................. 36
SYS 600 SCIL interpreter ........................................................................ 32
SYS_ directory ......................................................................................... 21
Sys_java.ini .............................................................................................. 21
SYS:BMS * SYS:BMU ............................................................................ 64
Sysconfiguration.java ............................................................................... 56
System
Device name ................................................................................. 60, 61
Diagnostics program ........................................................................... 53
Machine name .................................................................................... 54
Self Supervision .................................................................................. 62
System object ............................................................................................ 39
T
TCP/IP network ........................................................................................ 31
TCP/IP port ............................................................................................... 31
TCP/IP socket ........................................................................................... 31
Technical reference .................................................................................. 31
Temp directory ................................................................................... 60, 61
Terminating the installation ...................................................................... 14
Text ........................................................................................................... 43
Text string ................................................................................................. 47
The Java API server .................................................................................. 24
The Java Classes ....................................................................................... 31
Time
Limit ..................................................................................................... 8
Season ................................................................................................. 64
Synchronisation interval ..................................................................... 60
Zone .................................................................................................... 64

89
SYS 600 9.3 MicroSCADA Pro 1MRS756648
Java Programming Interface (Java-API)
Users Guide

Time channel object ................................................................................. 40


Time.class ................................................................................................. 64
Timeout .................................................................................................... 35
Length .......................................................................................... 56, 61
Value .................................................................................................... 8
Toolrevision ............................................................................................. 54
Total
Memory size ....................................................................................... 62
Memory usage .................................................................................... 62
Translated object number ................................................................... 58, 61
Translation type .................................................................................. 60, 61
Translations .............................................................................................. 31
TrimText(String) ...................................................................................... 58
TRUE ....................................................................................................... 21
Type .................................................................................................... 58, 60
U
URL location ............................................................................................ 24
User .................................................................................................... 21, 40
User defined attributes ............................................................................. 40
Using the Java API ................................................................................... 22
V
Vector ................................................................................. 7, 43, 48, 60, 64
Vector object ............................................................................................ 47
Vector type of value ................................................................................. 46
Vector type value ..................................................................................... 45
Vu-meter ................................................................................................... 63
Vu-meter applet ........................................................................................ 63
Vumeter.class ........................................................................................... 62
W
Warning
Label ................................................................................................... 62
Limit ................................................................................................... 63
Warning code ........................................................................................... 51
Warning message ..................................................................................... 51
Welcome dialog box ................................................................................. 15
Windows INI-files .................................................................................... 21
WriteAttributes method ............................................................................ 40
WWW-browser ........................................................................................ 13
WWW-server ............................................................................... 13, 23, 24
X
X-axis ....................................................................................................... 64
X-coordinates ........................................................................................... 55

90
1MRS756648 MicroSCADA Pro SYS 600 9.3
Java Programming Interface (Java-API)
Users Guide

Y
Y-axis ....................................................................................................... 66
Y-coordinates ........................................................................................... 55

91
Contact us

Copyright 2010 ABB. All rights reserved.


ABB Oy
Substation Automation Products
P.O. Box 699
FI-65101 Vaasa
FINLAND
Tel. +358 10 22 11
Fax. +358 10 224 1094

www.abb.com/substationautomation

1MRS756648 A/31.3.2010

You might also like