VTI Instruments Corp.
46
EX1200-1538: Programming the Instrument
//5V treshold for measuring the sine wave. Note that slope configuration
will NOT have any effect.
mfunction->Counter->Channels->Item["CH1"]->ConfigureThreshold(0, 5,
VTEXMultifunctionCounterSlopePositive);
//Enable Fifo for the channel
mfunction->Counter->Channels->Item["CH1"]->FifoEnabled = VARIANT_TRUE;
//This measures the frequency between 10000Hz and 1Hz.
mfunction->Counter->Channels->Item["CH1"]->UpperFrequencyLimit = 10000;
//Maximum frequency of 10000Hz
mfunction->Counter->Channels->Item["CH1"]->LowerFrequencyLimit = 1;
//Lower frequency of 1Hz
//This setting determines the no. of pulses for each revolution. In our case
it is 32, So 32 pulses makes one full revolution
mfunction->Counter->Channels->Item["CH1"]->RpmToothCount = 32;
//No missing count would be added or subtracted from actual count
mfunction->Counter->Channels->Item["CH1"]->RpmToothState =
VTEXMultifunctionCounterRpmToothStateNormal;
//Aperture time of 1 sencond. It averages the RPM for timespan for every
second.
mfunction->Counter->Channels->Item["CH1"]->AverageMode =
VTEXMultifunctionCounterAverageModeApertureTime;
mfunction->Counter->Channels->Item["CH1"]->ApertureTime = 1;
//aperature time in seconds
//measuring frequency in a Digital channel
//Only single measurement possible with EX1200 - 1538
//EX1200-1538 has only TTL logic for Digital channels. So range setting is
ignored.
//Digital channels configuration. Coupling setting is ignored for Digital
channel. Only DC coupling is possible for Digital channel.
mfunction->Counter->Channels->Item["CH2"]->ConfigureInput(VARIANT_TRUE,
VTEXMultifunctionCounterInputTypeDigital,
VTEXMultifunctionCounterInputModeSingleEnded, 0,
VTEXMultifunctionCounterCouplingDC);
//RPM measurement setting
mfunction->Counter->Channels->Item["CH2"]->Function =
VTEXMultifunctionCounterFunctionRpm;
// Threshold limits setting for Digital signal measurements are not required
//This measures the frequency between 10000Hz and 1Hz.
mfunction->Counter->Channels->Item["CH2"]->UpperFrequencyLimit = 10000;
//Maximum frequency of 10000Hz
mfunction->Counter->Channels->Item["CH2"]->LowerFrequencyLimit = 1;
//Lower frequency of 1Hz
//This setting determines the no. of pulses for each revolution. In our case
it is 32, So 32 pulses makes one full revolution
mfunction->Counter->Channels->Item["CH2"]->RpmToothCount = 32;
//No missing count would be added or subtracted from actual count
mfunction->Counter->Channels->Item["CH2"]->RpmToothState =
VTEXMultifunctionCounterRpmToothStateNormal;
//Aperture time of 1 sencond. It averages the RPM for timespan for every
second.
mfunction->Counter->Channels->Item["CH2"]->AverageMode =
VTEXMultifunctionCounterAverageModeApertureTime;