README.TXT

TPS V5.0 Samples Disk

This samples disk contains a selection of page displays 
collected from many different TPS projects.

All V5.0 samples pages are V4.0 backward compatible and therefore
only occupy the top left 80 columns and 35 rows. The full size
of the V5.0 display is actually 200 columns and 80 rows.

To install the samples, copy them to your TPS directory or,
more preferrably, a sub-directory such as c:\tpsv5\samples.
You can then browse the files via the page file dialog box -
press ALT P or select the Display, Open menu item to obtain
the page dialog box.

It is assumed you are familiar with basic TPS operations,
to use and understand the samples.

For view-port color examples, see pages 42-64.

Plot pages 5,7,8,9 and 20 have some pre-supplied data that can be
replayed and viewed on the their respective plot pages.

Sample Page Summary
-------------------

Page no


1,2,3) Misc. polynomial calibration view-ports

4)     Display format examples

5)     Toolkit Example - Attitude Control

A Sample compressed format data file '5.BIN' is supplied on the disk
to go with this plot. This is example mission data used in the 
TPS Toolkit. The data is in the TPS default packet format, 
namely, 128 byte packet length, and a two byte synchronisation 
pattern of 0x1234.

To replay the data, setup TPS as follows:

   unlock the display

   Configure the packet format as follows:

      Set the packet length to 128 bytes (default)
   
      Set the sync pattern to 0x1234 (default)

   replay the 'Compr'd bin' format file 5.bin for page 5.

6) TPS Configuration State. Various flags and numeric 
   view-ports showing current configuration state of TPS.

 Most of these view-ports are displayed on page 10.

 Backup 	ON/OFF (Options, System, Backup menu item)
 Diagnostics	ON/OFF (Options, Switches, Diagnostics menu item)
 Auto_tune	ON/OFF (Options, System, Autotune menu item)
 Timings	ON/OFF (Options, System, Timings menu item)
 Echo		ON/OFF (Transfer, Echo pkts menu item)
 Test_data	ON/OFF (Transfer, Test data menu item)
 Mono		ON/OFF (Options, Switches, Monochrome menu item)
 ASCII_out	ON/OFF (Transfer, Ascii-out menu item)
 Step_mode	ON/OFF (Options, Switches, Step-mode menu item)
 Sound		ON/OFF (Options, Switches, Sound menu item)
 Displaylock	ON/OFF (Display, Lock menu item)
 Cmd_out	ON/OFF (Transfer, Command menu item)

 API_byte_in	ON/OFF (Transfer, Custom API menu item)
 API_byte_out	ON/OFF (Transfer, Custom API menu item)
 API_pkt_in	ON/OFF (Transfer, Custom API menu item)
 API_pkt_out	ON/OFF (Transfer, Custom API menu item)

 Raw_recd	ON/OFF (File, Record, Raw bin menu item)
 Raw_replay	ON/OFF (File, Replay, Raw bin menu item)
 Compr'd_recd	ON/OFF (File, Record, Compr'd bin menu item)
 Compr'd_replay	ON/OFF (File, Replay, Compr'd bin menu item)
 Ascii_recd	ON/OFF (File, Record, Ascii hex menu item)
 Ascii_replay	ON/OFF (File, Replay, Ascii hex menu item)

 CCSDS		ON/OFF (Transfer, Pkt format dialog box, CCSDS)
 SYNCLOSSRP	ON/OFF (Transfer, Pkt format dialog box, Sync Loss Reporting)
 PKTSYNC	ON/OFF (Transfer, Pkt format dialog box, Synchronisation Pattern)
 PKTLENGTH	ON/OFF (Transfer, Pkt format, dialog box, Packet Length)

