5 web content - dynamic data, 1 static html files, 1 reg parameter – ocs register read reference – Horner APG XL4 OCS HE-ETN300 User Manual

Page 73: Web content - dynamic data, Static html files, Reg parameter – ocs register read reference

Advertising
background image

SUP0740-07

CH.11

11/30/2009

Page 73 of 98

# 958

consist of up to 8 characters, followed by an optional dot, and an optional extension with up to 3
characters.

Web content files can be stored into the OCS file system media (such as Compact Flash / Micro
SD), by temporarily plugging the media into a PC with an installed card reader, or via Ethernet
using FTP (File Transfer Protocol). See Chapter 10 for information on using the Ethernet Module
FTP Server.

To keep the web content files organized, multiple files, directories and subdirectories can be
created on the OCS file system media as desired. Normally, it is a good practice to store an
index.htm file in the root directory as a “home page”, but this is not required.

11.5

Web Content - Dynamic Data


An OCS HTML file is either static or dynamic. The application engineer creates a static HTML file
and stores it on the OCS file system media. As a result of special markups in the static HTML file,
the HTTP Server creates dynamic HTML files to access OCS Registers. This technique allows a
static HTML file to read and write OCS registers dynamically.

11.5.1 Static

Html

Files


Custom HTML files are created to suit the application. These files can be created with a simple
text editor or by using a 3

rd

party HTML Editor.


Within the static HTML file, <iframe> and <form> tags respectively read and write OCS Register
data, by referencing two specially named dynamic HTML files (readreg.htm and writereg.htm).

11.5.2 Dynamic Html Files – Reading OCS Register Data (readreg.htm)


OCS Register data is read by placing an <iframe> tag, that references readreg.htm, within a
static HTML file. The following example <iframe> tag reads and displays OCS Register %R11 as
an Unsigned Integer every two seconds:

<iframe src="readreg.htm;reg–R11;fmt–UINT;rfs–2"></iframe>


The required src attribute is a quoted string containing the readreg.htm reference and two or
three parameters, all separated by semicolons. The reg, fmt and rfs parameters specify the OCS
Register to read, the display format to use and optionally how often to refresh the data. These
parameters are described in more detail in the following 3 sections:

11.5.2.1

REG PARAMETER – OCS REGISTER READ REFERENCE


Examples: reg–R11
reg–R11.3
The required reg parameter is followed by a dash and an OCS Register reference. Register
reference numbers start at 1 and the maximum depends on the register type and Ethernet
Module type, as show in the following table:

Table 11.1 – OCS Register Read References

OCS Register Type

Maximum Reference

(ETN200)

Maximum Reference

(ETN300)

¾ %R

R2048

R9999

¾

%AI, %AQ

AI512, AQ512

AI512, AQ512

%I, %Q, %M, %T

I2048, Q2048, M2048, T2048

I2048, Q2048, M2048, T2048

%S S16

S16

Advertising
This manual is related to the following products: