Step 1. Configure Objects; Step 2. Open Objects; Step 3. Start Communication - National Instruments NI-CAN User Manual

Table of Contents

Advertisement

Chapter 2
Developing Your Application
NI-CAN User Manual

Step 1. Configure Objects

Prior to opening the objects used in your application, you must configure
the objects with their initial attribute settings. You can configure the objects
in one of two ways:
You can use the NI-CAN Configuration utility to define your objects
and specify their configuration attributes. This method is often
preferable, because it does not require configuration to be handled
within your application itself. Also, the NI-CAN Configuration utility
provides online help that describes each of the configuration attributes.
Each object can be configured within your application by calling the
function. This function takes the name of the object to
ncConfig
configure, along with a list of configuration attribute settings.

Step 2. Open Objects

You must call the
ncOpenObject
within your application.
The
function returns a handle for use in all subsequent
ncOpenObject
NI-CAN calls for that object. When you are using the G language
(LabVIEW) function library, this handle is passed through the upper left
and right terminals of each NI-CAN function used after the open.

Step 3. Start Communication

You must start communication on the CAN network before you can use
your objects to transfer data.
If you configured your CAN Network Interface Object to start on open,
then that object and all of its higher level CAN Objects are started
automatically by the
ncOpenObject
required for this step.
If you disabled the start-on-open attribute, then when your application
is ready to start communication, use the CAN Network Interface Object
to call the
ncAction
. This call is often useful when you want to use
NC_OP_START
to place outgoing data in write queues prior to starting communication.
If you want to reset the CAN hardware completely to clear a pending Error
Passive state, you can use the CAN Network Interface Object to call the
function with the
ncAction
reset must be done prior to starting communication.
function to open each object you use
function, so nothing special is
function with the
Opcode
parameter set to
Opcode
2-8
parameter set to
ncWrite
. This
NC_OP_RESET
ni.com

Advertisement

Table of Contents
loading

Table of Contents