www.vtiinstruments.com
EX1200-1538: Programming the Instrument
49
VTEXMultifunctionCounterInputModeSingleEnded, 48,
VTEXMultifunctionCounterCouplingDC);
mfunction->Counter->Channels->Item["CH1"]->Function =
VTEXMultifunctionCounterFunctionTimeInterval;
//Time interval measurement setting
/* You can also work with the following functions by changing the channel
function
* Phase measurement
*/
//Set channel 2 as the reference channel
mfunction->Counter->Channels->Item["CH1"]->ReferenceChannel = "CH2";
//Reference channel can be used for any measurement even though it is used
as the reference channel for channel 1 measurement.
mfunction->Counter->Channels->Item["CH2"]->Function =
VTEXMultifunctionCounterFunctionFrequency;
//Enable Fifo for the channels
mfunction->Counter->Channels->Item["CH1"]->FifoEnabled = VARIANT_TRUE;
mfunction->Counter->Channels->Item["CH2"]->FifoEnabled = VARIANT_TRUE;
//In case of Digital channel type, Level and Hysteresis settings are
ignored.
//5V treshold for measuring the sine wave. Measure on the Rising edges
only.
mfunction->Counter->Channels->Item["CH1"]->ConfigureThreshold(0, 5,
VTEXMultifunctionCounterSlopePositive);
//2.5V treshold for measuring the sine wave. Note that this will affect
only the Channel 2 frequency measurement only NOT Time interval measurement.The slope
configuration will NOT have any effect.
mfunction->Counter->Channels->Item["CH2"]->ConfigureThreshold(0, 2.5,
VTEXMultifunctionCounterSlopeNegative);
//This measures the frequency between 1000Hz and 1Hz. Both the channel's
input signal frequency should be same
mfunction->Counter->Channels->Item["CH1"]->UpperFrequencyLimit = 100000;
//Maximum frequency of 1000Hz
mfunction->Counter->Channels->Item["CH1"]->LowerFrequencyLimit = 1;
//Lower frequency of 1Hz
mfunction->Counter->Channels->Item["CH2"]->UpperFrequencyLimit = 1000;
//Maximum frequency of 1000Hz
mfunction->Counter->Channels->Item["CH2"]->LowerFrequencyLimit = 1;
//Lower frequency of 1Hz
//Aperture time of 2 seconds. It averages the timeinterval for 2 seconds
mfunction->Counter->Channels->Item["CH1"]->AverageMode =
VTEXMultifunctionCounterAverageModeApertureTime;
mfunction->Counter->Channels->Item["CH1"]->ApertureTime = 2;
//aperature time in seconds
//Aperture time of 1 senconds. It averages the frequency for 1 second
mfunction->Counter->Channels->Item["CH2"]->AverageMode =
VTEXMultifunctionCounterAverageModeApertureTime;
mfunction->Counter->Channels->Item["CH2"]->ApertureTime = 1;
//aperature time in seconds
mfunction->Trigger->Source = VTEXMultifunctionTriggerSourceImmediate;
//Start measurement
mfunction->Measurement->Abort();
mfunction->Measurement->Initiate();
int fifocount,loopcount = 0;
do
{