title: How to effectively work with devices over a serial connection?
body: <p>I have struggled with this for a long time, and I did get a solution working eventually but it wasn't pretty, and I am hoping to gain a little wisdom from the stackoverflow community about how this should be done.</p>
  
  <p>Basically I am working with motors that connect to the computer using a daisychained USB connection and I have to communicate with them using the SerialPort class in .Net and it goes through some driver installed on the computer to talk with the motors over USB.</p>
  
  <p>The problem is that the motors are daisy chained, and when I ask</p>
  
  <p>for information from one, or tell it to do something, i have to wait on the result to come back before doing something else with that motor or with any of the others.</p>
  
  <p>I've just had a generally hard time with it, and I'm sure there are better ways of working with serial communication that I've just never been exposed to. Are there any good guidelines or best practices for this kind of thing? Is this a fairly standard thing to do be doing (serial communication -> usb via a driver installed on computer)</p>
  
  <p>I'm working with six of the <a href="http://www.imshome.com/products/mdrive23plus_mdi.html" rel="nofollow noreferrer">MDrive23Plus Motion Control</a> motors from <a href="http://www.imshome.com/" rel="nofollow noreferrer">IMS</a>.</p>
  
  <p>I can provide plenty more details, but I'm not really sure where this will lead. I hope this is specific enough for StackOverflow, though I know it is sort of vague. I just don't really know how to ask it any better.</p>
  
  <p>Really what it comes down to is how do I synchronize communication effectively, and how do I wait and read the data coming back effectively? I know this is probably very simple to some people, but it just hasn't been working well for me.</p>