Sei sulla pagina 1di 16

What’s New in Stampw.

exe
Contents:
Purpose:................................................................................................................................................................... 1
Integrated Explorer: ................................................................................................................................................ 1
Editor Pane:............................................................................................................................................................. 2
Identify Function:.................................................................................................................................................... 3
Download Function:................................................................................................................................................ 4
Directive Menu and Buttons: .................................................................................................................................. 6
BASIC Stamp 2pe Support: .................................................................................................................................... 6
Generate Object Code:............................................................................................................................................ 6
On-Line Help: ......................................................................................................................................................... 8
Tip-of-the-Day: ....................................................................................................................................................... 8
Open From… and Save To… : ............................................................................................................................... 8
Command-Line Options: ........................................................................................................................................ 8
File Associations:.................................................................................................................................................... 8
Default Stamp Directories / Source Code Examples: ............................................................................................. 9
PBASIC Directive:.................................................................................................................................................. 9
Port Directive:....................................................................................................................................................... 10
Stampw.exe Command-Line Options: .................................................................................................................. 10
Additional Command-Line Details:.................................................................................................................. 11
About the /PIPE Switch: ................................................................................................................................... 11
Stamp Editor Messages:........................................................................................................................................ 12
Final and Intermediate Messages:..................................................................................................................... 12
List Of Messages:.............................................................................................................................................. 13

Purpose:
This document contains new information about BASIC Stamp Editor v1.33 and v2.0 that is not shown in the BASIC Stamp
manual v2.0.

Integrated Explorer: (v2.0)


The BASIC Stamp Editor now includes an integrated explorer. The integrated explorer works in a similar fashion to
Windows Explorer.

The upper portion of the integrated explorer is the Recent list. The Recent list is a drop-down list of default, favorite and
recently visited directories. If you select a directory from the Recent list, the integrated explorer will automatically navigate
to that directory. The button to the left of the Recent list allows you to limit the Directory list display to only the directories
that are in the Recent list (effectively hiding any drives and directories that are not in your Recent list). The Recent list
button behaves like a toggle switch; 1) selecting it switches to the “Show recent folders only” mode, 2) selecting it again
switches back to the “Show all folders” mode.

The Directory list, right below the Recent list, is similar to the “Folders panel” in Windows explorer. The Directory list
displays drives and directories in a hierarchical tree fashion. If a directory is selected, the Folders list displays the files in
that directory.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 1
The Folders list, below the Directory list, displays all the files in the selected directory that match the selected filter (in the
Filters list). You can select one or more files from this list and double-click, or drag-and-drop them over the edit panel, to
open those files.

The Filters list, at the bottom, is a drop-down list of file extension filters to apply to the Files list. It works just like the
“Save as type:” field of a standard open or save dialog.

Multi-file
Integrated editor with
Explorer syntax
Panel highlighting

The integrated explorer window can be resized via the vertical splitter bar that separates it and the edit pane. The
Directory list and File list can be resized via the horizontal splitter bar that separates them. The integrated explorer can
also be hidden or shown via the Explorer toolbar button, by pressing Ctrl-E or by resizing it to zero size via the vertical
splitter bar.

Editor Pane: (v2.0)


The editor pane now displays BASIC Stamp source code files with syntax highlighting. Syntax highlighting applies
designated colors and designated character case (upper, lower, etc) to reserved words in the PBASIC language. The
syntax highlighting settings can be changed or customized via the Preferences -> Editor Appearance tab.

Each editor pane can be individually split into two views of the same source code. This can be done via the Split button
on the toolbar, pressing Ctrl-L, or clicking and dragging the top or bottom border of the editor pane with the mouse. Once
split, the top and bottom edit controls allow viewing of different areas of the same source code; this can be handy when
needing to keep variable declarations or a particular routine in view while modifying a related section of code elsewhere.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 2
Automatic line
numbering.
(optional). Split edit pane;
allows viewing
two sections of
same source
program.

Bookmarks;
provide quick Syntax
navigation to highlighting;
important Provides easy
sections of distinction of
code. reserved
words and
code with
special
meaning.

Automatic line numbers can be enabled or disabled via the “Show Line Numbers” checkbox on the Preferences -> Editor
Appearance window. Line numbers, when enabled, appear in the gutter (gray area on the left of the editor pane).

