how can MATLAB handle .NET methods that have a REF parameter?
显示 更早的评论
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 个评论
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?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Get Started with Microsoft .NET 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!