|NI-SCOPE (English | Japanese)|
The horizontal timing parameters are all inter-related to comply with the IVI-Scope specification. These parameters all appear in the Configure Horizontal Timing function. The fundamental theory is that your time per record is a constant number during an acquisition. This is accomplished with the following parameter coercions:
The min sample rate parameter is coerced up to the next available sample rate that the digitizer supports. The available sample rates change based on the acquisition type (such as normal and Flex Res). The actual sampling rate may be retrieved with the Sample Rate function. This information is also returned by the Fetch function, with the x increment parameter, which is one divided by the actual sampling rate. If the sample rate parameter is set higher than the maximum, NI-SCOPE returns an error.
If the enforce realtime parameter is set to FALSE, the digitizer enters RIS mode when the sampling rate exceeds the maximum real-time sampling rate of the device. In RIS mode, the sampling rate is coerced up to a multiple of the maximum real-time sampling rate.
The min record length is coerced so that the time per record is constant. The formula is the following:
actual rec length = min rec length/min sample rate x actual sample rate
You can find the actual record length by calling the Actual Record Length function. You can retrieve this value any time after you call Configure Horizontal Timing. Keep in mind that the amount of memory required on the digitizer is generally higher than the actual record length.
The reference position is rounded to the nearest sample. You can use the relative initial x parameter from a Fetch function to determine the actual reference position. If you fetch relative to the pretrigger, and the offset is zero, the initial x value is the first pretrigger point to the trigger. Therefore, the actual reference position is the following:
The following C code shows how NI-SCOPE accomplishes timing coercions:
// Convert minimum sample rate into its corresponding
// time-per-record value
timePerRecord = minRecordLength / minSampleRate;
if (minSampleRate <= maxRealTimeSampleRate)
// For real-time, normal acquisitions, sample rate
// is an integer divisor of max sample rate
int divisor = (int) floor (maxRealTimeSampleRate / minSampleRate);
actualSampleRate = maxRealTimeSampleRate / divisor;
//In RIS, sample rate is a multiple of max sample rate
int overSamplingFactor = (int) ceil (minSampleRate / maxRealTimeSampleRate);
actualSampleRate = overSamplingFactor × maxRealTimeSampleRate;
actualRecordLength = (int) ((timePerRecord × actualSampleRate) + 0.5);