Prog2 – Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 143

Advertising
background image

Chapter
Commands

10

10 -13

Important: Before you attempt to program an EEPROM, read the PROG,
PROG1, PROG2, and MODE sections of this chapter. Also see CALL 78
(page 13 -8). If you have already used a PROG1, PROG2 supercedes it.

Note, the PROG2 command does not transfer the RAM program to
EEPROM. The PROG2 command enables the first program in EEPROM
to be run at each power up. The PROG2 command is the same as the
PROG1 command except the module immediately begins executing the
first program stored in the resident EEPROM instead of signing on and
entering the Command mode.

Use the PROG2 command to program the resident EEPROM with port
information for all three ports as well as store MTOP (page 9 -18)
information. At module power up, the BASIC module reads this
information and initializes MTOP and all three serial ports. The module
immediately begins executing the program stored in RAM. Otherwise, if
there is not a program in RAM, it executes the first program stored in the
EEPROM. Re-program by changing the appropriate port or MTOP
information, then execute PROG2 again.

You can use the PROG2 command to RUN (page 10 -19) a program on
power up without connecting to a console. Once you use PROG2 (and JW4
is not in the default position (page 1 -6)), the module powers up and
executes a RUN command if a program is in RAM. If there is not a
program in RAM, but there is a program in ROM, the module powers up
and executes a RROM command. If there is not a program in RAM or
ROM, the module powers up in the Command mode. This feature also
allows you to write a special initialization sequence in BASIC and generate
a custom sign-on message for specific applications. PROG2 does not alter
the first program in the memory module.

Important: The PROG2 command does not cause the BASIC module to
RUN at power up if PRT1 default communications are selected via JW4
(page 1 -6).

Important: PROG2 only executes ROM1 if no program is in RAM.

The flowchart on page 10 -14 shows the BASIC module operation from a
power-up condition using PROG1 and PROG2, or battery backed RAM.

Syntax

PROG2

Return

Example

READY

>PROG2

PROGRAMMING SEQUENCE WAS SUCCESSFUL

PROG2

Advertising