Bookmarks can be enabled or disabled via the “Show Bookmarks” checkbox on the Preferences -> Editor Appearance
window. Bookmarks are small numbered icons that appear in the gutter (gray area on the left of the editor pane).
Bookmarks provide a way to mark lines or sections of code that you need to quickly navigate to. You can define up to 9
bookmarks by clicking on the gutter where you want the bookmark placed or by pressing Ctrl-B when the caret is on the
desired line. You can navigate to any defined bookmark by pressing Ctrl-# (where # is the 1 though 9 keys) or by
selecting Go To Bookmark from the Edit menu.

Identify Function: (v1.33 and v2.0)


The Identify function has been completely rewritten. It will now identify what type, if any, BASIC Stamp is attached to any
available serial port. This information is displayed for the user to see, see below. The Identify function can be activated
by selecting Run -> Identify, pressing CTRL+I, or by pressing F6.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 3
The Port column shows the available serial ports (those that the Stamp Editor is trying to access). You can modify the
available COM Port List by clicking on the Edit Port List button.

The Device Type column shows the type of BASIC Stamp found on the respective port. For example, in the figure above,
the Stamp Editor found a BASIC Stamp 2e on COM port 2 and a BASIC Stamp 2 on COM port 3. There were no BASIC
Stamps found on COM port 4.

The Version column displays the firmware version number of the BASIC Stamp that was found.

The Loopback column indicates whether or not a loopback connection was found on the serial port. The loopback
connection is created by BASIC Stamp development boards, such as the Board of Education, across serial port pins 6
and 7 (of a DB9). A “Yes” in this column is an indication that the serial port and serial cable are properly connected to a
BASIC Stamp development board.

The Echo column indicates whether or not a communication echo was detected on the serial port’s transmit and receive
pins (pins 2 and 3). The BASIC Stamp module creates this echo naturally, even without power. A “Yes” in this column is
an indication that the serial port and serial cable are properly connected to a BASIC Stamp, and if using a BASIC Stamp
development board, it’s an indication that the BASIC Stamp is properly connected to the development board.

The Loopback and Echo columns are great for doing some simple connection diagnosis. For example, a Yes in both
columns indicates the serial port and serial cable are properly connected and that the BASIC Stamp is properly inserted
into its socket.

Loopback Echo Means


Yes Yes Serial port and serial cable properly connected. BASIC Stamp properly inserted into
socket. If no BASIC Stamp is detected, it is probably because the BASIC Stamp is not
connected to power. Other causes could be: 1) low battery, 2) Reset pin of BASIC Stamp
is connected to Vdd (it should be left disconnected), 3) the BASIC Stamp is damaged or
4) there is some other type of communication error (software or hardware).
Yes No Serial port and serial cable properly connected. BASIC Stamp improperly inserted into
socket (ie: inserted backwards or not inserted at all).
No Yes Serial port and serial cable may be improperly connected, or you may not be using a
standard BASIC Stamp development board. The Echo indicates there may be a BASIC
Stamp properly connected to the port (the Loopback is not required for successful
connection) or there may be another device connected to the serial port.
No No Serial port and serial cable are not properly connected, or not connected at all, to the
BASIC Stamp. Could also be an indication of a serial port hardware/software problem.

Download Function: (v1.33 and v2.0)


Like the Identify function, the Download function has been completely rewritten to provide more information and to help
guide you through the downloading process. The Download Progress screen looks similar to the Identify screen with the
exception of the additional Download Status area and the download indicator LED (to the left of the serial port and BASIC
Stamp that is being downloaded to). If any errors occur, such as communication failures or inability to detect a BASIC
Stamp, you will be prompted appropriately.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 4
One possible error is when the Stamp that your PBASIC program is targeting does not appear to be connected to the PC
(see figure below). This may be caused, for example, by opening up a BASIC Stamp 2 program (usually has a .bs2
extension) and trying to download it to a BASIC Stamp 2e module, instead. When this happens, you’ll be prompted with
something similar to the figure below.

This prompt allows you to quickly correct the situation by clicking on the BS2e (if you really intended to download to the
BS2e in the first place). Keep in mind that programs written for one BASIC Stamp model may not function properly on a
different BASIC Stamp module. Click on the More Info button for more detail. NOTE: If you select the BS2e button, as in
this example, the Stamp Editor will modify the $STAMP directive in the program, will notify you of this change and what it
means, and then will try to download to the BS2e.

