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
Software Plug
Appendix B
Example:
% assign values to structure element
parameter3.port = 2;
parameter3.file = 'c:\RS232MEX\TextFileToWriteTo.txt';
parameter3.position = 0;
parameter3.count = 24;
parameter3.temination = -1;
[result, condition] = RS232MEX('RF', parameter3)
[result, condition] = RS232MEX('rf', parameter3)
9.1.8. WriteFromFile:
Purpose:
To read from the specified file and write to output queue of the
specified COM port.
Algorithm:
Reads bytes from a file and writes them to the output queue until EOF
is encountered, the byte count is met, or the termination byte is
encountered.
Syntax:
[data, status] = RS232MEX(action, [CommPort, FileHandle, Count,
TerminationByte])
Parameters:
int CommPort - communication port to operate on
int FileHandle – pointer to the file containing the data to be written to
the output queue
int Count – number of bytes to write
int TerminationByte – byte value used to terminate the write
Example:
% assign values to structure element
parameter1.port = 2;
parameter1.position = 0;
parameter1.count = 0;
parameter1.temination = -1;
[result, condition] = RS232MEX('WF', parameter1)
[result, condition] = RS232MEX('wf', parameter1)
30