Overview
The example demonstrates how to event-like wait for a XNET CAN frame to be received.
Description
NI-XNET does not have the ability to trigger an event when a frame arrives. The example shows a suitable workaround to work around the limitation.
The example uses a Frame In Queued session type to build a queue of the specified frame. XNET Read is configured to read just one frame with a timeout of 100 ms, which means that the frame will be returned as soon as the NI-XNET hardware receives the frame. The timeout prevents the application from locking up if the frame is not yet received by the NI-XNET hardware. Therefore the expected timeout error is cleared and the XNET Read is tried again until the frame has been received or the loop is manually stopped.
Requirements
Software
- LabVIEW 2012 Base Development System (or compatible)
- NI-XNET 14.0 (or compatible)
Hardware
Steps to Implement or Execute Code
- Open the attached file
- Run the VI
Additional Information or References
**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**
Matthew B.
Offering Manager
NI