How do I access Thorlabs Kinesis .NET functions in Matlab?

39 ビュー (過去 30 日間)
Paul Farnsworth
Paul Farnsworth 2018 年 2 月 9 日
編集済み: anha sara mara 2024 年 6 月 10 日
I am attempting to program Thorlab KST Stepper Motor Controllers from Matlab. This simple script:
asm2=NET.addAssembly('C:\Program Files\Thorlabs\Kinesis\Thorlabs.MotionControl.GenericMotorCLI.dll');
sn1=('26001073');
Connect(Thorlabs.MotionControl.GenericMotorCLI.AdvancedMotor.GenericAdvancedMotorCLI,sn1)
generates the error:
Error using Thorlabs.MotionControl.GenericMotorCLI.AdvancedMotor.GenericAdvancedMotorCLI
Abstract classes cannot be instantiated. Class
'Thorlabs.MotionControl.GenericMotorCLI.AdvancedMotor.GenericAdvancedMotorCLI' defines abstract methods and/or
properties.
Thorlabs.MotionControl.GenericMotorCLI.AdvancedMotor.GenericAdvancedMotorCLI is a class in the .NET library:
Thorlabs.MotionControl.GenericMotorCLI.dll, and Connect(Thorlabs.MotionControl.GenericMotorCLI.GenericMotorCLI this, System.String serialNo) is listed as a method in that class.
Any suggestions would be appreciated.
  3 件のコメント
Happy PhD
Happy PhD 2021 年 5 月 28 日
Did you find a solution to this issue?
Paul Farnsworth
Paul Farnsworth 2021 年 5 月 28 日
No. I worked around it by switching to Labview.

サインインしてコメントする。

回答 (2 件)

Raha
Raha 2023 年 5 月 8 日
編集済み: Walter Roberson 2023 年 5 月 8 日
I have successfully used it in Matlab for KCube:
clear
clc
%Set path to the DLL files
NET.addAssembly('C:\Program Files\Thorlabs\APT\Thorlabs.MotionControl.DeviceManagerCLI.dll');
NET.addAssembly('C:\Program Files\Thorlabs\APT\Thorlabs.MotionControl.GenericMotorCLI.dll');
NET.addAssembly('C:\Program Files\Thorlabs\APT\Thorlabs.MotionControl.KCube.BrushlessMotorCLI.dll');
import Thorlabs.MotionControl.DeviceManagerCLI.*
import Thorlabs.MotionControl.GenericMotorCLI.*
import Thorlabs.MotionControl.KCube.BrushlessMotorCLI.*
DeviceManagerCLI.BuildDeviceList();
DeviceManagerCLI.GetDeviceListSize();
device = KCubeBrushlessMotor.CreateKCubeBrushlessMotor('yourserial number'); %The output of this line must be suppressed
device.Connect('YourserialNum');

anha sara mara
anha sara mara 2024 年 6 月 10 日
編集済み: anha sara mara 2024 年 6 月 10 日
hi , raha im currently working with LTS300/M ,I'm having the sam e issues as you i can detect the serial number cant connect ,which drivers did you install . did you reinstall the software or just the drivers

カテゴリ

Help Center および File ExchangeCall Web Services from MATLAB Using HTTP についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by