Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
What i need to know is what is the best method for sending data from multiple instances (upto 30) of the same vb.net aplication via usb, to a master controller that sends the data to the appropriate slave controller.
The boards in question can be found from the links below:
http://www.pc-control.co.uk/iso_master.htm
http://www.pc-control.co.uk/digital-io-slave.htm
I was thinking of using the message queue service? but im unsure if this will be able to cope with upto 30 instances sending data every 15mS? (extreme worst case scenario!).

I also thought of using the windows communication foundation (WCF) service client? But unsure where to even start!:confused:

Any advice on which method to use or alternative solutions would be greatly appreciated. :-D
Posted
Updated 15-Feb-11 1:01am
v2
Comments
#realJSOP 15-Feb-11 7:32am    
Can USB even handle that kind of throughput? It might be able to if you use USB3, but I'm not so sure USB2 can do the job.
phil_hobbs 15-Feb-11 8:59am    
USB 2.0 has a raw data rate at 480Mbps, and it is rated 40 times faster than its predecessor interface, USB 1.1, which tops at 12Mbps. Originally, USB 2.0 was intended to go only as fast as 240Mbps, but in October 1999, USB 2.0 Promoter Group pumped up the speed to 480Mbps.

If the output string is 12 bits. 12 bits x 30 = 360. 360 bits sent every 15mS
1000Ms / 15 = 66.667
so 360 x 66.667 = 24,000.12 bits sent per second

even if the output string is 50 bits. 50 bits x 30 = 1500. 1500 bits sent every 15mS
1000Ms / 15 = 66.667
so 1500 x 66.667 = 100,000.5 bits sent per second

100000 bps
= 750.00 KB/min
= 12.50 KB/s
= 100.00 Kbps
= 12.21 KiB/s
= 45.00 MB/h

so well within the 480Mbps of USB2.

The 15mS are pulses to a stepper motor so timings can be adjusted if need be.

But the actual problem is multiple instances of the same program (sending data to different slave boards) accessing the master controller.

1 solution

If this is giving you a real problem, then why not have a single instance of a master application which communicates directly to the USB device, and all the other Apps communicate only with it?
That would mean that the master could ensure that messages are complete before it started to stream them down to the USB.
Might make your architecture easier, and provide the possibility of running some of your other apps on a different pc.
 
Share this answer
 
Comments
phil_hobbs 15-Feb-11 9:57am    
Thanks OriginalGriff,

Would you suggest using the message queue service for the master application? Or could you recommend any other solution?
OriginalGriff 15-Feb-11 10:04am    
I'd just set up the appropriate number of sockets, and handle things as it comes in.
That way it doesn't matter where the app is, the socket just waits for a connection.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900