Admin Production ni-theme
Current Publication

CNSFlush

LabWindows/CVI

CNSFlush

int CNSFlush (CNSEndpoint endpointID, int timeout, CNSFlushCondition condition);

Purpose

Transfers all data to the reader endpoint before data flow resumes. You can call this function only from the writer endpoint.

Parameters

Input
Name Type Description
endpointID CNSEndpoint The handle of a network stream endpoint. You can obtain this handle using the CNSNewScalarEndpoint, CNSNewArrayEndpoint, or CNSNewEndpoint functions.
timeout int The time, in milliseconds, that this function waits for the data to be flushed. The default value is CNSWaitForever, which means this endpoint waits indefinitely. If the timeout expires, this function returns an error.
condition CNSFlushCondition The condition under which data flow resumes. You can select one of the following options:
Value Description
CNSFlushAllItemsReadFromStream Data flow resumes when the Network Streams Engine transfers all data to the reader endpoint and the reader endpoint finishes reading that data.
CNSFlushAllItemsAvailForRead Data flow resumes when the Network Streams Engine transfers all data to the reader endpoint but not necessarily after the reader endpoint finishes reading that data.

Return Value

Name Type Description
error int An error code returned by a Network Streams Library function.

Additional Information

Library: Network Streams Library

Include file: cvinetstreams.h

LabWindows/CVI compatibility: LabWindows/CVI 2013 and later

Example

Refer to networkstreams\cnsSimple.cws for an example of using the CNSFlush function.