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

Page 8

Advertising
background image

SETUP AND OPERATION

CHAPTER 2

Page 6

RPC-2300

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:

'Check VAT temperature

'Read the output from the RTD and
' calculate the temperature

2200 a = ain(0) :'Get temp

The first 3 comments downloaded to the SBS-2300
would be ignored. Similarly, the empty lines between
comm ents are a lso ignored . L ine 2200, with its
comment, is a part of the program and could be listed.
The m ajor pena lty by wr iting a progr am this w ay is
increased download time.

NOTE: Some versions of PC SmartLINK may
optionally strip comments before downloading. Check
your manual to see if this option is available.

Notice that you can w rite a progr am in lower case
characters. CA MBASIC II 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. Adding NEW ensures that these lines
are gon e. D ownloadin g time is incr eased wh en 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.

W h e n r e p la c in g a p r o gr a m or s ec t io n , do w n lo a di ng ti m e
is increased. Blocks of line numbers cannot be
renumber ed by CAM BASIC II when other parts of the
program are installed. However , if a particular section
is the only program downloaded, then line renumbering
in that range is possible. Refer to the CAM BASIC II
RENU M comm and.

CAM BASIC II automatically formats a line for
minimum code space and increased r eadability. For
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 initially displayed but not stored. The
following line:

10 for a = 0 to 5

would be compressed and displayed as in the second
example above. Spaces ar e removed.

The CAMBA SIC II Programming Manual has more
information about increasing program speed and editing
options.

Instead of uploading and downloading programs, you can
save them to the on car d flash EP ROM . T his is useful if
you are using a terminal to write programs. Make sure
the 'A UTORU N' jumper is installed (See Chapter 3
S A V IN G P R O GR A M S
). To prevent automatic program
execution on power up, inser t the STOP statement at the
beginning of the program (such as line 1). When you
power up the SBS-2300 , the progr am is tra nsferr ed into
RAM and executed. Delete the progr am line with the
STOP statement to normally start programs. When
saving programs, be sure to reenter the STOP statement
with its line number.

WHERE TO GO FROM HERE

If you want to do this:

Turn to
Chapter

Save a program

3

A u to r u n a p r og r a m

3

Know m ore abo ut serial por ts

4

Install a differ ent RAM mem ory chip

5

Battery backing up RAM

5

Using RAM to save variables

5

Configure digital I/O lines

6

Get switch status

6

Use high c urre nt outputs

6

Connect an external opto rack

6

Installing calend ar/ clock mo dule

7

A n al og I/ O

8

Keypad port

9

Watchdog timer

11

Also, r efer to the table of contents for a listing of major
functions.

Advertising