This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Matlab Code for ADC12D1X00RFRB

Other Parts Discussed in Thread: WAVEVISION5

Is there any sample Matlab code for the ADC12D1X00RFRB? 

  • Hi Brian

    Can you explain in more detail what you want to accomplish with the Matlab code?

    We do have some Matlab code that partially replicates the FFT functionality of the WaveVision software used with the ADC12D1X00RFRB, but it is not intended to interface with the board drivers. If that would be useful I can upload it.

    Best regards,

    Jim B

  • Hello Jim,

    Thank you for the fast response.  I would like to use MATLAB to continuously grab blocks of data (8K or 16K points) and implement an algorithm (which includes a couple FFTs)  and make this process move as fast as possible.  In the future I will like to implement the algorithm on the FPGA but for now I need to do the post  processing in MATLAB.  If your code can facilitate taking data from the board then it will be useful.

    Best Wishes,

    Brian F.

  • Hi Brian

    The WaveVision 5 software which controls the board consists of a GUI and a driver (DLL). It is possible to call the driver directly using other software. I believe that should be possible from Matlab, but I don't have any specific examples or support on how to do that. There is a fair bit of information available in E2E on the topic of using the WaveVision 5 DLL.

    First check out the Design Note here: http://e2e.ti.com/support/data_converters/high_speed_data_converters/w/design_notes/1783.aspx

    If you use the Search Community box above right and the search terms WaveVision 5 DLL, you should be able to find additional information and comments on the process from others.

    I hope this is helpful.

    Best regards,

    Jim B

  • Hello Jim,

    Thank you, the files are helpful and I should be able to develop a MATLAB control program for the eval board.  I will post the solutions when I have them.  Thanks again for your help.

    Best Wishes,

    Brian Fisher

  • Hi Brian,

    I would be highly interested in your Matlab solution for grabbing data via the WV5 DLL. Have you succeeded in aquiring data from the ADC board via Matlab?

    Would it be possible to share your Matlab code? That would be great!

    Thanks a lot your your kind support!

    Simon

  • Hello Simon,

    I apologize for the late reply, I was out of the country.  I have not solved the data grabbing issues for WV5 DLL.  I had issues loading the DLL into MATLAB.  I'm going back to  working on the MATLAB acquisition this week actually, perhaps we can help each other.

    Brian

  • Hi Brian,

    thanks for your reply! Looks like we're both kind of stuck at the same point :-(

    With the help of several posts here in this forum I finally got a little C/C++ application to work on my Win7 x64 system using wvdll.dll.

    Then, after struggling with the Microsoft Windows SDK v7.1 installation I was able to select the SDK compiler in Matlab (R2012b, 64-bit).

    The loadlibrary('wvdll.dll','wvdll.h') call then produces the following error message, though:

    Error using loadlibrary (line 419)
    There was an error loading the library "C:\Program Files (x86)\National Semiconductor\WaveVision5\wvdll.dll"
    C:\Program Files (x86)\National Semiconductor\WaveVision5\wvdll.dll is not a valid Win32 application.



    Error in WvDll (line 4)
    loadlibrary('wvdll.dll','wvdll.h')

    Caused by:
        Error using loaddefinedlibrary
        C:\Program Files (x86)\National Semiconductor\WaveVision5\wvdll.dll is not a valid Win32 application.

    From everything I read, I thought that 64-bit Matlab only can load x64 dlls (whereas 32-bit Matlab only can load 32-bit dlls). As I'm running 64-bit Matlab and wvdll was obviously built for x64, too, this error message makes no sense to me...

    Any ideas?

  • I've had this problem in the past, I tried using the "thunckfilename" option but form the loadlibrary help document but it produces an error:

    >>loadlibrary('wvdll', 'wvdll.h', 'thunkfilename','tfile')

    Error using loadlibrary (line 419)

    There was an error loading the library "C:\Users\Admin...\wvdll.dll"

    Undefined function or variable "thunk_build_fn"

    In the end I installed  a 32bit version of MATLAB in order to load the 32bit dll.  

    If you plan on compiling your code to create a standalone exe, you must create a prototype h file to replace the wvdll.h file; use to command 

    loadlibrary('wvdll','wvdll.h','mfilename','wvdll_proto');  

  • Hi Brian,

    I have kind of the same problems which you were experiening with the wvdll library. I was following this post, and I have tried too installing the 32 bit version of MATLAB.

    When I call the "loadlibrary" command, I still get always the error saying that it is no Win32 application.

    I have downloaded the dll from the link at the beginning of this communication, is that the 32 bit version of the dll? Or should I get it somewhere else?

    All the best,

     Giovanni.

  • hi.

    I'm stuck in the same problem that you had.

    do you have a solution for me?

    I put the 'hardware' file in the same place where I have the 'wvdll.dll','wvdll.h', and some other files.

    and I'm using in Matlab:[notfound, warnings] =  loadlibrary ('wvdll.dll','wvdll.h');

    and I keep having the same error:

    Error using loadlibrary (line 418)
    There was an error loading the library "C:\matan\hardware\wvdll.dll"
    ???????? ????? ?? ????.

    Error in Main (line 16)
    [notfound, warnings] = loadlibrary('wvdll.dll','wvdll.h');

    Caused by:
        Error using loaddefinedlibrary
        ???????? ????? ?? ????.

    what sould I do to figure it up?

    Matan

  • Hi Matan,

    It sounds like there may be some missing files. When you load the wvdll it looks for several files in its current directory structure. If anything is missing (like libcint.dll for example) you may get an error like the one you are seeing.

    Try putting your code in the WaveVision5 folder, most likely: C:\Program Files (x86)\National Semiconductor\WaveVision5

    Also, ensure that you've downloaded the latest version of WaveVision5. You may also need to use the P2R1 version of the WV5 API which can be found in the following thread: 

    http://e2e.ti.com/support/data_converters/high_speed_data_converters/f/68/p/280769/1226733.aspx#1226733

    Additionally, as pointed out above this is a 32 bit dll and should be used with a 32 bit version of matlab.