Handshaking refers to communication between two nodes that establishes the parameters for continued communication.
For a given function, handshaking does the following:
- Indicates when upstream nodes send valid data to the function. An upstream node is any node that sends data to the function.
- Determines when the function discards or accepts data from upstream nodes.
- Determines when downstream nodes discard or accept data from the function.
- Indicates when the function sends valid data to downstream nodes. A downstream node is any node that receives data from the function.
In a Clock-Driven Loop, handshaking is necessary because some nodes need more than one cycle to compute valid data, but the Clock-Driven Loop requires all nodes to return data every clock cycle. To ensure the numeric accuracy of an algorithm, nodes that depend on this data must know whether the data is invalid or valid. National Instruments has established a handshaking protocol you can use with certain nodes inside a Clock-Driven Loop. This protocol involves the following terminals:
- input valid—The next data point has arrived for processing.
- ready for output—The downstream node can accept a new data point.
- output valid—The current data point produced by the node is valid and ready to be used by downstream nodes.
- ready for input—The node can accept a new data point during the next clock cycle.