multi slot programming
Tobias
Posts: 95
·I've been reading multiple articles on trying to convert my bs2 program to bs2e, I kinda know about the run command and that you only have to insert your constants in the first program, and I don't know how to insert and program in the first or second slot? Any information will be very helpful.
Thank-You
Toby
Thank-You
Toby
Comments
Look in the PBasic help under $Stamp, it will explain how to do
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv87.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I read what Rick advised, but still can't make it work.
Your input will be greatly appreciated.
Thanks Toby
Toby
It appears you haven't read about, or fail to understand the purpose of the $STAMP compiler directive. Here is an explanation below·from the PBASIC Help File. It also can be found in the PBASIC Stamp Manual. The part pertaining to multi-slot programming is highlighted in RED.
quote
$STAMP
The $STAMP directive is a special compiler command that must be included (usually near the top) in a program to indicate the model of BASIC Stamp targeted. The line below is an example of the $STAMP directive (in this case, it indicates that the program is intended for a BASIC Stamp 2):
' {$STAMP BS2}
This line should be entered into your code, usually near the top, on a line by itself. Note that the directive appears on a comment line (the apostrophe (') indicates this) for compatibility with the DOS versions of the editor.
The 'BS2' in the example above should be changed to indicate the appropriate model of the BASIC Stamp you are using. For example, to use another BASIC Stamp module, enter one (just one) of the following lines into program:
' {$STAMP BS1}
' {$STAMP BS2}
' {$STAMP BS2e}
' {$STAMP BS2sx}
' {$STAMP BS2p}
' {$STAMP BS2pe}
' {$STAMP BS2px}
The directive itself must be enclosed in braces, {...}. There should not be any spaces between the dollar sign, $, and the word STAMP, however, the directive may contain additional spaces in certain other areas. Buttons on the editor tool bar simplify adding or changing the $STAMP directive.
The $STAMP directive is read and acted upon by the BASIC Stamp Windows Editor any time a source code file is loaded, tokenized, downloaded (run), or viewed in the Memory Map.
For BS2e, BS2sx, BS2p, BS2pe, and BS2px programs, each editor page can be a separate project, or part of a single project. A project is a set of up to eight files that should all be downloaded to the BASIC Stamp for a single application. Each of the files within the project is downloaded into a separate "program slot". Only the BASIC Stamp 2e, 2sx, 2p, 2pe, and 2px modules support projects (multiple program slots).
For BASIC Stamp projects (consisting of multiple programs), the $STAMP directive has an option to specify additional filenames. The syntax below demonstrates this form of the $STAMP directive:
' {$STAMP BS2e, file2, file3, ..., file8}
Use this form of the $STAMP directive if a project, consisting of multiple files, is desired. This directive must be entered into the first program (to be downloaded into program slot 0) and not in any of the other files in the project. The file2, file3, etc. items should be the actual name (and optionally the path) of the other files in the project. File2 refers to the program that should be downloaded into program slot 1, file3 is the program that should be downloaded into program slot 2, etc. If no path is given, the path of program 0 (the program in which the $STAMP directive is entered) is used.
Up to seven filenames can be included, bringing the total to eight files in the project all together. Upon tokenizing, running or viewing program 0 in the Memory Map, the editor will read the $STAMP directive, determine if the indicated files exist, will load them if necessary and change their captions to indicate the project they belong to and their associated program number. After the directive is tokenized properly, and all associated files are labeled properly, tokenizing, running or viewing any program in the Memory Map will result in that program’s entire project being tokenized, downloaded or viewed.
end quote
Regards,
Bruce Bates
For example, if you were building a project with a BS2sx that counted fish as they swam by...
The main program could be named "FishCntrSlot0".
And on the first line of FishCntrSlot0 you would need to have the directive:
'{$STAMP BS2sx,FishCntrSlot1,FishCntrSlot2,FishCntrSlot3,FishCntrSlot4,FishCntrSlot5,FishCntrSlot6,FishCntrSlot7}
This directive tells the compiler where to find the programs for the OTHER seven slots.
The programs for the OTHER slots would be named:
"FishCntrSlot1"
"FishCntrSlot2"
"FishCntrSlot3"
etc.
The first line in the Slot 1-7 programs needs to be just:
'{$STAMP BS2sx}
In actuality, you can use any names for the programs in slots 1-7, but you need to list those EXACT names, in order, in the
directive in slot0.
Dave G