www.vtiinstruments.com
EMX-75XX Index
43
Here is how to use the driver in each environment:
6)
Visual Studio C++
#import "IviDriverTypeLib.dll" no_namespace
#import "VTEXDIO.dll" no_namespace
7)
C#
Add a reference to VTEXDIO.dll in the project. Include the following at the top of any code
file that will access the driver:
using VTI.VTEXDIO.Interop;
8)
C/C++ on Windows
Link against VTEXDIO.lib and include VTEXDIO.h in the file.
9)
C++ on Linux
Link against /opt/vti/lib/libdio.so and include all the headers in /opt/vti/include in the source
file.
10)
LabView
Copy the driver package to the <Labview>/instr.lib directory and access all relevant VIs
U
SING THE
EMX-75XX
SERIES
I
NITIALIZING
\C
LOSING THE
I
NSTRUMENT
The base interface of the EMX-75XX IVI driver, VTEXDIO (LibDIO on Linux), is used to open
and close connections to the instrument as well as containing pointers to all other interfaces to
access the functionality of the instrument.
Initialization
Prior to using the EMX-75XX, an instrument driver connection must be made to the EMX-75XX.
Once a connection is made using the Initialize call, the user can execute their test code. Before the
program exits, the user should release the resources using the Close call. Users familiar with other
VTI Instrument Drivers for the EMX series should find this driver is very similar to ones they
have used before.
C++
#import "IviDriverTypeLib.dll" no_namespace
#import "VTEXDio.dll" no_namespace
int main()
{
//Windows driver creation
::CoInitialize(NULL); // start COM layer
try
{
IVTEXDIOPtr Dio (__uuidof(VTEXDIO));
/*We chose to give this driver an empty options string. If you have more
than one DIO card in your chassis, you will have to give it options such
as a slot number. This is because the DIO driver does not support more
than one card per driver instance. Note also that we set the reset flag
so that we can get a clean start witht he unit */
Dio->Initialize("TCPIP::10.20.1.5::INSTR", VARIANT_TRUE, VARIANT_TRUE,
"");
dio->Close();
::CoUninitialize();
}