MATLAB Answers

Hi/Low analog output to USB

11 ビュー (過去 30 日間)
Naz
Naz 2013 年 1 月 20 日
コメント済み: Walter Roberson 2015 年 9 月 4 日
Hi,
I am trying to use MatLAB script as an on/off switch. In simple words, I wish to set a constant output of ~0V (low) or ~5V (high) at the USB port whenever I need to. How could I do this in a most simple and inexpensive way?
Thank you

  0 件のコメント

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2013 年 1 月 20 日
This cannot be done directly with USB. USB is a shared serial bus, and only digital signals can be carried on it. If you were to use USB you would need to have a USB-interfaced device on the other end that decoded the serial commands to turn a switch on or off.
One important question for this purpose is what kind of rate of change do you need for this purpose? Another question is what precision you need in the timing. A third question is how much control you need over the pulse widths.

  13 件のコメント

表示 10 件の古いコメント
Image Analyst
Image Analyst 2013 年 1 月 21 日
The devices I'm using do not give pulsed outputs (rectangle waves or pulse trains) unless you tell them to - basically I think you'd have to manually tell it to go high, then go low, then go high, etc. Normally you just set a value and it stays there.
Walter Roberson
Walter Roberson 2013 年 1 月 21 日
That would certainly be easier than breadboarding in a flip-flop.
Naz
Naz 2013 年 1 月 21 日
Walter, Image Analyst: Thank you very much for such an extensive discussion. I greatly appreciate your time. This discussion will be usefull for many people. Regards, Naz

サインインしてコメントする。

その他の回答 (2 件)

Image Analyst
Image Analyst 2013 年 1 月 20 日
For $89 or so you can get a USB device that you can read pins from. See http://www.mccdaq.com/usb-data-acquisition/USB-1024-Series.aspx

  5 件のコメント

表示 2 件の古いコメント
Walter Roberson
Walter Roberson 2013 年 1 月 20 日
The particular device IA lists has digital I/O but no analog I/O. The device that Naz lists has digital I/O and analog input but no analog output.
Image Analyst
Image Analyst 2013 年 1 月 20 日
MCC has numerous such devices, many of which support analog. I have one: http://www.mccdaq.com/solutions/USB-Data-Acquisition.aspx - the USB-3100.
I'm only familiar with some of the MCC devices, not the DLP Design or other brands. MCC has excellent free tech support.
Walter Roberson
Walter Roberson 2013 年 1 月 20 日
It looks like their 1208LS might be suitable: USB, 2 analog outputs of 12 bit resolution, $129.
In terms of effort involved, possibly their device with built-in relays would be easier: USB, 8 SPDT relays, $329. I'm just thinking in terms of the time and effort to put together a relay, mount it on a small breadboard, test it, and so on. A relatively easy lab assignment for an EE student who was provided with parts and testing equipment, but a nuisance for people who do not have those things on-hand or have the relevant experience.
(I think I still remember how to solder, but it would probably take me at least 3/4 hour just to track down a local store that still bothered to stock the parts, now that the days are long gone where RadioShack carried parts like these...)

サインインしてコメントする。


Matyas Varga
Matyas Varga 2015 年 9 月 3 日

  1 件のコメント

Walter Roberson
Walter Roberson 2015 年 9 月 4 日

Price and availability of those appear to be questionable. It appears to me that they are no longer sold by NI, and auction sites list them between $US150 and $US300 plus about $US25 shipment from overseas.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by