Freesteel Blog » Threads

Threads

Thursday, October 19th, 2006 at 8:07 am Written by:

On Tuesday afternoon I went to the engineering department and together with Carl rejigged the python script he uses to control their machine. We now use two python threads, one controls all moves of the motors, updates the user interface edit boxes with the current position and speed data, and also controls buttons that are pressed or unpressed automatically when the machine is rotating. We have a separation of user interface and motor control so that the user interface is always responsive. The UI passes requests for movements through a queue to the motor thread.

In the past we could use just one thread because we always ever had to handle one request for the motors to move. The calls to the DLL for the controller card always return immediately, the controller maintains it’s own motion queue. But we had to implement sequences of movements of different speeds and pauses. The queueing system we have now in place in the python thread allows that now easiy.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>