sunjerry019 / nanosquared

Open Source M-Squared Measurement Automation using Dataray WinCamD and Ophir NanoScan. WinCamD and NanoScan code may be used independently
GNU General Public License v3.0
6 stars 1 forks source link

C# Implementation of interfacing with the NanoScan Device #12

Closed sunjerry019 closed 2 years ago

sunjerry019 commented 2 years ago

After discussing with the lead software engineering in-charge of maintaining this software at MKS Ophir Optics, we came to the conclusion that many functions just do not work well between that particular ActiveX COM interface and Python. One particular error was an error in pywin32 that results in by-ref parameters being passed wrongly to the COM interface. This error was only fixed in version 300, which is not available to us right now.

In any case, Python can use C#.NET DLLs through pythonnet very well and this particular ActiveX COM Interface works decently well in C#. This sub-project therefore serves to wrap the interop DLL in a way that can be accessed by Python, thereby saving a lot of work trying to find workarounds to make things work.

The current implementation has been minimally tested, but should be ready to be merged for more development.

sunjerry019 commented 2 years ago

Limitations It seems that GUI Functions such as the showing and hiding of the NanoScan window does not work through the 32-bit server provided by msl-loadlib. I am unfamiliar with the implementation of msl-loadlib's server32, and I don't think it is very relevant at this point.