Another possibility is having two or more of the same BASIC Stamp model connected to the PC. In this case, the Stamp
Editor will prompt you for clarification as to which BASIC Stamp module you want to download to.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 5
Directive Menu and Buttons: (v1.33 and v2.0)
The Directive Menu contains options for setting the Stamp Mode, PBASIC version and Port number. Toolbar buttons are
also provided for the Stamp Mode and PBASIC version number directives.

The “Stamp Mode” simply means, which BASIC Stamp model is the desired target for a particular PBASIC program. The
Stamp Directive (a special command inserted near the top of the PBASIC program) tells the BASIC Stamp editor which
BASIC Stamp the code is intended for. While the directive can be entered, or modified, manually, it can be tedious to
remember the syntax. For this reason a Directive menu and “Stamp Mode” buttons have been provided. Simply selecting
the desired menu item or clicking on the desired Stamp Mode button will cause the Stamp Editor to insert or modify the
Stamp Directive in you PBASIC program.

The Stamp Directive is required to be in each PBASIC program. The editor determines which Stamp to target for
downloading based on this directive. NOTE: Any code that is missing the Stamp Directive, but who's filename contains a
known Stamp extension (.bs2, bse, bsx, bsp) will be recognized by the extension and an appropriate Stamp Directive will
be added automatically for you.

The PBASIC version directive allows you to indicate which version of the PBASIC language to use. Currently the options
are 2.0 (the default) and 2.5. See the on-line help or “PBASIC Compiler 2.0 Beta 2.pdf” document for more information on
the enhanced v2.5 language syntax. The PBASIC directive is only required if you want to use version 2.5; version 2.0 is
assumed if no PBASIC directive exists in the source code. See “PBASIC Directive,” below for more information.

The PORT directive allows you to indicate which serial port to download the program on. This is convenient if you have
more than one BASIC Stamp of the same model connected to your computer at the same time; if each program indicates
a different port (using the PORT directive) then downloading won’t cause unnecessary on-screen prompts. See “Port
Directive,” below for more information.

BASIC Stamp 2pe Support: (v1.33 and v2.0)


This software contains integrated support for the latest BASIC Stamp Module, the BS2pe.

Generate Object Code: (v1.33 and v2.0)


