Interpreting Values for the ncWaitForState Function or ncWait.vi
Hardware: Industrial Communications>>CAN
Problem: How do I interpret the value to be written or returned by the ncWaitForState function or ncWait.vi?
Solution: The ncWaitForState function or ncWait.vi returns a value indicating that one or more of the following events occurred:
- Read Available (at least one frame is available to read; 0x01)
- Write Success (all frames provided to via the write function or vi have been successfully transmitted onto the network; 0x02)
- Remote Wakeup (a remote wakeup occurred and Transceiver Mode has changed from sleep to normal; 0x04)
- Read Multiple (a specified number of frames is available for reading; 0x08)
The hexadecimal values indicated in parenthesis above correspond to values used to set or used to interpret the value returned for the ncWaitForState() function or ncWait.vi. However, it is possible to specify waiting on more than one of the above events, where the function will return when any of the selected events occurs. You can specify this by simply performing a bit-wise OR operation of the hex values for the states you wish to return on. Similarly, the value returned may be a bit-wise OR'ing of more than one of the above events; the interpretation is that more than one of the above states occurred "simultaneously" (before the function returned, as dictated by the development environment and operating system).
For more information please reference the function description of the ncWait VI or the ncWaitForState() function in chapter 10 or 11 of the NI-CAN Hardware and Software Manual linked below.
Related Links: Product Manuals: NI-CAN Hardware and Software Manual
Attachments:
Report Date: 09/24/2004
Last Updated: 09/09/2006
Document ID: 3DNBCA4B