Chapter 4
Application Examples
4-6
ni.com
Figure 4-2.
Program Flowchart for Example 2
Example 3. Interactive CAN Example
This example provides an overview of how the features of NI-CAN are
used within LabVIEW. It provides a LabVIEW front panel that you can use
to interact with CAN devices and to learn the basic operation of NI-CAN.
The
interact.vi
front panel provides
CAN Network Interface
and
Baud Rate
controls, which are used to specify the CAN interface to use
Yes
No
No
1
2
3
8
10
Timeout/
Error Detected?
Open CAN Network
Interface Object
7
If Frame Detected in Buffer,
Process It
5
4
If Frame Available, Read
Frame and Place It into Buffer
Configure CAN Network
Interface Object
Yes
Callback
Invoked?
No
6
Yes
Timeout/
Error Detected?
Close CAN Network
Interface Object
9
Print Message for
Timeout/Error
Create Notification Thread
ncConfig
ncOpenObject
ncCreateNotification
ncRead
ncCloseObject