Gx3748EventCaptureResetTimestampCounter

Purpose

Resets the time stamp counter to zero.

Syntax

Gx3748EventCaptureResetTimestampCounter (nHandle, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3748 board.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function resets the time stamp counter to zero.

The time stamp counter can count up to 4.5 hours before starting a new cycle. The user can read the current time stamp counter at any time. The user can and should reset the counter before starting any event capture by calling Gx3748EventCaptureResetTimestampCounter() API. If any of the three event capture memories are in ARM state than the counter will not reset and the function will return an error.

Example

The following example sets event capture memory 0 mode to Transitions, state to HALT, reset the time stamp counter and return its value, returns the memory mode, state, memory counter and content:

 

SHORT nHandle, nStatus;

SHORT nMode, nState, nCounter;

BYTE ucLogicLevel[256];

DOUBLE dTime [256];

DWORD dwSize;

DOUBLE dTimestampCounter;

 

Gx3748EventCaptureResetTimestampCounter (nHandle, &nStatus);

Gx3748EventCaptureReadTimestampCounter (nHandle, &dTimestampCounter, &nStatus);

 

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, Gx3748EventCaptureReadMemory, Gx3748EventCaptureReadMemoryCount, Gx3748EventCaptureReadTimestampCounter, Gx3748EventCaptureSetMode, Gx3748EventCaptureSetSampleRate, Gx3748EventCaptureSetSource, Gx3748EventCaptureSetState, Gx3748EventCaptureSoftwareTrigger, Gx3748EventCaptureSetHoldoffTime, GxFpgaGetErrorString