The File menu now contains an item called Generate Object Code… Use this feature to tokenize a PBASIC program and
save it to a file in the tokenized form. This allows you to send your BASIC Stamp’s object code (the actual binary data
that is downloaded to the BASIC Stamp) to other people without having to reveal your PBASIC source code. If you have
customers using Stamp-based products, you can release firmware updates to them in this manner.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 6
Object code can be saved as a separate .obj file (downloadable with the StampLoader.exe program) or as a single
executable (integrated with the StampLoader.exe inside of it. The single executable method provides a simpler way to
pass your firmware update on to your customers.

The StampLoader.exe program is required for downloading separate .obj files.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 7
If you don’t have the StampLoader.exe program, it can be automatically generated for you by selecting the second output
file option, “Object Code and Stamp Loader”, in the Generate Object Code screen. Additionally, firmware, product,
company and related info can be embedded in the object code or single executable file for your customers to view before
downloading. See diagram below.

In the example above, we chose to generate a single executable with custom names and messages as shown. Then we
clicked the Generate… button (which prompted us for a file name) and the file was created. When a user runs the file we
just generated, they see a screen similar to the figure below:

On-Line Help: (v1.33 and v2.0)


The Stamp Editor includes on-line help. The current on-line help contains the entire PBASIC syntax documentation. On-
line help will be updated in the near future to include additional BASIC Stamp information.

Context sensitive help (highlighting a word in editor and pressing F1 key) is also supported. On-line help can remain open
while using the Stamp Editor; simply press ALT+TAB to toggle back and forth between the Stamp Editor and on-line help.

NOTE: On-Line help requires Microsoft's HTML Help utility and Internet Explorer 4.0 or above (IE6.0 recommended). The
proper version of HTML Help is included with Windows 2000 and Windows XP. On other versions of Windows you may
have to install or upgrade your HTML Help utility to properly view the Stamp Editor’s on-line help. The HTML Help
upgrade program (hhupd.exe) is included as part of the BASIC Stamp Editor setup program. You can download the latest
version of Internet Explorer from Microsoft’s web site at: http://www.microsoft.com/ie

Tip-of-the-Day: (v1.33 and v2.0)


A Tip-of-the-Day feature is included and can be configured to automatically open at startup or is viewable at any time from
the Help menu. The tips are contained in the Stamp_Tips.txt file in an easy to use format. You can add your own tips as
long as you follow the simple rules described at the top of the Stamp_Tips.txt file.

Open From… and Save To… : (v1.33 and v2.0)


Two new methods exist for opening and saving PBASIC source code, Open From... and Save To... These features allow
quick access to any directory from the default and favorite directories (set within Preferences) or the list of recently used
directories. If you organize your files in many different directories, the Open From and Save To features can be very
helpful.

Shortcut keys CTRL+SHFT+O and CTRL+SHFT+S activate the Open From and Save To feature, respectively.

Command-Line Options: (v1.33 and v2.0)


The Stamp Editor supports new command-line options (switches): /COM#, /ReadOnly, /Tokenize, /Identify, /Download,
/Updates, /NoDebug, /NoPrompts and /Pipe. See the "Command-Line Options" section for more information.

File Associations: (v1.33 and v2.0)


The Stamp Editor automatically associates BASIC Stamp source code file types (.BS2, .BSE, .BSX, .BSP and .BPE) with
the BASIC Stamp editor. This feature can be configured through automatic prompts or through Preferences.

Also, when using any Explorer-shell for file browsing, right-clicking on a BASIC Stamp source code file provides you with
an Open With Stamp Editor option.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 8
Default Stamp Directories / Source Code Examples: (v1.33 and v2.0)
Upon installation of the BASIC Stamp Editor software, the PBASIC source code examples from the BASIC Stamp manual
are copied to the installation folder. If the default installation folder is used, the source code files will be copied to the
C:\Program Files\Parallax Inc\Stamp Editor vx.xx\BS2, …BS2e, etc folders.

The Stamp Editor automatically sets it’s default directories (in Preferences) to point to these source code examples. This
makes them immediately available via the File -> Open From… menu.

Note that if you are upgrading from a previous version of the Stamp Editor and you have set your own default directories,
from the Edit -> Preferences, Editor Operations tab, they will not be replaced with the source code example directories;
upon opening the editor, only default directory options that are blank will be redirected to the source code examples.

PBASIC Directive: (v2.0)


The PBASIC directive ($PBASIC) has been added to indicate the version of the PBASIC language that the source code is
written in. They syntax of the PBASIC directive is below:

' { $PBASIC version }

where version is a valid PBASIC version number; 2.0 or 2.5.

See the on-line help or “PBASIC 2.5 Syntax.pdf” document for more information on the enhanced v2.5 language syntax.
The PBASIC directive is only required if you want to use version 2.5; version 2.0 is assumed if no PBASIC directive exists

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 9
in the source code. Note that the syntax highlighting feature of the Stamp editor will also adjust to the language version
indicated by the PBASIC directive.

Port Directive: (v1.33 and v2.0)


The Port directive ($PORT) has been added to allow directing a PBASIC program towards a specific serial port. The
syntax is as follows:

' { $PORT COM# }

where # is a valid port number. When any PBASIC program containing this directive is downloaded, all other ports will be
ignored. This directive is especially important if using two of the same BASIC Stamp models (such as two BS2s) on two
COM ports and you have two different PBASIC programs to download (one to each BS2). Without this directive,
developing and downloading in this case would be a tedious task of always answering the "which Stamp?" prompt.

The Port directive can be automatically inserted or modified by selecting the appropriate port from the Directive -> Port
menu. The COM ports listed in the Directive -> Port menu are automatically updated any time a change is made to the
exiting computer hardware or to the available ports list (in preferences).

Stampw.exe Command-Line Options: (v1.33 and v2.0)

The following is the syntax and description of the Stamp Editor’s command-line switches.

Stampw.exe {/Com#} {{/ReadOnly} source_file}


Stampw.exe {/Com#} /Download {/Updates} {/NoDebug} {/NoPrompts} source_file > output_file
Stampw.exe {/Com#} /Identify {/NoPrompts} > output_file
Stampw.exe /Tokenize source_file > output_file
Stampw.exe /Pipe master_file
Stampw.exe /Help

/Com# – Specify com port (serial port) to download to. # is a valid com port number. NOTE: must be one
word, ie: Com2 indicates com port 2.
/ReadOnly – Open source_file in read-only mode. The CTRL key acts as a download key when in read-only mode.
Requires source_file option. This command option is not available if double-piped communication is
established.
/Identify – Identify BASIC Stamp modules on COM ports. Requires redirection to output_file.
/Tokenize – Tokenize source code. No prompts will be displayed. Requires source_file option and redirection to
output_file.
/Download – Tokenize source code, and download it (if tokenization successful). Requires source_file option and
redirection to output_file.
/Updates – Provides program slot number (if applicable) and download-percentage-complete status updates
during download.
/NoDebug – No Debug Terminal opens after downloading (even if code contains DEBUGs) and COM port is
immediately closed after downloading. This option requires /Download switch. Note: This switch will
have no effect if Debug Terminal is already open from a previous operation.
/NoPrompts – No screen prompts at all (except for Debug Terminal). This option requires /Download switch.
/Pipe master_file – Start up master_file (must be .exe) and establish bi-directional communication pipes for master-
program-controlled execution. Stampw.exe remains open until master_file breaks pipe. This
command option is not available once double-piped communication is established.
/Help – Display command-line help. This command option is not available if double-piped communication is
established.

Note: If redirection to an output file is used with syntax #1, GUI prompts still appear and their text is copied to output_file
where applicable.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 10
Additional Command-Line Details: (v1.33 and v2.0)

The Stampw.exe program is a Win32 application that can be run through any normal method. It has special features
available by passing it command-line options (switches) shown above. While this program can be run from a command-
prompt on a Window system, it will not work on a DOS-only system.

The Stampw.exe supports redirection of its input and output via the standard pipe mechanisms. If its output is redirected
via the command-line (ex: Stampw.exe myfile.bs2 > Test1.txt) the designated output file, Test1.txt in this case, will be
created and various information about the processing of its object file will be stored there. This information directly
reflects the information available on the GUI prompts, interactions with the user and downloading status. This feature can
be combined with the /NoDebug and /NoPrompts switches for various levels of GUI interaction with the user.

About the /PIPE Switch: (v1.33 and v2.0)


The /PIPE switch is a special option that causes the Stamp Editor to create two pipes (for bi-directional communication),
start another program (that will act as a Master program) and establish a connection between itself and the master_file.
This option allows a developer to create software (the master_file) that controls the Stamp Editor’s actions. The
master_file program simply needs to write to its Standard Output and read from its Standard Input to communicate with
the Stamp Editor.

When the Stamp Editor is started with this option, after it creates the pipes and starts the master_file program, it then sits
quietly in the background waiting for commands from the master_file program. The available commands are exactly the
same as the normal command-line switches (with the exception that the /PIPE and /HELP switches are no longer
available).

Example #1:
If your master program is called Master.exe and you’d like it to make the Stamp Editor program tokenize the source file
called C:\Temp\MySource.bs2, do the following:

1. Issue the command-line: Stampw.exe /PIPE Master.exe


a. The Stampw.exe will start, create two pipes, start the Master.exe program, connect the two pipes to the
Master.exe program’s STDIN and STDOUT and then sit quietly in the background waiting for its first
command from the Master.exe program’s STDOUT.
2. Have your master program write the following to its STDOUT: /Tokenize C:\Temp\MySource.bs2
3. Have your master program read its STDIN and process the response messages that arrive from the Stamp Editor.

Example #2:
If you’d like the Stamp Editor program to download the same source file:

1. Issue the command-line: Stampw.exe /PIPE Master.exe


a. The Stampw.exe will start, create two pipes, start the Master.exe program, connect the two pipes to the
Master.exe program’s STDIN and STDOUT and then sit quietly in the background waiting for its first
command from the Master.exe program’s STDOUT.
2. Have your master program write the following to its STDOUT: /Download C:\Temp\MySource.bs2
3. Have your master program read its STDIN and process the response messages that arrive from the Stamp Editor.

Note #1: When used with the /PIPE switch, the Stampw.exe program will remain running (in the background) even after
successfully downloading (or performing any other command) and will await your next command, as if it was just started.
There are two exceptions to this: 1) A Fatal Error occurs; such as those caused by issuing invalid command-line switches,
or 2) the Master.exe program breaks its STDOUT pipe (by closing the STDOUT handle or simply terminating itself). See
the Stamp Editor Messages for more information.

Note #2: The Stampw.exe program responds via the master program’s STDIN using predefined messages. The
messages and their formats are shown in the Stamp Editor Messages section, below.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 11
Note #3: To allow a user to simply run your master program (rather than forcing them to enter the command-line
mentioned above), simply do the following in your master program immediately after starting up:
1. Create a PStartupInfo structure and fill it with a call to GetStartupInfo.
2. If the hStdInput field of the PstartupInfo structure = 0 then you know the user, not the Stamp Editor, started this
program…
a. Use the ShellExecute API call (or similar function) to start the Stamp Editor program with the following
command-line: Stampw.exe /PIPE /EditorMaster.exe (make sure to get the paths correct)
b. Terminate yourself (your instance with the invalid handles)
3. Otherwise, continue as normal (retrieve the valid Standard Input and Standard Output handles to communicate
with the Stamp Editor program).

A Delphi program and source code is available (called EditorMaster) that does this. This program should be located in the
C:\Program Files\Parallax Inc\Stamp Editor\Developer\EditorMaster. Even if you’re not familiar with Delphi, reading the
source code of the EditorMaster program can be helpful. There are only a few Windows API calls that are necessary to
accomplish this since the Stamp Editor takes care of all the complicated issues.

Stamp Editor Messages: (v1.33 and v2.0)


When the output of the Stamp Editor is piped (to a file or a master program) it displays all its messages in a specific,
predefined format. There are 3 types of messages: 1) Errors, 2) Events and 3) Information. Each type can contain a
number of different messages. The format of the piped output messages is:

