Clear Filters
Clear Filters

reading external data via lan or usb or others

8 views (last 30 days)
Hi everybody....I want to read outside world data by matlab , perhaps via LAN , USB, or anything else.How can I do that?

Answers (3)

Image Analyst
Image Analyst on 6 Apr 2012
You might want to consider buying the Data Acquisition Toolbox.
  3 Comments
Ahmed Tawfeeq
Ahmed Tawfeeq on 6 Apr 2012
instrument control toolbox reads data from a rather sophisticated hardware interface which I don't have , what I have is an analog voltage taken from human body and this voltage I want it read by matlab...
Walter Roberson
Walter Roberson on 6 Apr 2012
Instrument Control Toolbox is the toolbox that has the tcp and udp functions that would allow data to be read over a LAN.

Sign in to comment.


Jason Ross
Jason Ross on 6 Apr 2012
What do you want to read the data from? A file on your LAN or USB stick? An instrument? A camera? What do you mean by "anything else"?
  1 Comment
Ahmed Tawfeeq
Ahmed Tawfeeq on 6 Apr 2012
I have a project that requires inputting an external data towards matlab simulink ,I tried to use the mic(FROM AUDIO DEVICE)block in the simulink library but there was a problem caused by the noise...I wonder if there is a block that reads the data as the mic block does but from LAN or USB or may the serial or parallel port.Thanks in advance.

Sign in to comment.


Walter Roberson
Walter Roberson on 6 Apr 2012
Instrument Control Toolbox is the one for reading data from a LAN or remote instrument with internet capabilities.
Reading data from a parallel port is not recommended for new work. Parallel port access was deliberately made more difficult by Microsoft after Windows XP, and by the time of Windows 7 has to be done by nearly cheating on interfaces. Parallel port access will be removed in a future version of MATLAB.
Reading from a serial port is possible, provided that the device has a serial port to communicate with. Serial ports cannot be used to directly monitor voltage sources: serial ports require a specific protocol and specific timings. Parallel ports are more flexible in some ways, but still parallel ports cannot be used to directly monitor voltage levels other than in a "exceeds a particular standard voltage or it doesn't" sense.
The microphone input can be used to monitor voltage levels, provided that the voltage is in the range -0.447 V to +0.447 V relative to reference. If not then you may need to use amplifiers or resistors or voltage shift circuits to get the voltage in the right range, but those may introduce noise. You will almost certainly get clipping noise if your voltage is outside the above range.
The recommended approach for this kind of thing is to use an analog to digital convertor, possibly as a direct card in the computer. The Data Acquisition Toolbox is valuable if you use an A/D convertor.
With regard to USB: USB is a serial bus with a very specific protocol. There is no way to directly attach a voltage source to a USB port and measure the voltage levels. Some A/D convertors have USB interfaces; if you use such a device, then you must install the drivers for it, and the device must present itself as a "virtual serial device" and you would communicate with the device using serial port commands.
The only other realistic possibility with USB is if the device presents itself as a file system and offers what looks like a file, that contains a block of data when you "read" the file. This would not be common at all for an A/D convertor, but it can be worked with.
Ok, I guess a USB microphone could also be worked with, on the same basis as a microphone.
If all that you have now is the voltage source and for some reason you cannot get an A/D convertor, then microphone is all you can do.
  1 Comment
Image Analyst
Image Analyst on 6 Apr 2012
I like using the MCC PMD-1024 (http://www.mathworks.com/products/daq/supportedio14004.html#USB) for doing things like detecting switch closures. It's a nice little USB device. They have USB devices that act as ADCs, measure temperature, and lots more.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!