Example Initializing Internal RAM

The main goal of this example is to show how to use an include file to initialize Internal RAM variables. For a detailed description of Internal RAM variables, see the Internal RAM documentation. This example uses various numeric and string field widgets which display the values of different Internal RAM variables. Internal RAM variables can be initialized to defined values by including an initialization file via a META tag in the HTML page. Here is a snapshot of what the HTML page looks like in a "WYSIWYG" tool:


Figure 1.

Figure 1 has one META tag which instructs the HTMLCompiler to use an initialization file named initInternalRAM.ini. The META tag syntax is as follows:

<META NAME="initInternalRAM" SRC="filename.ini">

The initialization file, filename, must have a .ini extension and it must be located in the same directory as your main html page. Inside the initialization file, any line preceded with // is treated as a comment. All initializations must be located in the far left column, so do not tab over.

The initialization file named initInternalRAM.ini is composed of the following text:

//Block Fill Initializations
InternalRAM.byte(1-2) = 127
InternalRAM.word(3-4) = 32768
InternalRAM.string(110-111) = "The cat in the hat"

//Byte Initializations
InternalRAM.byte(0) = 16
InternalRAM.byte(127) = 120
InternalRAM.byte(255) = 180

//Word Initializations
InternalRAM.word(01)   = 255
InternalRAM.word(200) = 512
InternalRAM.word(235) = 65535

//String Initializations
InternalRAM.string(2)     = "Amulet Technologies, LLC"
InternalRAM.string(100) = "www.AmuletTechnologies.com"
InternalRAM.string(198) = "Hello, World!"

Simply add the comment characters (//) to the beginning of a line to add a comment to the initialization file. Notice that all variable numbers and values in initInternalRAM.ini are specified in decimal format. To use the hexadecimal format, be sure to precede the value with "0x". For example, use the following syntax to initialize Internal RAM byte variable 254 to a value of 127 in decimal format:

InternalRAM.byte(254) = 127

The equivalent initialization, but in hexadecimal format is as follows:

InternalRAM.byte(0xFE) = 0x7F

To see how easy it is to initialize Internal RAM variables in an include file, try editing some of the variable values in the initInternalRAM.ini file in a text editor. Better yet, try adding a new Internal RAM variable initialization. Reference the Internal RAM documentation for more info regarding the syntax to use when initializing Internal RAM variables. Be sure to save any changes you make to the initialization file. Don't forget to either edit one of the existing widgets or add a new widget in CompileMe.htm which references the newly initialized Internal RAM variable. Then, use the HTMLCompiler to recompile CompileMe.htm and program the HTML page into the Easy GUI module.

NOTES:



Amulet HTMLCompiler,
Copyright © 2000-2004 by
Amulet Technologies, LLC

Back to Welcome - Contact Amulet - Amulet Home