Message Header (always first 9 characters) Message Text (unlimited length)


Character 1 Characters 2 - 5 Characters 6 – 9 Characters 10+
Start Of Header Message Type Message ID Message Text
SOH character ERR:, EVT: or INF: nnn- Text string indicating the nature of the
(ASCII value 1). meaning Error, ;where nnn is the message.
Event or Info, 3-digit unique ID of
respectively. the message.

For example, an Error-type message may appear as: ERR:001-Invalid command-line switch: switch_name
Note: The “ ” is the SOH character (ASCII 1) that appears at the start of every message.

This format works well for both computers and humans. The Message Type (ERR:, EVT: or INF:), Message ID (nnn-) and
Message Text is easily readable by humans when seen in a redirected output file. The Start Of Header is always the first
character of each new message, and the Message Type and ID can be easily parsed by most programming languages.
In addition, each of these fields begins at a specific character location in every message.

Final and Intermediate Messages:


The Message ID is a unique, 3-digit number. A program can quickly determine the nature of the message by its ID. The
ID indicates two things: 1) the actual meaning of the message (ie: errors, events, etc) and 2) the scope of the message
(ie: final or intermediate). The scope of the message indicates whether or not there are more messages to follow. A
“final” message (those with IDs less than 501) is the last message anyone should expect to receive from the Stamp Editor
until it is commanded to do another task. An “intermediate” message (those with IDs greater than 500) is NOT the last
message anyone should expect to receive from the Stamp Editor. This is particularly important when using pipes
since a call to read the pipe does not return until data is received (ie: if you go to read the pipe and the program
on the other side never sends any data, your program will be preempted (locked) indefinitely).

