Quote Originally Posted by LiamC View Post
...
QUESTION:
1. Is this correct or close to ?

2. I guess step1 should be started in the SIGNALED STATE (=AutoResetEvent (True)) if I want to have a loop around SerialPort.Write() ?

3. Are the Waithandles the best way to have all these other tasks working separately and at the right time, the way you did with the first 2 (to return the string in the TxtBox) ?...
Your analysis seems correct, but then your question 2 confuses me. The autoreset event indicates data was received.

Question 3: as good as any IMHO.

This is what I think you/system is trying to do.


  1. Open the port
  2. Send a command that causes the object to move
  3. When it stops you take a picture - I am assuming that there is some data received that indicates stop
  4. Repeat 2-3 some number of times


Can you, with minimal changes to the code I provided, send one move, take a picture, and then stop?