How does matlab handle activex variant function calls?

2 vues (au cours des 30 derniers jours)
Steven
Steven le 26 Jan 2015
Commenté : Steven le 26 Jan 2015
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 commentaire
Steven
Steven le 26 Jan 2015
>> 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)

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Use COM Objects in MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by