The Stamp Editor also sends the Final message with an EOT (End of Transmit, ASCII 4) character at the end of the
Message Text portion. Either the Message ID or the EOT character can be used to determine if there are more
messages to come.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 12
List Of Messages: (v1.33 and v2.0)
The following are all the possible messages, their types and IDs.

ERROR MESSAGES
FATAL ERRORS (failures that cause termination of Stamp Editor program, even when double-piped)
001 - Invalid command-line switch: 'SWITCH'
002 - Duplicate or Conflicting command-line switch: 'SWITCH'. This switch either: 1) appears more than once, or
2) is not allowed in combination with the switches appearing before it
003 - SWITCH switch not allowed while in Inter-Process Communication Pipe Mode.
004 - Duplicate command-line option: 'SWITCH'. Only one input filename (object_file or master_file) is allowed.
005 - Missing parameter required. REQUIREMENTS.
006 - Cannot create In-Pipe or Out-Pipe.
007 - Cannot create child process.
008-050 - (reserved)
SERIOUS ERRORS (failures that don't cause termination of Stamp Editor program (when double-piped))
~~~file related errors~~~
051 - File not found: 'FILENAME'.
052-100 - (reserved)
~~~tokenizer related errors~~~
Note: Errors 101 – 250 are in the format: PROGRAM=#:NAME START=R:C(CH) LENGTH=#
STATUS=ERRORMESSAGE ;where R = row number, C = column number, CH = character number and
ERRORMESSAGE is the text of the message, indicated below.
101 - Expected character(s)
102 - Expected terminating “
103 - Unrecognized character
104 - Expected hex digit
105 - Expected binary digit
106 - Symbol exceeds 32 characters
107 - Too many elements
108 - Constant exceeds 16 digits
109 - Constant exceeds 16 bits
110 - Undefined symbol
111 - Undefined label
112 - Expected a constant
113 - Cannot divide by 0
114 - Location is out of range
115 - Location already contains data
116 - Expected '?'
117 - Label is already defined
118 - Expected ‘\’
119 - Expected '('
120 - Expected ')’
121 - Expected '['
122 - Expected ']'
123 - Symbol is already defined
124 - Data occupies same location as program
125 - Array size cannot be 0
126 - Out of variable space
127 - EEPROM full
128 - Symbol table full
129 - Expected ':'or end-of-line
130 - Expected ',', end-of-line, or ':'
131 - Expected 'STEP', end-of-line, or ':’
132 - 'NEXT' must be preceded by 'FOR'
133 - Expected ','

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 13
134 - Expected ',' or ']’
135 - Expected a variable
136 - Expected a byte variable
137 - Expected a variable modifier
138 - Variable is already bit-size
139 - Expected a smaller-size variable modifier
140 - Variable modifier is out-of-range
141 - Expected a constant, variable, unary operator, or '(‘
142 - Expected a binary operator or ')’
143 - Expected a comparison operator or '['
144 - Expression is too complex
145 - Limit of 255 GOSUBs exceeded
146 - Limit of 16 nested FOR-NEXT loops exceeded
147 - Limit of 6 values exceeded
148 - Expected a label
149 - Expected a label, variable, or instruction
150 - Expected '=’
151 - Expected 'THEN'
152 - Expected 'TO'
153 - Expected a filename
154 - Expected a directive
155 - Duplicate directive
156 - Unknown target module. $STAMP directive not found
157 - Nothing to tokenize
158 - Limit of 16 nested IF-THEN statements exceeded
159 - ‘ELSE’ must be preceded by 'IF' or 'CASE'
160 - 'ENDIF' must be preceded by 'IF'
161 - Expected a label, variable, instruction, or 'ENDIF'
162 - Expected a label, variable, instruction, or end-of-line
163 - Limit of 16 nested DO-LOOP statements exceeded
164 - 'LOOP' must be preceded by 'DO'
165 - 'WHILE' or 'UNTIL' conditions cannot appear after both 'DO' and 'LOOP'
166 - Expected 'WHILE', 'UNTIL', end-of-line, or ':'
167 - 'EXIT' only allowed within FOR-NEXT and DO-LOOP structures
168 - 'IF' without 'ENDIF'
169 - 'FOR' without 'NEXT'
170 - 'DO' without 'LOOP'
171 - Limit of 16 EXIT statements within loop structure exceeded
172 - Expected variable or 'WORD'
173 - Expected a word variable
174 - Label is missing ':'
175 - Pin number must be 0 to 15
176 - Expected a label, variable, instruction, or 'NEXT'
177 - Expected a label, variable, instruction, or 'LOOP'
178 - Limit of 16 nested SELECT statements exceeded
179 - Expected 'CASE'
180 - 'CASE' must be preceded by 'SELECT'
181 - Limit of 16 CASE statements within SELECT structure exceeded
182 - Expected a label, variable, instruction, or 'ENDSELECT'
183 - 'ENDSELECT' must be preceded by 'SELECT'
184 - 'SELECT' without 'ENDSELECT'
185 - Expected 'GOTO' or 'GOSUB'
186 - Constant cannot be less than 1
187 - Invalid PBASIC version number. Must be 2.0 or 2.5
188 - Expected number, editor directive, #DEFINE'd symbol, or '-'

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 14
189 - Illegal operator in conditional-compile directive
190 - Expected #THEN
191 - '#IF' without '#ENDIF'
192 - '#SELECT' without '#ENDSELECT'
193 - '#ELSE' must be preceded by '#IF'
194 - '#ENDIF' must be preceded by '#IF'
195 - Illegal symbol in conditional-compile directive
196 - Expected a user-defined symbol
197 - Limit of 16 nested #IF-#THEN statements exceeded
198 - Expected a character or ASCII value
199 - {User Defined Error Message}
200 - Expected '#ENDIF'
201 - Expected ‘}’.
202 - Expected ‘}’. Can not specify project files outside of project program 0.
203 - Expected ‘}’. Can not specify more than 7 additional project files.
204 - Expected a target module: BS2, BS2E, BS2SX, BS2P or BS2PE.
205 - Expected quote (").
206 - Expected comma ',' or end bracket ‘}’.
207 - Expected text.
208 - Expected COM Port name: COM1, COM2, etc.
209-212 - (reserved)
210 - Expected valid parity. Parity must be "N", "E", "NONE" or "EVEN"
211 - Expected valid number of data bits. Data bits must be "7" or "8".
212 - Expected valid flow control state. Flow control must be "ON" or "OFF".
213 - Program 0, PROGRAMNAME, must not appear in the project list.
214 - Program FILENAME not found.
215 - Directory PATHNAME does not exist.
216 - "ARGUMENT" is not a valid com port on this computer.
217 - Stamp mode undetermined. Please enter $STAMP directive.
218 - Limit of 16 nested #SELECT statements exceeded
219 - Expected '#CASE'
220 - '#CASE' must be preceded by '#SELECT'
221 - '#ENDSELECT' must be preceded by '#SELECT'
222 - Expected a declaration, run-time statement, or '#ENDIF'
223 - Expected a declaration, run-time statement, or '#ENDSELECT'
224 - Expected '#ELSE'
225 - Expected number, editor directive, or #DEFINE'd symbol
226 - Expected statements to follow previous 'CASE'
227 - Expected a constant, variable or 'WORD'
228 - 'ELSEIF' must be preceded by 'IF'
229 - Limit of 16 ELSEIF statements within IF structure exceeded
230 - 'ELSEIF' not allowed after 'ELSE'
231-250 - (reserved)
~~~com port related errors~~~
251 - No serial ports are listed in the Available Ports List. Please add serial port entries to this list.
252 - Source code requires Debug Terminal but none are available.
253-300 - (reserved)
~~~device related errors~~~
301 - Can not program version VERSIONNUMBER of the MODULENAME. Contact Parallax, Inc. for updated
software.
302 - No BASIC Stamps found.
303 - No MODULENAME found.
304 - EEPROM verify failure!
305 - Hardware communication failure! Check serial cable and power supply.
306 - Duplicate devices found. Select COM port of desired unit.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 15
307-350 - (reserved)
EVENT MESSAGES
Events usually indicate an action taken by user, lead up to a required user action, or other significant event.
FINAL EVENTS (events that mark the last message from Stamp Editor)
351 - User cancelled device selection.
352 - Download successful!
353 - One or more BASIC Stamps found.
354-400 - (reserved)
INTERMEDIATE EVENTS (events that indicate more messages to come from Stamp Editor)
501 - Duplicate devices found.
502 - User selected device on COM#.
503 - Downloading to COM#.
504-550 - (reserved)
INFO MESSAGES
Information messages indicate status of ports and downloading progress.
FINAL INFO (info that marks the last message from Stamp Editor)
401 - File(s) Tokenized Successfully.
402-450 - (reserved)
INTERMEDIATE INFO (info that indicate more messages to come from Stamp Editor)
551 - PROGRAM=#:NAME STATUS=Tokenize Successful
552 - PORT=COM# DEVICE=DEVICENAME VERSION=VERSIONNUMBER LOOPBACK=YES/NO
ECHO=YES/NO
553 - SLOT=PROGSLOTNUMBER PROGRESS=DOWNLOADPERCENTAGE%
554 - The STAMP directive in line LINENUMBER has been modified to indicate that this is now a
STAMPMODULE program.
555 - A STAMP directive has been inserted at line 1 to indicate that this is now a STAMPMODULE program.
556 - The PORT directive in line LINENUMBER has been modified to force this code to download only on
PORTNAME.
557 - A PORT directive has been inserted at line 2 to force this code to download only on PORTNAME.
558 - The PBASIC directive in line LINENUMBER has been modified to compile this code using PBASIC language
version NUMBER.
559 - A PBASIC directive has been inserted at line 2 to compile this code using PBASIC Language version
NUMBER.

sales / technical support (916) 624-8333 • fax (916) 624-8003


stamptech@parallaxinc.com Rev 1.5 Page 16

Potrebbero piacerti anche