Gx3748EventCaptureReadMemory

Purpose

Returns the specified event capture memory content, time stamp and voltage logical levels.

Syntax

Gx3748EventCaptureReadMemory (nHandle, nMemory, nTimeUnits, pucLogicLevel, pdTime, dwStart, pdwSize, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3748 board.
nMemory
SHORT
Specified memory number, memory number are as follows:
0.      GX3748_EVENT_CAPTURE_MEMORY0: memory number 0.
1.      GX3748_EVENT_CAPTURE_MEMORY1: memory number 1.
2.    GX3748_EVENT_CAPTURE_MEMORY2: memory number 2.
nTimeUnits
SHORT
Specified time units, time units are as follows:
0.      GX3748_EVENT_CAPTURE_TIME_UNITS_ USEC: Format the return time stamp buffer data in uSec.
1.      GX3748_EVENT_CAPTURE_TIME_UNITS_ MSEC: Format the return time stamp buffer data in mSec.
2.    GX3748_EVENT_CAPTURE_TIME_UNITS_ SEC: Format the return time stamp buffer data in Sec.
 pucLogicLevel
BYTE
Pointer to an array of type BYTE, array size has to at minimum equal to the number of pdwSize. Maximum array size can be 12288. Data can be as followed:
If the specified event capture memory source is group 0:
0.      Input voltage level was inside the event capture memory source is group channel window threshold settings was recorded at the same time stamp.
1.      Input voltage level was outside the event capture memory source is group channel window threshold settings was recorded at the same time stamp.
If the specified event capture memory source is group 1 or 2:
0.      Input voltage level was below the event capture memory source is group channel threshold settings was recorded at the same time stamp.
1.    Input voltage level was above the event capture memory source is group channel threshold settings was recorded at the same time stamp.
pdTime
DOUBLE
Pointer to an array of type DOUBLE, array size has to at minimum equal to the number of pdwSize. This array contains the time stamp data, formatted as specified by the nTimeUnits. Maximum array size can be 12288.
dwStart
DWORD
Used to specify the offset into the specified event memory start reading from. Range is 0 to 12287.
pdwSize
PDWORD
Number of items to read, the maximum number of comparison results is 12288. Both arrays, the pucLogicLevel and the pdTime need to be of the same size and at least equal to the pdwSize.  The returned data will be the lower of the two: if the specified pdwSize is less than the actual number of recorded data or if the actual number of recorded data is less than pdwSize.
Upon return pdwSize will be updated with the actual number of data points.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function returns the specified event capture memory content, time stamp and voltage levels.

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 user can read the specified event capture memory content only when the specified event capture memory is in HALT state. The time stamp counter is about 4.5 hours long, and longer captures will cause the time stamp counter to start form zero. The user can and should reset the time stamp counter using the Gx3748EventCaptureResetTimestampCounter() API, before starting any events. The user can also read back the value of the time stamp counter at any time by calling the Gx3748EventCaptureReadTimestampCounter() API.

Example

The following example sets event capture memory 0 mode to Transitions, state to HALT, and returns the memory mode, state, memory counter and content:

 

SHORT nHandle, nStatus;

SHORT nMode, nState, nCounter;

BYTE ucLogicLevel[256];

DOUBLE dTime [256];

DWORD dwSize;

 

Gx3748EventCaptureSetState (nHandle, GX3748_EVENT_CAPTURE_MEMORY0, GX3748_EVENT_CAPTURE_STATE_HALT, &nStatus);

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

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

Gx3748EventCaptureGetState (nHandle, GX3748_EVENT_CAPTURE_MEMORY0, &nState, &nStatus);

Gx3748EventCaptureReadMemoryCount(nHandle, GX3748_EVENT_CAPTURE_MEMORY0, &nCounter, &nStatus);

if (nCounter)

{

dwSize= nCounter;

Gx3748EventCaptureReadMemory(nHandle, GX3748_EVENT_CAPTURE_MEMORY0, GX3748_EVENT_CAPTURE_TIME_UNITS_ USEC, ucLogicLevel, dTime, 0, &dwSize, &nStatus);

}

 

See Also

Gx3748EventCaptureClearMemory, Gx3748EventCaptureReadMemoryCount, Gx3748EventCaptureReadTimestampCounter, Gx3748EventCaptureResetTimestampCounter, Gx3748EventCaptureSetMode,  Gx3748EventCaptureSetSampleRate, Gx3748EventCaptureSetSource, Gx3748EventCaptureSetState, Gx3748EventCaptureSoftwareTrigger, Gx3748EventCaptureSetHoldoffTime, GxFpgaGetErrorString