eWON · Java Application examples • Standard Application (As developed with BASIC) • New “Tag...

Preview:

Citation preview

eWONJAVA eWON Tool Kit

D. Hammond & S. Detollenaere

JAVA ETK

• ETK = eWON ToolKit• eWON runs a Java Virtual Machine which executes your third

party Java programs (Libraries).• In addition to the JAVA native APIs, The ETK offers a set of

APIs used to control and manage the eWON.

JAVA IDE

• A Java IDE is required to develop your JAVA application.• Any JAVA IDE can theoretically be used. Netbeans v7 is the

one we document on our website.

JAVA Application Deployment

• The code compilation produces two files. One *.jad and one *.jar• Both files need to be pushed through FTP in the /usr directory of the eWON.

• Netbeans features a FTP client to deploy your application directly from your IDE.

Start the Java Application

• Starting the JAVA application can be done through different ways :

• Using the “jvmrun” (To start the JAVA program at boot) to be copied along with the *.jar and *.jad files.

• Using an URL (Only for debugging)

-heapsize 1M –classpath/usr/HelloWorld.jar -emain HelloMain

Start the Java Application (2)

• heapsize : Virtual Memory allocated to the JAVA program.

• classpath : Path to the executable to start.

• emain: Name of the main class where the “main” function is located (= Entry point of the program)

-heapsize 1M –classpath /usr/HelloWorld.jar -emain HelloMain

Java Application examples

• Standard Application (As developed with BASIC)

• New “Tag Publishing” Protocol (Other than Modbus TCP and SNMP). See “Telnet” example on http://developer.ewon.biz

• New IOserver (With Java IOserver Library)

• OEM Application (Code cannot be edited). License system can be created to sell the JAVA application.

• Unconventional real use cases : • FTP Gateway (Make the link between two FTP servers)• Modem Simulator (Simulate a Modem through TELNET to allow a HMI to generate SMS

through eWON)

JAVA vs. Basic

BasicScript interpreted by the firmwareNo software needed. (embedded IDE)

BASIC functions allow to manage Tags, events, configurations, files, IP sockets, Serial Ports,…

Works mainly on events

Mono-threading

eWON own BASIC functions. Only eWON uses this language.

Online debugging with breakpoints, Step by step,…

JavaCompiled code executed by the JVMIDE Software needed. (Netbeans 7)

JAVA ETK provides the same set of APIs and even more, like Server Sockets and User Led Management.

Works on events as well as using endless LOOP.

Multi-threading

Standard language. Examples and tutorials can be found on Internet (Except for ETK APIs)

Online debugging with breakpoints, Step by step,… in Netbeans

https://developer.ewon.biz

eWON Programming JAVA

Website

Show Time…

Telnet Server

• eWON acts now as a Telnet server and listens on the TCP port 333 for incoming connection.

• The Telnet protocol provides an access to a command-line interface

• Get the Tag value by typing the Tagname.

JAVA

Telnet Server

Thank you!

Recommended