ADLINK Technology NuCOM PCI-7841 User Manual

ADLINK Technology NuCOM PCI-7841 User Manual

Dual-port isolated can interface card

Advertisement

Quick Links

PCI-7841/cPCI-7841/PM-7841
Dual-Port Isolated CAN Interface Card
Manual Rev.
Revision Date:
Part No:
Advance Technologies; Automate the World.
NuCOM
User's Manual
3.00
June 28, 2006
50-11109-1010
©

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the NuCOM PCI-7841 and is the answer not in the manual?

Questions and answers

Summary of Contents for ADLINK Technology NuCOM PCI-7841

  • Page 1 NuCOM © PCI-7841/cPCI-7841/PM-7841 Dual-Port Isolated CAN Interface Card User’s Manual Manual Rev. 3.00 Revision Date: June 28, 2006 Part No: 50-11109-1010 Advance Technologies; Automate the World.
  • Page 2 Copyright 2006 ADLINK TECHNOLOGY INC. All Rights Reserved. The information in this document is subject to change without prior notice in order to improve reliability, design, and function and does not represent a commitment on the part of the manufacturer.
  • Page 3 Getting Service from ADLINK Customer Satisfaction is top priority for ADLINK Technology Inc. Please contact us should you require any service or assistance. ADLINK TECHNOLOGY INC. Web Site: http://www.adlinktech.com Sales & Service: Service@adlinktech.com TEL: +886-2-82265877 FAX: +886-2-82265717 Address: 9F, No. 166, Jian Yi Road, Chungho City,...
  • Page 5: Table Of Contents

    Table of Contents Table of Contents..............i List of Tables................iii List of Figures ................ iv 1 Introduction ................ 1 PCI/cPCI/PM-7841 Features ..........1 Applications ................. 3 Specifications............... 4 2 Installation ................7 Before Installing the PCI/cPCI/PM-7841......7 Installing PCI-7841 .............. 7 Installing cPCI-7841.............
  • Page 6 CanEnableReceive() ............. 24 CanDisableReceive() ............ 25 CanSendMsg() .............. 25 CanRcvMsg() ..............26 CAN-layer Status Functions ......... 27 CanClearOverrun() ............27 CanClearRxBuffer() ............28 CanClearTxBuffer() ............28 CanGetErrorCode() ............29 CanSetErrorWarningLimit() .......... 31 CanGetErrorWarningLimit() .......... 32 CanGetRxErrorCount() ..........32 CanGetTxErrorCount() ..........33 CanSetTxErrorCount() ..........
  • Page 7: List Of Tables

    List of Tables Table 1-1: PCI-7841 Specifications ........... 4 Table 1-2: cPCI-7841 Specifications ......... 4 Table 1-3: PM-7841 Specifications ..........5 List of Tables...
  • Page 8: List Of Figures

    List of Figures Figure 2-1: Default Base Address Configuration......13 Figure 2-2: IRQ Settings ............14 List of Figures...
  • Page 9: Introduction

    Introduction The PCI/cPCI/PM-7841 is a Controller Area Network (CAN) inter- face card used for industrial PC with PCI, Compact-PCI, and PC104 bus. It supports dual ports CAN’s interface that can run independently or bridged at the same time. The built-in CAN con- troller provides bus arbitration and error detection with auto cor- rection and re-transmission function.
  • Page 10 The cPCI-7841 is a Dual-Port Isolated CAN Interface Card with the following features: Two independent CAN network operation Bridge function supports Compatible with CAN specification 2.0 parts A and B Optically isolated CAN interface up to 2500 Vrms isolation protection Direct memory mapping to the CAN controllers Powerful master interface for CANopen, DeviceNet and SDS application layer protocol...
  • Page 11: Applications

    1.2 Applications Industry automation Industry process monitoring and control Manufacture automation Product testing Introduction...
  • Page 12: Specifications

    1.3 Specifications PCI-7841 Specification Table Ports 2 CAN channels (V2.0 A,B) CAN Controller SJA1000 CAN Transceiver 82c250 Signal Support CAN_H, CAN_L Isolation Voltage 2500 Vrms Connectors Dual DB-9 male connectors ° Operation Temperature 0 ~ 60 ° ° Storage Temperature C ~ 80 Humidity 5% ~ 95% non-condensing...
  • Page 13: Table 1-3: Pm-7841 Specifications

    Size 132(L)mm x 98(H)mm Table 1-2: cPCI-7841 Specifications PM-7841 Specification Table Ports 2 CAN channels (V2.0 A,B) CAN Controller SJA1000 CAN Transceiver 82c250/82c251 Signal Support CAN_H, CAN_L Isolation Voltage 1000 Vrms Connectors Dual 5 male connectors ° Operation Temperature 0 ~ 60 °...
  • Page 14 Introduction...
  • Page 15: Installation

    Installation This chapter describes how to install the PCI/cPCI/PM-7841. At first, the contents in the package and unpacking information that you should be careful are described. 2.1 Before Installing the PCI/cPCI/PM-7841 Your PCI/cPCI/PM-7841 card contains sensitive electronic compo- nents that can be easily damaged by static electricity. The card should be done on a grounded anti-static mat.
  • Page 16 PCI-7841 Layout: Terminator Configuration A 120 Ohm terminal resistor is installed for each port, while JP1 enables the terminal resistor for port0 and JP2 enables the termi- nal resistor for port 1 Connector Pin Definition P3 and P4 are CAN connectors; pin definition is as follows: Installation...
  • Page 17: Installing Cpci-7841

    2.3 Installing cPCI-7841 What you have In addition to this User's Manual, the package includes the follow- ing items: cPCI-7841 Dual Port Compact-PCI Isolated CAN Interface Card ADLINK CD-ROM If any of these items is missing or damaged, contact the dealer from whom you purchased the product.
  • Page 18: Installing Pm-7841

    Connector Pin Definition J1 and J2 are CAN connectors; pin definition is as follows: 2.4 Installing PM-7841 What you have In addition to this User's Manual, the package includes the follow- ing items: PM-7841 Dual Port PC-104 Isolated CAN Interface Card ADLINK CD-ROM If any of these items is missing or damaged, contact the dealer from whom you purchased the product.
  • Page 19 PM-7841 Layout Terminator Configuration A 120 Ohm terminal resistor is installed for each port, while JP1 enables the. terminal resistor for port0 and JP2 enables the terminal resistor for port 1. Installation...
  • Page 20: Jumper And Dip Switch Description

    Connector Pin Define J1 and J2 are CAN connectors; pin definition is as follows: 2.5 Jumper and DIP Switch Description You can configure the output of each channel and base address by setting jumpers and DIP switches on the PM-7841. The card's jumpers and switches are preset at the factory.
  • Page 21 SW1 : Base Address = 0x200 A ( 8 7 6 5 4 ) Figure 2-1: Default Base Address Configuration (*): default setting ON X: don't care Note: A4,…, A9 correspond to PC-104(ISA) bus address lines. Installation...
  • Page 22: Irq Level Setting

    2.7 IRQ Level Setting A hardware interrupt can be triggered by the external Interrupt sig- nal which is from JP3 ad JP4. The jumper setting is specified as below: Note: Be aware that there is no other add-on cards sharing the same interrupt level in the system.
  • Page 23: Function Reference

    Function Reference The cPCI/PCI-7841 functions are organize into the following sec- tions: CAN layer functions Card Initialization and configuration functions CAN layer I/O functions CAN layer status functions CAN layer Error and Event Handling functions DeviceNet layer functions Send and Receive packet functions Connection establish and release functions DeviceNet object class functions The particular functions associated with each function are pre-...
  • Page 24: Port_Struct Structure Define

    CanClearOverrun() CanClearRxBuffer() CanClearTxBuffer() CanGetErrorCode() CanGetErrorWarningLimit() CanSetErrorWarningLimit() CanGetRxErrorCount() CanGetTxErrorCount() CanSetTxErrorCount() CanGetPortStatus() CanGetLedStatus()1 CanSetLedStatus()1 Error and Event handling functions Operation System Function Name CanInstallCallBack() CanRemoveCallBack() Windows 95/98/NT CanInstallEvent() Note: only for compact PCI and PC-104 version. PORT_STRUCT structure define The PORT_STRUCT structure defines the mode of id-mode, acceptance code, acceptance mask and baud rate of a physical CAN port.
  • Page 25 Members mode: 0 means using 11-bit in CAN-ID field 1 means using 29-bit in CAN-ID field. accCode:Acceptance Code for CAN controller. accMask:Acceptance Mask for CAN controller. baudrate:Baud rate setting for the CAN controller. Value Baudrate 125 Kbps 250 Kbps 500 Kbps 1M bps CanPortConfig(), CanGetPortStatus(), and PORT_STATUS struc- ture...
  • Page 26: Can_Packet Structure Define

    unsigned short TxEnd: 1; unsigned short RxStatus: 1; unsigned short TxStatus: 1; unsigned short ErrorStatus: 1; unsigned short BusStatus: 1; unsigned short reserved: 8; See Also CanGetPortStatus(), and PORT_STATUS structure CAN_PACKET structure define The CAN_PACKET structure defines the packet format of CAN packet.
  • Page 27: Devicenet_Packet Structure Define

    DEVICENET_PACKET structure define The DEVICENET_PACKET structure defines the packet format of DeviceNet packet. It is widely used by the DeviceNet layer func- tions. typedef struct _tagDEVICENET_PACKET BYTE Group; BYTE MAC_ID; BYTE HostMAC_ID; BYTE MESSAGE_ID; BYTE len; BYTE data[8]; DWORD time; BYTE reserved;...
  • Page 28: Can Layer Functions

    3.2 CAN LAYER Functions CAN-layer Card Initialization Functions PM7841_Install(base, irq_chn, 0xd000) Purpose Get the version of driver Prototype C/C++ int PM7841_Install(int baseAddr, int irq_chn, int memorySpace) Parameters baseAddr:Base Address of PM-7841(DIP Switch) Irq_chn: IRQ channel (Jumpper) MemorySpace: Memory Mapping Range Return Value A signed integer 0 : Successful...
  • Page 29: Canopendriver()

    Remarks Call this function to retrieve the version of current using driver. This function is for your program to get the version of library and dynamic-linked library. See Also none Usage C/C++ #include “pci7841.h” WORD version = GetDriverVersion(); majorVersion = version >> 8; minorVersion = version &...
  • Page 30: Canconfigport()

    Parameters handle : handle retrieve from CanOpen- Driver() Port : index of port Return Value Return 0 if successful -1 if error occurs Remarks Call this function to close a port. See Also CanOpenDriver() Usage See usage of CanOpenDriver(). CanConfigPort() Purpose Configure properties of a port Prototype...
  • Page 31: Candetectbaudrate()

    CanCloseDriver(handle); CanDetectBaudrate() Purpose Perform auto-detect baud rate algorithm. Prototype C/C++ CanDetectBaudrate(int handle, miliSecs) Parameters handle: handle retrieve from CanOpen- Driver() MiliSecs: timeout time(ms) Return Value Return –1 if error occurs Others is the baudrate Value Baudrate 125 Kbps 250 Kbps 500 Kbps 1 Mbps Remarks...
  • Page 32: Canread()

    CanConfigPort(handle, &port_struct); CanCloseDriver(handle); Visual Basic(Windows 95/98/NT) CanRead() Purpose Direct read the register of PCI-7841. Prototype C/C++ BYTE CanRead(int handle, int offset) Parameters handle : handle retrieve from CanOpen- Driver() offset : offset of register Return Value Return data read from port. Remarks Direct read the register of PCI-7841.
  • Page 33: Candisablereceive()

    void CanEnableReceive(int handle); Parameters handle : handle retrieve from CanOpen- Driver() Return Value none Remarks Call this function to enable receive. Any packet on the network that can induce a interrupt on your computer. If that packet can pass your acceptance code and accep- tance mask setting.
  • Page 34: Canrcvmsg()

    -1 if error occurs Remarks Send a message to an opened CAN port. Actually, this function copies the data to the sending queue. Error occurs when the port has not been opened yet or the packet is a NULL pointer. You can use the Error and Event handling functions to handle the exceptions.
  • Page 35: Can-Layer Status Functions

    card to memory. It starts after your port con- figuration is done. This function copies the buffer to your application. So if your pro- gram has the critical section to process the data on the network. We suggest that you can call the CanClearBuffer() to clear the buffer first.
  • Page 36: Canclearrxbuffer()

    …. CanClearOverrun(handle); CanCloseDriver(handle); CanClearRxBuffer() Purpose Clear data in the receive buffer Prototype C/C++ void CanClearRxBuffer(int handle) Parameters handle : handle retrieve from CanOpen- Driver() Return Value none Remarks Clear the data in the receive buffer There are 2-type of buffer defined in the driver.
  • Page 37: Cangeterrorcode()

    un-send message would be stored in the memory of the driver. The sequence of out- going message is the FIRST-IN-FIRST- OUT. According this algorithm, if your pro- gram need to send an emergency data, you can clear the transmit buffer and send it again.
  • Page 38 Bit interpretation of ERRC1 and ERRC2 Bit ERRC1 Bit ERRC2 Function bit error form error stuff error other type of error Bit interpretation of SEG4 to SEG 0 SEG4 SEG3 SEG2 SEG1 SEG0 Function start of frame ID.28 to ID.21 ID.20 to ID.18 bit SRTR bit IDE...
  • Page 39: Canseterrorwarninglimit()

    Remarks Get the information about the type and location of errors on the bus. When a bus error occurs, if your program installed the call-back function or error-han- dling event. The error-bit position would be captured into the card. The value would be fixed in the card until your program read it back.
  • Page 40: Cangeterrorwarninglimit()

    CanSetErrorWarning(handle, 96); CanCloseDriver(handle); CanGetErrorWarningLimit() Purpose Get the Error Warning Limit Prototype C/C++ BYTE CanGetErrorWarningLimit(int han- dle) Visual Basic(Windows 95/98/NT) Parameters handle : handle retrieve from CanOpen- Driver() Return Value 0-255 (Error warning limit value) Remarks Get the error warning limit See Also CanSetErrorWarningLimit() Usage...
  • Page 41: Cangettxerrorcount()

    #include “pci7841.h int handle = CanOpenDriver(0, 0);//open the port 0 of card 0 …. BYTE error_count = CanGetRxErrorCount(); CanCloseDriver(handle); CanGetTxErrorCount() Purpose Get the current value of the transmit error counter Prototype C/C++ BYTE CanGetTxErrorCount(int handle) Parameters handle : handle retrieve from CanOpen- Driver() Return Value value...
  • Page 42: Cangetportstatus()

    Parameters handle : handle retrieve from CanOpen- Driver() value : a byte value Return Value None Remarks This function set the current of the transmit error counter. Please see the remark of CanGetTxError- Count(). See Also CanRcvMsg() Usage C/C++ #include “pci7841.h int handle = CanOpenDriver(0, 0);//open the port 0 of card 0 ….
  • Page 43: Cangetledstatus()

    CanCloseDriver(handle); CanGetLedStatus() Purpose Get the LED status of cPCI-7841 and PM- 7841 Prototype C/C++ BYTE CanGetLedStatus (int card, int index); Parameters card : card number Index : index of LED Return Value status of Led Value Function Led Off Led On Remarks Get the status of Led This function supports the cPCI-7841 and...
  • Page 44: Cangetrcvcnt()

    Led Off Led On Return Value none Remarks Set Led status of cPCI-7841 and PM-7841 This function supports the cPCI-7841 and PM-7841 See Also CanRcvMsg() Usage C/C++ #include “pci7841.h int handle = CanOpenDriver(0, 0);//open the port 0 of card 0 ….
  • Page 45: Error And Event Handling Functions

    Error and Event Handling Functions When the exception occurs, your program may need to take some algorithm to recover the problem. The following functions are oper- ation-system depended functions. You should care about the restriction in the operation-system. DOS Environment CanInstallCallBack() Purpose Install callback function of event under DOS...
  • Page 46: Canremovecallback()

    occurs when the event happened. It will not be disabled until using CanRemoveCall- Back() or a hardware reset. Actually, the call-back function is a part of ISR. You need to care about the DOS reen- trance problem, and returns as soon as possible to preventing the lost of data.
  • Page 47 Bus Error void (far *proc)() : Previous call-back func- tion Return Value Return 0 is successful -1 if error occurs Remarks Install the call-back function for event han- dling In normal state, all hardware interrupt of cPCI/PCI-7841 wouldn’t be set except receive and transmit interrupt.
  • Page 48: Canclosedriver(Handle)

    CanCloseDriver(handle); Windows 95/98 Environment CanGetReceiveEvent() Purpose Install the event under Windows 95/98/NT system Prototype C/C++ (Windows 95/98/NT) void CanGetReceiveEvent(int handle, HANDLE *hevent); Parameters handle : handle retrieve from CanOpen- Driver() Heven : HANDLE point for receive event Return Value none Remarks Retrieve receive notify event Under Windows 95/98/NT environment,...
  • Page 49: Caninstallevent()

    You need not to call ResetEvent()….. err=CanRcvMsg(handle,&rcvMsg[0] [rcvPatterns[0]]); rcvPatterns[0]++; cout1 = CanGetRcvCnt(handle[0]); To retrieve number of unread in the FIFO CanInstallEvent() Purpose Install the event under Windows 95/98/NT system Prototype C/C++ (Windows 95/98/NT) int CanInstallEvent(int handle, int index, HANDLE hEvent); Parameters handle : handle retrieve from CanOpen- Driver()
  • Page 50 system). You can’t release the event object you created, because it was attached to the VxD. The VxD would release the event object when you installed another event. One way to disable the event handling is that you install another event which handle is NULL (ex: CanInstallEvent(handle, index, NULL)).
  • Page 51: Warranty Policy

    Warranty Policy Thank you for choosing ADLINK. To understand your rights and enjoy all the after-sales services we offer, please read the follow- ing carefully. 1. Before using ADLINK’s products please read the user man- ual and follow the instructions exactly. When sending in damaged products for repair, please attach an RMA appli- cation form which can be downloaded from: http:// rma.adlinktech.com/policy/.
  • Page 52 3. Our repair service is not covered by ADLINK's guarantee in the following situations: Damage caused by not following instructions in the User's Manual. Damage caused by carelessness on the user's part dur- ing product transportation. Damage caused by fire, earthquakes, floods, lightening, pollution, other acts of God, and/or incorrect usage of voltage transformers.

This manual is also suitable for:

Nucom cpci-7841Nucom pm-7841

Table of Contents