Operácie

Stamp Plot Manual

Z SensorWiki

Program StampPlot sa pripojí na sériovú linku a prijíma data. Všetky prijaté data musia končiť znakom CR (Carriage Return, ASCII 13, '\r').

  • Analogové veličiny - ľubovoľný reťazec začínajúci numerickou hodnotou, hneď sa aj kreslí.
  • Digitálne hodnoty - ľubovoľný reťazec začínajúci znakom %, hneď sa aj nakreslí.
    Napr. printf("%%1001\r");

nakreslí štyri veličiny pod seba.

  • Riadiace sekvencie - ľubovoľný reťazec začínajúci znakom ! sa interpretuje ako príkaz. Popis kódov nasleduje nižšie.
  • Všetky ostatné data sa chápu ako text a zobrazia sa v terminálovom okne.

Poznámka:

The application requires a minimum processing time. A short pause (10mSec on fairly fast computers) may be required in short programs.


Stamp Plot Control Codes

The plot may be configured from the microcontroller using the following control codes:

!TITL message	Sets to title of the form to the message
!USRS message	Sets the User Status box to display the message
!BELL		Sounds the bell on the PC
!AMAX value     Sets the plot maximum analog value
!AMIN value	Sets the plot minimum analog value
!SPAN minValue, MaxValue
                Sets the plots analog maximim and minimum as above
                but also adds the range to the Range Drop-Down box.
!AMUL value	Sets the value to multiply incoming data by
 
!TMAX value     Sets the plot maximum time (seconds)
!TMIN value	Sets the plot minimum time (seconds)
!PNTS value	Sets the number of data points to collect
!PLOT ON/OFF	Enables/disables the plotting of data
!RSET		Resets the plot and all data
!CLRM		Clears the message list
!CLMM		Clears the min/max recorded values
!CMMR ON/OFF	Enables/Disables clearing of Min/Max recorded values
               on reset
!MAXS		Sets the plot to STOP when datapoints are full
!MAXR		Sets the plot to RESET when datapoints are full
!SHFT ON/OFF	Enables/disables the plot from shifting when recording data
               (may cause a loss of data accuracy if enabled)
!TSMP ON/OFF	Enables time stamping of list messages, messages
               and data saved to files
!SAVD ON/OFF	Enables saving of analog and digital data to files (stampdat.txt)

!SAVM ON/OFF	Enables saving of messages to a file (stampmsg.txt)
!DELD		Deletes the saved data file (stampdat.txt)
!DELM		Deletes the saved message file (stampmsg.txt)

See also: Data and Message Saving

Example:

printf("!SPAN 0, 500\n !RSET\n !PLOT ON\n");


Recommendations

Upon microcontroller reset for configuring:

  • Pause for 500 mSec to allow PC buffer to clear.
  • Reset (!RSET) prior to any time/value changes to clear data.
  • Reset (!RSET) at end of configuration to reset plot to time 0
  • The application requires a minimum processing time.
    A short pause (10mSec on fairly fast computers) may be required in short programs.


Data and Message Saving

Data and messages may be recorded to a file.

Messages will be saved to a file named "stampmsg.txt" in the application directory. They will be time stamped if enabled.

Data will be saved to a file names "stampdat.txt" in the application directory The data will be time stamped if enabled.

The data file has the following format:

[System time, plot time in seconds,] analog data point value, analog value, digital datapoint value, digital data.

NOTE: Writing to the file is based on ANALOG DATA ARRIVING ONLY. If you are dealing with only digital data, transmit a 0 analog value along with your digital data.

i.e.: DEBUG DEC 0,CR, IBIN8 INS, CR

When deleting the data or analog files (from the application or from the microcontroller), if file save is enabled the files will be re-created and new data will be saved. Examples

Simplest possible example for analog value and digital one.

See the code or download it.



Návrat na cvičenie 11...