Code covered by the BSD License  

Highlights from
cport

  • cportclose; function stat=cportclose(H) closes an open serial or parallel port
  • cportconfig; function stat=cportconfig(H,Name,Value,Name,Value,Name,Value...)
  • cportgetchar; function Params[ch,err]=cportstate(H,nchar) retrieves characters from a
  • cportopen; function H=cportopen(Port) opens a serial or parallel communication port
  • cportpurge; function stat=cportpurge(H) discards all characters from the output or
  • cportreset; function [stat,ErrStr]=cportreset(H) resets a previously opened communications
  • cportstate; function Params=cportstate(H) retrieves the configuration and timeout
  • cportwrite; function nW=cportwrite(H,Data,EOL) sends data to a previously opened
  • s=cportgetline(H,nMax,EOL,Tim... function s=cportgetline(H,nMax,EOL,Timeout) reads in one line of character
  • Contents.m
  • View all files
from cport by Eyal Doron
The CPORT minitoolbox supplies basic functions to open, configure, read from,etc to ports.

cportopen;
function cportopen;
%function H=cportopen(Port) opens a serial or parallel communication port
%for use. The parameters are:
%
%Port - A string specifying the desired port. The supported ports are
%       "com1" to "com8" and "lpt1" to "lpt3".
%H    - The returned port handle, or zero if an error occured. This variable
%       should be kept unchanged throughout the session with the port.

% Written by Eyal Doron, July 1999

error('CPORTOPEN is implemented in a MEX file.');

Contact us at files@mathworks.com