Programming Model For Ni-Can Applications - National Instruments NI-CAN User Manual

Table of Contents

Advertisement

Chapter 2
Developing Your Application

Programming Model for NI-CAN Applications

NI-CAN User Manual
the frame. For CAN Objects that transmit data frames, the
function provides the outgoing data bytes.
Some possible uses for CAN Objects include the following:
You can configure a CAN Object to periodically transmit a data frame
for a specific arbitration ID. The CAN Object transmits the same data
bytes repetitively until different data is provided using
configuration is useful for simulation of a device that periodically
transmits its data, such as simulation of an automotive sensor. This
configuration is also useful for devices that expect to periodically
receive data for a particular arbitration ID to respond with data using a
different arbitration ID, such as a device containing analog inputs and
outputs.
You can configure a CAN Object to watch for unsolicited data frames
received for its arbitration ID, then store that data in the CAN Object's
read queue. A watchdog timeout is provided to ensure that incoming
data is received periodically. This configuration is useful when you
want to apply a timeout to data received for a specific arbitration ID
and store that data in a dedicated queue. If you do not need to apply a
timeout for a given arbitration ID, it is often preferable to use the CAN
Network Interface Object to receive that data.
You can configure a CAN Object to periodically poll for data by
transmitting a remote frame and receiving the data frame response.
This configuration is useful for communication with devices that
require a remote frame to transmit their data.
You can configure a CAN Object to transmit a data frame whenever it
receives a remote frame for its arbitration ID. You can use this
configuration to simulate a device which responds to remote frames.
In general, you use CAN Objects for data transfer for a specific arbitration
ID, especially when that data transfer needs to occur periodically.
The following steps demonstrate how to use the NI-CAN functions in your
application. The steps are shown in Figure 2-1 in flowchart form.
2-6
ncWrite
. This
ncWrite
ni.com

Advertisement

Table of Contents
loading

Table of Contents