Gx3748EventCaptureSetSampleRate

Purpose

Sets the sampling rate, only event capture memories which are to continuous mode are affected.

Syntax

Gx3748EventCaptureSetSampleRate (nHandle, dwSampleRate, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3748 board.
dwSampleRate
DWORD
Sampling rate, only event capture memories which are to continuous mode are affected, sampling rates can as follow:
  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_1_USEC: 1uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_2_USEC: 2 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_4_USEC: 4 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_8_USEC: 8 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_16_USEC: 16 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_32_USEC: 32 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_64_USEC: 64 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_128_USEC: 128 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_256_USEC: 256 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_512_USEC: 512 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_1024_USEC: 1024 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_2048_USEC: 2048 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_4096_USEC: 4096 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_8192_USEC: 8192 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_16384_USEC: 16384 uSec.

  • GX3748_EVENT_CAPTURE_SAMPLE_RATE_32768_USEC: 32768 uSec.

pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function sets the specified event capture memory sampling rate.

There are 3 independent event capture memories. Each memory can record input events from any of the channels’ groups by setting the memory source, Gx3748EventCaptureSetSource() API. The user can read any number of elements from any of the memories using the Gx3748EventCaptureReadMemory() API., as well as the current number of recorded elements by calling the Gx3748EventCaptureReadMemoryCount() API. Whenever the user changes the specified event capture memory input source (group and channel), the content of that memory and the recorded element counter will be cleared. Whenever the user changes the specified event capture memory mode, Gx3748EventCaptureSetMode() API , the content of that memory and the recorded element counter will be cleared.

The sampling rate is only applicable whenever the user set the mode to GX3748_EVENT_CAPTURE_MODE_CONTINUOUS, using the Gx3748EventCaptureSetMode() API. In that mode once the specified event capture memory is enabled, by calling the Gx3748EventCaptureSetState() API, the input voltage level at every sample rate period will be recorded with its timestamp. The sample rate can be set by calling the Gx3748EventCaptureSetSampleRate() API. When done, the user can disable the specified event capture memory form recording any more transition by calling the Gx3748EventCaptureSetState() API. Once the memory is in a HALT state, the memory content can be read.

When setting the sample rate to the max, 32768 uSec, the event capture memory can store up to 6.7 minutes of continuous sampling. When setting the sample rate to 1 uSec, the event capture memory can store up to 12 mSec of continuous sampling

Note: Each event capture memory can have up to 12288 recorded events, and ignore any additional samples.

Example

The following example sets event capture memory 0 mode to Continuous, sample rate to 1024uSec and returns the memory mode and sample rate:

 

SHORT nHandle, nStatus;

SHORT nMode;

DWORD dwSampeRate;

 

Gx3748EventCaptureSetMode (nHandle, GX3748_EVENT_CAPTURE_MEMORY0, GX3748_EVENT_CAPTURE_MODE_CONTINUOUS, &nStatus);

Gx3748EventCaptureSetSamplingRate (nHandle, GX3748_EVENT_CAPTURE_SAMPLE_RATE_1024_USEC, &nStatus);

Gx3748EventCaptureSetMode (nHandle, GX3748_EVENT_CAPTURE_MEMORY0, &nMode, &nStatus);

Gx3748EventCaptureGetSamplingRate (nHandle, &dwSampleRate, &nStatus);

 

See Also

Gx3748EventCaptureClearMemory, Gx3748EventCaptureReadMemory, Gx3748EventCaptureReadMemoryCount, Gx3748EventCaptureReadTimestampCounter, Gx3748EventCaptureResetTimestampCounter, Gx3748EventCaptureSetMode, Gx3748EventCaptureGetSampleRate, Gx3748EventCaptureSetSource, Gx3748EventCaptureSetState, Gx3748EventCaptureSoftwareTrigger, Gx3748EventCaptureSetHoldoffTime, GxFpgaGetErrorString