Chapter 4
Application Examples
4-4
ni.com
Figure 4-1.
Program Flowchart for Example 1
Example 2. Simple CAN Bus Analyzer
This example focuses on usage of the
ncCreateNotification
function
within the C programming language. It illustrates a simple CAN bus
analyzer using the CAN Network Interface Object.
An automotive test engineer is writing a diagnostic utility for use in service
bays. This utility is used to diagnose problems with car models that use
Yes
No
1
2
3
4
5
6
7
8
9
Finished Ten
Periods?
Configure CAN Objects
Configure CAN Network
Interface Objects
Write Data to be Transmitted
Periodically from
CAN1::STD5
Wait for First Transmission
to Complete
Wait for Reception of Periodic
Data on
CAN0::STD5
Close CAN Objects
Read Data from
CAN0::STD5
Open CAN Objects
ncConfig
ncConfig
ncOpenObject
ncWrite
ncWaitForState
ncWaitForState
ncRead
ncCloseObject