FPGA and MATLAB communication HELP!

Now I have written verilog or VHDL and load commands into FPGA. Then it produces some data that I need.
The problem is [COLOR=“Red”][SIZE=“5”]I need these data to be processed by MatLab, is it possible for the FPGA board to communicate with MatLab (GUI) in Real Time? [/SIZE][/COLOR]
If it is, can you provide some [COLOR=“red”][SIZE=“5”]examples[/SIZE][/COLOR]?
And for the output data of FPGA to MatLab, what is its [COLOR=“red”][SIZE=“5”]format[/SIZE][/COLOR], is it .mat file which can be directly read by MatLab?

[COLOR=“DarkOrange”][SIZE=“4”]Thanks very much!!![/SIZE][/COLOR]

:):):slight_smile:

@wenfeng-

Yes, this is possible. Matlab provides an extensive ability to communicate with external DLLs. You can simply make calls to these methods.

We also provide a sample Matlab API (see the API folder in your install directory). Although unsupported, this is a good start for you to review the source code and see how it works.

Regarding the format, the data is read directly into Matlab data structures if you call the DLL. (calllib)

Please try to make judicious use of the forum formatting.

Hi, thanks for ur help.
Now I have downloaded one ok_test.m (contributed from jmahan) from this forum for trial. Below is the error message i got:

In loadlibrary at 279
In ok_test at 12
Warning: The function ‘okFrontPanelDLL_LoadLib’ was not found in the library
In loadlibrary at 323
In ok_test at 12
Warning: The function ‘okFrontPanelDLL_FreeLib’ was not found in the library
In loadlibrary at 323
In ok_test at 12
??? Error using ==> calllib
No method with matching signature.

Error in ==> ok_test at 19
[m,voidPtr] = calllib(‘okFrontPanel’, ‘okUsbFrontPanel_GetDeviceListModel’, xptr,
j-1);

I am using latest frontpanel 3.0.11 and latest version of matlab 7.5.0
Board is 3010-1000

I think the ‘voidPtr’ gives me the error message. When i deleted the voidPtr, the code can be executed. The rest codes can be executed without the voidPtr but the functionality changes.

Can you help with this? Thanks