06-08-2009 04:25 AM
Solved! Go to Solution.
06-09-2009 10:46 AM
murat,
Thank you for posting on the NI Forums. The reason that you are getting these errors when you try to run your program is that there is not an API for the NI scopes with Matlab®. You have a couple of options. You can use the C API to write code in C and interface with the 5112, you could program in LabVIEW, I also found a forum post where a couple of individuals used the "Matlab® Node" to make calls to Matlab® from LabVIEW. That forum can be found here. Hope this helps.
06-09-2009 12:06 PM
Dear Aaron;
Thanks for your suggestions. But I could not understant what you mean: "The reason that you are getting these errors when you try to run your program is that there is not an API for the NI scopes with Matlab®".
I must use Matlab m file for my Ph.D thesis. I could not use LabVIEW (because I don't have a licence for LabVIEW). Is it possible to use my NI 5112 with Matlab®. Can you help me How can I solve this problem and compile my mex files urgently.... Please......
06-09-2009 01:39 PM
Murat,
When I mention that there is not an API for the NI Scopes with Matlab®. I mean that our driver for our NI-Scope devices has not been designed specifically to work with Matlab® without first using LabVIEW. I do not have any idea how to about how to get the mex files to compile correctly as I have not used Matlab® with any of our devices. It sounds like you are at a university, and most universities have a site license for LabVIEW, so that would be my best suggestion for getting the scope acquiring data. The other option is to use Visual Studio or other C Compiler to write the code in C, as the NI-Scope driver will support development with C. If you could make a dll file from the C code you might be able to call that dll from within Matlab®. Once again, I am not familiar with Matlab® and am not sure if this will work or not. Those are a couple of suggestions that I would suggest looking into. Another option is to talk to MathWorks, Inc. who makes Matlab® and see if they have any suggestions for interfacing their software with the 5112.
You might also look into look into the NI LabVIEW Math Interface Toolkit, which allows you to call LabVIEW applications in Matlab®. It requires you to build the program with LabVIEW, but it might be an option. You can find the link to the toolkit here.
MATLAB is a registered trademark of The MathWorks, Inc.
06-10-2009 02:39 AM
Aaron W.
Thanks for your suggestions again. I want to explain why persisting on the Matlab mex file:
I am able to run my NI 5112 with C, Visual C++, Visual Basic and Visual C#. I dont have any problem with these languages related with NI 5112 . But I must use Matlab Wavelet Transform tool kits for my subjetc. I wrote a gui application on Matlab using with Matlab GUI interface (this application uses Matlab Wavelet Transform tool kits to process data). But I need a code to acquire data from NI 5112 . This code must be base on Matlab codes. I want to take data in my Gui application via this code and process this data with Matlab Wavelet Transform tool kits synchronously. So I decided to use mex file (for converting C routines to Matlab routines). There is an C application may be you know which name is GettingStarted. I used this first, but could not and I wrote you....
I want to ask last a question. If I have been understood true , Is it possible to compile a mex file for NI 5112 with LabVIEW and this mex file can be call from Matlab m files.???.
06-10-2009 09:28 AM
Murat,
If you use the LabVIEW Math Interface Toolkit it appears that you will be able to create a MEX-file. On this page here, it mentions "The Math Interface Toolkit connects the two systems by compiling fully-developed LabVIEW applications into MEX-files." My suggestion would be to look into the Math Interface toolkit and see if it will work for your application.
MATLAB® is a registered trademark of The MathWorks, Inc.
06-15-2009 02:01 AM
Hello;
I downloaded evaluation version of the LabVIEW 8.6v. But I could not find LabVIEW Math Interface Toolkit in it. I think the toolkits must be download separately. But There is no link for evaluation version of LabVIEW Math Interface Toolkit. Could you help me how can evaluate LabVIEW Math Interface Toolkit free. Is there a way. Thanks for your help...
06-16-2009 03:04 PM
Murat,
Sorry for the delay in reply, but I have done some research into what exactly is included in the Evaluation DVD. I thought that the Math Interface Toolkit might be included, but I found out that the toolkit is NOT included in the DVD. I was unsure as to why, but I found out that our Math Interface Toolkit is not one of our toolkits where we offer for trial version. We offer only some of our toolkits for trial version, but unfortunately this is not one of them. The only way to use the toolkit would be to purchase it. I apologize for the inconvenience.
12-18-2009 06:43 PM - edited 12-18-2009 06:43 PM
Murat, hopefully this doesn't reach you too late..
You have two options to use NI hardware with Matlab.
1) You can either use the Matlab Instrument Control Toolbox (which is what you would usually use to communicate with instruments) and use the NI IVIScope driver to interface with the 5112.
http://www.mathworks.com/products/instrument/supportedio13785.html
The 5112 IVI driver is here: http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E950B659CE034080020E748...
2) Or, you can use the C DLL interface in Matlab to talk to the NI created driver DLLs.
Further, NI provides you with example code to have most if not all of the functionality of a traditional boxed instrument for free.
Best of luck with your thesis if you're not yet finished with it.
Regards,
Tolga Cengiz
Field Sales Engineer
National Instruments