User manual

Programmer’s Guide Page 59 of 66
if (trigChan > 0) // Internal Trigger
{
long moduleNbr = (trigChan - 1) / nbrIntTrigsPerModule;
long inputNbr = (trigChan - 1) % nbrIntTrigsPerModule;
srcPattern = (moduleNbr<<16) + (0x1<<inputNbr);
}
else if (trigChan < 0) // External Trigger
{
trigChan = -trigChan;
long moduleNbr = (trigChan - 1) / nbrExtTrigsPerModule;
long inputNbr = (trigChan - 1) % nbrExtTrigsPerModule;
srcPattern = (moduleNbr<<16) + (0x80000000>>inputNbr);
}
else
PROBLEM!
Note that moduleNbr and inputNbr start from 0. An 'industrial strength' implementation should contain some
checks on the range of trigChan and/or inputNbr.
3.19. Special Operating Modes
Some Acqiris digitizers offer alternative operating modes, which are controlled with the function
AcqrsD1_configMode. The default state of any digitizer is mode = 0 and flags = 0, corresponding to the normal
digitizer operation, as described in the other sections of this manual.
3.19.1. Frequency Counter
This is an option available for the DC140 and DC135 digitizers. It is implemented with a signal counter that counts
trigger signals from the user-requested channel. A time counter generates the user-programmed aperture time, during
which the measurement is performed.
The user-requested signal channel has to be programmed for the expected signal characteristics; the standard config
functions should be used to set the full-scale, coupling, offset and trigger threshold. The HF trigger mode may be set
by the driver software on the basis of the user-supplied target frequency value. In order to obtain the best results, it is
recommended to adjust the full scale and offset so that they span the expected input signal. In addition, the trigger
threshold should be set to approximately the center of the signal voltage range. Calls to AcqrsD1_configVertical
and AcqrsD1_configTrigClass are needed. If an external time base reference is desired, AcqrsD1_configExtClock
should be called. If the totalize in gate functionality is desired the source of the gate must be set with the function
AcqrsD1_configControlIO, with the parameters connector = 1 (I/O A) or 2 (I/O B) and signal = 9. Note that when
this mode is in use the Enable trigger input (signal = 6) functionality of AcqrsD1_configControlIO cannot be used.
The function AcqrsD1_configFCounter sets the parameters specific to the frequency measurements.
AcqrsD1_configFCounter(instrID, channel, type, targetValue, apertureTime,
0.0, 0);
Comments:
Channel numbers run from 1 to the available number of signal channels in the digitizer.
The value type is 0 for Frequency, 1 for Period, 2 for Totalize by Time and 3 for Totalize by Gate.
The targetValue is an estimator of the expected result. If no estimate is possible, use the value 0.0. This
value is only used to activate the HF trigger mode which extends the useable frequency range. By default,
the frequency range is extended except:
type
Measurement
Divide by 1
0
Frequency
if targetValue is smaller than 1 kHz (1000.0) and larger than 0.0
1
Period
if targetValue is larger than 1ms (0.001)
2
Totalize by Time
always (the HF mode is never used)
3
Totalize by Gate
always (the HF mode is never used)