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
A tool is provided to interact with data and programs external to the MatLab
TM
environment
by taking advantage of the MatLab
TM
Application Program Interface (API). By utilizing MEX-files
(MatLab
TM
executable files), there is a library of functions that provide a communication link
between MatLab
TM
and an external environment. The MEX-files (Dynamic Link Libraries DLL) as
they are called in the Microsoft Windows environment, are linked subroutines that may be loaded
and executed in the workspace.
The MEX-files behave just like M-files and built-in functions in MatLab
TM
. The difference is
that M-files have a platform-independent extension, ".m", whereas MatLab
TM
identifies MEX-files
by platform-specific extensions. This system was developed under the Windows Platform,
hence, the dll suffix. The MEX-files may be called exactly into the workspace as any M-function
is called.
In the SPPDF-01 and in the Windows Platform, if there is a MEX-file called LINK.DLL, it is
invoked from MatLab
TM
as LINK if no arguments are required. The call can be made from either
the workspace or another M-file.
The "software plug", MEX-file or DLL using the FCL implements serial communication rou-
tines that provide the protocol link for the loading of coefficients into the SPPDM-01 filter plat-
form.
The Software "Plug" syntax: The "software plug" may be called using the following syntax:
[data, status] = RS232MEX (command, parameters)
The command input is a character string. With this input, an action is performed using the
parameters input. The actions performed are specified as follows:
Character Code
Action
'O' or 'o'
: open and configure a communication port
'C' or 'c'
: close communication port
'WF' or 'wf'
: write from file to output buffer
'WB' or 'wb'
: write to output buffer
'FI' or 'fi'
: flush input queue
'FO' or 'fo'
: flush output queue
'RF' or 'rf'
: read to file from input buffer
'RB' or 'rb'
: read from input buffer
'RY' or 'ry'
: read byte from input buffer
'WY' or 'wy'
: write byte to output buffer
26