25 Locust St, Haverhill, Massachusetts 01830 • Tel: 800/252-7074, 978/374-0761 • FAX: 978/521-1839
e-mail: [email protected] • Web Address: http://www.freqdev.com
SPPDF-01 Development Suite
User’s Manual
Sotware Plug
Appendix B
OutFlushCommPort:
Purpose:
Removes all data from the output queue.
Algorithm:
Removes all characters from the output queue of the specified port.
Syntax:
[data, status] = RS232MEX(action, [CommPort])
Parameters:
int CommPort - communication port to flush
Examples:
[result, condition] = RS232MEX('FO', [2])
[result, condition] = RS232MEX('fo', [2])
9.1.1. InFlushCommPort:
Purpose:
Removes all data from the input queue.
Algorithm:
Removes all characters from the input queue of the specified port.
Syntax:
[data, status] = RS232MEX(action, [CommPort])
Parameters:
int CommPort - communication port to flush
Example:
[result, condition] = RS232MEX('FI', [2])
[result, condition] = RS232MEX('fi', [2])
9.1.2. CloseCommPort:
Purpose:
Closes the specified communication port, restores the associated
interrupt vectors, and frees the input and output queues.
Algorithm:
Closes a communication port.
Syntax:
[data, status] = RS232MEX(action, [CommPort])
Parameters:
int CommPort - communication port to close
Example:
[result, condition] = RS232MEX('C', [2])
[result, condition] = RS232MEX('c', [2])
9.1.3. ReadBytePort:
Purpose:
To read the specified byte from the input queue.
Algorithm:
Reads a byte from the input queue of the specified port. Returns an
integer whose low-order byte contains the byte read. If an error
occurs, the returned value is a negative error code.
Syntax:
[data, status] = RS232MEX(action, [CommPort])
Parameters:
int CommPort - communication port to operate on
Example:
[result, condition] = RS232MEX(‘RY’, [1]);
[result, condition] = RS232MEX(‘ry’, [1]);
Byte = uint8(result);
% example on how to use the returned value
27