I am trying to use the kinesis .NET package from Thorlabs (https://www.thorlabs.com/software_pages/ViewSoftwarePage.cfm?Code=Motion_Control).
I have the Thorlabs Laser diode controller (model TLD001), a Thorlabs piezo control (model TPZ001) and a Thorlabs strain gauge reader (model TSG001) all connected to my PC through the USB port. I can operate all of these devices through the Kinesis software package, but I am interested in operating these devices through Matlab because I want my own custom interface and functionality. The libraries for the Kinesis control software is in the microsoft .NET framework. I have Microsoft .NET Framework 4.6.1 installed on my computer currently and the operating system is Windows 7 Enterprise.
In MATLAB, I run the following commands to load the .dll files:
asm = NET.addAssembly('c:\Program Files\Thorlabs\Kinesis\Thorlabs.MotionControl.GenericMotorCLI.dll');
dsm = NET.addAssembly('c:\Program Files\Thorlabs\Kinesis\Thorlabs.MotionControl.Tools.WPF.dll');
bsm = NET.addAssembly('c:\Program Files\Thorlabs\Kinesis\Thorlabs.MotionControl.TCube.LaserDiodeCLI.dll');
csm = NET.addAssembly('c:\Program Files\Thorlabs\Kinesis\Thorlabs.MotionControl.DeviceManagerCLI.dll');
I am also able to initialize some of the class methods from the libraries:
However, when I try to access the libraries for the Laser Diode Controller, such as:
I get thrown an error.
Message: External component has thrown an exception.
This same error occurs whenever I try to call any method associated with the class:
I don't understand the error. I think its related to the dotnetclient.dll? Please advise. Thank you!