The Integrated Development Environment
Invoking the Vesta Basic IDE
Your First
Program
Toolbar Buttons
IDE Menus
The File Menu
File|Open Task
File|Save Task
File|Save Task As
File|Print
File|Exit
The Edit Menu
Edit|Find
The Tools Menu
Tools|Serial Port
Tools|Compiler
Tools|Debugger
Tools|Task Memory
Invoking the Vesta Basic IDE
To invoke the Vesta Basic IDE, use the Windows Start Bar to select Programs\VMTBasic2\Vesta
Multi-tasking Basic, or click the Vesta Multi-tasking Basic icon.
Wait a moment while the IDE checks to see if there is a Vesta SBC connected
to the PC.
If you get the "No Response from SBC2000" message, just click OK and
use Tools|Serial Port to select the com port that the IDE will use to communicate
with the SBC.
If you do not have an SBC2000 connected, you may select the COM port that you
intend to use or you may select "none" for now. Selecting none will
enable you to write and compile code, but you cannot download it into an SBC2000.
With the Vesta Multi-Tasking Basic CD in the drive, you can select File|Open
Task and navigate to the D:\Vesta MT Basic\Examples folder to see the sample
code that we provide.
The \Examples directory contains the following subdirectories.Please browse around, it's a gold mine.
\Vesta ST Basic - Contains examples that are specific to Vesta Single Tasking Basic and the SBC2000-062 and SBC2000-074.
\Vesta MT Basic - Contains examples that are specific to Vesta Multi-tasking Basic and the SBC2000-188 and SBC2000-332.\Applicat - Examples of applications.
\Arrays - Examples using arrays.
\Keywords - Contains examples that illuminate the Vesta keywords
\Multitsk - Examples of multi-tasking techniques.
\Periph - Examples using different peripheral boards.
\SBC2000 - Examples that demonstrate some of the on-board capabilities of the SBC2000 engines.
\Strings - Examples involving strings.
- Open a new task window by selecting Tasks|Task1 from the menu bar.
- With the Vesta Basic CD in the drive, you can get to the application examples using File|Open and selecting your CD drive from the "Look in" listbox. Double click \Examples, then \Keywords, then the \Do_while directory. Then double click the Dowhile0.txt file to load its contents into Task1.
- Double click on the word "index" in the first line, then double click the watch variables button (that looks like two eyes opened wide) on the tool bar, and click OK in the window that comes up.
- Another window, called the Watch Variables Window, will pop up. If it's not in a convenient place, move it to the side, off the IDE window so that you can see it and the Task window at the same time.
- Because this text was read from the CD drive, we need to save it to the hard drive before we continue. You don't usually have to do this step. However, keep in mind that the compiler will save the current changes to a file before compiling.
- Select File|Save As, and navigate back to C:\Program Files\VMTBasic2\Projects or wherever you installed the Vesta Multi-tasking Basic application, and click the Save button (feel free to rename the file first).
- Now click the Go button. A progress window will pop up for a minute and then disappear. Your task has just been compiled. This is the point where you would have been alerted if there had been any errors in the code.
- Now click the Step button several times. You'll see the highlight cycle around each line of code as it is executed. Now click the Step button a few times slowly, and watch the variables in the Watch Variables Window as they change.
- It only takes 30 clicks before this little program runs out of things to do. It will stop on the last executable line, which in this case is the DO WHILE index line.
- If you want to get out early, click the Stop button, to halt execution of the task. Polling will continue and the Heart icon in the upper left corner will continue to flash. You can turn off polling by closing the Watch Variables window, or by selecting Tools|Debugger and setting the Poll rate to zero.
Save Task
Paste
Find
Delete Watch
Continue
Reset
Step
Move to Flash
Go
File|Open Task
The File|Open Task menu is available only when a task window is open. This command
reads any .TXT file into the currently active task window. Use the Tasks Menu
to open a Task window.
File|Save Task
The File|Save Task command saves the active task into the file from which it
was opened, or if it's a new file, to the default filename: TASKx.TXT, where
"x" represents the task number. Tasks are also saved when compiled.
The name of a task does not affect its execution order or where it is saved
in the SBC's Memory.
File|Save Task As
This command saves a task under any filename in any subdirectory.
File|Print
This command allows you to print the text of a task.
File|Exit
Exits the Vesta Multi-tasking Basic IDE and returns to the Windows desktop.
The Edit Menu
The Edit menu commands are standard Windows commands. These commands can also
be invoked using the traditional Windows keystrokes:
^X CutThe IDE Task Editor also provides some fancy features such as drag-and-drop text, double-click to select a word and triple click to select a line.
^C Copy
^P Paste
^Z Undo
Edit|Find
Edit|Find searches the current task for a specified string.
Tools|Serial Port
Use Tools|Serial Port to select the serial port that is connected to the DEV
port on the SBC.
The baud rate and connection settings are fixed at 9600 baud, 8 bits, no parity,
1 stop bit. .
Test Serial Link
Click the Test Serial Link button to verify that the SBC is connected to the
PC or to re-establish communications with the SBC if the link has gone down.
.
The Test Serial Link button on the tool bar will perform the same function as
the Test Link button on the Serial Port Settings Window.
IDE/SBC Transactions
From the Serial Port Settings window, you can click the View Button under IDE/SBC
Transactions to view the status of communications between the SBC and the Vesta
Basic IDE.
TO SBC 2000 - shows what the IDE has sent to the SBC.
Transmit Buffer - shows what is queued to be sent to the SBC.
Transmit Keystrokes - provides an entry area where you can type characters that
you would like to send to the SBC.
Keystrokes Received - shows the history of what the SBC has sent to the IDE.
Receive Buffer - shows keystrokes that have been sent to the IDE, but have not
yet been processed.
Target Board
The SBC2000-332 and the SBC2000-188 have different memory configurations and
use different processors.
The IDE will detect the SBC2000 model connected to your PC and set the compiler
to match.
If you want to work off-line, you can tell the IDE which board you intend to
write for by setting the target board here. However, if you connect and power
up a different board, the IDE will detect it, and change this setting automatically.
If you manage to fool the IDE and download an inappropriately compiled task,
the SBC2000 will refuse to execute the code and issue a "Download Failure"
message.
The version of the compiler must match the version of the Vesta Basic execution
engine on the SBC2000. If a mis-match exists, a "Version Mismatch"
message will be displayed.
The VMTB Runtime engine and the VMTB Compiler contain revision level information.
When the compiler produces a task image, it embeds the compiler revision level
in the task. When the task image is downloaded to the board by the IDE, the
Runtime engine performs several tests to determine if the task image is valid.
One of these tests verifies that the task was compiled for the same revision
of VMTB. If the revision information matches, the Runtime engine will accept
the task. If not, an error will be reported to the IDE, which will in turn report
a version number mismatch error to the user.
Display Compiler Warnings
If you find compilers warnings distracting, you can de-select Display Compiler Warnings
and cause the compiler to only tell you about errors.
Tools|Debugger
This dialog box shows the currently selected polling rate and those tasks that
have been selected for compilation with full debug capability.
SBC Polling
The poll rate determines how often the PC communicates with the SBC2000. If
you are watching variables or animating, the polling rate should be set high.
If your application stops task 0 (the Debug Monitor), set the polling rate to
0 or else the IDE will complain that the SBC2000 is not responding.
Vesta Basic runtime errors are reported to the IDE when the SBC2000 is polled,
so turning off the polling will cause the IDE to cease reporting errors. When
the polling rate is set to 0, animation and variable watch is also disabled.
However, you can still highlight and press a variable Ctrl-W to find its value.
Polling the Basic Monitor affects the execution speed of Vesta Basic to a small
degree. When your application is finished, there will be no IDE connected, so
for final application speed testing and fastest execution, set the polling rate
to zero.
If you get a message that says "SBC2000 is not responding", try cycling
power to the SBC2000 and clicking the Test Serial Link button to re-establish
communications between the SBC2000 and the IDE.
Compile With Debug
Tasks may be individually compiled with extended debug information that allows
animation. Un-checking a task will disable that task's animation button and
the task will execute faster. The performance improvement varies between 5%
to 30%. Execution speed improvement is most significant for tasks that use keywords
with short execution times, and simple statements on individual lines, such
as empty loops waiting for a condition.
For example:
SUBROUTINE delay(time AS INTEGER) LOCAL index AS INTEGER FOR index=0 TO time REM NEXT ENDOn the SBC2000-332 (20MHz), it takes 83 microseconds per increment of time with debug on and 57 microseconds with debug off. In general, however, most applications will only benefit ~ 10% by turning debug off.
Tools|Task Memory
This dialog box allows the programmer to allocate SBC2000 memory usage on a
task-by-task basis.
We have selected sizes that are appropriate for most cases. Recursive programs
may require larger amounts of data stacks, return stacks, and string stacks.
Increasing these limits will reduce the amount of memory that may be used for
data acquisition applications.
Note that exceeding any stack limit at runtime can cause your application to
stop executing or behave abnormally.
Program Size
The Program Size parameter causes the compiler to issue an error if the compiled
size of the task is larger than the size set here.
Data Stack
The Data Stack holds subroutine arguments.
You need two bytes for each integer, and four bytes for each long, float, or
string passed as an argument to an active subroutine or function or that is
declared local to an active subroutine or function. Functions require an additional
allocation of two or four bytes each for the return value for that function.
You will also need some extra room on the stack to hold the intermediate values
produced when expressions are evaluated.
Return Stack
The Return Stack is used for control flow information and so determines how
deeply you can nest subroutines.
You need one entry for each nested subroutine or function call that your application
will make.
String Space
String space includes several kinds of string data but not string array data
or string constants.
You need one entry for the task itself, one for each global string declared,
one for each function that returns a string result, and enough additional entries
to handle each string passed into a subroutine or function as a parameter or
declared locally to an active subroutine or function. You do not need to count
arrays of strings or constant strings.
Global Space
Set the Global space high enough to accommodate all the Global variables the
task will use.
Constant Space
This is where you set the memory limits for all the string and numeric constants
your task will use. Constant strings take only enough space to hold the value
of the constant (unlike regular strings that require 256 bytes regardless of
the value saved to the variable).
Data Space
Data Space is the memory used to hold any kind of data that doesn't fall into
any of the categories above, such as array data.
Location
Indicates the where the task is on the SBC. If the task has been loaded to RAM as well
as Flash, this section will say Flash.
For more information on the use of memory on your SBC2000, see "
SBC2000
Memory.
Tools|SBC Memory
This dialog box shows the size and usage of RAM and flash as reported by the
SBC2000 to the IDE.
Tools|Build ROM
The user has the choice of running the finished code from ROM or Flash. ROM
allows faster programming in production and enhances safety by preventing accidental
erasure of the program. Flash offers faster execution of the code on the SBC
and the ability to upgrade the application without making hardware changes.
The Vesta Basic IDE can create an EPROM image that can be programmed into a
ROM chip with an EPROM Programmer device, however, the Vesta Basic IDE does
not provide the function of actually programming the EPROM chip.
Tools|Extensions|Download
Extensions
This menu command allows newer Vesta Basic extensions to be downloaded to the SBC for
testing.
The standard Vesta Basic extensions are installed automatically when you install Vesta
Basic on your PC. Unless you have received updated extensions or built your own, you
will not need to use this command.
For more information on the Vesta Multi-tasking Basic extensions, see Vesta
Basic Extensions.
Tools|Extensions|Build Basic Image
If you have developed custom extensions for Vesta Basic, this menu command allows
you to incorporate the Basic Runtime Engine, the Monitor, and your extensions
into a new Flash image.
For more information on Vesta Basic Extensions see the Vesta C Library manual.
Debug|Reboot SBC2000
The Reboot SBC2000 command will send a reboot command to the SBC2000. This will
cause the Vesta Basic execution engine to jump to the reset vector as though
a power on reset or hardware reset had taken place.
Upon SBC2000 reboot, the IDE reports that the SBC2000 has re-booted and that
all tasks in RAM must be re-loaded. If you don't get this message, check the
Dev connection and cycle power to the SBC again.
If you suspect that the SBC2000 is at fault, the first indication of correct
operation is the LED. The LED is controlled by software and will not be lit
if Vesta Basic is not active.
You can confirm correct operation of the SBC2000 by connecting the Dev port
to a terminal device or terminal emulation program and applying power. You will
see a sign on message like this one:
VBasic-332(20) V2.0a (c) 1997 VTI 02:36:45.71 Jan. 01,1996 SUN 262144 bytes of RAM installed. 230656 bytes of RAM available. 1048576 bytes of Flash installed. 917504 bytes of Flash available. Task 1 is invalid. Task 2 is invalid. Task 3 is invalid. Task 4 is invalid. Task 5 is invalid. Task 6 is invalid. Task 7 is invalid.If there is no valid Vesta Basic image in the flash, you will see a sign on message like the following:
Boot-332 SBC2000:
Debug|Stop Autostart
Stop AutoStart is used to suppress the AutoStart function of the SBC so that it can be
restarted without automatically passing control to the tasks in Flash. This command is
required when a task stops task 0 (the IDE monitor) and therefore is no longer controlled
by the IDE monitor.
After executing this command you can choose Flash|Erase Runaway Task to remove all tasks
in flash.
Debug|Go
The Go command compiles and downloads the current task (if not already downloaded in
its unmodified form), resets the program pointer to the beginning of the new task and
starts the task executing.
Mousing around or switching to another program during the download process can cause
a packet error and may require power cycling the SBC2000.
The "modeless" design does not enforce a distinction between the debug and
editing modes of operation. You can edit your source code while the program is executing.
If you change your source code and then invoke animation, the IDE will report that the
code has been changed and ask if you want to download the new version.
The Go button performs that same function as the Debug|Go menu option.
Debug|Stop
The Stop command stops the current program. The Stop button performs that same function
as the Debug|Stop menu option.
Debug|Compile Only
This command allows you to compile without downloading, resetting, or executing.
Debug|Download
The Download command compiles and downloads the current task, but does not start execution.
The Download button performs that same function as the Debug|Download menu option.
Debug|Step
This command executes the currently highlighted line of Vesta Basic code.
The Step button performs that same function as the Debug|Step menu option.
Debug|Animate
This command highlights and executes lines of code. The rate of animation is controlled
by the Poll Rate setting in the TOOLS|DEBUGGER dialog box.
The Animate button performs that same function as the Debug|Animate menu option.
Debug|Continue
This command executes the current task from where it was last stopped.
The Continue button performs that same function as the Debug|Continue menu option.
Debug|Reset
This command resets the current task program pointer to the start of the task.
The Reset button performs that same function as the Debug|Reset menu option.
Debug|Add Watch
This command invokes a window containing the variables selected during the add watch
session. Variables are updated every time the SBC2000 is polled. The value of the variable
on the SBC2000 may be changed by stopping the task and entering a new value into the
watch window. A carriage return sends the new data to the SBC2000.
You can watch elements of an array that are specified by constant indices, but you cannot
watch array elements with a variable as the index.
The rate at which these variables are updated depends on the Poll Rate set with the Tools|Serial
Port command.
The Add Watch button performs that same function as the Debug| Add Watch menu option.
Debug|Delete Watch
This command removes variables from the watch window. Variables can be deleted directly
from the watch window by highlighting the variable and pressing the delete key.
The Delete Watch button performs that same function as the Debug| Delete Watch menu option.
Debug|Modify Watch
This command allows you to change the value of a variable in the watch list. Enter the
new value followed by the enter key. The modified value is sent to the SBC2000.
STOP the program before you MODIFY WATCH for best results.
View|Toolbar
This command toggles the toolbar on and off.
View|Task Toolbar
When you select View|Task Toolbar the IDE opens all seven task windows (minimized) and
provides seven task buttons that can be used to select (and maximize) each of the task
windows.
You can use the commands in the Window menu to arrange the task windows for easier viewing.
View|Task Toolbar is a 'toggle' command, so you can get rid of the Task buttons by selecting
it again, and it will not close any open windows.
View|Modify Toolbar
View|Modify Toolbar allows you to change the selection and order of the buttons in the
Toolbar. You can also invoke this function by double-clicking on any part of the toolbar
that does not have a button.
View|View Task Status
This command invokes a window that provides status information about the tasks downloaded
to the SBC and the connection between the SBC and the IDE.
Task status is updated when the SBC2000 is polled. Setting the polling rate to zero will
prevent the task status window from updating.
Task Status
Invalid - the task window is empty.
Running - the task is executing.
Error - the task stopped because a runtime error has occurred.
Reset - the task is not running and is at the beginning of code.
Stopped - the task is not running. You'll see this normally when single stepping.
IDE Status
Board Running - the SBC is connected and powered up.
No Response - the SBC is not responding, usually because the Dev cable is not connected
or the power to the board is off.
The Tasks Menu
These commands open task windows 1 through 7.
Flash|Move Current to Flash
This menu option moves the current task into flash. If the task is not currently in RAM,
the IDE will compile and download the task before moving it to flash.
Flash|Erase Flash
This command clears all tasks and data in flash. .
Flash|Move All to Flash
This command moves all open tasks into flash. .
Flash|Upgrade Vesta Basic
Invoking this command will transfer a new copy of the Runtime Engine into flash from
the current Vesta Basic directory on the PC. If Vesta Basic is already available on the
board, you will be prompted to cycle power.
Flash|Erase Runaway Task
This command causes all tasks in Flash to be erased. It can be invoked after executing
Stop Autostart.
Vesta Basic incorporates a "Boot Monitor" program that allows the IDE to interrupt
the invocation of Vesta Basic. This allows the IDE and the Boot Monitor to erase all
of the tasks in flash or to upgrade the Runtime Engine.
The Boot Monitor may be invoked from a terminal device or terminal emulation program,
by holding down a repeating "V" key and applying power to the SBC2000. The
Boot Monitor will respond with.
Boot-332 or Boot-188 SBC2000: SBC2000:When the Boot Monitor is running, the LED on the SBC2000 will be off. Typing "H" will list the available commands:
SBC2000: help dump{address[len]]dump memory db[address[len]]dump memory(bytes) dw[address[len]]dump memory(word) edit[address] edit memory eb[address] edit memory(bytes) ew[address] edit memory(words) xload XModem load file to Flash x XModem load file to Flash basic Erase VBasic from Flash b Erase VBasic from Flash tasks Erase the rest of the Flash t Erase the rest of the Flash ticks Print the current tick count ? display this information. reboot restart the system. r restart the system
The Window menu
Standard Windows options are available.
The Help menu
Online Help is available for most questions
Help|About Vesta Basic
The Help|About Vesta Basic tells you some important information such as the version of
the Basic IDE you are running and our Tech Support e-mail address.
The System Info button tells you interesting details about the system PC on which Vesta
Basic is running.