Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous AI and DI and analysis on matlab ?

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.....

0 Kudos
Message 1 of 6
(3,654 Views)

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.

.

Regards,
Efrain G.
National Instruments
Visit http://www.ni.com/gettingstarted/ for step-by-step help in setting up your system.
0 Kudos
Message 2 of 6
(3,634 Views)

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 ?

0 Kudos
Message 3 of 6
(3,606 Views)

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

  •  Multi-Function-Synch AI-Read Dig Chan.vi (55.4 K) LabVIEW 8.5
  • Get Terminal Name with Device Prefix.vi  (25.7 K) LabVIEW 8.5

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.

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 4 of 6
(3,572 Views)

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..

0 Kudos
Message 5 of 6
(3,495 Views)

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!

Gary P.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(3,476 Views)