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,...
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.............
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...
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...
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 °...
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...
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.
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...
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...
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.
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-...
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...
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.
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;...
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...
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 &...
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...
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.
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.
-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.
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.
…. 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.
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...
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.
#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...
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 ….
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...
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 ….
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...
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.
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,...
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)).
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.
Need help?
Do you have a question about the NuCOM PCI-7841 and is the answer not in the manual?
Questions and answers