Section Debug Immediate Window and Control Instructions

The Debug/Immediate Window is used to monitor data as it is processed or to directly enter data and instructions.

V Re-run the "Plotting 3 Analog Values" program.

'Plotting 3 analog values

'Plotting 3 analog values

val

VAR

Byte

val2

VAR

Byte

val3

VAR

Byte

DO

FOR Val

= 0 TO 255

val2 =

val / 2

val3 =

val * 2

DEBUG

DEC val, ","

, DEC val2, ",

,", DEC val3, CR

PAUSE

100

NEXT

LOOP

V Close the Debug Terminal

V In StampPlot, connect and plot.

V Open the Logs Debug/Immediate Window with this button: D

V In the Logs Debug/Immediate Window check the Anlg (analog) check box to view analog data as it is processed.

V Note that the analog values are displayed.

V Disconnect on StampPlot.

V Keep plotting enabled.

V Reset the plot area.

V In the text box at the bottom of the Logs Debug/Immediate Window, type in three values, pressing Enter on your keyboard after each value.

V Note that these values were plotted.

V Use the keyboard UP arrow to display your last entry, then press Enter again.

V Plot several other values for the fun of it.

V Try some binary values, such as %1001, and a text message such as Hello World!

NOTE: The plot will not shift automatically when the connection is not open. Control Instructions

The box you were using is the Command Line Interface (CLI) text box, where you can enter test values or instructions. Virtually every facet of StampPlot can be controlled using control instructions. These instructions may come from:

The user manually entering them in the Debug/Immediate CLI.

Serially from the BASIC Stamp module as strings.

From a PC based text file (macro).

Over the Internet using the TCP-Serial Gateway program.

All control instructions are 4-lettered mnemonics starting with an exclamation point (!), and of course, must end with a carriage return.

Try the following instructions one at a time using the CLI, and watch the effect of each. Explanations to the right are not to be entered or used. Instructions to enter will be italics for emphasis.

!POBJ Clear Removes all controls form the plot screen

!NEWP Starts a new plot - default configuration

!SPAN-100,100 Sets the analog (Y-axis) scales

!TMAX 600 Sets maximum time for 600 minutes

IRTIM ON Enables Real-Time on X-axis

!SHFT ON Enables plot shifting at maximum

IFLSH ON Enables data flushing

!TITL Practice Titles the plot window

!PLOT ON Enables plotting

!RSET Resets the plot

!STAT This is a message Places a message in the User Status text box in the plot.

!DBUG Hello! Displays data in the Debug Window.

Instructions that use ON/OFF may also use 1/0:

!CONN 1 Connect on COM port

These control instructions may also be part of the PBASIC code as a debug instruction.

'Plotting 1 analog value & using control instructions PAUSE 100

DEBUG

CR,"!POBJ Clear",

. CR

DEBUG

"!NEWP", CR

DEBUG

"!PLOT ON", CR

DEBUG

"!SHFT ON", CR

DEBUG

"!RSET", CR

Val VAR Byte

DO

FOR Val = 0 TO 255

' Plot Value

DEBUG DEC VAL, CR

' Show value in Status

box

DEBUG "!STAT Value = ",

, DEC Val, CR

PAUSE 1000

NEXT

LOOP

As always, watch the BASIC Stamp Editor Debug Terminal to verify the strings look well formed.

NOTE: When StampPlot connects it will cycle the DTR line causing the BASIC Stamp module to reset. This is important to ensure the configuration information at the beginning of the program is sent. If the DTR Enabled option is unchecked you may need to manually reset your BASIC Stamp module.

To insure there is not a portion of a previous line (from resetting your stamp in the middle of sending) in the StampPlot queue, always start your 1st debug with a cr to end the sting portion.

The StampPlot Help files, Summaries, provides a full listing of available control instructions and use.

DIY Battery Repair

DIY Battery Repair

You can now recondition your old batteries at home and bring them back to 100 percent of their working condition. This guide will enable you to revive All NiCd batteries regardless of brand and battery volt. It will give you the required information on how to re-energize and revive your NiCd batteries through the RVD process, charging method and charging guidelines.

Get My Free Ebook


Post a comment