How does matlab handle activex variant function calls?

1 回表示 (過去 30 日間)
Steven
Steven 2015 年 1 月 26 日
コメント済み: Steven 2015 年 1 月 26 日
I am calling an activex control that interfaces with a usb device. I can get as far as to see the function calls but I can't seem to get data back and forth like I do in python. The first thing I do is pass in text of the usb device id and then I get a handle string back that I pass into the openpipe function, then I can access the usb device via the read functions. In matlab it returns an NAN when I try GetConnectedDevices. In python it has to build a com wrapper file to translate the data, is matlab not translating the data it gets back right?
>> device = actxserver('USBommited.ommited.1'); >> invoke(device) GetConnectedDevices = Variant GetConnectedDevices(handle, string) OpenPipe = uint32_T OpenPipe(handle, string) ClosePipe = void ClosePipe(handle) ReadPipe = [uint32_T, Variant(Pointer)] ReadPipe(handle, uint32_T) ReadPipeBytes = Variant ReadPipeBytes(handle, uint32_T)
>> iscom(device)
ans =
1
>> ismethod(device,'GetConnectedDevices')
ans =
1
>> device.GetConnectedDevices('CC476332-BBC1-4737-8376-B237C00199C0')
ans =
NaN
>>
  1 件のコメント
Steven
Steven 2015 年 1 月 26 日
>> invoke(device)
GetConnectedDevices = Variant GetConnectedDevices(handle, string)
OpenPipe = uint32_T OpenPipe(handle, string)
ClosePipe = void ClosePipe(handle)
ReadPipe = [uint32_T, Variant(Pointer)] ReadPipe(handle, uint32_T)
GetDeviceDescriptor = [uint32_T, Variant(Pointer)] GetDeviceDescriptor(handle, string)
GetStringDescriptor = [uint32_T, string] GetStringDescriptor(handle, string, char, uint16_T)
GetParentDeviceInstanceID = string GetParentDeviceInstanceID(handle, string, string)
ReadPipeBytes = Variant ReadPipeBytes(handle, uint32_T)

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeUse COM Objects in MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by