how can MATLAB handle .NET methods that have a REF parameter?
Mostrar comentarios más antiguos
I have a .NET dll which provides the following capability:
TMCTL cTmctl = new TMCTL();
int ret = 0;
ret = cTmctl.Initialize(TMCTL.TM_CTL_ETHER, "11.22.33.44,anonymous,", ref id );
I need to use this dll file in Matlab, and so far I can succesfully reference the dll and create the necessary object:
YK_TMCTL = NET.addAssembly('C:\Windows\SysWOW64\TmctlAPINet64.dll');
Oscilloscope = TmctlAPINet.TMCTL;
However, I have difficulties in callig the Initialize function, this code always retunrs 1, wihch means the function could not establish a connection:
int32DeviceID = int32(0);
int32InstrumentAnswer = Oscilloscope.Initialize(Oscilloscope.TM_CTL_ETHER,'10.60.142.50,anonymous',int32DeviceID);
Oscilloscope.TM_CTL_ETHER is just a constant, it's not giving me any trouble. But I believe the int32DeviceID is the problem and I do not know how to succesfully pass this 'reference' variable.
[int32InstrumentAnswer,int32DeviceID] = Oscilloscope.Initialize(Oscilloscope.TM_CTL_ETHER,'10.60.142.50,anonymous')
Unfortunatelly this fails with the following error: No method 'Initialize' with matching signature found for class 'TmctlAPINet.TMCTL'.
Hence, the question in the title.
Regards,
Cristian
1 comentario
what does
methodsview(Oscilloscope)
%or
methods(Oscilloscope, '-full')
says the full signature of Initialize is (there may be several, in which case, show them all).
Oh, and what is the actual documented .Net signature?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Identification 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!