Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to interface ports in Matlab?

Not open for further replies.


Member level 1
Oct 9, 2005
Reaction score
Trophy points
Activity points

does anyone know how to interface the ports(parallel or serial) in matlab?????



First you create a serial port object and pass parameters such as:

s = serial('COM1');


s = serial('COM1','BaudRate',4800,'Parity','even');

then connect to the device with:


then use



out = fscanf(s)

to read/write.

Hope this helps some.

Also, the matlab help has significant files on this.


Re: matlab

dear explorer

in the case of interfacing, specially parallel and serial ports, in MATLAB
the best guite is the following pdf file.

also you can go to "data acquision toolbox" HELP in MATLAB.


What Is the Data Acquisition Toolbox?
The Data Acquisition Toolbox is a collection of M-file functions and MEX-file
dynamic link libraries (DLLs) built on the MATLAB® technical computing
environment. The toolbox provides you with these main features:
•A framework for bringing live, measured data into MATLAB using
PC-compatible, plug-in data acquisition hardware
•Support for analog input (AI), analog output (AO), and digital I/O (DIO)
subsystems including simultaneous analog I/O conversions
•Support for these popular hardware vendors/devices:
- Agilent Technologies E1432A/33A/34A VXI modules
- Keithley boards that use DriverLINX drivers.
- Measurement Computing Corporation (ComputerBoards) boards
- National Instruments boards that use NI-DAQ software (except SCXI)
- Parallel ports LPT1–LPT3
- Windows sound cards
Additionally, you can use the Data Acquisition Toolbox Adaptor Kit to
interface unsupported hardware devices to the toolbox.
•Event-driven acquisitions
Exploring the Toolbox
A list of the toolbox functions is available to you by typing
help daq
You can view the code for any function by typing
type function_name
You can view the help for any function by typing
daqhelp function_name
You can change the way any toolbox function works by copying and renaming
the M-file, then modifying your copy. You can also extend the toolbox by adding
your own M-files, or by using it in combination with other products such as the
Signal Processing Toolbox or the Instrument Control Toolbox.

Who Should Read This Document?
You should read this document if you want to
•Develop an adaptor to support hardware that is not currently supported by
the Data Acquisition Toolbox
•Add new features to an existing adaptor
The Data Acquisition Toolbox Adaptor Kit addresses the needs of individuals
who want to interface the toolbox to a single board, and manufacturers wanting
to interface the toolbox to a range of hardware. Although this document is
aimed primarily at supporting a single board, hardware manufacturers should
use this document as the basis for developing a multiple-board adaptor,
generalizing the single-board support issues appropriately.
What Knowledge Is Required?
To build an adaptor, you should have a working knowledge of
•C++, Microsoft’s Component Object Model (COM), and the Active Template
Library (ATL)
•The functionality of your hardware device, and its associated Application
Programming Interface (API)
•Data Acquisition Toolbox concepts, functionality, and terminology as
described in the Data Acquisition Toolbox User’s Guide
What Effort Is Required?
The effort required to produce an adaptor depends on the capabilities of the
hardware device and your acquisition requirements.
The simplest type of adaptor supports only single-sample acquisition or burst
acquisition, and uses software clocking. You can create this type of adaptor by
modifying the demo adaptor.

Not open for further replies.

Part and Inventory Search

Welcome to