04-13-2009 12:49 PM
Hi,
We have a USB controlled device with an activex dll type driver. After registration (regsvr32.exe CIUsbLib.dll) , we built a Labview driver for it. When it was run, at the first vi ( Open Automation reference: Automation Open.vi) we got error (-2147352568, Bad variable type in Open CIUsb Ref.vi ). What is the possible reason for this error?
Thanks
Zhong Cao
Boston Micromachines Corp.
04-14-2009 11:32 AM
Hi Zhong,
Can you post a snippit of your code so I could see how it is written? This error is from a type mismatch. Unfortunately, since we have no knowledge bases about this, If I could see or reproduce the problem I would be much more useful here.
Thanks,
04-14-2009 01:32 PM
Please see the attached file .
Thanks.
Zhong
04-15-2009 08:01 PM
Hi Zhong,
I noticed that you have created a service request for this issue. Let will let you work through that channel. Good luck.
11-16-2010 11:05 AM
This issue came up last year and was never resolved so I spent some time lokoing at this and found that the "Bad variable type. in Open CiUsbLib.vi" error code was due to a dll method that uses a windows handle data type:
([id( 4), helpstring("method CIUsb_SetNotify")] HRESULT CIUsb_SetNotify ([in] HWND hWindow, [in] UINT uMessageId);)
This method uses a window handle (HWND) and message identifier (UINT) to allow the plug and play (PnP) system to notify the application of USB device insertion and extraction events
I was able to get around the issue by removing this method from the dll and recompiling but in the process have lost some of the dll functionality.
Does anyone have any suggestions as to how I can maintian the functionality provided by this method or hwo LabView may be able to work with this Windows handle data type?
Thank you