LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB - simulate function using PC?

Hi!
 
We are now working on a device which contains a USB host and is able to write data to a UMS and I am the one who will have to test it.
 
I am not too happy about buying a bunch of USB sticks and placing them in the device, then back to the PC to analyze the written data, so I was thinking maybe there is a chance I can use the PC to plug USB directly to the device and simulate several UMS devices. I have some knowledge about USB and it tells me this is not really possible, but I would like a second opinion :). Of course, the idea is to use Labview.
 
If I remember correctly, the hub functionality of the PC is implemented in hardware and I don't know if it is possible to go around the Windows Host Controller (or is that also implemented in hardware?).
 
So what do you think? Do I stand a chance or should I go a different way?
 
Thanks in advance for any help!
0 Kudos
Message 1 of 11
(3,847 Views)
As you have said, host and device are different in hardware.  I don't think it's possible to get around this via software.

There should be devices out there which allow something like you want.  It would sit as a host to device adapter between your device and the PC......

Don't know of any off-hand, but I can imageine it's something which  could already exist.

Another idea.... Can't you put a USB hub between the usb stick and the device you're testing.  That was your PC and device could both have direct access to whatever files are being stored on the pen dirve and there's no plugging ang unplugging......

Shane.
Message 2 of 11
(3,837 Views)

Not sure if this would help but it reads like the OLD "Broklyn Bridge" which let you cable PC's up to to do file transfers.

Ben

BTW: Please note the T-shirt shown on the above page. (Knight that says NI )



Message Edited by Ben on 06-17-2008 09:28 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 11
(3,830 Views)
Hi Intaris and thanks for the reply!
 
I am still investigating the matter and it seems indeed that you may be right and my idea is not possible.

On the other hand, I did quite a lot of googling and was not able to find such a host-to-device adapter on the web. I am actually analyzing the possibility to build something of the sort myself. I want to build a kind of USB-to-RS232 pass-through adapter, with USB facing our device and RS232 facing the PC. Then, all UMS "firmware" is actually implemented in the PC. Kind of ambitious, but it may work.
 
One possible problem with the above idea is the maximum transfer speed of RS232 (as compared to the possibilities of USB), but I am not really worried about that because the architecture of our device makes it rather slow internally and RS232 would be able to deal with it. I think. I'll have to double check. Anyways, going down this path, there is no alternative, because to make a USB-to-USB passthrough I would have to use 2 controllers (I don't think there are USB controllers with 2 USB ports) and still interafce them via UART...
 
Still, USB-to-USB would really be the ideal thing. 😄
0 Kudos
Message 4 of 11
(3,825 Views)
Thanks for the idea, Ben, but the fact that it requires Vista raises 2 difficulties:
  1. Our PCs still have XP. Not sure this is a bad thing. 🙂 Anyways, I work in a big company and I don't have power to influence this.
  2. Our device under test is embedded, so this adapter would REALLY have to behave just like any other UMS device. Apart from that, to test the interface, I need to be able to replicate various kinds of behaviors, including abnormal, on the bus.

Other than this, I will google to see if this adapter can be hacked in some way. It would need both an XP driver and some firmware...

PS: I'm not sure I understand the point with the T-Shirt. 🙂

0 Kudos
Message 5 of 11
(3,821 Views)
Ben,

just what I was thinking about.  Don't know if it'd work, but it's just what I had in mind.

Louis,

Before building something yourself, why not try connecting PC, USB-Stick and device to the same USB hub?

Instead of plugging and unplugging, you can monitor the data at any time.....

Shane.


0 Kudos
Message 6 of 11
(3,817 Views)
@Intaris: I hadn't thought about that. But do you think having 2 hubs on a bus would work? I'll google around for this.
0 Kudos
Message 7 of 11
(3,786 Views)
Louis,

AFAIK, there's no problem having two or even three hubs on a single USB bus.

Shane.
0 Kudos
Message 8 of 11
(3,783 Views)

Even so, I don't think it would offer the functionality I need. I mean, the point is that I must be able to emulate a UMS device. Or more devices...

I must say, I am actually very surprised to find out there are no real off-the-shelf solutions for this. It's like no one makes embedded devices which contain a USB hub...

0 Kudos
Message 9 of 11
(3,752 Views)

All,

 

Any luck finding a way to simulate a USB device using a PC / LabVIEW?  I am hitting the same walls as described in your thread.  I need to write a program that behaves like a printer (device) connected to our CPU (controller).  The CPU uses an internally developed OS but speaks USB per the specification.

 

Matt

 

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 10 of 11
(3,499 Views)