Setup and operation chapter 2, Where to go from here – Remote Processing RPC-52 User Manual

Page 8

Advertising
background image

SETUP AND OPERATION

CHAPTER 2

Page 6

Editing programs and program ming hints

Files uploaded or downloaded are simply ASCII DOS
text files. No special characters or control codes are
used. You m ay create and edit programs using your
favorite word processor or editor. Just be sure to save
files in DO S text form at.

A technique used to further program documentation and
reduce code space is the use of comments in a
downloaded file. For example, you could have the
following in a file written on your editor:

REM Check position

REM Read output from the pot and
REM calculate the position

2200 a = ain(0) :REM Get position

The first 3 comments downloaded to the RPC -52
are ignored. Similarly, the empty lines between
comm ents are ign ored. Line 2200 , w ith its comm ent, is
a part of the program and could be listed. T he major
penalty by writing a program this way is increased
download time.

NOTE: Some versions of PC SmartLINK may

optionally strip comments before downloading.
Check your m anual to see if this op tion is
available.

Notice that you can w rite a progr am in lower case
characters. RPBASIC-52 translates them to upper case.

Some program mers put "N EW" as the first line in the
file. During debugging, it is common to insert
"temporary" lines. This ensures that these lines are
gone. Down loading time is increase d when the old
progr am is still pre sent.
If you like to write programs in separate modules, you
can download them separately. M odules are assigned
b lo c ks o f l in e nu m b er s . S ta r t u p co d e m i gh t b e fr o m 1
to 999. Interrupt handling (keypad, serial ports) might
be from lines 1000 to 1499. Display output might be
from 1500 to 2500. The program mer m ust determine
the number of lines required for each section.

RPBASIC-52 autom atically formats a line for minimum
code space. F or example, you could download the
following line of code:

10 fora= 0to5

When you listed this line, it would appear as:

10 FOR A=0 TO 5

Spaces are displayed but not stored. The following line:

10 for a = 0 to 5

will be compressed and displayed as in the second
example above. Spaces are removed. H owever, spaces
as part of a remark or PRINT are not removed.

Instead of uploading and downloading programs, you can
save them to the on card EEP ROM . This is useful if you
are using a terminal to write program s. Simply type
S A V E . T o r e tr i ev e a p r o gr a m , t yp e L OA D .

WHERE TO GO FROM HERE

If you want to do this:

Turn to
Chapter

Save a program

3

Run a program at power up or

reset (autorun)

3

Know m ore abo ut serial por ts

4

Install a differ ent RAM mem ory chip

5

Using RAM to save variables

5

Run an assembly language program

5

Configure digital I/O lines

6

Detect on/off switch status

6

Use high c urre nt outputs

6

Use on board opto rack

6

Connect an external opto rack

6

Lear n to use G5 m odule

6

Use the calendar/clock

7

Displays

8

Keypad

9

A n al og I/ O

10

Refer to the table of contents for a more detailed listing.

Advertising