An open exchange for the MATLAB and Simulink user community |
Hosted by The MathWorks |
|
| Related Topics |
| New Products | Support | Documentation | Training | Webinars | Jobs | Newsletters |
| Problems? Suggestions? Contact us at files@mathworks.com | © 1994-2008 The MathWorks, Inc. Trademarks Privacy Policy |
Hi Doug, I saw your demonstrations of http://blogs.mathworks.com/pick/2007/12/04/advanced-matlab-data-acquisition-in-matlab/, but I can’t see the winsound input, matlab said me the following:
??? Error using ==> analoginput.analoginput
Error using ==> analoginput.analoginput>localCreateAnalogInputObject
Failure to find requested data acquisition device: adaptor.
Can you help me please?
Thanks
Juan Manuel “El Mer” Merlo
Juan,
This is a question best answered by my colleagues in Technical support. They can be reached here:
http://www.mathworks.com/support
Doug
My questions are
How to use Matlab to record computer mouse movement
Do I need the Data Acquistion Toolbox to do so
Thanks,
Di-An
Di-An
I just put up this video:
http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/
This should help you.
Doug
Hi Doug, I have a question regarding DAT and usb mice, which doesn’t fit under either of your two previous posts.
I am trying to devise a cheap pendula experiment for university and highschool students,
the idea is to use a usb mouse (as has been done before, but differently and not using Matlab) as the sensor. I would like to use Matlab to acquire data from the usb mouse (specificaly the coordinates which would now be angles), but it should not be identified as a mouse, and should not interfere with the computers primary one.
I thought it might be possible to use DAT by creating an adaptor for the usb port, and then considering considering it as a digital input and not as a mouse.
As I have never used DAT before I am not sure this is possible, and if it is, exactly how to go about it.
Any help would therefore be very much apreciated!
Thanks!
Dayal,
USB is not a protocol but if you have a dll driver for the mouse and know the API you can write a DAT adaptor.
Having said that, writing a DAT adaptor is not an easy task and we usually recommend it only for the hardware vendors themselves. This doc
http://www.mathworks.com/access/helpdesk/help/pdf_doc/daq/adaptorkit.pdf
has all the information necessary for writing an adaptor.
There are some inexpensive USB devices available that we do support (some from Measurement Computing, some from National Instruments) but you would then need to find a sensor.
DAT does not appear to be the correct solution for this problem.
Doug
Dayal, here’s another thought that could use the Data Acquisition Toolbox. Use a rotary potentiometer (variable resistor) as a sensor. The basic idea here is voltage divider. Place a reference voltage (say 5V) across the ends and connect the wiper pin to the analog input channel. The digitized voltage would be proportional to the rotation angle of the pot. Many cars now use exactly this for the gas pedal sensor, In fact, maybe you can take the foot pedal off a video game, or from a sewing machine, etc.
Cheers
Bob
Hi Doug,
Is there a way to analyze the rpm of an engine from the sound with Matlab? I downloaded an example “Real time octave analysis” http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=3076 and I tried to put in a band-pass filter but the program crashes every time when I try to run it.
If there is a way to do that, can you give me an idea how? For an 12 cylinder 4stroke engine and rpm between 800 – 9000 (16.67-150 Hz) it gives a maximum of 900 pulses a second. So I think I will need than a Fs > 1800 Hz. But is there a way to filter real time data ?
Thanks,
Gert
Gert,
I can not speak to the stability of any of the File Exchange, you will need to speak to the original author about that. However, to filter “Real Time Data”, you need to be more specific. Are you tying to get the results of your analysis while the test is running, or is this post test analysis. If you want the results while the test is running, how “Real Time” do you need to be. You might end up using Real Time Workshop. Explain more what you are looking for, and I will try to help.
Doug
Hi Doug -
I’m trying to use an accelerometer to measure the tilt angle and record that data in MATLAB. I have it hooked up to a power supply and to a Measurement Computer USB-1208FS DAQ. Then I have code in MATLAB to acquire the data. It works for a second or two, but then it stops. Is there a template code for doing something like this? Any clue on the problem?
- Bryan
Hi all,
I have the Data Acquisition Toolbox, and I’m trying for 2 weeks to send a step voltage, and just after another one of a different voltage WITHOUT going back to “zero” between the two..
I tried to do it little by little and I saw that the “start” function between the two steps reinitialize the voltage at a value of zero volts. And I wouldn’t like it because the piezo I want to control has a really fast response time..
Furthermore I think I am compelled to use a “start” function between the two steps because I have to compute de Amplitude of the second step in real time so I don’t have to prepare the two steps before and put both of them in the engine using one “putdata”.
Is there a way to avoid it ?
Thank you a lot, This problem is really annoying me.
Pierre
Hello Pierre,
Please look at the OutOfDataMode property.
http://www.mathworks.com/access/helpdesk/help/toolbox/daq/outofdatamode.html
You can use it to set a value that will be held when the queued data has been output.
start will not set the output voltage to zero until that value is in your output signal.
Regards,
Sherryl
In Response to Post #10 by Bryan -
Hi Bryan,
By default the analog input object will acquire one second worth of data.
There are many ways to acquire more than that.
1. Set TriggerRepeat to greater than 0
2. Set SamplesPerTrigger to a larger number than the default, which matches the default SampleRate
3. Use either a TimerFcn or SamplesAcquiredFcn callback to restart the acquisition
All of these things are well documented here:
http://www.mathworks.com/access/helpdesk/help/toolbox/daq/daq.html
They can also be seen in the demos . Bring up MATLAB and type:
demo(’toolbox’,'data acquisition’)
at the command line (requires that Data Acquisition Toolbox already is installed).
Regards,
Sherryl
Hi sherryl and thank you for answering me,
Actually, I already tried before to use this property because I saw that it was what I wanted, nevertheless I got this error:
EDU>> AO = analogoutput(’ueidaq’,'pwrdaq://dev0′);
EDU>> addchannel (AO, 0);
EDU>> AO.OutOfDataMode = ‘DefaultValue’;
??? Error using ==> daqdevice.subsasgn at 108
Error using ==> daqdevice.set at 261
Invalid property: ‘OutOfDataMode’.
Then I tried to skip it just by doing :
EDU>> AO.Channel.DefaultChannelValue = 5;
And then I had no error but also no effect : I still got a value of “zero” instead of 5 volts between the two steps ..
I don’t know why this property is not recongnized, do you ?
I am using the R2007a student version of matlab.
Thanks,
pierre