The following six mnemonics PORTSTRT, PORTSLDD, PORTEND,
NOFRIXS, CURFRIX and MEMALCT were originaly used by MST 
for system debugging but you may find them useful, mainly 
for judging how full your page is. One or more of the values
change when view-port edits and deletes are performed. These 
parameters are best copied to the current page your developing.

 PORTSTRT	The number of the first view-port on the user page (system
		debug information. Normally, 12 on V5.0 as there are 11
		view-ports on the system pages 0 and 9999.
 PORTSLDD	Total number of view-ports displayed including the 10 on
		pages 0 and 9999. If you copy this to your own display
		page it will tell you how many view-ports your page has
		including the 10 on pages 0 and 9999 and an additional 1
 		for itself, PORTSLDD. The maximum value is currently 512
		view-ports permitted on a single page. since the system
		requires 10 plus a further 4 for workspace. 
 PORTEND	The number of the last view-port on the page.

 NOFRIXS	Number of free entries in the TPS memory tables.

		3 Entries for a minimum view-port
		('minimum' implies no calibration, a single
		text entry in only one of the mnemonic, title or units)

		Plus

		1 for title text
		1 for units text
		2 for polynomial calibration
		2 for parameter recording
		1 for an alarm
		
		3 minimum, 10 maximum

CURFRIX		Index of the next free space in the memory tables. It can
		be practically any value and follows no sequence. Of little
		use to the user!

MEMALCNT	Current number of entries used in the memory tables. When
		displayed on this samples page 6, its value is 672.

	The following combination rules applies:

	PORTSTRT + PORTSLDD = PORTEND + 1

	NOFRIXS + MEMALCT = 3072 

	(3072 is the TPS internal maximum memory allocation count)

LOOPCT	

	Total number of internal TPS cycles made. At 10ms LOOPMEAS,
this will increment at 100Hz, i.e. 100 every second. On Windows 3.1
where LOOPMEAS is only 55ms (or less), this increments about 18.2Hz.
Although of little if any relevance to the user, it gives a health
check on TPS - i.e. has TPS seized up!

TPSSECS	

	Number of seconds elapsed since TPS was last started. This
number is converted to days, hours, minutes, seconds at the bottom
left of the display making the TPS 'Elapsed time' in the dddd.hh:mm:ss
format.

TPSMSECS	Number of milliseconds elapsed since TPS was last started.

Free_RAM	Total free RAM in kilobytes
		For Windows NT/95 this is VIRTUAL MEMORY, i.e. nearly 2Gb!
		For Windows 3.1 this is RAM + page swap file memory

Free_DISK	Total free disk space in kilobytes - Windows NT/95 only, 
		Value remains at 0 for Windows 3.1

All other parameters are copies of those shown on page 10 and 11

7)     Empty Page (1 view-port only)

8)    Three small example plots 

See the enclosed Example Sheet 'File Replay, Samples Page 8'

A Sample raw format data file '8.DAT' is supplied on the disk
to go with this plot. To replay, setup TPS as follows:

   unlock the display

   Configure the packet format as follows:

      Set the packet length to 122 bytes
   
      Set the sync pattern to 0x1234 (default)

   replay the 'raw' format file 8.dat for page 8

Note, there is a data glitch at 130 seconds, please ignore.

9)     Super/Sub-commutation example.

A Sample raw format data file '9.DAT' is supplied on the disk
to go with this plot. To replay, setup TPS as follows:

   unlock the display

   Configure the packet format as follows:

      Set the packet length to 128 bytes
   
      Set the sync pattern to 0x1234 (default)

   replay the 'raw' format file 9.dat for page 9

  See the V5.0 Supplement for more details on this example
  and TPS's Super/Sub-commutation handling.

10) Old V4.0 Page 10

11)     Empty Page (1 view-port only)
12)     Empty Page (1 view-port only)
13)     Empty Page (1 view-port only)
14)     Empty Page (1 view-port only)

15) Unpacking data example.

    You must switch on the test data to understand the numbers shown. 
    To do this, select the Tranfer, Test data menu item and select 'on',
    followed by pressing OK.

    The two examples illustrate how to unpack two 12 bit numbers
    packed into 3 bytes.

    The numbers used are the consecutive bytes 12 13 14 starting
    at byteindex 4 in the test data. Thus, the two 12 bit
    unpacked numbers are 121 (hex) and 314 (hex) i.e.
    289 and 788 in decimal.


Example1 'EX1'

   Extract full 16 bits
   EX1.1 2 byte unsigned short integer starting at byteindex 4 = 1213 hex

   mask off l.s.4 bits not wanted
   EX1.2 = EX1.1 & 0xfff0 = 1210 (hex)

   shift out lower 4 bits and convert to decimal
   EX1.3 = EX1.2 >> 4     = 289.0 (decimal)

Example 2 'EX2'
   
   Extract full 16 bits
   EX2.1 2 byte unsigned short integer starting at byteindex 5 = 1314 hex

   mask off l.s.4 bits not wanted
   EX2.2 = EX1.1 & 0x0fff = 314 (hex)

   display in decimal
   EX2.2 = 788 (decimal)

16)   TPS toolkit 'COLTOPKT' columns 2-5 plotted against col 1.
      See the COLTOPKT utility and the 'Examples' section in the 
      Toolkit Reference Manual for more details.

17)   TPS toolkit 'COLTOPKT' columns 6-9 plotted against col 1.
      See the COLTOPKT utility and the 'Examples' section in the 
      Toolkit Reference Manual for more details.

