How to call a .dll?
Mostrar comentarios más antiguos
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 comentarios
Image Analyst
el 20 de Oct. de 2019
Did you look at loadlibrary()?
Kacper Gawinkowski
el 20 de Oct. de 2019
Respuestas (0)
Categorías
Más información sobre Calendar en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!