
TRANSPUTER COMMUNICATION UTILITIES FOR PC MATLAB
================================================

Author: Robert Shaw
	Dept. of Electrical and Electronic Engineering
	Nottingham Trent University
	Burton Street
	Nottingham
	NG1 4BU
	Tel: (0115) 9418 418 extn. 2695
	Fax: (0115) 9486 567
	E-Mail: ca153rs01@ntu.ac.uk

Version: 1.0
Date:    March 1996

Files:  mlabtc1.zip contains,
	bootlink.m      MATLAB Help File
	resetlnk.m              ''
	readlink.m              ''
	sendlink.m              ''
	bootlink.dll    Windows Executable under MATLAB
	resetlnk.dll            ''
	readlink.dll            ''
	sendlink.dll            ''
	readme.txt      This text file

Notes:
	These routines are designed for use under MATLAB under
	Windows. There have been tested on MATLAB v4.2, and run
	under Windows v3.11 for Workgroups.
	Any communication with the author concerning these
	routines is welcomed.

Installation:
	All the files can be copied to a directory. Then add
	this directory to the list of paths in the MATLABRC.M
	file. This will allow the use of the routines from
	anywhere during a MATLAB session.

Use:
	Use the .m files for syntax help (e.g. help bootlink).
	
	Bootlink is not a server, it simply resets then boots
	a transputer network. .BTL files for this kind of use
	can be compiled using a reduced library set as no I/O
	calls from the transputer are communicated.
	Any MATLAB prompt - Transputer network communication
	can then be done using the readlink and sendlink
	routines.
	An example of a typical session is:

		>> bootlink('example.btl',336)   << Boot File is example.btl
		Sending example.btl to link at 0x150    << Link address
		Boot file sent to link                     is 336 decimal       
							   or 0x150 hex
		ans =
		
			5907            <<< Size of the Boot File

		>> sendlink(1,9,336)     <<< write the 8-bit number 9 to link

		ans =

		     1                  << One 8-bit element sent

		>> readlink(2,1,336,2)   << read one 16-bit number
					   from the link
		ans =

		    1024                << The returned 16-bit element


	The communication routines allow the read/sending of 8, 16, 24
	and 32 bit words by specifing the byte size. This allows
	flexible communication with any transputer family.
	
	Example 2 : M-file Booter
	Here is an example for booting a network using a MATLAB M-file
	which demonstrates the use of the communication routines.

	function [sent] = booter(file_string, base_add)
	%       Booter resets and boots a transputer 
	%       network using file_string as a boot
	%       file and base_add as the memory
	%       location of the link adapter.
	%
	%       E.g.
	%               base = hex2dec('150');
	%               booter('boot.btl',base);
	%
	%       Booter returns the number of bytes sent.
	%       A value of -1 indicates an error.
	%
	%       SEE ALSO: RESETLNK
	%
	fid = fopen(file_string,'r');
	[boot,count] = fread(fid,inf,'char');
	fclose(fid);
	resetlnk(base_add);
	sent = sendlink(1,boot',base_add,2);
	% End of M-File

	
	March 1996
