09-01-2010 08:11 AM - edited 09-01-2010 08:14 AM
Hello
My job is to read two analog and two digital inputs simultaneously and analyse them. One of the digital inputs is my trigger source. I am using NI USB-6251 daq card. Actually i am a matlab user and have to analyse data on matlab. I have done some applications with matlab daq. toolbox. But matlab daq toolbox not suitable for this app because it doesn't support clocked digital io.What is the way to get this data and save it to a bin file so i can open that data on matlab. I have done some research about this but i couldn't find a clear explanation.
Thanks.....
09-02-2010 01:38 PM
Dear Baris,
As you pointed out, the Data Acquisition Toolbox does not support hardware timed DIO. In this case, my recommendation would be to write a small program in ANSI C, C++ or .NET that contains your required DAQmx calls. You can use this program to save your data unto a binary file. You should be able to open this file in MATLAB®.
To get you started I would recommend looking at the Referance Help and Example code that is included with the installation of your DAQmx drivers:
Start>>Program Files>>National Instruments>>NI-DAQ>>Text Based Code Support
Now if you happen to have LabVIEW, it will be significanlty easier to just write to a binary file there and use that file later.
.
09-04-2010 04:45 AM
Thanks for your help.
I have dowloaded labview trial and installed it, this is first time i am using labview. I it is really simple with labview, do you have any suggestions where to look a help for this job. I really don't want to spend much time learn labview because probably i will never use labview again, just this measurement.
Also i found this page http://decibel.ni.com/content/docs/DOC-12185
I have downloaded vi files when i attemp to open files it seeks for another vi files. I couldn't understand how to open this files. Is this example suitable for me ?
09-07-2010 05:21 PM
Hello,
The simplest way to get started is using examples such as the one you have found. There is also ni.com/gettingstarted where you can view tutorials on LabVIEW basics.
To run the community example, make sure you have both files off the page
Also, you will need the DAQmx driver installed. This installation comes after you install LabVIEW. The download can be done online here. The most recent version at this time is DAQmx 9.2.1.
09-23-2010 04:47 AM
Thank you i have installed daqmx again, example file worked fine this time. Does anyone have any suggestions for easiest way to save acquired analog and digital data to a file.
Thanks..
09-24-2010 12:47 PM
Hi Baris-
The best thing for you to do is utilize the example finder. Kyle recommended a couple of examples above. When you get the example finder open, click on the Search tab and type in "File". Search that term and you will get a list of about 50 example VIs that all demonstrate different ways to save to a file. A few I would recommend (depending on what file type you are trying to write) are:
Cont Acq&Graph Voltage - To File (Binary).vi
Write Binary File.vi
Write to Text File.vi
I hope this helps. Best of luck with your application!