Webdevice Script Programming

Overview
WebDevice is the embedded web server that comes on the EDASce.

Key features:

Static content such as html, image, text, etc. can be loaded on the EDAS CE.

 

This allows custom web pages, documentation, instructions, etc to be stored and retrived directly off the EDASce using a browser.

 

Content can easily be modified and extended to provide a custom look, feel or complete solution.

Server Side Scripting

 

Allows WebDevice to serve dynamic content.

 

With a server side scripting you can read/write input and output values and build dynamic HTML content to be returned to a browser. For example you can read the current inputs scale them and return a html page with a table containing the current value of the inputs.

 

Allows you to build applications that run continiously on the EDASce. For example you can build an application that reads inputs, scales the data and then logs the data to a file on the EDASce or send the data to a remote database.

Supports Push technology

 

Allows WebDevice to send real-time data to applets, providing real-time data displays in html pages. These Applets require a JVM (Java Virtual Machine) with Swing capability.

Supports Unit to unit Communications

 

With WebDevice you can build applications that communicate with other EDAS CE units or with other web servers such as Apache and Internet Information Server (IIS).

 

WebDevice Script Requirements.

 

A WebDevice script is an ASCII file that contains a sequence of WebDevice script statements. A WebDevice script statement is like a function call in other languages. Script statements can generate HTML pages, read and write the EDAS CE's IO, read/write local files on the EDAS CE, do math and other processing functions, run other scripts or programs, and interface with other EDAS CE units or other web servers.
You can use WebDevice scripts to add functionality to the EDAS CE's current web site or build a completly new web site, full customized to your application needs.

All WebDevice Script must:

 

Have the file extention .wds (ie: myScript.wds)

 

Be stored under the WebDevice\HTROOT folder on the EDASce's Compact Flash card.

 

End with the "EndScript" statement.
For example:
   EndScript Return=hOut Type="text/html"
   where hOut is the variable containing the data to be returned.

All WebDevice Script may:

 

Have include comments by starting the line with '
' this is a comment

 

Execute and return data to a Web Browser, another EDAS CE or other program.
OR
Execute in a endless loop, reading, processing, logging, etc...

 

Be used to build a web site localy on the EDAS CE Perform a wide range functionality.

Example:

' WebDevice Script Example

 

' Create a varaible named myData and set its value to 101.45

Set Name=myData Val="101.45"

 

' Use AppendText to build a web page in the variable hOut

AppendText Out=hOut

<html>

<head><title>My WebDevice Script page</title></head>

<body>

My WebDevice Script page

<br>myData is |myData|

</body>

</html>

EndAppendText

EndScript Return=hOut Type="text/html"

 

-----------------------------------------------------------------------------------

Live EdasCE Remote Manager

There is currently a live EdasCE system with an enhanced main page at IP address, 66.192.11.198.  Enter this IP address into the address line of your browser and you will see a Web-page for the EdasCE.The Remote Manager selection displays what is the default for the Remote Manager on the EdasCE.

NOTE!!!  All of the examples presented here use Applets. These Applets require JVM (Java Vitrual Machine) with Swing capability. On this page you can check to see if you have the Sun JVM installed on your computer.

The EdasCE itself must also have have applets installed.  The normal factory default files for the EdasCE do not include these files and must be installed on the EdasCE.

The two Demo's should be executed with caution.  They may or may not be functioning at any given time.  The 'Data Logger Demo' is almost always running, whereas the 'FFT Demo' may not.

The Tutorials section for WebDevice contains many good sample programs and explanations of how to develop WebDevice script.  Most samples are stactic in nature, meaning you need to press a button to update the WebDevice screen. Examples here will be dynamic in nature, meaning that the screens will automatically update as values change on the EdasCE modules that are  being monitored.

------------------------------------------------------------------------------------


Direct Links to the topics on this page:


EdasCE Remote Manager - Update Manager


Update Manager Selections.


The purpose of the Update Manager is to allow you to update the EdasCE with current drivers or files with a single command.

The EdasCE may require updating due to module type expansion or driver updates to the existing modules.  In the case of developing WebDevice script applications a set of applet files need to be added to the EdasCE. A set of Tutorials can also be added to your EdasCE system if desired.

Note!  Only one selection for update can be performed at a time.  If you  need to update, please first contact Techical Support at Intelligent Instrumentation to make sure the updates are current.


WebDevice Script Programming Samples

WebDevice applications will consist of multiple WedDevice scripts.  Primarily that will be a WebDevice script that runs in a continious loop that accesses the EdasCE Modules.  Another Webdevice script is used for viewing the results. In these examples, there is also WebDevice script that allows you to start and stop the application.

 

Important! All the sample programs presented here must be located in a specific folder on the EdasCE.

This main location is '\Storage Card\WebDevice\HTROOT\APPS'.  The folder 'APPS' does not exist when the unit is shipped from the factory, so it needs to be created.

Each sample program for a particular EdasCE module is also placed in its own folder upder the 'APPS' folder.

For example, the WebDevice example files for the Edas-2002M-1 module will need to be placed in a '2002' folder under 'APPs'.


2002_in_out_bit.ZIP

5.3 kB


WebDevice Programming Sample Explained

The following is a detailed explanation of the methodology used in the first sample program. This same pattern is used in the remaining examples.

This first example demonstrates writing WebDevice Script for the Edas-2002M-1, Digital I/O module.

