Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

IviDmm_GetSpecificDriverCHandle

Hi,
 
Can anybody tell me how to call this function from class driver(IviDmm.dll) using .Net C#.

Actually i have created a .Net wrapper over the class driver using Measurement Studio. The prototype of that function is:
 
[DllImport("IviDmm.dll", EntryPoint = "IviDmm_GetSpecificDriverCHandle", CallingConvention = CallingConvention.StdCall)]
public static extern int GetSpecificDriverCHandle(System.IntPtr Instrument_Handle, out System.IntPtr Specific_Driver_C_Handle);
 
When i call this using the class driver as follows, i get an error with no error message!!
 
iviDmm classDriver = new iviDmm("DMMLogicalName", true, true);
IntPtr specific = System.IntPtr.Zero;
int status = classDriver.GetSpecificDriverCHandle(specific);
 
All the other functions like selfTest, reset,dispose,etc are working. Can anyone help me out??
 
 
Thanks,
Priya.
0 Kudos
Message 1 of 3
(3,522 Views)
Hello Priya,

Where are you getting this error, is it just after you import the dll, or during the iviDMM setup function calls?

I have found an article which has .NET examples for using ivi here.

Let us know if this helps.
Christian A
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(3,503 Views)

Hi,

I have fixed the issue. Actually there is an error in the wrapper code generated by Measurement Studio for this method. It should take an 'out' parameter but instead it is taking an 'in' parameter in the signature.

Thanks,

Priya.

 

0 Kudos
Message 3 of 3
(3,496 Views)