Closed flowbee1974 closed 2 years ago
Unfortunately it is possible that there is nothing that can be done to fix this error from within msl-equipment. Thorlabs provides the Kinesis SDK which handles the communication between the computer and the device. All the Python code does is it calls the functions within the SDK with the appropriate data types and values. If your code works (even only once) then this might mean that there are bugs in the version of the Kinesis SDK that you are using or the functions that are being called may not be executed in the expected order (where expected refers to what the developers who wrote the SDK code had in mind for proper usage).
I have found that different versions of the Kinesis SDK have different bugs and I have had discussions with the Thorlabs software engineers where they told me not to call some functions because they have known issues.
Some suggestions:
1) If you have access to older versions of the Kinesis software then you could try to install it to see if the issue goes away.
2) Try reducing the example code to do the bare minimum to achieve what you want in a reliable way.
3) Power off the BSC203, disconnect the USB cable from the computer then power on the BSC203 and plug in the USB cable into the computer.
4) Run the GUI that comes with Kinesis. Sometimes this fixes communication problems. The Kinesis software probably does the expected sequence of function calls.
It is possible that the Kinesis developers changed a data type (e.g., from a uint32 to a uint16) in v1.14.30 and the Python code is using the data type for a previous Kinesis version. I will have a look.
Thanks. Yes- I was also expecting that the error is not related to the msl equipment. Concerning 3 and 4: Both approaches make the code work again - at least partially until the windows error comes up again. I will try approach 1 and let you know..
Just letting you know that I tested the example with Python 3.9.7 (conda) and Kinesis 1.14.30 (x64) on a Windows 10 x64 (build 19043) computer and I was able to run the example bsc201.py
script 10 times without an error being raised. I also tested Kinesis 1.14.28 (x64). The only difference is that I don't have access to a BSC203, so I have never tried communicating with that device. According to the Kinesis manual, the same DLL supports: Benchtop Stepper Motor (BSC103, BSC102, BSC101, BSC203, BSC202 or BSC201).
Hopefully you can track down what is causing this issue.
Hi,
executing the example code in
https://github.com/MSLNZ/msl-equipment/blob/main/msl/examples/equipment/thorlabs/bsc201.py
sometimes works fine - sometimes I get
OSError: [WinError -529697949] Windows Error 0xe06d7363
I have to mention that I actually got the two BSC203 (3 channel controllers)
Kinesis Verion 1.14.30 Python 3.9.7 (Anaconda)