Using The Emx-75Xx Series; Initializing\Closing The Instrument - Ametek VTI Instruments EMX-75 Series User Manual

64-channel digital input / output
Table of Contents

Advertisement

VTI Instruments
U
EMX-75XX
SING THE
I
\C
NITIALIZING
LOSING THE
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();
}
catch (_com_error &e)
{
}
catch (...)
{
// handle errors here, depending on needs
}
Return 0;
}
Option Strings
The VTEX drivers provide option strings that can be used when Initializing an instrument. The
option string values exist to change the behavior of the driver. The following options strings are
available on VTI IVI drivers:
Simulate: Allows the user to run a program without commanding switch card or instruments.
This option is useful as a debugging tool.
40
SERIES
I
NSTRUMENT
::MessageBox(NULL, e.Description(), e.ErrorMessage(),
MB_ICONERROR);
EMX-75XX Index

Advertisement

Table of Contents
loading

Table of Contents