![Ametek VTI Instruments EX1200-1538 User Manual Download Page 45](http://html1.mh-extra.com/html/ametek/vti-instruments-ex1200-1538/vti-instruments-ex1200-1538_user-manual_3044149045.webp)
www.vtiinstruments.com
EX1200-1538: Programming the Instrument
45
if (mfunction != NULL && mfunction->Initialized)
{
// Close driver
mfunction->Close();
}
}
catch (_com_error& e)
{
::MessageBox(NULL, e.Description(), e.ErrorMessage(), MB_ICONERROR);
}
::CoUninitialize();
printf("\nDone - Press Enter to Exit");
getchar();
return 0;
}
RPM
F
UNCTION
This example measures the RPM using an encoder or syncro resolver.
Visual Studio C++
// RPM measurement.cpp : Defines the entry point for the console application.
#include<stdio.h>
#include "stdafx.h"
#import "IviDriverTypeLib.dll" no_namespace
#import "VTEXMultifunction.dll" no_namespace
//This example measures the RPM using an encoder or syncro resolver(less voltage type)
int _tmain(int argc, _TCHAR* argv[])
{
::CoInitialize(NULL);
try
{
IVTEXMultifunctionPtr mfunction(__uuidof(VTEXMultifunction));
try
{
//Initialize a new session
mfunction->Initialize("TCPIP::10.20.11.158::INSTR", VARIANT_TRUE,
VARIANT_TRUE, "");
//Differential measurement
//EX1200-1538 has only two voltage ranges - 48V and 100mV. Since the sine
wave is of ±10 volts, 48V range is being used.
//This example uses AC coupling to cutoff offset voltage in the sinewave.
//Analog channels Configuration
mfunction->Counter->Channels->Item["CH1"]->ConfigureInput(VARIANT_TRUE,
VTEXMultifunctionCounterInputTypeAnalog,
VTEXMultifunctionCounterInputModeDifferential, 48,
VTEXMultifunctionCounterCouplingAC);
mfunction->Counter->Channels->Item["CH1"]->Function =
VTEXMultifunctionCounterFunctionRpm;