Rtsi Examples; Example 1. Using Can Objects - National Instruments NI-CAN User Manual

Table of Contents

Advertisement

Chapter 4
Application Examples

RTSI Examples

Example 1. Using CAN Objects

NI-CAN User Manual
and
ncReadObjMult.vi
cluster.
is the C source that shows the use of the
SimpanlzLS.c
NC_ATTR_LOG_COMM_ERRS
applications.
InteractLS.vi
the
ncNetAttrLS
NC_ATTR_LOG_COMM_ERRS
Refer to the NI-CAN Programmer Reference Manual for a list of examples.
This example focuses on the basics of using CAN Objects.
An automotive test engineer is trying to test a variety of CAN devices. One
of the CAN devices is a speed display. This display expects to receive the
current speed of the vehicle in a CAN frame every 100 milliseconds, so that
the driver of the vehicle can be continuously updated. Another CAN device
is a speed sensor (speedometer), which measures the speed of the vehicle
and transmits it in a CAN frame every 100 milliseconds.
To use NI-CAN to test the speed display, the engineer uses a CAN Object
to simulate the role of the speed sensor. This CAN Object is configured to
transmit a simulated speed every 100 milliseconds. By using the CAN
Object to transmit different speeds, the test engineer can verify that the
speed display always shows the correct speed.
To use NI-CAN to test the speed sensor, the engineer uses a CAN Object to
simulate the role of the speed display. This CAN Object is configured to
receive speeds from the sensor and display them. By using this CAN Object
to receive and display different speeds, the test engineer can connect the
speed sensor to a real engine, then verify that the speeds it transmits are
correct.
To learn the basics of CAN Object usage prior to testing the actual devices,
the test engineer writes a simple example to implement both CAN Objects.
To do this, he uses a two-port CAN interface, such as the AT-CAN/2. He
connects the top port of the card to the bottom port using a cable. One port
uses the
NCTYPE_CAN_DATA_TIMED
attribute for low-speed CAN
is the LabVIEW/BridgeVIEW example that shows
cluster that lets you set the
attribute for low-speed CAN applications
4-2
ni.com

Advertisement

Table of Contents
loading

Table of Contents