CAN Getting Started with Your CAN Hardware and the NI-CAN™ Software for Windows NT Getting Started with CAN for Windows NT January 1998 Edition Part Number 321372C-01
Internet Support E-mail: support@natinst.com FTP Site: ftp.natinst.com Web Address: http://www.natinst.
Important Information Warranty The CAN hardware is warranted against defects in materials and workmanship for a period 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 during the warranty period. This warranty includes parts and labor.
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 Communications (DOC).
Contents About This Manual How to Use the Manual Set .............................................................................................ix Organization of This Manual ...........................................................................................x Conventions Used in This Manual...................................................................................xi Related Documentation....................................................................................................
Contents Appendix A Uninstall the Hardware and Software Uninstalling the CAN Hardware from Windows NT...................................................... A-1 Uninstalling the NI-CAN Software from Windows NT.................................................. A-1 Appendix B Cabling Requirements Connector Pinouts ........................................................................................................... B-1 Power Supply Information for the CAN Ports ..........................................
Contents Figure 2-4. Figure 2-5. Figure 2-6. Figure 2-7. Inserting the PCMCIA-CAN...................................................................2-5 CAN Interface That Is Working Properly ...............................................2-7 Resources Dialog Box for the PCMCIA-CAN .......................................2-7 NI-CAN Settings for the PCI-CAN/2 .....................................................2-8 Figure 3-1. NI-CAN Diagnostic Utility after Testing.........................................
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.
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, Introduction, 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.
About This Manual Conventions Used in This Manual The following conventions are used in this manual: » The » symbol leads you through nested menu items and dialog box options to a final action. The sequence File»Page Setup»Options»Substitute Fonts directs you to pull down the File menu, select the Page Setup item, select Options, and finally 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.
About This Manual Related Documentation The following documents contain information that you may find 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, Version 2.0, CAN Physical Layer for Industrial Applications • DeviceNet Specification, Volume 1, Version 2.
1 Introduction 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.
Chapter 1 Introduction 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.
Chapter 1 Introduction 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.
Chapter 1 Introduction • 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 National Instruments. LabWindows/CVI is an interactive ANSI C development environment for building test and measurement and instrument control systems.
Installation and Configuration 2 This chapter describes how to install and configure the CAN hardware 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 Windows NT (Disk 1) into an unused drive. 3.
Chapter 2 Installation and Configuration Figure 2-1. Add/Remove Programs Properties Dialog Box You can use this same applet to uninstall the NI-CAN software at a later time. Refer to Appendix A, Uninstall the Hardware and Software, for more information. 4. Click on the Install button. 5. Insert the NI-CAN Software for Windows 95 and Windows NT (Disk 1), and click on the Next button to proceed. The software installation wizard begins with the screen shown in Figure 2-2.
Chapter 2 Installation and Configuration Figure 2-2. NI-CAN Software Setup Screen 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. Install the CAN Hardware This section describes how to install your CAN hardware.
Chapter 2 Installation 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 opening on the back panel. It might be a tight fit, but 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. Installing the PCI-CAN 6.
Chapter 2 Installation and Configuration Install Your PCMCIA-CAN or PCMCIA-CAN/2 ! Caution 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.
Chapter 2 Installation 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, other than the PCMCIA-CAN cable. Refer to Appendix B, Cabling Requirements, for information about the cabling requirements of the CAN hardware.
Chapter 2 Installation and Configuration Figure 2-5. CAN Interface That Is Working Properly 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.
Chapter 2 Installation 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. For each port, use the Name drop-down box to select the name for the CAN Network Interface Object (CAN0, CAN1, and so on). You use this name to refer to the physical port from within your NI-CAN application.
3 Verify the Installation This chapter describes how to verify the hardware and software installation. You can use the NI-CAN Diagnostic 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 anything else in your system. To run the utility, select the NI-CAN Diagnostic item: • Windows NT 3.
Chapter 3 Verify 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. For 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.
4 Begin to Use the NI-CAN Software 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 device drivers. For example, 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.
Chapter 4 Begin to Use the NI-CAN Software General Programming Considerations As you begin developing your Win32 NI-CAN application, remember the following points: • For your LabVIEW application, you must use the NI-CAN LabVIEW functions in nican.llb. • For your C/C++ application, you must include the NI-CAN header file, nican.h, in your source code. • The NI-CAN software is accessed through the 32-bit DLL, nican.
Uninstall the Hardware and Software A 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 remove the CAN interfaces from your computer. To do so, shut down Windows NT, power off your computer, and physically remove the CAN interfaces.
Appendix A Uninstall 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.
Appendix A Uninstall the Hardware and Software Figure A-2. NI-CAN Uninstallation Results 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.
B 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.
Appendix B Cabling Requirements V- CAN_L Shield CAN_H V+ 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. 1 2 3 4 5 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.
Appendix B Cabling Requirements Power Supply Information for the CAN Ports 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.
Appendix B Cabling Requirements Figure B-5 shows how to configure your jumpers for internal or external power supplies. INT 3 2 EXT 1 a. Internal Power Mode INT 3 2 EXT 1 b. External Power Mode (Device Net) Figure B-5. Power Source Jumpers The CAN physical layer is still isolated regardless of the power source chosen. The PCMCIA-CAN and PCMCIA-CAN/2 are available with two types of cable. The DeviceNet (bus powered) cable requires that the CAN physical layer be powered from the bus cable power.
Appendix B Cabling Requirements Cable Specifications 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. Table B-2.
Appendix B Cabling 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 numbers of devices may be connected if the electrical characteristics of the devices do not degrade signal quality below ISO 11898 signal level specifications.
Appendix B Cabling Requirements Cabling Example Figure B-7 shows an example of a cable to connect two CAN devices. For the internal power configuration, no V+ connection is required. 5-Pin Combicon 9-Pin D-Sub Pin 4 Pin 7 Pin 2 Pin 2 Pin 3 Pin 5 Pin 5 Pin 9 Pin 1 Pin 3 CAN_H 120Ω 9-Pin D-Sub 5-Pin Combicon Pin 7 Pin 4 Pin 2 Pin 2 Pin 5 Pin 3 Pin 9 Pin 5 Pin 3 Pin 1 120Ω CAN_L GND V+ V– Power Connector V+ V– Figure B-7.
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 configuration 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-CAN Configuration icon in the Control Panel: • Windows NT 3.
Appendix C Troubleshooting 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.
Appendix C Troubleshooting and Common Questions 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.
Appendix C Troubleshooting 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.
D Specifications This appendix describes the physical characteristics of the CAN hardware, along with the recommended operating conditions. Table D-1. PCI-CAN and PCI-CAN/2 Hardware Characteristics Characteristic © National Instruments Corporation Specification Dimensions 10.67 by 17.46 cm (4.2 by 6.88 in.
Appendix D Specifications Table D-2. PCMCIA-CAN and PCMCIA-CAN/2 Hardware Characteristics Characteristic Specification Dimensions 8.56 by 5.40 by 0.5 cm (3.4 by 2.1 by 0.4 in.
Customer Communication E 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 one, about your system configuration to answer your questions as quickly as possible.
Fax-on-Demand Support Fax-on-Demand is a 24-hour information retrieval system containing a library 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 through 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 suggestions.
Technical Support Form Photocopy this form and update it each time you make changes to your software or hardware, and 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.
Hardware and Software Configuration Form Record the settings and revisions of your hardware and software on the line to the right of each item. Complete a new copy of this form each time you revise your software or hardware configuration, 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.
Documentation Comment Form 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: January 1998 Part Number: 321372C-01 Please comment on the completeness, clarity, and organization of the manual.
Glossary Prefix Meanings Value n- nano- 10–9 m- milli- 10 –3 c- centi- 10 –2 k- kilo- 10 3 M- mega- 10 6 ° degrees Ω ohms % percent A amperes AC alternating current ANSI American National Standards Institute AT-compatible compatible with the 16-bit Industry Standard Architecture b bits B bytes C Celsius CAN Controller Area Network CiA CAN in Automation DLL dynamic link library DMA direct memory access EMI electromagnetic interference FCC Federal Communication
Glossary in.