« Close

Datasheets and User Guides

App Notes

Software & Driver

 

LJM_STREAM_SCANS_RETURN

Summary

Sets how LJM_eStreamRead will return data.

Below, ScansPerRead is a parameter of LJM_eStreamStart.

LJM_STREAM_SCANS_RETURN_ALL = 1 (default)

  • A mode that will cause LJM_eStreamRead to sleep until the full ScansPerRead scans are collected by LJM.
  • This mode may not be appropriate for stream types that are not consistently timed, such as externally clocked stream mode.

LJM_STREAM_SCANS_RETURN_ALL_OR_NONE = 2

  • A mode that will cause LJM_eStreamRead to never sleep, and instead either:
    • consume ScansPerRead scans and return LJME_NOERROR, or
    • consume no scans and return LJME_NO_SCANS_RETURNED.

The constant LJM_STREAM_SCANS_RETURN can be used interchangeably with the string "LJM_STREAM_SCANS_RETURN".

Remarks

LJM_STREAM_SCANS_RETURN does not affect currently running or already initialized streams.

Relevant Functions

To read LJM_STREAM_SCANS_RETURN, use LJM_ReadLibraryConfigS.

To write LJM_STREAM_SCANS_RETURN, use LJM_WriteLibraryConfigS or LJM_LoadConfigurationFile.

LJM_STREAM_SCANS_RETURN affects the behavior of LJM_eStreamRead.

Example

[C/C++] Set the LJM_STREAM_SCANS_RETURN mode to LJM_STREAM_SCANS_RETURN_ALL_OR_NONE.

char ErrorString[LJM_MAX_NAME_SIZE];
int LJMError = 0;
LJMError = LJM_WriteLibraryConfigS(
     LJM_STREAM_SCANS_RETURN,
     LJM_STREAM_SCANS_RETURN_ALL_OR_NONE
);
if (LJMError != 0) {
    LJM_ErrorToString(LJMError, ErrorString);
    printf("LJM_WriteLibraryConfigS error: %s\n", ErrorString);
}

For more LJM configurations, see Library Configuration Functions.