Example 3. Interactive Can Example - National Instruments NI-CAN User Manual

Table of Contents

Advertisement

Chapter 4
Application Examples
If Frame Detected in Buffer,
7
8
No
9
10

Example 3. Interactive CAN Example

NI-CAN User Manual
Configure CAN Network
1
Interface Object
Open CAN Network
2
Interface Object
3
Create Notification Thread
Process It
Timeout/
Error Detected?
Yes
Print Message for
Timeout/Error
ncCloseObject
Close CAN Network
Interface Object
Figure 4-2. Program Flowchart for Example 2
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
Baud Rate controls, which are used to specify the CAN interface to use
ncConfig
ncOpenObject
ncCreateNotification
4
Callback
Invoked?
If Frame Available, Read
5
Frame and Place It into Buffer
Timeout/
6
Error Detected?
front panel provides CAN Network Interface and
4-6
No
Yes
ncRead
No
Yes
ni.com

Advertisement

Table of Contents
loading

Table of Contents