MDK-ARM Keil, MDK-ARM Datasheet - Page 90

KIT REALVIEW MCU DEVELOPMENT

MDK-ARM

Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Datasheets

Specifications of MDK-ARM

For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
90
Chapter 4. RL-TCPnet Introduction
Here we want to display temperature values held in a C array controlled by the
application code. We add a script command for each line of JavaScript that is
used to pass the graph coordinates. The fixed graph values are replaced by a %s
for the dynamic data. When the page is loaded, each script line will trigger the
cgi gateway function cgi_func(). A second user defined command is added for
each script line (a to l). Each time the script command triggers, the cgi_func() is
called and we enter case ’m’: of the switch statement. The ASCII value of the
second user defined character is read from the env[] array and we deduct
.
0x61
This converts from an ASCII character value to a binary value between 0 and 11.
This value is used as an index into the application data array (months[]). The
logged temperature data is then converted into an ASCII string. Finally, the
sprintf() command is used to replace the %s in the HTML code with the
application data value. The result is a graph that displays the dynamic data
logged by the application. Using this approach, you can see that web server
scripting commands in TCPnet allow you to pass dynamic application data to any
embedded object.
Exercise: JavaScript
This exercise demonstrates adding a JavaScript Graph object to a CGI page.
AJAX Support
Using the RL-TCPnet scripting language to pass dynamic data to JavaScript
objects allows you to easily build sophisticated html pages that utilize the
thousands of man hours of development that has gone into many web browsers.
However, there are disadvantages if you are trying to display frequently changing
data. An easy solution is for the user to press the browser’s refresh button or you
can add a refresh tag to the <head> section of the HTML code.
<meta http-equiv = "refresh" content="600">
While this works, it is not very satisfactory for two reasons. First, this causes the
whole page to reload, what causes screen flicker and thus is not very satisfactory
for the user. Second, the browser has to download the whole page again, which
is slow and consumes bandwidth. The solution to this problem is to use a group
of interrelated web development techniques called “Asynchronous JavaScript and
XML” or Ajax for short. For our purposes, Ajax is used to isolate the dynamic
data within a group of XML tags. This data is then sent to the browser at an
update rate defined within the html page. This means that the dynamic
application data is sent in a single TCP packet providing a very fast update rate

Related parts for MDK-ARM