Thorlabs / Motion_Control_Examples

Software examples for Thorlabs motion control products (e.g. T-Cube, K-Cube, and benchtop brushless, DC, stepper, and Piezo motor controllers)
MIT License
71 stars 28 forks source link

add the readme files for VCP setup and a serial commaond example about KBD101 #45

Closed ZiyingZhang313 closed 3 months ago

ZiyingZhang313 commented 6 months ago

I've added the readme file to examples containing serial communication codes.

And I finished the serial command example about KBD101. I tested the example with the KBD101. The program runs fine in most cases. The biggest bug I met was that sometimes the serial communication failed and the KCube got totally stuck. The device even can't respond to the wheel or the button, and I can't turn off the device. Such phenomenon doesn't happen every time running the code, but there's some regularity, like getting stuck every third time running the code after rebooting the KCube. I suspected the problem is caused by the transmit buffer or the time interval between two write commands. So I tried to optimize the code. It didn't work at first. I tried many times and I'm not confident the problem is 100% solved now, but I ran the latest code more than 10 times, the KCube doesn't get stuck.