Saving programs chapter 3 – Remote Processing RPC-2300 User Manual

Page 10

Advertising
background image

SAVING PROGRAMS

CHAPTER 3

Page 8

RPC-2300

Figure 3-1 Autorun jumper

INTRODUCTION

P r o gr a m s a r e st or e d in s oc k et U 3. A n o pt io n al r ea l t im e
clock mo dule, a DS-12 16EM may also b e installed in
U3. See Chapter 7 for calendar/clock installation and
operation.

You can store one program up to a maximum size of
about 28K bytes. A general rule to determine program
storage requirements is one line requires 40 bytes. 28K
bytes would store over 700 lines of code. Your
application could be significantly mor e or less,
depending upon the number of commands / line,
comments, and print statements. Another indication of
program size is to use the file length as saved on a PC
disk.

Despite the fact you may have 128K or 512K RAM
installed, the maximum progr am size CAMBASIC II can
run is about 28K (leaving room for variable storage).
Only one program can be stored on the EPROM.
Program s cannot be chained.

A flash EPROM is non-volatile (retaining data even
when power is disconnected), having an unlimited
numbe r of re ad cycles an d a limited nu mber of write
cycles (about 1,000). A program is not run fr om
EPROM . It is transferred to RAM and run from there.
Programs in RAM are run and can be modified. They
can be saved to EPROM for auto execution later.

The SBS-2300 can be set to autorun on power up or reset
by installing a jumper (W 1[9-10]). When autor un is on,
the program in EP ROM is loaded into RAM and begins
to execute immediately.

The EP ROM is write-protected w ith a software lock, so
accidental writes on pow er-on or -off are almost
impossible. You cannot disable the lock except when
executing the SAVE comma nd. T o save param eters,
you must use battery backed RAM.

SAVING A PROGRAM

To save a program, set jumper W1[9-10]. You may set
the jumpe r even if the power is on. R emem ber to
discharge any static electricity before installing or
removing the jumper. For this example, assume you
w a n te d to s av e th e fo ll ow i ng p r og r a m :

10 FOR N = 0 TO 2
20 PRINT "Hello ";
30 NEXT
40 PRINT

If this progr am is not alr eady in, type it in now (o r, if
you prefer, use your own progr am).

Type in the following command:

SAVE

CAM BASIC II will compile the program, program the
EPR OM, and verify its contents.

Compile...Write...Verify

The time it takes to do all of this depends upon the
length and co mplexity of the progr am. Gener ally, it w ill
be from 1 to 20 second s. T he read y prom pt (> ) will
appear when the p rogr am has b een succes sfully saved to
the EPROM . If the program does not write to the
EPROM, an error message will appear:

Fail @ xxxx

Saving a pr ogram overw rites the pr evious one. Ther e is
no way to recover it since both occupy the same space.

AUTORUNNING

Advertising