We are using Agilent U2353A driver for the lab. The drivers have intergration features with .NET framework.
I'm trying to invoke the Agilent driver functions from my VB.NET Scripts. When we do the same steps manually, the interface is working fine. But, if it is controlled by another test VB.NET Scripts, it is not permitting me to access the driver functions. Everytime, i get the error as shown below:
System.InvalidCastException was unhandled
Message=Unable to cast COM object of type 'Agilent.AgilentU235x.Interop.AgilentU235xClass' to interface type 'Agilent.AgilentU235x.Interop.IAgilentU235x2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{43B06E80-AC83-48B6-88FD-D4119CE5F021}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Source=mscorlib
StackTrace:
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)
at Agilent.AgilentU235x.Interop.AgilentU235xClass.get_AnalogIn()
at GBX_Sys_Sim.Drivers_IVI.ADC_Read_DC_Voltage_IVI(Int16 UUT_IO) in C:\Matthew\20120307\WC\Copy of GBX Sys Sim\Drivers_IVI.vb:line 304
at GBX_Sys_Sim.SysSim.ScanAllOutputs() in C:\Matthew\20120307\WC\Copy of GBX Sys Sim\SysSim.vb:line 247
at GBX_Sys_Sim.read_write_sim.update_Sim_output_val() in C:\Matthew\20120307\WC\Copy of GBX Sys Sim\server_Module.vb:line 232
at GBX_Sys_Sim.read_write_sim.ScriptThreadFunc() in C:\Matthew\20120307\WC\Copy of GBX Sys Sim\server_Module.vb:line 92
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
snapshot of the error is attachedView attachment exception Driver IVI.pdf View attachment exception Driver IVI.pdf
Any idea why this error is occuring.
I'm trying to invoke the Agilent driver functions from my VB.NET Scripts. When we do the same steps manually, the interface is working fine. But, if it is controlled by another test VB.NET Scripts, it is not permitting me to access the driver functions. Everytime, i get the error as shown below:
System.InvalidCastException was unhandled
Message=Unable to cast COM object of type 'Agilent.AgilentU235x.Interop.AgilentU235xClass' to interface type 'Agilent.AgilentU235x.Interop.IAgilentU235x2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{43B06E80-AC83-48B6-88FD-D4119CE5F021}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Source=mscorlib
StackTrace:
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)
at Agilent.AgilentU235x.Interop.AgilentU235xClass.get_AnalogIn()
at GBX_Sys_Sim.Drivers_IVI.ADC_Read_DC_Voltage_IVI(Int16 UUT_IO) in C:\Matthew\20120307\WC\Copy of GBX Sys Sim\Drivers_IVI.vb:line 304
at GBX_Sys_Sim.SysSim.ScanAllOutputs() in C:\Matthew\20120307\WC\Copy of GBX Sys Sim\SysSim.vb:line 247
at GBX_Sys_Sim.read_write_sim.update_Sim_output_val() in C:\Matthew\20120307\WC\Copy of GBX Sys Sim\server_Module.vb:line 232
at GBX_Sys_Sim.read_write_sim.ScriptThreadFunc() in C:\Matthew\20120307\WC\Copy of GBX Sys Sim\server_Module.vb:line 92
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
snapshot of the error is attachedView attachment exception Driver IVI.pdf View attachment exception Driver IVI.pdf
Any idea why this error is occuring.