Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to wrap IVI COM over IVI C?

thanks for ur response

                  Since C is Very old we thought of using COM for our solution,but some instruments are lacking IVI-COM driver support

can u please suggest me some other method for using IVI-C driver as like COM Drivers, since we need to expose common API''S

for all Drivers (Both IVI-COM and IVI-C),

What kind of wrapper can we create in common for both IVI-COM and IVI-C so that end user may not aware of underlying Driver?

 

thanks

Bharathi

0 Kudos
Message 11 of 15
(1,739 Views)

Assuming you use IVI-COM and IVI-C drivers in mixture, the simplest solution is write language-based wrappers, that are all common style wrapping your IVI-COM and IVI-C.  For example (assuming you use VC++), you can write CIviDriver abstract class with InitWithOptions() and Close() and some other necessary methods and data members that can be applied to all the drivers. Then write model-specific wrapper classes such as CYourInstr class, which is derived from CIviDriver, then add model-specific wrapper methods.  This approach can be used not only for C++, but C# and VB.NET can also be okay.  By this approach, your app will be able to handle all the drivers as a collection or array of multiple CIviDriver instances.

Or, other way is write a "pseudo" IVI-COM thin wrapper DLL for the IVI-C.  (Applicable only if you have skill to write ATL COM DLL with VC++.)  Although this COM DLL is ***not fully*** complant with IVI-COM spec, you can treat it as if it was a true IVI-COM driver.  Actually, create an ATL COM DLL project, then add a component class such as CYourInstr with IYourInstr interface (IDL is auto-generated).  Add import directive to IDL and #import to stdafx.h to import typilib part from "IviDriverTypeLib.DLL"  Then hand-edit the IDL so that your IYourInstr interface is derived from IIviDriver rather than IUnknwon.  Hand-edit the C++'s CYourInstr class header and add IIviDriver, IIviDriver, IIviDriverUtility, IIviDriverIdentity, IIviDriverOperation as its base interface classes being inherited.  Finally you will have to add 10 ~ 20 additional method (of IIviXXXX interfaces that you added)  to build the DLL without compile error.  Actual implementation of the DLL will be probably redirection code to the IVI-C driver.   By this approach, all the drivers can be handled as a collection or array of IIviDriverPtr (smart ptr of C++) objects.

 

Message 12 of 15
(1,732 Views)

shall i use NI-Mesurment studio for genrating the language base wrapper?

 

thanks

bharathi

0 Kudos
Message 13 of 15
(1,727 Views)

Hello Gagi,

I'd like to use IVI specific driver for "Chroma 61602" power supply and "TDS 2004B" oscilloscope.

I have installed "Microsoft Visual Studio 2005" and created a project in C#.

I followed the manual "Using IVI Specific Drivers in Visual Basic .NET, Visual C# or Visual Basic 6 Applications".

Step 1: OK,

Step 2: OK,

Step 3: I have no "Categories pane", just a list of all possibilities

Step 4: I have no "Instrument driver" option 😞

This is what I get when I go to Menu-->Project--> Add new item: (see Picture1.jpg in attachment)

I would be grateful for any hints 🙂

Thanks,

                           Glidko.

0 Kudos
Message 14 of 15
(1,559 Views)

hi,

Hope installing NI-Measurment Studio will solve ur problem

Refer the attachment

 

thanks

bharathi

0 Kudos
Message 15 of 15
(1,552 Views)