ProSoft Technology MVI56-BAS User Manual
Page 51

MVI56-BAS ♦ ControlLogix Platform
Using the Program Port (PRT1)
BASIC Module (DB/BAS Compatible)
User Manual
ProSoft Technology, Inc.
Page 51 of 234
December 13, 2011
5.4
Permanently Saving BASIC Programs
There are two ways to permanently save a BASIC program. The first method has
already been shown. When you type the program into the module, it is
permanently saved to a file on the Compact Flash drive called "XRAM.BAS". If
you want to save more than one program, you can use the PROG command.
Refer to the Using ROM Storage section for more information. The PROG
command copies the program from the "XRAM.BAS" file to another file called
"EPROM.BAS". The "EPROM.BAS" file differs from the "XRAM.BAS" file in two
important points. First, up to 255 programs can be saved in "EPROM.BAS". The
programs are stored as ROM 1, ROM 2 , ROM 3, and so on. Second, you cannot
modify a program stored in "EPROM.BAS". All you can do is ERASE the last
program stored in "EPROM.BAS".
5.4.1 EPROM File Storage
When you want to store a XRAM program in EPROM, you type the PROG
command. The programs are stored sequentially starting with ROM 1.
Executing a Program in EPROM
If you want to execute a program in EPROM, use the ROM command. ROM
without a number moves the BASIC pointer to point to ROM 1. If you want to
select another program stored in EPROM, type ROM followed by the number of
the program you wish to execute.
Note that the ROM command only changes the BASIC program pointer. It does
not automatically execute the program. You can use the RUN command to
execute the program.
If you want to select another EPROM program and execute that program, you
can use the RROM (RUN ROM) command followed by the number of EPROM
program you wish to execute (that is, RROM 3).
5.4.2 Erasing EPROM Programs
If you want to remove EPROM programs, you can use the ERASE command.
The ERASE command removes the last program in EPROM. You cannot remove
a program at the beginning or in the middle of the EPROM programs.
5.4.3 Editing EPROM Programs
You cannot modify programs stored in EPROM. If you must modify a program in
EPROM, you can use ROM to change the pointer to the program that needs
modification. Then you can XFER that program to XRAM. Then you change the
BASIC program pointer back to XRAM using the RAM command. Now the
program has been moved to XRAM, and the BASIC pointer is pointing to XRAM,
so the program can be edited.