Read With Abort Endpoint

Requires: Base Development System

Reads an element from a Lossy Stream channel or signals the channel to abort. This endpoint is the same as the Read endpoint except that it has an abort input and an aborted? output. You can use the abort capability of the Lossy Stream channel to close a channel abruptly, ignoring any data left in the channel buffer. You must use this endpoint together with the Write With Abort endpoint.

You can drop this endpoint on the block diagram by right-clicking a Lossy Stream channel terminal or wire and selecting Create»Channel Reader»Lossy Stream»Read With Abort.

Details  

timeout in ms is the time, in milliseconds, that this endpoint has to read the elements from the channel. The default value is -1, which means there is no time limit.
channel is the channel wire that connects this endpoint to a writer endpoint.
abort specifies whether to abort this channel. If abort is TRUE, this endpoint marks the channel as closed and ignores further calls to read. Meanwhile, the aborted? output returns TRUE on the next call of this endpoint.
timed out? returns TRUE if the amount of time specified by timeout in ms elapses before the endpoint reads the data specified in element from the channel. This output returns FALSE if aborted? is TRUE. If timed out? is TRUE, element valid? and last element? will be FALSE.
gap? returns TRUE if any data was lost because an endpoint attempted to write to a full channel between the previous read operation and this one.
element valid? returns TRUE if the element was read successfully. This output returns FALSE if a timeout occurs, if the channel closes without a valid last element, or if the channel aborts.
element returns the data that this endpoint reads from the channel. This output returns the default value of the transmission data type if a timeout occurs, if the channel closes without a valid last element, or if the channel aborts.
last element? returns whether this is the last element that the endpoint reads from the channel. last element? can be TRUE even if element valid? is FALSE, which means that the last element was already written to the channel during the previous iteration or the channel closes without a valid last element. This output returns FALSE if a timeout occurs or if the channel aborts.
aborted? returns TRUE if abort occurred on this endpoint or the writer endpoint connected to the channel. If aborted? is TRUE, further calls to this endpoint will do nothing except returning aborted? TRUE again.
count returns the number of elements in the channel after this endpoint updates the channel. Use this output to monitor the relative writing and reading speed of the channel endpoints and make adjustments, if necessary.

Read With Abort Details

Related Information

Write With Abort