2

I'm using Matlab's Data Acquisition Toolbox for interfacing with a National Instruments ADC. Unfortunately, I only have access to the hardware in my lab for limited parts of the day, but I'd like to be able to develop and test my code when I don't have access. Does anyone know of a way that I can collect some sample data, then feed it into the DAQ toolbox from a file instead of from the actual hardware? It needs to be input over time, same as it would with the NI hardware.

Current code:

s = daq.createSession('ni');
s.addAnalogInputChannel('Dev1',0,'Voltage');
s.Rate = 250;
s.DurationInSeconds = 30;
lh = s.addlistener('DataAvailable', @(src,event)myfunction(src,event));
s.NotifyWhenDataAvailableExceeds = 1000;
s.startBackground();
s.wait();
delete(lh);
Jordan
  • 3,998
  • 9
  • 45
  • 81
  • It would be useful if you could post some code, showing exactly how you are using ACQ to get your data. Spoofing data isn't hard, (a second MATLAB instance writing to a file should suffice) but it's difficult to answer your question with such an abstract problem statement. – Justin Fletcher Jun 16 '14 at 15:41
  • @fletch Of course, it is added now. – Jordan Jun 16 '14 at 15:48
  • I dont know about reading from a file, but you can create a virtual channel for that purpose and use the same matlab code you have. read more on creating a virtual channel here: http://www.ni.com/white-paper/5375/en/ – bla Jun 16 '14 at 17:52

0 Answers0