How does matlab handle activex variant function calls?

2 views (last 30 days)
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 Comment
Steven
Steven on 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)

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!