The CAN hardware is warrant ed against defects in material s and workmanship for a per io d of one year from the date
of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace
equipment that proves to be defective dur ing the war ranty period . This war ranty in cludes pa rts and labor .
The media on which you receive National Instruments software are warranted not to fail to execute programming
instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced
by receipts or other documentation. National Instruments will, at its option, repair or replace software media that do not
execute programming instructions if National Instruments receives notice of such defects during the warranty period.
National Instruments does not warrant that the operation of the software shall be uninterrupted or error free.
A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on the outside
of the package before any equipment will be accept ed for warranty work. National Instru ments will pay the shippi ng costs
of returning to the owner parts which are covered by warranty.
National Instruments believes that the informatio n in this manual is accurate. The docume nt has been ca refully review ed
for technical accurac y. In th e even t that te ch nical o r typograp hic al errors exis t, Nation al Inst ruments rese rves th e right to
make changes to subsequent editions of this document without prior notice to holders of this edition. The reader should
consult National Instruments if errors are suspected. In no event shall National Instruments be liable for any damages
arising out of or related to this document or the information contained in it.
XCEPT AS SPECIFIED HEREIN
E
ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE
CUSTOME R
OR INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF
National Instruments will apply regardless of the form of action, whether in contract or tort, including negligence.
Any action against National Instruments must be brought within one year after the cause of action accrues. National
Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty
provided herein does not cover damages, defects, malfunctions, or service failures caused by owner’s failure to follow
the National Instruments installation, operation, or maintenance instructions; owner’s modification of the product;
owner’s abuse, misuse, or negligent acts; and power failure or surges, fire, flood, accident, actions of third parties,
or other events outside reasonable control.
ATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS
. N
ATIONAL INSTRUMENTS MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AND SPECIFICALLY DISCLAIMS
, N
Copyright
Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical,
including photocopyi ng, recordi ng, st oring in an info rmation ret riev al syste m, or translating , in whole or in part, wit hout
the prior written consent of National Instruments Corporation.
USTOMER’S RIGHT TO RECOVER DAMAGES CAUSED
. C
. This limitation of the liability of
,
Trademarks
CVI™, LabVIEW™, natinst.com™, and NI-CAN™ are trademarks of Nati onal Instr um ents Corpo r at ion.
Product and company names listed are trademarks or trade names of their respective companies.
WARNING REGARDING MEDICAL AND CLINICAL USE OF NATIONAL INSTRUMENTS PRODUCTS
National Instruments products are not designed with components and testing intended to ensure a level of reliability
suitable for use in treatment and diagnosis of humans. Applications of National Instruments products involving medical
or clinical treatment can create a potential for accidental injury caused by product failure, or by errors on the part of the
user or application des igner. Any us e or ap plica tion of Na tiona l Instrum ents pr oducts for or inv olving m edi cal or clin ica l
treatment must be performed by properly trai ned and qualifi ed medic al pe rsonne l, and al l tra ditiona l medic al safegu ards,
equipment, and procedu res that are appropriate in the particula r situation to prevent serious injury or dea th should al ways
continue to be used when Natio nal Instrume nts products are being use d. National In struments prod ucts are N OT intended
to be a substitute for any form of establis hed process, procedure, or e quipment us ed to monit or or safeguard human heal th
and safety in medical or clinical treatment.
FCC/DOC Radio Frequency Interference
Class A Compliance
This equipment generates and uses radio frequency energy and, if not installed and used in strict accordance
with the instructions in this manual, may cause interference to radio and television reception. Classification
requirements are the same for the Federal Communications Commission (FCC) and the Canadian
Department of Communi cations (DOC). This equipment has been tested and found to comply with the
following two regulatory agencies :
Federal Communications Commission
This equipment has bee n tested and found to compl y wi th t h e l im i ts for a Cla s s A digital device, pursua nt
to part 15 of the FCC Rules. These limits are de signed to provide reasonable protection agai nst ha rm ful
interference when the equipment is operate d in a commercial environment. This equipm ent generates,
uses, and can radiate radio frequency energy and, if not installed and used in accordance with the instruction
manual, may cause harmful interference to radio communicati ons. Operation of this equi pment in a
residential area is likely to cause harmful interference in which case the use r w il l be required to correct the
interference at his own expense.
Notices to User: Changes or modifications not expressly approved by National Instruments could void
If necessary, consult Nation al Instruments or an experien ced radio/television tech nician for additional
suggestions. The following bookl et prepared by the FCC may also be hel pful: Interference to H o me Electronic Entertainment Equipment Handb ook. This booklet is available from the U.S. Government
Printing Office, Washington , DC 20402.
the user’s authority to operate the equipment under the FCC Rules.
This device complies with the FCC rules only if used with shielded in te rfac e cables
of suitable quality and construction. National Instruments used such cables to test
this device and provides them for sale to the user. The use of inferior or nonshielded
interface cabl es co ul d void the user’s authority to operate the equ ip men t under the
FCC rules.
Canadian Department of Communications
This Class A digital appar at us meets all requirements of th e Canadian Interference -Causing Equipment
Regulations.
Cet appareil numérique de la classe A respecte toutes les exigences du Règlement sur le matériel brouilleur
du Canada.
Contents
About This Manual
How to Use the Manual Set.............................................................................................ix
Organization of This Manual................................................ ...... .....................................x
Conventions Used in This Manual...................................................................................xi
Related Documentation....................................................................................................xii
National Instruments CorporationviiGetting Started with CAN for Windows NT
About This Manual
This manual contains instructions to help you install and configure the
National Instruments CAN hardware and the NI-CAN software for
Windows NT. The National Instruments CAN hardware supported under
Windows NT includes the PCI-CAN, PCI-CAN/2, PCMCIA-CAN, and
PCMCIA-CAN/2.
This manual assumes that you are already familiar with Windows NT.
How to Use the Manual Set
Getting Started
Manual
Novice
Users
NI-CAN
User Manual
for Windows 95
and Windows NT
Application
Development
and Examples
Installation and
Configuration
Experienced
Users
NI-CAN Programmer
Reference Manual
for Win32
Function
and Object
Descriptions
Use this getting started manual to install and configure your CAN hardware
and the NI-CAN software for Windo ws NT.
Use the NI-CAN User Manual for Windows 95 and Windows NT to learn
the basics of CAN and how to develop an application program. The user
manual also contains debugging information and detailed examples.
National Instruments CorporationixGetting Started with CAN for Windows NT
About This Manual
Use the NI-CAN Programmer Reference Manual for Win32 for specific
information about each NI-CAN function and object, such as format,
parameters, and possible errors.
Organization of This Manual
This manual is organized as follows:
•Chapter 1, Introd uction, explains how to use this manual, lists what
you need to get started and optional equipment you can order, and
briefly describes the CAN hardware and the NI-CAN software for
Windows NT.
•Chapter 2, Installation and Configuration, describes how to install
and configure the CAN hardware and the NI-CAN software for
Windows NT.
•Chapter 3, Verify the Installation, describes how to verif y the hardware
and software installation.
•Chapter 4, Begin to Use the NI-CAN Software, helps you get started
with the NI -CAN software for Windows NT.
•AppendixA, Uninstall the Hardware and Softwar e, describes how
to uninstall the CAN hardware and the NI-CAN software from
Windows NT.
•AppendixB, Cabling Requirements, describes the cabling
requirements for CAN interfaces.
•AppendixC, Troubl eshooting and CommonQuestions, describes ho w
to troubleshoot problems and answers some common questions.
•AppendixD, Specifications, describes the physical characteristics of
the CAN hardware, along with the recomm ended operating conditi ons.
•Appendix E, Customer Communication, contains forms you can use to
request help from Nati onal Instruments o r to comment on our products
and manuals.
•The Glossary contains an alphabetical list and a description of terms
used in this manual, including abbreviations, acronyms, metric
prefixes, mnemonics, and symbols.
The following conventions are used in this manual:
»The » symbol leads you throu gh nested men u items and dialog box op tions
to a final action. The sequence File»Page Setup»Options»SubstituteFonts directs you to pull down the File men u, select the Page Setup item,
select Options, and f inally select the Substitute Fonts option from the last
dialog box.
This icon to the left of bold italicized text denotes a note, which alerts you
to important information.
!
bold
bold italicBold italic text denotes a note or caution.
CAN hardwareCAN hardware refers to the PCI-CAN, PCI-CAN/2, PCMCIA-CAN, and
italic
monospaceText in this font denotes text or characters that you should literally enter
monospace italic
This icon to the left of bold italicized text denotes a caution, which advises
you of precautions to take to avoid injury, data loss, or a system crash.
Bold text denotes the names of menus, menu items, parameters, d ialo g
boxes, dialog box buttons or options, icons, windows, Windows NT tabs,
or LEDs.
PCMCIA-CAN/2 in cases where the material applies to all the interfaces.
Italic text denotes emphasis, a cross reference, or an introduction to a key
concept. This font also denotes text for which you supply the appropriate
word or value, such as in Windows 3.x.
from the keyboard, sections of code, programming examples, and syntax
examples. This font is also used for the proper n ames of disk d ri ves, p aths,
directories, progr ams, su bprog rams, s ubrouti nes, d e vice n ames, functio ns,
operations, variables, filenames, and extensions, and for statements and
comments taken from program code.
Italic text in this font denotes that you must su pply the appropriate words
or values in the place of these items.
pathsPaths in this manual are denoted using backslashes (\) to separate drive
National Instruments CorporationxiGetting Started with CAN for Windows NT
About This Manual
Related Documentation
The following document s contain informat ion that you may f ind helpful as
you read this manual:
•ANSI/ISO Standard 11898-1993, Road Vehicles—Interchange of
Digital Information—Controller Area Network (CAN) for High-Speed
Communication
•CAN Specification Version 2.0, 1991, Robert Bosch Gmbh.,
Postfach 500, D-7000 Stuttgart 1
•CiA Draft Standard 102, Ve rs io n 2.0, CAN Physical Layer for
Industrial Applications
•DeviceNet Specification, Volume 1, Version 2.0, Open DeviceNet
Vendor Association
•Microsoft Windows NT User’s Guide, Microsoft Corporation
Customer Communication
National Instruments wants to receive your comments on our products
and manuals. We are interested in the applications you develop with our
products, and we want to help if you have problems with them. To make it
easy for you to contact us, this manual contains comment and configuration
forms for you to complete. These forms are in Appendix E, Customer
This chapter explains how to use this manual, lists what you need to get
started and optional equipment you can order, and briefly describes the
CAN hardware and the NI-CAN software for Windows NT.
National Instruments Corporation1-1Getting Started with CAN for Windows NT
Chapter 1Introduction
What You Need to Get Started
Make sure you have all of the following items before you attempt to install
the hardware and software:
❑ Windows NT 3.51 or later installed on your computer
❑ One of the following CAN interfaces, which is included in your kit:
PCI-CAN
PCI-CAN/2
PCMCIA-CAN
PCMCIA-CAN/2
❑ The following 3.5 in., high-density (1.44 MB) disks, which are
included in your kit:
NI-CAN Software for Windows 95 and Windows NT (Disk 1)
NI-CAN Software for Windows 95 and Windows NT (Disk 2)
❑ PCMCIA-CAN cable, which is included in your kit, if you have a
PCMCIA-CAN or PCMCIA-CAN/2
❑ CAN interface cables that meet the requirements in Appendix B,
Cabling Requirements
CAN Hardware Overview
The National Instruments CAN hardware supported under Windows NT
includes the PCI-CAN, PCI-CAN/2, PCMCIA-CAN, and
PCMCIA-CAN/2
The PCI-CAN and PCI-CAN/2 are completely software configurable
and compliant with the PCI Local Bus Specification. With a PCI-CAN
or PCI-CAN/2 boa rd, you can make yo ur PC-compatible computer with
PCI Local Bus slots communicate with and control CAN devices.
The PCMCIA-CAN and PCMCIA-CAN/2 are Type II PC Cards that are
completely software configurable and compliant with the PCMCIA
standards for 16-bit PC Cards. With a PCMCIA-CAN card or
PCMCIA-CAN/2 card, you can make your PC-compatible notebook with
PCMCIA sockets communicate with and control CAN devices.
The PCI-CAN and PCMCIA-CAN interfaces each have one CAN port. T he
PCI-CAN/2 and PCMCIA-CAN/2 interfaces each have two CAN ports.
CAN interfacing is accomplished using the Intel 82527 CAN controller
chip. The PCI-CAN physical layer fully conforms to the ISO 11898
physical layer specification for CAN and is optically isolated to 500 V.
PCI-CAN boards are available with two physical connector types: DB-9
D-Sub and Combicon-style pluggable screw terminals. PCMCIA-CAN
cables include both a DB-9 D-Sub and a Combicon-style pluggable screw
terminal. The CAN physical layer on PCI-CAN cards can be powered
either internally (from the card) or externally (from the bus cable power).
The power source for the CAN physical layer for each port is configured
with a jumper. T here are two cables available for the PCMCIA-C AN cards.
In one cable the CAN physical layer is powered internally (from the card).
In the other cable the CAN physical layer is powered externally (from the
bus cable power). The CAN hardware supports a wide variety of transfer
rates up to 1 Mb/s.
All of the CAN hardware uses the Intel 386EX embedded processor to
implement time-critical features provided by the NI-CAN software. The
CAN hardware communicates with the NI-CAN driver through on-board
shared memory and an interrupt.
NI-CAN Software Overview
Chapter 1Introduction
The NI-CAN software includes a native, 32-bit multitasking Windows NT
kernel driver.
The NI-CAN software for Windows NT supports the concurrent use of
multiple types of CAN hardware. For e xample, you can commun icate with
CAN devices through both a PCI-CAN and PCI-CAN/2 in the same system
at the same time. The NI-CAN software is fully integrated into the
Windows NT operating system. It is configurable through the W indows NT
Control Panel and uni nstalla ble through the Add/ Remov e Progr ams applet
of the Control Panel.
The NI-CAN software, along with the CAN hardware, transforms your
computer into a CAN interface with complete communications and bus
management capability. The NI-CAN software includes the following
components:
National Instruments Corporation1-3Getting Started with CAN for Windows NT
Chapter 1Introduction
•Language interface libraries for Microsoft Visual C/C++ 2.0 or later,
LabWindows/CVI 4.0 or later, and LabVIEW 4.0 or later
•Example programs that use NI-CAN functions
Optional Programming Tools
Your kit includes the NI-CAN software for Windows NT. In addition,
you can order the LabWindows/CVI or LabVIEW software from Nat ional
Instruments.
LabWindows/CVI is an interactive ANSI C development environment for
building test and measurement and instrument control systems. It includes
interactive code-gener ation tools and a graphical editor for building custom
user interfaces. It also includes built-in libraries for IEEE 488.2, VXI,
RS-232 control, and plug-in da ta acquisition. When you order
LabWindows/CVI, you also get hundreds of complete instrument drivers,
which are modular, source-code programs that handle the communication
with your instrument so that you do not have to learn the programming
details.
LabVIEW is a complete programming environment that departs from the
sequential nature of traditional programming languages and features a
graphical programming environment. It includes all the tools needed for
instrument control, data acquisition, analysis, and presentation. LabVIEW
also includes an extensive instrument driver library.
For more information about LabWindows/CVI and LabVIEW, contact
National Instruments.
This chapter describes how to install and configure the CAN hard ware and
the NI-CAN software for Windows NT.
Install the NI-CAN Software
Before installing the CAN hardware, complete the following steps to install
the NI-CAN software for Windows NT.
Installing for Windows NT 3.51
1.Log in as Administrator or as a user that has Administrator
privileges.
2.Insert the NI-CAN Software for Windows 95 and Wi ndows NT (Disk 1)
into an unused drive.
3.In the Run dialog box, type the following:
x:\setup
where x is the letter of the drive containing the disk (usually a or b).
4.Shut down your computer when the setup is complete.
2
Installing for Windows NT 4.0
1.Log in as Administrator or as a user that has Administrator
privileges.
2.Select Start»Settings»Control Panel.
3.Double-click on the Add/Remove Programs icon in the Control Panel
to launch the Add/Remove Programs applet. A dialog box similar to
the one in Figure 2-1 appears.
The setup wizard guides you through the necessary steps to install
the NI-CAN software. You may go back and change values where
appropriate by clicking on the Back button. You can exit the setup
where appropriate by clicking on the Cancel button.
6.Shut down your computer when the setup is complete.
NI-CAN Software Setup Screen
Install the CAN Hardware
This section describes how to install your CAN hardware.
Install Your PCI-CAN or PCI-CAN/2
CautionElectrostatic discharge can damage several components on these CAN interfaces.
!
To avoid such damage in handling your interface, touch the antistatic plastic
package to a metal part of your computer chassis before removing the interface
from the package.
1.Make sure that your computer is turned off. Keep the computer
plugged in so that it remains ground e d while you install the CAN
interface.
2.Remove the top cover (or other access panels) to give yourself access
to the computer expans io n slot s .
National Instruments Corporation2-3Getting Started with CAN for Windows NT
Chapter 2Installation and Configuration
3.Find an unused expansion slot of the appropriate type in your
computer.
4.Remove the corresponding slot cover on the back panel of the
computer.
5.Insert the CAN interface into the slot with the CAN connector(s)
sticking out of the openi ng on the back panel. It might be a t ight fit, b ut
do not force the interface into place. Figure 2-3 shows how to install
the PCI-CAN into a PCI expansion slot.
Figure 2-3.
6.Screw the mounting bracket of the CAN interface to the back panel rail
of the computer.
7.Replace the top cover (or the access panel to the expansion slot).
8.Turn on your computer and start Windows NT.
When you have finished installing the hardware, proceed to the Connect the
Electrostatic discharge can damage several components on these CAN interfaces.
To avoid such damage in handling your interface, touch the antistatic plastic
package to a metal part of your computer chassis before removing the interface
from the package.
Note
Because of restrictions imposed by Windows NT, only one PCMCIA-CAN or
PCMCIA-CAN/2 can be used in a given Windows NT system. F or example, if you
have a PCMCIA-CAN card in your system, you cannot use a PCMCIA-CAN/2
card at the same time.
1.Shut down your operating system and power off your system.
2.Insert the card into a free PC Card (PCMCIA) socket. The card has no
jumpers or switches to set. Figure 2-4 shows how to insert the card and
how to connect the PCMCIA-CAN cable and connector to the card.
National Instruments Corporation2-5Getting Started with CAN for Windows NT
Inserting the PCMCIA-CAN
Chapter 2Installation and Configuration
3.Connect the PCMCIA-CAN cable to the card.
4.Power on your computer.
When you have finished installing the hardware, proceed to the next
section, Connect the Cables.
Connect the Cables
Because exact cabling requirements will vary for each application,
National Instruments does not provide cables, othe r than the
PCMCIA-CAN cable. Refer to Appendix B, Cabling Requirements,
for information about the cabling requirements of the CAN hardware.
After you have installed the CAN interface, connect your CAN cables to
the interface. The CAN hardware installation is now complete. Proceed
to the next section, Configure the NI-CAN Software.
Configure the NI-CAN Software
The NI-CAN Configuration utility is located in the Windows NT Control
Panel. You can use it to examine or modify the configuration of the
NI-CAN software. The context-sensitive online help, available by
right-clicking on any of the controls on the configuration utility buttons,
includes all of the information that you need to configure the NI-CAN
software properly.
To use the NI-CAN Configuration utility, you must first log in as
Administrator or as a user that has Administrator privileges. To
configure the NI-CAN software, double-click on the NI-CAN
Configuration icon in the Control Panel:
•Windo ws NT 3.51 : Open th e Control Panel in the Main group o f the
Program Manager.
•Windows NT 4.0 or later: Select Start»Settings»Control Panel.
Figure 2-5 shows a CAN interface that is wo rking properly. If no interfaces
are listed under NI-CAN Configuration, refer to the Missing CAN
Interface in the NI-CAN Configuration Utility section in Appendix C,
Troubleshooting and Common Questions,
To select a particular interface, click on that interface in the list.
When you install a PCI-CAN interface, your computer automatically
assigns valid resources to it. Because this resource assignment is automatic,
you do not need to use the Resources dialog box for the PCI- CAN, and you
do not need to restart Windows NT.
When you install a PCMCIA-CAN interface, your computer assigns
default resources to it. Because the default resources may conflict with
other devices in your system, you must use the Resources dialog box to
select valid resources for the PCMCIA-CAN. Figure 2-6 shows the
Resources dialog box for the PCMCIA-CAN.
Figure 2-6.
Resources Dialog Box for the PCMCIA-CAN
Click on the Settings button to view information about the NI-CAN
software configuration for the CAN interface. Figure 2-7 shows the
Settings dialog box.
National Instruments Corporation2-7Getting Started with CAN for Windows NT
Chapter 2Installation and Configuration
Figure 2-7.
NI-CAN Settings for the PCI-CAN/2
Each port of the CAN hardware interface is configured from this tab. Use
the drop-down box nearest the top of the tab to select the physical port
number to configure. F or each por t, use the Name drop-down bo x to select
the name for the CAN Network In terf ace Object (
CAN0, CAN1, and so on).
You use thi s name to refer to the physical port from within your NI-CAN
application.
To access online help for the NI-CAN Configuration utility, click on the
Help
button. Alternately, you can right-click on a specific control and
What’s This?
select
from the pop-up menu to see context-sensitive help
for the item you have clicked on.
When you have finished configuring the NI-CAN software, proceed to
Chapter 3, Verify the Installation.
NoteIf you changed the resources for any PCMCIA-CAN or PCMCIA-CAN/2
interface, you must restart Windows NT for the changes to take effect.
This chapter describes how to verify the hardware and software
installation.
You can use the NI-CAN Diagn os tic utility, installed with your NI-CAN
software, to test the hardware and software installation. The utility verifies
that your hardware and software are functioning properly and that the
configuration of your CAN interfaces does not conflict with an ything else
in your system.
To run the utility, select the NI-CAN Diagnostic item:
•Windows NT 3.51: Double-click on the
NI-CAN Software for Windows NT
the
Manager
•Windows NT 4.0 or later: Select
for Windows NT»NI-CAN Diagnostic
When you have started the NI-CAN Diagnostic utility, test your CAN
interfaces by clicking on the
interface by highlighting it and clicking on the
NI-CAN Diagnostic is successful, it puts a checkmark next to the interface
and changes its status from
fails, it puts an X next to the interface, and changes its status from
Failed
to
tested some CAN interfaces.
.
. Figure 3-1 shows the NI-CAN Diagnostic utility after it has
National Instruments Corporation3-1Getting Started with CAN for Windows NT
Chapter 3Verify the Installation
Figure 3-1.
NI-CAN Diagnostic Utility after Testing
You can get details about any tested CAN interface by selecting the
interface and clicking on the Details button. F or each failed CAN interface,
select it and click on the Details button to get a description of the failure.
Use that information and the information in Appendix C, Troubleshooting
and Common Questions, to troubleshoot the problem. Troubleshooting
information is also available in the online help for the NI-CAN Diagnostic
utility, which you can access by clicking on the Help button.
This chapter helps you get started with the NI-CAN software for
Windows NT.
Using the NI-CAN Software
The functions provided by the NI-CAN software are similar to those
provided by many other devi ce drivers. For e xample, NI- CAN has open,
close, read, and write functions. NI-CAN provides two different levels of
access to a CAN network: the CAN Network Interface Object and CAN
Objects. Both forms of access support timestamping of incoming data, as
well as various forms of queuing.
The CAN Network Interface Object provides low-level access to a CAN
network. Each CAN Network Interface Object maps to a specific CAN
port, with no limitati on on the maxim um number of port s or car ds you can
use (for example, two PCI-CAN/ 2 interf aces w ould p rov ide
CAN3). You can use this object to transmit and receive entire CAN frames.
For example, to transmit a CAN frame, you would specify the outgoing
arbitration ID, frame type (data or remote), data length, and data.
4
CAN0 through
The CAN Objects provide higher level access to a CAN network. Each
CAN Object maps to a specific data item (arbitration ID), and you can use
multiple CAN Objects for a given port. When configuring a CAN Object
for use, you specify the arbitration ID, direction of data transfer, data
length, and how you want the data to be accessed (such as periodically).
For example, you could configure a CAN Object to transmit an outgoing
data frame for a specific arbitration ID every 100 ms. After opening this
CAN Object, you use the write function to provide data to transmit, and the
NI-CAN embedded firmware handles all periodic timing.
For detailed information about the NI-CAN software and functions, refer
to the NI-CAN User Manual for Windows 95 and Windows NT and the NI-CAN Programmer Reference Manual for Win32.
National Instruments Corporation4-1Getting Started with CAN for Windows NT
Chapter 4Begin to Use the NI-CAN Software
General Programming Considerations
As you begin developing your W in32 NI-CAN app l icat ion , remem ber t he
following points:
•For your LabVIEW application, you must use the NI-CAN LabVIEW
functions in
•For your C/C++ application, y ou must include the NI-CAN header f ile,
nican.h, in your source code.
•The NI-CAN software is accessed through the 32-bit DLL,
nican.dll, either by linking with one of the language interfaces
provided with the NI -CAN software, or by using direct DLL entry
from other programming environments.
•Several sample CAN applications are included with the NI-CAN
software. Use these as a guide for your own application development.
For information about developing your application, refer to the NI-CAN User Manual for Windows 95 and Windows NT. For detailed information
about NI-CAN functions and objects, refer to the NI-CAN Programmer Reference Manual for Win32.
This appendix describes how to uninstall the CAN hardware and the
NI-CAN software from Windows NT.
Uninstalling the CAN Hardware from Windows NT
Because the current version of Windows NT does not maintain hardware
information for the CAN interfaces, you just need to physically remov e the
CAN interfaces from your computer. To do so, shut down Windows NT,
power off your computer, and physically remove the CAN interfaces.
National Instruments CorporationA-1Getting Started with CAN for Windows NT
The following instructions apply to Windows NT 4.0 only. If you are using
Windows NT 3.51, refer to the
for information on how to uninstall the NI-C AN software.
Before uninstalling the NI-CAN software, you should remove all CAN
interface hardware from your computer, as explained in the previous
section.
Complete the following steps to remove the NI-CAN software:
1.Select the Add/Remove Programs icon under Start»Settings»
Control Panel. A dialog box similar to the one in Fig ure A-1 appears.
This dialog box lists the software available for removal.
readme.txt file in your NI-CAN directory
Appendix AUninstall the Hardware and Software
Figure A-1.
Add/Remove Programs Properties Dialog Box
2.Select the NI-CAN software you want to remove, and click on the
Add/Remove button. The uninstall program runs and removes all
folders, utilities, device drivers, DLLs, and registry entries associated
with the NI-CAN software. Figure A-2 shows the results of a
successful uninstallation.
The uninstall program removes only items that the installation program
installed. If you add anything to a directory that was created by the
installation program, the uninstall program does not delete that directory,
because the directory is not empty after the uninstallation. You need to
remove any remaining components yourself.
If you want to reinstall the hardware and software, refer to Chapter 2,
National Instruments CorporationA-3Getting Started with CAN for Windows NT
Cabling Requirements
This appendix describes the cabling requirements for CAN interfaces.
Cables should be constructed to meet these requirements, as well as the
requirements of the other CAN or DeviceNet devices in the network.
Connector Pinouts
Depending on the type of CAN interface you are installing, the CAN
hardware either has DB-9 D-Sub connectors(s), or Combicon-style
pluggable screw terminal connector(s).
The 9-pin D-Sub follows the pinout recommended by CiA DS 102.
Figure B-1 shows the pinout for this connector.
National Instruments CorporationB-1Getting Started with CAN for Windows NT
Pinout for 9-Pin D-Sub Connector
6
789
No Connection
CAN_L
VNo Connection
Shield
Appendix BCabling Requirements
The 5-pin Combicon-style pluggable screw terminal follows the pinout
required by the DeviceNet specification. Figure B-2 shows the pinout for
this connector.
CAN_L
V-
12345
Shield
CAN_H
V+
Figure B-2.
Pinout for 5-Pin Combicon-Style Pluggable Screw Terminal
CAN_H and CAN_L are signal lines that carry the data on the CAN
network. These signals should be connected using twisted-pair cable.
The V+ and V– pins are used to supply bus power to the CAN physical
layer if external power is required for the CAN physical layer. If internal
power for the CAN physical layer is used, the V– pin ser ves as the reference
ground for CAN_H and CAN_L. See the next section, Power Supply
Information for the CAN Ports, for more information.
Figure B-3 shows the end of a PCMCIA-CAN cable. The arrow points to
pin 1 of the 5-pin screw terminal block. All of the signals on the 5-pin
Combicon-style pluggable screw terminal are connected directly to the
corresponding pins on the 9-pin D-Sub.
For the PCI-CAN and PCI-CAN/2, the power source for the CAN physical
layer is configured with a jumper. For the PCI-CAN and port one of the
PCI-CAN/2, power is configured with jumper J6. For port two of the
PCI-CAN/2, power is configured with jumper J5. The location of these
jumpers is shown in Figure B-4.
12
3
54
1 Power Supply Jumper J6
2 Product Name
3 Serial Number
4 Assembly Number
Figure B-4.
5 Power Supply Jumper J5
PCI-CAN/2 Power Source Jumpers
Connecting pins 1 and 2 of a jumper con f igur es the CAN ph ysical l ayer to
be powered externally (from the b us cable power). In this configuration, the
power must be supplied on the V+ and V– pins on the port connector.
Connecting pins 2 and 3 of a jumper con f igur es the CAN ph ysical l ayer to
be powered internally (from the card). In this configuration, the V– signal
serves as the reference ground for the isolated signals.
National Instruments CorporationB-3Getting Started with CAN for Windows NT
Appendix BCabling Requirements
Figure B-5 shows how to configure your jumpers for internal or external
power supplies.
INTEXT
123123
a. Internal Power Mode
Figure B-5.
Power Source Jumpers
INTEXT
b. External Power Mode
(Device Net)
The CAN physical layer is still isolated regardless of the power source
chosen.
The PCMCIA-CAN and PCMCIA-CAN/2 are available with tw o typ es of
cable. The DeviceNet (bu s powered) cable requires that the CAN physical
layer be powered from the bus cable power.
The internal-powered cable supplies po wer to the CAN physical layer from
the host computer . The V+ pi n is not connected to any internal signals, b ut
the corresponding pins on the 9-pin D-Sub and the 5 pin Combicon-style
connectors are still connected. The V– pins serves as the reference ground
for the isolated signals.
The CAN physical layer is isolated from the computer in both types of
cable.
Bus Power Supply Requirements
If the CAN physical layer is powered from a bus power supply, the power
supply should be a DC power supply with an output of 10 V to 30 V. The
power requirement s for the CAN por ts for Bus-Po wered conf igurations are
shown in T able B-1. You should take these requirements into account when
determining requirements of the bus power supply for the system.
Table B-1.
CharacteristicSpecification
Voltage RequirementV+ 10-30 VDC
Current Requirement40 mA typical
Cables should meet the physical medium requirements specified in
ISO 11898, shown in Table B-2.
Belden cable (3084A) meets all of those requirements, and should be
suitable for most applications.
Appendix BCabling Requirements
Cable Lengths
Table B-2.
Impedance108 Ω minimum, 120 Ω nominal,
Length-related resistance70 mΩ/m nominal
Specific line delay5 ns/m nominal
The allowable cable length is affected b y the character istics of the cabling
and the desired bit transmission rates. Detailed cable length requirements
can be found in the ISO 11 898, CiA DS 10 2, and De viceNet specif ications .
ISO 11898 specifies 40 m total cable length with a maximum stub length
of 0.3 m for a bit rate of 1 Mb/s. The ISO 11898 specification says that
significantly longer cable lengths may be allowed at lower bit rates, but
each node should be analyzed for signal integrity problems.
Table B-3 lists the DeviceNet cable length specifications.
ISO 11898 Specifications for Characteristics of a CAN_H and
CAN_L Pair of Wires
CharacteristicValue
132 Ω maximum
Table B-3.
DeviceNet Cable Length Specifications
Bit RateThick CableThin Cable
500 kb/s100 m100 m
250 kb/s200 m100 m
100 kb/s500 m100 m
National Instruments CorporationB-5Getting Started with CAN for Windows NT
Appendix BCabling Requirements
Maximum Number of Devices
The maximum number of devices that you can connect to a CAN port
depends on the electrical characteristics of the devices on the network. If all
of the devices meet the requirements of ISO 11898, at least 30 devices may
be connected to the bus. Higher numb ers of devices may be connected if the
electrical characteristics of the devices do not degrade signal quality below
ISO 11898 signal level specifications. If all of the devices on the network
meet the DeviceNet specifications, 64 devices may be connected to the
network.
Cable Termination
The pair of signal wires (CAN_H and CAN_L) constitutes a transmission
line. If the transmission line is not terminated, each signal change on the
line causes reflections that may cause communication failures.
Because communication flows both ways on the CAN bus, CAN requires
that both ends of the cable be terminated. However, th is requirement does
not mean that every device should have a termination resistor. If multiple
devices are placed along the cable, only the de vices on the ends of the cable
should have termination resistors. See Figure B-6 for an example of wher e
termination resistors should be placed in a system with more than two
devices.
CAN
Device
CAN_H
CAN
Device
120 Ω120 Ω
CAN_L
Figure B-6.
The termination resistors on a cable should match the nominal impedance
of the cable. ISO 11898 requires a cable with a nominal impedance of
120 Ω; therefore, a 120
Each termination resistor should each be capable of dissipating 0.25 W of
power.
Getting Started with CAN for Windows NTB-6
CAN
Device
Termination Resistor Placement
Ω resistor should be used at each end of the cable.
National Instruments CorporationB-7Getting Started with CAN for Windows NT
C
Troubleshooting and
Common Questions
This appendix describes how to troubleshoot problems and answers some
common questions.
Missing CAN Interface in the NI-CAN Configuration
Utility
The NI-CAN Configuration utility contains configuratio n information for
all of the CAN hardware it is aware of that is installed in your system. To
start the NI-CAN Configuration utility, double-click on the NI-CANConfiguration icon in the Control Panel:
•Windows NT 3.51: Open the Control Panel in the Main group of
the Program Manager .
•Windows NT 4.0 or later: Select Start»Settings»Control Panel.
If the CAN interface you are looking for is not listed under NI-CAN Configuration, the CAN interface is not properly installed. For National
Instruments CAN hardware, this means that the interface is not physically
present in the system. If the interface is firmly plugged into its slot and the
problem persists, contact National Instruments.
Troubleshooting Diagnostic Utility Failures
The following sections explain common error messages generated by the
NI-CAN Diagnostic utility.
Resource Errors
This error occurs if the memory resource or interrupt resource assigned to
a CAN interface conflicts with the resources being used by other devices
in the system. If a resource error occurs, click on the Resources button
in the NI-CAN Configuration utility to view the board resources. For the
PCMCIA-CAN, change the conflicting resource shown in Resources until
National Instruments CorporationC-1Getting Started with CAN for Windows NT
Appendix CTroubleshooting and Common Questions
the interface passes the diagnostic test. For the PCI-CAN, if legacy boards
in your system are using the resources, change the resource configuration
of the legacy board. If the problem persists, contact National Instruments.
NI-CAN Software Problem Encountered
This error occurs if the NI-CAN Diagnostic utility detects that it is unable
to communicate correctly with the CAN hardware using the installed
NI-CAN software. If you get this err or , shut do wn your computer , rest art it,
and run the NI-CAN Diagnostic utility again. If the problem persists, try
reinstalling the NI-CAN software for Windows NT.
Missing CAN Interface
If a National Instruments CAN interface is physically installed in your
system, but is not listed in the NI-CAN Diagnostic utility, check to see if
the NI-CAN Configuration utility has detected the hardware. For more
information, refer to the Missing CAN Interface in the NI-CAN
Configuration Utility section earlier in this appendix.
CAN Hardware Problem Encountered
This error occurs if the NI-CAN Diagnostic utility detects a defect in the
CAN hardware. If you get this error, write down the numeric code shown
with the error, and contact National Instruments. Depending on the cause
of the hardware failure, you may need to repair or replace your CAN
interface.
Common Questions
How can I determine which type of CAN hardware I have installed?
Run the NI-CAN Configuration utility. To run the utility, select
Start»Settings»Control Panel»NI-CAN Configuration. If any CAN
hardware is correctly installed, it is listed under National Instruments
CAN Interfaces.
How do I connect a CAN cable to my CAN interface?
For information about cabling requirements for National Instruments
CAN hardware, refer to Appendix B, Cabling Requirements.
How can I determine which version of the NI-CAN software I have
installed?
Run the NI-CAN Diagnostic utility. To run the utility, select the NI-CAN
Diagnostic item under Start»Programs»NI-CAN Software for
Windows NT. The NI-CAN Diagnostic utility displays information about
the version of the NI-CAN software currently installed.
Which CAN interfaces does the NI-CAN software for Windows NT
support?
The NI-CAN software for Windows NT supports the PCI-CAN,
PCI-CAN/2, PCMCIA-CAN, and PCMCIA-CAN/2.
What do I do if the NI-CAN Diagnostic utility fails with an error?
Refer to the Troubleshooting Diagnostic Utility Failures section in this
appendix for specific information about what might cause the NI-CAN
Diagnostic utility to fail. If you have already completed the troubleshooting
steps, fill out the forms in Appendix E, Customer Communica tion, and
contact National Instruments.
How many CAN boards can I configure for use with my NI-CAN
software for Windows NT?
The NI-CAN software for Windo ws NT can be configured to communicate
with up to 10 CAN boards.
Are interrupts required for the NI-CAN software for Windows NT?
Yes, one interru pt per board is re quired.
How do I use an NI-CAN language interface?
For information about using NI-CAN language interfaces, refer to
Chapter 3, Developing Your Application, in the NI-CAN User Manual for Windows 95 and Windows NT.
How do I use NI-CAN from within LabVIEW?
For information about using NI-CAN from within LabVIEW, refer to
Chapter 3, Developing Your Application, in the NI-CAN User Manual for Windows 95 and Windows NT.
National Instruments CorporationC-3Getting Started with CAN for Windows NT
Appendix CTroubleshooting and Common Questions
Why does the uninstall program leave some components installed?
The uninstall program removes only items that the installation program
installed. If you add anything to a directory that was created by the
installation program, the uninstall program does not delete that directory,
because the directory is not empty after the uninstallation. You must
remove any remaining components yourself.
What information should I have before I call National Instruments?
When you call National Instru ments, you should have all of th e information
filled out on the Hardware and Software Configuration Form in
Appendix E, Customer Communication.
For your convenience, this appendix contains forms to help you gather the information necessary
to help us solve your technical problems and a form you can use to comment on the product
documentation. When you contact us, we need the information on the Technical Support Form and
the configuration form, if your manual contains on e, abou t your s ystem configuration to answer your
questions as quickly as possible.
National Instruments has technical assistance through electronic, f ax, and telephone systems to quickly
provide the information you need. Our electronic services include a b ulletin board service, an FTP site,
a fax-on-demand system, and e-mail support. If you ha v e a hardware or softw are problem, first try the
electronic support systems. If the information available on these systems does not answer your
questions, we of fer fax and tele phone supp ort through our technical su pport centers, which are staf fed
by applications engineers.
Electronic Services
Bulletin Board Support
National Instruments has BBS and FTP sites dedicated for 24-hour support with a collection of files
and documents to answer most common customer questions. From the se sites, you can also download
the latest instrument drivers, updates, and exam ple programs. F or recorded instructions on ho w to u se
the bulletin board and FTP services and for BBS automated information, call 512 795 69 90. You can
access these services at:
United States: 512 7945422
Up to 14,400 baud, 8 data bits, 1 stop bit, no parity
United Kingdom: 01635 551422
Up to 9,600 baud, 8 data bits, 1 stop bit, no parity
France: 01 48 65 15 59
Up to 9,600 baud, 8 data bits, 1 stop bit, no parity
FTP Support
To access our FTP site, log on to our Internet host, ftp.natinst.com, as anonymous and use
your Internet address, such as
documents are located in the
National Instruments CorporationE-1Getting Started with CAN for Windows NT
joesmith@anywhere.com, as your password. The support files and
/support directories.
Fax-on-Demand Support
Fax-on-Demand is a 24-hour informat ion retrie v al system co ntaining a librar y of documents on a wide
range of technical information. You can access Fax-on-Demand from a touch-tone telephone at
512 418 1111.
E-Mail Support (Currently USA Only)
You can submit technical support questions to the applications engineering team throu gh e-mail at the
Internet address listed below. Remember to include your name, address, and phone number so we can
contact you with solutions and sugg estions.
support@natinst.com
Telephone and Fax Support
National Instruments has branch offices all over the world. Use the list below to find the technical
support number for your country. If there is no National Instruments office in your country, contact
the source from which you purchased your software to obtain support.
Photocopy this form and update it each time you mak e changes to yo ur software or hardw are, an d use
the completed copy of this form as a reference for your current configuration. Completing this form
accurately before contacting National Instruments for technical support helps our applications
engineers answer your questions more efficiently.
If you are using any National Instruments hardware or software products related to this problem,
include the configuration forms from their user manuals. Include additional pages if necessary.
Name __________________________________________________________________________
Company _______________________________________________________________________
Address ________________________________________________________________________
_______________________________________________________________________________
Fax ( ___ )________________Phone ( ___ ) __________________________________________
Computer brand____________Model ___________________Processor _____________________
Operating system (include version number)____________________________________________
Clock speed ______MHz RAM _____ MBDisplay adapter __________________________
Mouse ___yes ___no Other adapters installed_______________________________________
Hard disk capacity _____MB Brand_________________________________________________
Instruments used _________________________________________________________________
_______________________________________________________________________________
National Instrument s hard war e produ c t mode l_____________ Revision ________________ __ __
Configuration ____________ ___ ___________________ ____________________ _____________
National Instruments software product___________________ Version _____________________
Configuration ___________________________________________________________________
The problem is: __________________________________________________________________
_______________________________________________________________________________
List any error messages: ___________________________________________________________
_______________________________________________________________________________
The following steps reproduce the problem: ___________________________________________
Record the settings and revisions of your hardware and software on the line to the right of each item.
Complete a new copy o f this form each tim e yo u revise your software or har dw are con figuration, and
use this form as a reference for your current configuration. Completing this form accurately before
contacting National Instruments for technical support helps our applications engineers answer your
questions more efficiently.
National Instruments Products
General Information
CAN Interface Type (such as PCI-CAN/2) ____________________________________________
NI-CAN Diagnostic Utility Results __________________________________________ ________
Version Information
To access complete version information, including the hardware version and the NI-CAN
driver version, open the MS-DOS Prompt and change to the NI-CAN installation directory
(usually
candiag -v
Version Information from the NI-CAN Diagnostic ______________________________________
c:\nican). At the prompt, enter the following command:
Programming Environment Information
Programming Language ___________________________________________________________
Compiler Vendor_________________________________________________________________
Compiler Version ________________________________________________________________
Application Information
LabVIEW Application ______________________________ ____________________ __________
Win32 Application _______________________________________________________________
If Win 32, method of accessing DLL (link with language interface or direct entry?) ____________
National Instruments encourages you to comment on the documentation supplied with our products.
This information helps us provide quality products to meet your needs.
Title:
Getting Started with Your CAN Hardware and the NI-CAN™Software
for Windows NT
Edition Date:
Part Number:
Please comment on the completeness, clarity, and organization of the manual.
_______________________________________________________________________________
If you find errors in the manual, please record the page numbers and describe the errors.
Thank you for your help.
Name _________________________________________________________________________
Title __________________________________________________________________________
Company_______________________________________________________________________
Address ________________________________________________________________________
Technical Publications
National Instruments Corporation National Instruments Corporation
6504 Bridge Point Parkway 5127945678
Austin, Texas 78730-5039
Fax to:
Technical Publications
Glossary
PrefixMeaningsValue
n-nano-10
m-milli-10
c-centi-10
k-kilo-10
M-mega-10
°degrees
Ωohms
%percent
Aamperes
ACalternating current
ANSIAmerican National Standards Institute
–9
–3
–2
3
6
AT-compatiblecompatible with the 16-bit Industry Standard Architecture
bbits
Bbytes
CCelsius
CANController Area Network
CiACAN in Automation
DLLdynamic link library
DMAdirect memory access
EMIelectromagnetic interference
FCCFederal Communications Commission
Hzhertz
IEEEInstitute of Electrical and Electronic Engineers
National Instruments CorporationG-1Getting Started with CAN for Windows NT
Glossary
in.inches
IRQinterrupt request
ISAIndustry Standard Architecture
ISOInternational Standards Organization
mmeters
PCperson al computer
PCIperipheral component interconnect
PCMCIAPersonal Computer Memory Card International Association
RAMrandom-access memory
resourcehardware settings used by National Instruments CAN hardware, including
an interrupt request l ev el ( IRQ) and an 8 KB ph ysical memory range (such
as D0000 to D1FFF hex)
sseconds
Vvolts
VDCvolts direct current
Wwatts