Basic Concepts
Home ] Up ] [ Basic Concepts ] Serial Connection ] Plotting Basics ] Logging, Saving and Printing ] Interactive Control ] Macro Basics ] Macros - Default & Events ] Macro Math Discussion ] Defined Macro Buttons/Menus ] Drawing Basics ] Media and Paths ] Drawing Coordinate Modes ] Plot Objects ] Macro Editor ] Using Templates ] External Applications ] Historical/Logged Data ] Internet ] Binary and Special Data ]

Note: Text in Maroon bold can generally be tested directly using the Immediate CLI.

StampPlot is a Line Interpreter application.  Almost exclusively, all instructions are carried out fully by interpreting a string of text that ends with a carriage return (ASCII 13).  These text strings may come from:

bulletSerial data from a controller or device on the serial port.
bulletData arriving using TCP/IP from the TCP/IP-Serial gateway
bulletData entered directly in the Immediate/Command Line Interpreter (CLI) text box.
bulletData in a text file, such as the StampPlot Macro files (*.spm).

In many languages, strings are used within the language.  Such as in computer BASIC programs, a typical statement may be:  PRINT "The value of X is ="; X where quotation marks are used to identify the string portion.

StampPlot's interpreter is different.  Typically, there is no distinction for what we would term a string.  StampPlot accepts a string of data and processes it accordingly.  To be able to have different data types, math processing, variables and constants, the string is specially formatted.  When StampPlot interprets the string, it will look for certain indicators for processing.
bulletCharacters !, %, ^, ~ and @ at the start of a string inform StampPlot the string is a certain Data Type.
bulletParenthesis in the string ( ) denote macro or object values that may need to be replaced.
bulletBrackets in the string [ ] denote math operations to be performed.
bulletData markers (%m) can be used as variables to hold an recall data.
bulletCertain data is specially denoted.

StampPlot operates heavily by substitution.  Values, math, data markers and Data Names (friendly names assigned to data markers) are pre-processed in most cases and replaced before the string is processed for the intended operation.  When used properly, this makes StampPlot a very versatile program.

Take for example the string:
!STAT The time is (RTIME)
When sent by a micro, or entered directly in the CLI, the top text box of StampPlot (User Status) will show the current time.  (RTIME) is replaced with the real time of computer's clock.

Changing the line to:
!STAT The time in one hour will be: [(RTIME),+,1:00]
This will show the time one-hour from now in the User Status.  The value of (RTIME) is replaced, then the bracketed math is performed and that string portion is replaced.

bulletData Types:
SPP accepts serial data, and based on its structure, performs different actions based on the data.  Data sent as ASCII string must end in a carriage return, ASCII 13 (sending data as binary values will be discussed later).
bulletAnalog:  Any string which begins with a numeric value will be plotted as an analog value.  Multiple values may be separated by commas.
!PLOT ON
!RSET
10,20,30
bulletDigital:  Any string beginning with a percent sign (%-binary indicator) containing 1's and 0's will be plotted as individual digital traces.
%101
bulletControl and Drawing Instructions: Strings beginning with !,~,^ or @ will be interpreted as plot instructions.
!RSET
~FREC 40a,40a,60a,60a
bulletMessages:  Strings not fitting any of the three above structures will be listed as a message.
HELLO WORLD!

 

bulletData Points: 
bulletData arriving and being plotted is stored in Data Points.  This allows data to be saved to a file, re-drawn, and played.
bulletBy Default, SP holds 500 data points, after which it resets and starts a new plot.  Using configuration options this may be adjusted for specific uses.
bulletThe total percent of data points is indicated by the top blue status bar on the bottom left.
bulletAnalog data, digital data, and drawing instructions beginning with ^ are saved as data points.  These three data types require Plotting to be enabled for them to be acted on.
bulletThe oldest data may be flushed (!FLSH ON) for continuous plotting.
bulletA maximum of 60,000 data points may be stored for a single plot, though more than 5000 is typically not recommended due to the time required to redraw the plots.

bulletQueue:
bulletAs data arrives from the controller, from the Log/Debug window, or from macros, it is held in the queue while awaiting processing.
bulletBy default, the queue is set up for 3000 bytes, though this may be adjusted (!QSIZ 10000).  Should the queue reach 2x's the set value, StampPlot will stop plotting data and disconnect.
bulletThe total percent of data in the queue is indicated by the bottom blue status bar on the bottom left (above).
bulletOn a connection, the queue is emptied of old data.

bulletPlot Resets and New Plots:

When a Plot Reset occurs, using the toolbar or the instruction (!RSET), the Data Points are cleared, the plot is cleared and time is set is reset to 0 seconds.  If drawing is used, Constant Drawings and Data Markers are NOT cleared.

On a New Plot (!NEWP), a reset occurs, Constant Drawings are cleared, Data Markers are cleared and all StampPlot configurations are returned to a default setting.  Plot Objects are NOT deleted or cleared.  To delete these, a StampPlot must be told to delete the Plot Objects (!POBJ Clear)

bulletInstructions:
Instructions fall into 2 main categories:  Control and configuration, and drawing instructions.  All instructions are four-lettered words (symbols or mnemonics).  Instructions are simply strings which may be sent by the controller, hand-entered, or from a macro text file.  Instructions begin typically with !, or if drawing instructions are used, ^,~ or @.

bulletControl and Configuration instructions begin with ! and are used to control StampPlot, such as enabling plotting (!PLOT ON), or to configure StampPlot, such as setting the analog span for plotting (!SPAN -250,250).  Control instructions are also used to created and configure Plot Objects. 

bulletDrawing Instructions begin with ~,^,@ and may be used to draw shapes, place images and play WAV files.  The 3 different symbols denote the following:
bullet~ indicates the operation is performed once (temporary) and it does NOT get stored as a data point.
bullet^ indicates the operation is performed AND it is stored as a data point for later use for re-drawing or saving the plot.
bullet@ indicates the operation is to be stored as a Constant Drawing.  Constant Drawing survive a Reset so that special plot drawings will be re-drawn following resets.
bulletBeyond plotting data, the data may be used to control Plot Objects, and to create logs.