18)   Time in seconds since Jan 1st 00hrs 1970 (DOS, Windows NT/95)
      Time in seconds  since Jan 1st 00hrs 1900 (Windows 3.1)

      The parameter is c_ltime and its value should be around
      839,000,000 seconds (DOS, Windows NT/95) or 3,050,000,000
      (Windows 3.1).
      
      This time is split into separate view-ports
      showing the total in years, days, weeks, hours, minutes, seconds

19)     Empty Page (1 view-port only)

20)   Example plot-port

A Sample compressed format data file '20.BIN' is supplied on the disk
to go with this plot. To replay, setup TPS as follows:

   unlock the display

   Configure the packet format as follows

      Set the packet length to 1824 bytes
      Select the Transfer, Packet Format menu item
      and change the Packet Length in the dialog box to 1824.
   
      leave the sync pattern on the default setting 0x1234

   replay the 'Compressed' format file 20.bin for page 20

21)   All 20 mathematical calibration functions e.g. sine, cosine etc

      Reset the packet length to 128 bytes if this was set
      otherwise when viewing page 20, above. To do this,
      select the Transfer, Packet Format menu item
      and change the Packet Length in the dialog box to 128.

      Switch on the test data to view.

      You should see both valid numbers and also examples of
      invalid arguments to some functions e.g. sinh shows 1.#IO
      - this is because test data is physically meaningless (by design)
      and so not all inputs to the functions are valid real numbers.

      You should also see TPS errors '0018 Math Exception Error'
      in the TPS error display (bottom centre)

22)   More example plots (no data)

23)   Dual channel oscilloscope plot page taken from a custom GPIB
      interface (no data).

24)   Performance measurement and Tuning Statistics.
	See the Online Help 'Performance and Tuning'.

25)   Hexadecimal bytes

Displays each byte of the first 240 bytes of the packet as an unsigned
hexadecimal value in its own view-port. 

Switch on the test data to get a good idea of the pages function.

Each byte is extracted from the packet as the first byte of a two 
byte unsigned integer (Datatype "%hu"). The single byte extraction 
is done by using a bitmask = 0x00ff within a linear polynomial 
calibration a1=1, a0=0.

26)   Decimal bytes

Similar to page 25 except the bytes are displayed as in decimal, unsigned.

27)   Two-byte Hexadecimal Integers

Displays each of the first 240 2-byte integers of the packet 
as a 4-digit hexdecimal value in its own view-port. Each integer
starting on an odd or even byte boundary. For instance,

the first integer occupies 2 bytes starting at byteindex 0
the second integer occupies 2 bytes starting at byteindex 1
the third integer occupies 2 bytes starting at byteindex 2
etc...

Thus, each integer overlaps one byte with the next integer.
This is done in case your packet has 2-byte integers starting
on odd boundaries.

The numbers are displayed as extracted (except in hexadecimal format)
and there is no polynomial calibration.

28)   Two-byte Decimal Integers

As for page 27 but the numbers are displayed in decimal as real
(floating point) values with a linear polynomial a1=1.0, a0=0.0
applied to convert from the 2-byte integer raw datatype to the
displayed real format "%5.0f".

29)     Single byte plots

A plot of the bytes on page 26

30)     Two-byte plots

A plot of the bytes on page 28

Pages 31,32   More example plot ports (no data)

33)  CCSDS Transfer Frame Header Parameters. Only valid
     when the CCSDS Packet Format is selected. See the TPS
     'Transfer, Pkt-format' menu item.
  
34)  Source Packet Header Parameters. Only valid when
     reading Source Packets conforming to ESA's PSS-04-106
     Telemetry Packet Standard. Note, this is NOT valid when
     the CCSDS packet format is enabled (see Samples Page 34)

35)     Empty Page (1 view-port only)
36)     Empty Page (1 view-port only)
37)     Empty Page (1 view-port only)
38)     Empty Page (1 view-port only)
39)     Empty Page (1 view-port only)
40)     Empty Page (1 view-port only)
  
41) Al old V4.0 Page 10 with different view-port colors.

Pages 42 to 64
      view-ports in all different color combinations.
      See especially page 51 considered the best (highest contrast)
      view-port color combinations - all ports selected from the
      other pages 42 to 64.

65)   Data Packet Hexadecimal dump, byteindices 0 - 383
66)   Data Packet Hexadecimal dump, byteindices 384 - 767
67)   Data Packet Hexadecimal dump, byteindices 768 - 1151
68)   Data Packet Hexadecimal dump, byteindices 1152 - 1535