The Edas-2002M-1 is a very versatile digital I/O module in that it can access its 8 digital inputs and 4 digital outputs as pure High/Low lines, or can be programed for different conditions.  For instance, a digital input can be programmed to be a counter input, or a digital output can be configured to generate a squarewave.



The complete WebDevice application really consists of five(5) WebDevice script(.WDS) files.


in_out_bit_indx.wds -  This is the starting point in starting the whole application.  This is pretty much a one time shot program.  Only when you first start the program will this script run.

Pressing 'Start' in the 'in_out_bit_indx.wds' script menu runs the WebDevice script called 'in_out_bit_apps.wds', which continuously loops and runs a slightly more sophisiticated display script called 'in_out_bit_apps_indx.wds'.  This script allows you to stop the 'in_out_bit_apps.wds' script or 'View' the data, which is done by executing the WebDevice script called 'in_out_bit_current.wds'.

in_out_bit_apps_indx.wds - This WebDevice script menu is displayed after you 'Start' the application from the 'in_out_bits_indx.wds' WebDevice Script.  The Web Device script allows you to stop the "in_out_bit_apps.wds' script or go to the viewing script called 'in_out_current.wds'.

in_out_bit_apps.wds - This is the heart of the application.  Within this WebDevice script, the location of the Edas-2002M-1 is determined, the module is initialized, outputs are force to a specific state, and inputs are checked as to their high or low status.  The Webdevice script interfaces with the 'in_out_bit_current.wds' WebDevice script.

in_out_bits_current.wds - This WebDevice script is the viewing portion of the application.  The script displays the state of the Digital Inputs and allows manipulation of the states of the digital outputs.

isScriptRunning.wds - This is a commonly called WebDevice script, used to see if a particular WebDevice script is currently running.



Displayed when in_out_bit_indx.wds is executed.


in_out_bit_apps_indx.wds -  With this being displayed, the script that runs in a continuous loop called in_out_bit_apps.wds' has been started.  You now have the option to stop the in_out_bit_apps.wds' script or select the "View Edas-2002M-1 real-time digital I/O access".  This executes the script called 'in_out_bit_current.wds', which displays the real time data.



Displayed when in_out_bit_indx.wds is executed.


Now how do you know that the 'in_out_bit_apps.wds' script is really running?

Probably one of the hardest things to do with WebDevice script is trying to debug the code. In most cases you get no error indication, things just don't run.

The way you can know if the 'in_out_bit_apps.wds' script is really running is by monitoring the Serial port on the EdasCE CPU module with Hyperterminal.  The 'in_out_bit_apps.wds' script sends serial messages out the COM port and you will see them displayed in the Hyperterminal display screen .



Data sent out the serial port on the CPU unit when the "in_out_bit_apps.wds' script is really running.


in_out_bit_current.wds - Selecting the "View Edas2002M-1 real-time digital I/O access" will display the "Edas-2002M-1 Digital I/O Web Device Demo Applet. This Script shows the state of the digital inputs and allows you to manipulate the state of the digital outputs.

Note! - Once the 'in_out_bit_apps.wds' is running, others can just run the 'in_out_bit_current.wds' script from their browsers and view the same data.

 



Real Time DataView of WebDevice Script for the Edas-2002M-1.


2002_in_out_combo.ZIP

7.1 kB


2002_in_out_combo.zip demonstrates and shows how to configure the Edas-2002M-1 for individual bit charateristics.




Real Time DataView of WebDevice Script for the Edas-2002M-1.


WebDevice_2003.ZIP

This example will read all 16 analog channels and display the voltage values of the 16 analog inputs. It also displays one of those values on a chart and Meter.

5.5 kB





Real Time DataView of WebDevice Script for the Edas-2003M-1.


2003_database.ZIP

This sample saves analog data into a ODBC compliant database.

25 kB




Real Time DataView of WebDevice Script for the Edas-2003M-1.


Webdevice_2004.ZIP

In this example the Edas2004M-1 is configured to read its 16 digital inputs.

4.7 kB




Real Time DataView of WebDevice Script for the Edas-2004M-1.


Webdevice_2005M.ZIP

This example illistrates the use of WebDevice scripts to access a Edas-2005M-1 Digital Output module.

5.8 kB




Real Time DataView of WebDevice Script for the Edas-2005M-1.


WebDevice_2006.ZIP

This example illistrates the use of WebDevice scripts to access a Edas-2006M-1 Analog Output module.

4.8 kB




Real Time DataView of WebDevice Script for the Edas-2006M-1.


edasce_2010.ZIP

This example illistrates the use of WebDevice scripts to access a Edas-2010M-1 Digital Output module.

151 kB




Real Time DataView of WebDevice Script for the Edas-2010M-1.


edasce_2011.ZIP

This example illistrates the use of WebDevice scripts to access a Edas-2011M-1 Digital Output module.

146 kB




Real Time DataView of WebDevice Script for the Edas-2011M-1.


WebDevice_Message.ZIP

This example illistrates the use of WebDevice script to send messages. In this case no EdasCE modules are involved. Messages can be passed and displayed,

28 kB



Messages get instantly displayed on everyone screen running this WebDevice Script application

Subscribe to our newletter:
Your name:
Email:
 Edit your data






factoryviewcom pageid775
factoryviewcomdate20120211
factoryviewcommonth201202
English

1