How to call a .dll?

5 ビュー (過去 30 日間)
Kacper Gawinkowski
Kacper Gawinkowski 2019 年 10 月 20 日
コメント済み: Kacper Gawinkowski 2019 年 10 月 20 日
I made a simple dll file in c# with some funtions that should move the table.
Code fo the dll file looks like this:
namespace Table
{
public class TableAuto
{
IScan myscan; IStage myxyStage; IZ myz; IEncoders encoders; int port = 3;
double CurrentX, CurrentY;
public void MoveToAbsolute( int absoluteX, int absoluteY) %the method that i try to use
{
myscan = new Scan(); myxyStage = new Stage();
myscan.Connect(ref port);
myxyStage.MoveToAbsolute(absoluteX, absoluteY);
Thread.Sleep(1000);
myscan.DisConnect();
}
}
}
and code from matlab looks like this:
asm = NET.addAssembly('C:\Users\xactive\Desktop\tempProjects\Mikroskop\Table.dll');
Table.TableAuto.MoveToAbsolute(0,0); %i try to use the method here
I have no idea what im doing and how to operate on dll files. Things that i found on the internet are not understendable for me, thats why i try to get some help here.
Id be glad if you could tell me more less how to call a method from dll file in matalb code.
Thanks in advance.
  2 件のコメント
Image Analyst
Image Analyst 2019 年 10 月 20 日
Did you look at loadlibrary()?
Kacper Gawinkowski
Kacper Gawinkowski 2019 年 10 月 20 日
i think that loadlibrary() is for .h files wrote in C/C++ not for .NET library which im using

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

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by