Stream baseband data in MATLAB

Discussion in 'General' started by sweta, Feb 21, 2017.

  1. sweta

    sweta New Member

    Hi,
    i am trying to stream data from X2M200 in MATLAB, while loading 'libModuleConnector64.dll' library in MATLAB, it's thrwing an error "Could not find file libModuleConnector64.h in directory".

    Could you please help me on streaming baseband data on MATLAB?

    Thank you
     
  2. Magnus Bache

    Magnus Bache New Member Staff Member

    Hi sweta,

    Sorry for the late answer.

    Are you trying to load the library directly using loadlibrary(..)?

    I recommend using the ModuleConnector.Library class to handle loading of the library. This takes care of all the includes necessary. You can load the library simply by calling the ModuleConnector.Library constructor. Just remember to add both the include and lib folders to your MATLAB path. Let me know if this helped.

    Regards,

    Magnus Bache.
     
  3. sweta

    sweta New Member

    Hi Magnus,

    I tried with ModuleConnector.Library. All necessary files was in path. The following error are -
    Error using loadlibrary (line 263)
    The specified key is not present in this container.
    Error in ModuleConnector.Library/loadlib (line 32)
    [notfound,warnings] =
    loadlibrary(obj.library_name,obj.library_includes,'addheader',obj.library_recording_includes,'addheader',obj.library_datatypes_includes);

    Error in ModuleConnector.Library (line 24)
    obj.loadlib();

    It's searching for 'libModuleConnector64.h'. MATLAB will support only c compiler.

    Thank you.
    Sweta
     
  4. sweta

    sweta New Member

    and also ModuleConnector requires pre-loading of the dynamically linked library.
     
  5. Magnus Bache

    Magnus Bache New Member Staff Member

    What version of MATLAB are you running? Is it 32 or 64 bit?

    M.
     
  6. sweta

    sweta New Member

    MATLAB-2015a(64bit)
     
  7. Magnus Bache

    Magnus Bache New Member Staff Member

    I'm not able to recreate this. What C compiler have you configured for MATLAB? What is the output of mex -setup?
     
  8. sweta

    sweta New Member

    i had tried with gcc and visual studio compiler. it's searching for 'libModuleConnector64.h' file, that is not in directory.
     
  9. Magnus Bache

    Magnus Bache New Member Staff Member

    There is no libModuleConnector64.h, nor is there supposed to be. The necessary headers are specified in the library includes properties of the ModuleConnector.Library class. How do you know it's searching for this file?
     
  10. sweta

    sweta New Member

    1. i run this command: - mc = ModuleConnector('COM33',5); and following below error popup-
    ModuleConnector requires pre-loading of the dynamically linked library.
    Warning: The following error was caught while executing 'ModuleConnector' class destructor:
    Attempt to reference field of non-structure array.
    Error using ModuleConnector (line 69)
    Cannot find library libModuleConnector64

    2. for pre loading of dll , i run loadlibrary('libModuleConnector64.dll');
    Error using loadlibrary>lFullPath (line 634)
    Could not find file libModuleConnector64.h.

    Error in loadlibrary (line 229)
     
  11. Magnus Bache

    Magnus Bache New Member Staff Member

    Aha. I see...

    When preloading the dll, you should run ModuleConnector.Library. Then create the ModuleConnector instance. Try this:

    % Preload library
    Lib = ModuleConnector.Library;
    Lib.libfunctions; % This should list the set of available library functions.

    % Create ModuleConnector object
    mc = ModuleConnector.ModuleConnector('COM33',5);

    Also, in MATLAB the "+" folder name prefix denotes a package, kind of like a namespace. So to create the objects in the +ModuleConnector folder you need to prefix them with "ModuleConnector.".

    Let me know how this turned out.

    Magnus.
     
  12. sweta

    sweta New Member

    thanks. it worked.
     
  13. sweta

    sweta New Member

    Hi Magnus,
    could you plz explain me what is number of bins mean in amplitude/phase signal?

    Regards-
    Sweta
     
  14. erpeng

    erpeng New Member

    Hi Magnus,
    I am trying to use the matlab demo, but it dose not work:


    Error in loadlibrary>getLoadlibraryCompilerConfiguration (line 527)

    Error in loadlibrary (line 263)

    Error in ModuleConnector.Library/loadlib (line 32)
    [notfound,warnings] =
    loadlibrary(obj.library_name,obj.library_includes,'addheader',obj.library_recording_includes,'addheader',obj.library_datatypes_includes);

    Error in ModuleConnector.Library (line 24)
    obj.loadlib();
    Error in test_BasicRadarClassX4 (line 3)
    Lib = ModuleConnector.Library;

    so, why happen this ? My matlab is 2015a,64bit. And the Radar is X4M03
     
  15. Magnus Bache

    Magnus Bache New Member Staff Member

    Hi erpeng,

    Which compiler have you configured for MATLAB? What happens if you enter mex -setup in the MATLAB command window?

    Magnus.
     
  16. erpeng

    erpeng New Member

    Hi Magnus,

    I find when I enter mex -setup in my matlab, it will get error. So I think it is my matlab's assignment problem.

    Now I can work well in python enviroment. I have another question is how high the frame rate for frame streaming can get! it is very important for my work ,thank you very much !

    erpeng
     
  17. Ash

    Ash New Member


    Hi Magnus,

    Thanks for your post. I followed the same but i face the same error. Could you please help me to resole this?

    this is the error message:
    Undefined variable "ModuleConnector" or class "ModuleConnector.Library".
    Error in XEP_X4_plot_frame (line 20)
    Lib = ModuleConnector.Library;

    Thanks.
    /Ash