LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open Automation reference error -2147352568

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.

 

 

0 Kudos
Message 1 of 5
(3,634 Views)

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,

Stephen B
0 Kudos
Message 2 of 5
(3,608 Views)

Please see the attached file .

 

Thanks.

 

Zhong

0 Kudos
Message 3 of 5
(3,598 Views)

Hi Zhong,

 

I noticed that you have created a service request for this issue. Let will let you work through that channel. Good luck.

 

 

Joshua B.
National Instruments
0 Kudos
Message 4 of 5
(3,580 Views)

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

0 Kudos
Message 5 of 5
(3,252 Views)