How to call a .dll?
5 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!