Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to interface with custom-built A/D board

Subject: How to interface with custom-built A/D board

From: Stephane Carlier

Date: 30 Apr, 2010 15:08:04

Message: 1 of 2

Matlab is able to do data acquisition with AD board from NI, MCC, etc, but i have a different problem.

We have built an ultra-fast A/D board by using a 200 MS/s ADC and an FPGA. The FPGA writes the data to memory via PCI-express. A C++ software takes care of the streaming of data from PCI-ex to memory and did a preliminary processing which reduces the data rate to about 1MS/sec. Now I wish to write a Matlab GUI that periodically read in the data from the memory location and then do some processing/display in real time (update speed ~100Hz). How can I achieve this?

Thank you,

Subject: How to interface with custom-built A/D board

From: Daniel Armyr

Date: 7 May, 2010 07:19:06

Message: 2 of 2

>Now I wish to write a Matlab GUI that periodically read in the data from the memory >location and then do some processing/display in real time (update speed ~100Hz). >How can I achieve this?

You write a mex-file. A mex-file is a C/C++ dll that can do everything a C program can do. In addition, it has an interface to matlab so that it can be called like any matlab function and pass data in and out of matlab. Once you have written this file, you will have access to your the data in matlab and can write a GUI the usual way.

Note, however, that Matlab is not built for high-speed visualisation. Without using some very fancy tricks (so fancy in fact that you might be better off skipping Matlab entirely), you would probably not achieve a visualisation update higher than 10Hz. On the other hand. our eyes have difficulty seeing things faster than 8Hz, so that is probably not an issue.

Read all about mex-files here: http://www.mathworks.com/support/tech-notes/1600/1605.html

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us