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.

cportwrite;
function cportwrite;
% function nW=cportwrite(H,Data,EOL) sends data to a previously opened
% communication port. The parameters are:
%
%H    - The port handle returned by cportopen.
%Data - A character array or data vector to send to the port. A character
%       array will be converted to ASCII before being sent on, while any
%       other data vector will be sent as-is. Note that if carriage-return
%       and/or linefeed line termination is required, it must be included
%       in the character array.
%EOL  - Optional end-of-line specifier, can be 'CR', 'LF', 'CRLF'.
%
%nW   - The number of characters actually written to the port (optional).
%
% Written by Eyal Doron, July 1999

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

Contact us at files@mathworks.com