Home

1. Introducton - ICP DAS USA`s I

image

Contents

1. 2 4 Installation 1 Configure the jumper settings on your PIO CAN400 CAN200 in accordance with your particular requirements 2 Shutdown your system and take off the chassis of your machine 3 Plug in your PIO CAN400 CAN200 into a suitable empty PCI slot 4 Replace your chassis PIO CAN400 200 User s Manual Ver 1 1 01 27 05 10 5 Plug your CAN bus cable s into the 5 pin screw terminal connector or the 9 pin D sub connector 6 When the hardware installation is complete please turn on the computer again 3 Software Installation The PIO CAN400 CAN200 can be used in 98 Me NT 2000 XP Windows environments For these Windows operation systems the recommended installation procedure is given as follows Step 1 Step 2 Step 3 Step 4 Step 5 Insert the companion CD into the CD ROM driver and wait a few seconds until the installation program starts automatically If it cannot be started automatically for some reason please double click the file NAPDOS AUTO32 EXE on this CD Click the first item Toolkits Software Manuals Click the item PCI Bus DAQ Card Click PIO CAN 400 200 Click install Toolkit for Windows 98 Or Me NT 2000 XP which is based on the operation system you used Then the Install Shield will start the driver installation process and copy the related material to the indicated directory and then register the driver on your computer The driver target directory
2. Table 4 1 DLL function definition Function definition Int CAN_GetDliVersion Int CAN_TotalBoara Int CAN GetCardinf BYTE BoardNo DWORD dwVID DWORD dwDID DWORD dwSVID DWORD dwSDID DWORD 15 dwirqNo Int CAN_ActiveBoard BYTE wBoardNo Int CAN_CloseBoard BYTE wBoardNo int CAN_BoardlsActive BYTE BoardNo int CAN Reset BYTE BoardNo BYTE Port int CAN_Init BYTE wBoardNo BYTE Port int CAN_Config BYTE BoardNo BYTE Port ConfigStruct CanConfig int CAN EnableRxlrg BYTE BoardNo BYTE Port int CAN_DisableRxIrq BYTE BoardNo BYTE Port int CAN_RxirgStatus BYTE BoardNo BYTE Port BYTE bStatus int CAN_Installlrq BYTE BoardNo int CAN_Removelrq BYTE BoardNo int CAN_IrqStatus BYTE BoardNo BYTE bStatus int CAN_Status BYTE BoardNo BYTE Port BYTE bStatus int CAN_SendMsg BYTE BoardNo BYTE Port PacketStruct CanPacket int CAN_RxMsgCount BYTE BoardNo BYTE Port int CAN_ReceiveMsg BYTE BoardNo BYTE Port PacketStruct CanPacket int CAN_ClearSoftBuffer BYTE BoardNo BYTE Port int CAN_ClearDataOverrun BYTE BoardNo BYTE Port LONGLONG CAN_GetSystemFreq void 4 1 1 CAN GetDllVersion e Description PIO CAN400 200 User s Manual Ver 1 l 01 27 05 13 Obtain the version information of PIOCAN dll driver e Syntax WORD CAN_GetDllVersion viod e Parameter None eo Return DLL version information For example I
3. Figure 6 1 The form of demo1 program PIO CAN400 200 User s Manual Ver 1 1 01 27 05 39 DEMO2 In demo 2 we provide a demonstration on how to send out a CAN message through port 1 and receive the CAN message in port 2 by means of the interrupt mode Contained within this operation the user can key in the CAN message into the port 1 frame area and click on the Send button to send out the CAN message At the same time the CAN message will be received at port 2 by means of the interrupt mode As shown in the following figure port 2 can automatically receive the CAN message and store it within the 4K bytes of buffer software When the user clicks the Receive button all the messages stored in the 4K bytes buffer will all be presented in the TEXT edit area as shown in the following figure PIO CAN400 200 demo2 Port 1 ID he RTR DLC 1 8 EXIT 2 3 4 5 6 7 SMON CON tim 20 SN a SN EN 77M es Extened 29 bit ID Status E Send 1h ATR 0 DLC 8 Data hex 11 22 33 44 55 66 77 88 TimeStamp 3843 35030346036sec 2h ATR 0 DLC 8 Data hex 11 22 33 44 55 66 77 88 TimeStamp 3845 32033764068sec 3h ATR 0 DLC 8 Data hex 11 22 33 44 55 66 77 88 TimeStamp 3847 068891 71668sec 4h ATR 0 DLC 8 Datafhex 11 22 33 44 55 66 77 88 TimeStamp 3848 84192571961sec 5h ATR 0 DLC 8 Datafhex 11 22 33 44 55 66 77 88 TimeStamp 3850 62713166059sec Status E Figure 6 2 The form of demo2 program PIO CAN400 200 User s Manu
4. y CAN_ Config y CAN_EnableRxlrq y CAN _Installlrg lt CAN_RxMsgCount gt 0 NO YES y CAN_ReceiveMsg y CAN _DisableRxiIrq y CAN_Removelrq y CAN_CloseBoard y end of Application Figure 4 3 Flow Diagram Receive CAN Massage with IRQ PIO CAN400 200 User s Manual Ver 1 1 01 27 05 37 5 Demo Programs for Windows All of demo programs will not work normally if DLL driver would not be installed correctly During the installation process of DLL driver the install shields will register the correct kernel driver to the operation system and copy the DLL driver and demo programs to the correct position based on the driver software package you have selected Win98 Me NT win2000 XP After driver installation the related demo programs and development library and declaration header files for different development environments are presented as follows Demo gt demo program BCB3 gt for Borland C Builder 3 CAN H gt Header file PIOCAN LIB gt Linkage library for BCB Delphi4 gt for Delphi 4 CAN PAS gt Declaration file VB6 gt for Visual Basic 6 CAN BAS gt Declaration file The list of demo programs DEMO1 Transmit and receive CAN messages DEMO2 Transmit and receive CAN messages with IRQ PIO CAN400 200 User s Manual Ver 1 l 01 27 05 38 A brief introduct
5. Acceptance Filtering Four 8 bits wide Acceptance Code registers ACO AC1 AC2 and AC3 and Acceptance Mask registers AMO AM1 AM2 and AM3 are available for a versatile filtering of messages These registers can be used for controlling a single long filter as shown in Figure A 1 Which bits of the message are used for the acceptance filtering depend on the received frame Standard or Extended Acceptance Filtering CAN Message RTR bt JL JL L J COMES s Bits used for acceptance filtering Receive E ilter FIFO lt E R Extended Frame RTR bit eg ene Bits used for acceptance filtering Figure A 1 Acceptance Filtering Example 1 Suppose a messages with a Standard Frame The Acceptance Code Registers ACRn and Acceptance Mask Registers AMRn contain n 0 1 upper 4 bits 2 3 ACRn 01XXX010 XXXX XXXX XXXX XXXX XXXX AMRn 0011 1000 1111 1111 1111 11111 1111 Accepted messages 1D 28 1D 18 RTR X irrelevant x don t care only the upper 4 bits of ACR1 and AMR1 are used 01xx x010 XXXX At the bit positions containing a 1 in the Acceptance Mask Registers any value PIO CAN400 200 User s Manual Ver 1 1 01 27 05 44 is allowed in the composition of the identifier for the Remote Tranmission Request bit and for the bits of data byte1 and 2 Example 2 Suppose the following 2 messages with a Standard Frame Identifier have to be accepted without any further decoding of the identifier
6. SOFTWARE INSTALLATION sccssssevsscsesenssecssovscsnessccsssseessesvosessdessscvasocussesdscsanses 11 4 INSTALLATION DLL DRIVER 6 iiscssavscsccigistacceaicctaszosscen teaccesnasbinesecuaicaporassvevesoos 12 4 1 DLL FUNCTION DEFINITION AND DESCRIPTION an saserenserenanene dtenaerenseenanredsenndenenteene 12 4 1 1 CAN_GetDllVersion Ln AA EENES anne baan 13 4 1 2 CAN _TotalBoard as 14 ATS CAN G tboard Inf E 15 AAA CAIN ActivebBo rdi erennere a E E e E odie att 16 JLI CAN CIO ODO A a 16 4 1 6 CAN BO4rdisA cave a dt 17 ALZ CAN RESISTE en 17 BLS CAN AME ieden deedeetee es 18 AL OAN COULEE nrden EN de RE Ran A 19 AA TO CAN EnableRxlrg ad 21 RT A TEA IN ST SOCIO e lito 22 41 IZAN Rylrg Sta tUs eee eir e EE ra 23 ANAIS CANAS MAS A E A aah 24 AL 14 CAN REMOVE a a 25 HEL CAN TV SWAG zeten et ld 26 ALA CAN SS LOTUS er ande end ahead E 27 AST ok CANES CINES O Ze A En aaa e aae a aaa a naa aaa diada es 29 ALAS CAN RMS ECO dan eeen nes 30 PIO CAN400 200 User s Manual Ver 1 1 01 27 05 2 BTS CAN Rec eiveMS aarnaast 31 4 1 20 CAN ClearSoftBuffet sas ts ai a RA AE AAA A AER 32 4 1 21 CAN ClearDataOverrun nennen eenen enervenneneevenneneevennenee vene enervenenen 33 ARL CAN AS NOR ee eeen eneen la igs 33 4 2 TABLE OF RETURN CODE ngn a aaa aa a ase verende 34 4 3 FLOW DIAGRAM FOR APPLICATION ccccccccccccccccssssssceccccccccsssssscscccccessusesesesceseseusunenenss 35 5 DEMO PROGRAMS FOR WINDOWS o ccccccccccococononoconononononononononon
7. Ver 1 l 01 27 05 21 4 1 11 CAN _DisableRxlrq e Description Disable receive interrupt of the CAN controller e Syntax int CAN DisableRxlrg BYTE BoardNo BYTE Port eo Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 e Return CAN_NoError OK CAN _DriverError Kernel driver can t be opened CAN BoardNumberError BoardNo is not correct or exceeds the current total board number CAN PortNumberError Port number is not correct CAN ActiveBoardError This board is not activated CAN _DisableRxlrgFailure Disable receive interrupt failure PIO CAN400 200 User s Manual Ver 1 l 01 27 05 22 4 1 12 CAN_RxirqStatus Description Obtain receive interrupt status of the CAN controller Syntax int CAN_RxirqStatus BYTE BoardNo BYTE Port BYTE bStatus Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 bStatus output 0 gt receive interrupt disable 1 gt receive interrupt enable Return CAN_NoError OK CAN_DriverError Kernel driver can t be opened CAN_BoardNumberError BoardNo is not correct or exceeds the current total board number CAN_PortNumberError Port number is not correct CAN_ActiveBoardError This board is not activated PIO CAN400 200 User s Manual Ver 1 1 01 27 05 23 4 1 13 CAN Installlrg e Description Enable or start IRQ for PIO CAN400 200 Board Before calling this function CAN_Enabl
8. bits Data and Remote Frames have to be received correctly Data bytes are not involved in the acceptance filtering Message 1 ID 28 1011 1100 101 ID 18 Message 1 ID 28 1111 0100 101 ID 18 Using the Single Filter result in accepting four message and not only the request two n 0 1 upper 4 bits 2 3 ACRn 1X11 X100 101X XXXX XXXX IXXXX XXXX AMRn 0100 1000 1111 1111 1111 Di Accepted messages 11011 0100 101x 1D 28 1D 18 RTR 1111 0100 101x message 2 1011 1100 101x message 1 1111 1100 101x X irrelevant x don t care only the upper 4 bits of ACR1 and AMR1 are used This result does not meet the request for receiving 2 messages without any further decoding Example 3 In this example a group of messages with an Extended Frame Identifier are filtered using a long single acceptance filter n 0 1 2 3 upper 6 bits ACRn 1011 0100 1011 000X 1100 XXXX 0011 OXXX AMRn 0000 0000 0000 0001 0000 1111 0000 0111 Accepted messages ID 28 ID 0 RTR X irrelevant x don t care only the upper 6 bits of ACR3 and AMR3 are used 1011 0100 1011 000x 1100 xxxx 0011 Ox PIO CAN400 200 User s Manual Ver 1 1 01 27 05 45
9. 00 User s Manual Ver 1 1 01 27 05 17 4 1 8 CAN Init e Description Initiate CAN controller e Syntax int CAN Init BYTE BoardNo BYTE Port Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 e Return CAN_NoError OK CAN_DriverError Kernel driver can t be opened CAN_BoardNumberError BoardNo is not correct or exceeds the current total board number CAN_PortNumberError Port number is not correct CAN_ActiveBoardError This board is not activated CAN_InitError Initiating CAN controller failure PIO CAN400 200 User s Manual Ver 1 1 01 27 05 18 4 1 9 CAN Config Description Configure CAN controller After calling this function the CAN controller will enter operating mode Syntax Int CAN _Config BYTE BoardNo BYTE Port ConfigStruct CanConfig Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 ConfigStruct input The point of structure for ConfigStruct is defined as following typedef struct config BYTE AccCode 4 BYTE AccMask 4 BYTE BaudRate BYTE BT0 BT1 ConfigStruct AccCode 4 Acceptance code for CAN controller AccMask 4 Acceptance mask for CAN controller BaudRate 0 gt user defined must to set BTO BT1 1 gt 10Kbps 2 20Kbps 3 gt 50Kbps 4 gt 125Kbps 5 gt 250Kbps 6 gt 500Kbps 7 gt 800Kbps 8 gt 1Mbps BTO BT1 user defined baud rate used only if BaudRate 0 F
10. 2 bit PCI slot and is supported with actual Plug amp Play technology 1 2 Features PCI BUS interface 2500Vrms photo isolation protection Four or two independent CAN communication ports Compatible with CAN specification 2 0 parts A and B On board optical isolation protection Programmable transfer rate up to 1 Mbps Jumper select 1200 terminator resistor for each port Direct memory mapping to the CAN controllers 33MHz 32bit 5V PCI bus V2 1 plug and play technology Driver supported for Windows 98 ME NT4 2000 XP 1 3 Specifications e CAN controller Phillips SJA1000T PIO CAN400 200 User s Manual Ver 1 1 01 27 05 4 CAN transceiver Phillips 82C250 251 Signal support CAN_H CAN L 16 MHz CAN controller frequency Connector 5 pin screw terminal connector or 9 pin D sub male connector Isolation voltage 2500Vrms Power requirements CAN400 5V 640mA CAN200 5V 380mA Environmental Operating temp 0 60 C Storage temp 20 80 C Humidity 0 90 non condensing Dimensions 130mm X 110mm 1 4 Product Check List In addition to this manual the package includes the following items PIO CAN400 CAN200 card ADP 9 Board for PIO CAN400 only Software CD ROM User manual It is recommended that users read the release note first All the important information needed will be provided in the release note as follows O O O O Where you can find the software driver utility and de
11. BufferlsFull Ver 1 1 01 27 05 Software buffer in driver is full 34 4 3 Flow Diagram for Application In this section we will show the operation procedure of PIO CAN board for sending and receiving CAN message Figure 4 1 presents the Send CAN Message procedure Figure 4 2 and 4 3 stand for the receiving CAN Message in polling and in interrupt mode respectively Users need to follow the operation principle of PIO CAN board for correctly and easily send and receive the CAN message through CAN network For more detail information please refer to the demo programs in section 5 A Start of Application A y CAN_ActiveBoard v CAN Reset y CAN Init v CAN_ Config v CAN_SendMsg Y CAN_CloseBoard Ena of Application Figure 4 1 Flow Diagram Send CAN Massage PIO CAN400 200 User s Manual Ver 1 1 01 27 05 35 stan of Aplican y CAN_ActiveBoard v CAN Reset AA CAN Init y CAN_Config lt CAN_RxMsgCount gt 0 NO CAN_ReceiveMsg y CAN_CloseBoard y Era of Application Figure 4 2 Flow Diagram Receive CAN Massage PIO CAN400 200 User s Manual Ver 1 1 01 27 05 36 B stan of Application y CAN_ActiveBoard v CAN Reset AA CAN_Init
12. GetSystemFreq Parameter None e Return Return the system clock frequency PIO CAN400 200 User s Manual Ver 1 1 01 27 05 33 4 2 Table of Return Code Return Code Table 4 3 Interpretation of the return code Error ID Comment CAN _NoError OK CAN _DriverError Driver error CAN ActiveBoardError This board can t be activated CAN BoardNumberError The board number exceeds the maximum board number 7 CAN PortNumberError The port number exceed the maximum port number CAN ResetError CAN chip hardware reset error CAN SoftResetError CAN chip software reset error CAN _InitError CAN chip initiation error CAN _ConfigError CAN chip configure error CAN_SetACRError Set to Acceptance Code Registe error CAN_SetAMRError CAN_SetBaudRateError CAN_EnableRxirqFailure CAN_DisableRxIrqFailure CAN _InstalllrgFailure Installing PCI board IRQ failure CAN _RemovelrgFailure Removing PCI board IRQ failure CAN _TransmitBufferLocked Transmit buffer in CAN chip is locked CAN _Transmitincomplete Previously transmission is not yet completed CAN _ReceiveBufferEmpty CAN chip RXFIFO is empty CAN _DataOverrun Data was lost because there was CAN ReceiveError Receive data is not completed CAN _SoftBufferlsEmpty Software buffer in driver is empty PIO CAN400 200 User s Manual CAN_Soft
13. PISO CAN400 D T PISO CAN200 D T User s Manual Warranty All products manufactured by ICP DAS are warranted against defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assumes no liability for damages consequent to the use of this product ICP DAS reserves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use or for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 2004 by ICP DAS Co LTD All rights reserved worldwide Trademark The names used for identification only may be registered trademarks of their respective companies PIO CAN400 200 User s Manual Ver 1 l 01 27 05 1 Contents 1 GENERAL INFORMATION psevssicsssvccsccevvedssseavsseseses sscesstvacoosestedssenssdetsasebsecstocnaens 4 Lal INTRODUCTION GREENLEE ENGE 4 EZ FEATURES a tinten 4 LASPECIICATIONS sentent teelde ie 4 14 PRODUCT CHECK LIST orentis batt elken 5 2 HARDWARE CONFIGURATION nnssasesosreonseonseoonc enne eonseonseenseensvenseeeense 6 ZE BOARD EA os 6 ZJ DMPER SELECTION a ds ici iS 8 2 3 CONNECTOR PIN ASSIGNMENT 0 A aati 9 2 3 1 5 pin screw terminal Connector zede cS SoBe EEEN ERE 9 2 3 2 9 pin D sub male connectors nnn ted ds ieee tuts Gti aoa A 10 DANS TATA ATION GELEEN 10 3
14. al Ver 1 1 01 27 05 40 6 Utility Program for Windows For PIO CAN200 CAN400 we also provide a CANbus utility to allow user to easily and friendly send and receive the CAN messages to and from CAN network It can be thought as a useful tool for monitoring or testing CAN messages on the CAN network which includes the raw CAN messages DeivceNet CANopen and etc The operation principle will be addressed in the following sub section 1 CAN Configure Please select the CAN port and focus on the CAN port configuration area According to CAN communication requirement user need to setup the Baudrate acceptance and acceptance mask And then select transmit or receive function and finally click enable to open transmit or receive mode of the relative CAN port ICPDAS PIO CAN400 200 Utility CAN Port 1 Configuration Baud Rate Acceptance code Acceptanc Mask Function Exit e 125K ACO 0 AMO ff Transmit C C Reveive z a act 0 ami ff Status C 800K AC2 0 AM2 ff C Enable C 1M AC3 0 AM3 ff f Disable Figure 6 1 Initial page of the Utility tool PIO CAN400 200 User s Manual Ver 1 1 01 27 05 41 2 CAN Transmit function In the Figure 6 2 the CAN Port Transmit mode is opened User can key in the CAN message into the framework of the CAN port transmit area and then click the send button to send out the CAN message into the CAN network Note that user can key in all of the CAN messages into transmit area and click th
15. e relative send button to send out CAN message in sequence For example user can key in the DeviceNet ot CANopen message in the transmit frame and click the relative send button to send out DeviceNet or CANopen message ICPDAS PIO CAN400 200 Utility Port 1 Port 2 Port 3 Porta CAN Port 1 Configuration Baud Rate Acceptance code Acceptanc Mask Function 3 aca 0 Amo ff 3 act 0 amt if mee po ae E eae aca 0 awa f Disable CAN Port 1 Transmit ID Hex1 MODE o hm A A AS RAMAS 111111 11111 lele ARMAS 111111 Lel 111111 ler ARA AMA ME TELL lek TUT To Titi Tt lt Figure 6 2 Transmit mode PIO CAN400 200 User s Manual Ver 1 1 01 27 05 42 3 CAN Receive function Figure 6 3 shows the CAN receive mode Note that CAN port receive mode is working on the interrupt receiving mode Once CAN port receive the CAN message it will be shown on the CAN port receive framework It is especially valuable for working on CAN bus message monitor analysis ES icppas PIO CAN400 200 Utility 2 Port3 Porta CAN Port 2 Configuration Baud Rate Acceptance code Acceptanc Maska Function aco 0 amo f Transmit ACI Po ami ff EE AGZ 0 2 7 EE aca 0 awa ff C Disable RTR DLC D1 TimeStamps sec 8 14 2B 3C 4D SE 66 77 88 4160 11837 Figure 6 3 Receive mode PIO CAN400 200 User s Manual Ver 1 1 01 27 05 43 Appendix
16. eRxirq must to be called first e Syntax int CAN _Installlrg BYTE BoardNo Parameter BoardNo input PIO CAN board number 0 7 e Return CAN_NoError OK CAN_DriverError Kernel driver can t be opened CAN_BoardNumberError BoardNo is not correct or exceeds the current total board number CAN ActiveBoardError This board is not activated CAN_InstalllrqFailure Enable or start IRQ failure PIO CAN400 200 User s Manual Ver 1 1 01 27 05 24 4 1 14 CAN _Removelrg e Description Disable or stop IRQ for PIO CAN400 200 Board After calling this function the interrupts for all CAN controllers on board will be disabled e Syntax Int CAN_Removelrq BYTE BoardNo Parameter BoardNo input PIO CAN board number 0 7 e Return CAN_NoError OK CAN_DriverError Kernel driver can t be opened CAN_BoardNumberError BoardNo is not correct or exceeds the current total board number CAN ActiveBoardError This board is not activated CAN_RemovelrqFailure Disable or stop IRQ failure PIO CAN400 200 User s Manual Ver 1 1 01 27 05 25 4 1 15 CAN IrqStatus Description Obtain IRQ status of the PIO CAN200 400 board Syntax int CAN IrqStatus BYTE BoardNo BYTE bStatus Parameter BoardNo input PIO CAN board number 0 7 bStatus output 0 gt IRQ disable 1 gt IRQ enable Return CAN _NoError OK CAN _DriverError Kernel driver can t be opened CAN BoardNumberError BoardNo is not correct or exceed
17. f 101 hex is return it means driver version is 1 01 4 1 2 CAN_TotalBoard e Description Obtain the total board number of PIO CAN boards installed in the PCI bus e Syntax int CAN_TotalBoard void Parameter None eo Return Return the total board number PIO CAN400 200 User s Manual Ver 1 1 01 27 05 14 4 1 3 CAN GetBoardinf Description Obtain the information of PIO CAN boards which include vender ID device ID and interrupt number Syntax WORD CAN GetCardinf BYTE BoardNo DWORD dwVID DWORD dwDID DWORD dwSVID DWORD dwSDID DWORD dwSAuxlD DWORD dwlrqNo Parameter BoardNo input PIO CAN board number dwVID output vendor ID of this board dwDID output device ID of this board dwSVID output sub vendor ID of this board dwSDID output sub device ID of this board dwSAuxID output sub auxiliary ID of this board dwirq output logical interrupt number of this board Return CAN_NoError OK CAN_DriverError Kernel driver can not be opened CAN_BoardNumberError BoardNo exceeds the current total board number PIO CAN400 200 User s Manual Ver 1 1 01 27 05 15 4 1 4 CAN ActiveBoard e Description Activate the device It must be called once before using the other functions of PIO CAN400 200 board e Syntax int CAN ActiveBoard BYTE BoardNo Parameter BoardNo input PIO CAN400 200 board number 0 7 e Return CAN _NoError OK CAN BoardNumberError Boa
18. ion of the demo programs DEMO1 Demo1 is the example used for starting the PIO CAN board This demo program is designed to send out the CAN message through Port 1 and receive the CAN message immediately at port 2 in the same PIO CAN board Before exercising this demo the user needs to finish the CAN median wiring connection between port 1 and port 2 Based on this demo the user can key in the CAN message into the port 1 frame area and then click the Send button in order to send out the CAN message to port 2 If you click the Receive button in the CAN port 2 frame area the CAN message received by CAN port 2 will be presented in TEXT box This is shown in the below screenshot Note that if port 2 displays a warning message like CAN Data Overrun then it is an indication that the un read messages within the 64 bytes RXFIFO CAN buffer have been covered by another message This means that the messages that are being received from the CAN bus may be in error and or they may be missing part of the message Then the user can click on the Clear Overrun button to clear the RXFIFO buffer overrun status within the CAN controller PISO CAN400 200 demo1 Port 1 IDfhex RTR DLC 1 EXIT 2 3 4 5 6 7 8 139 0 MN CON 11 220 ON AN SN CM 77 es Extened 29 bit ID Status 5 Send Port 2 01 Mode 0 ID 123h ATR 0 DLC 8 Datafhex 11 22 33 44 55 66 77 88 TimeStamp 3734 3343581377 sec Status C ClearOverrun Receive
19. is as below for the different systems Windows NT 2000 WINNT SYSTEM32 DRIVERS Windows 98 Me XP WINDOWS SYSTEM32 DRIVERS PIO CAN400 200 User s Manual Ver 1 1 01 27 05 11 4 Installation DLL Driver The DLL driver is the collection of function calls on the PIO CAN400 CAN200 cards used for Windows 98 Me NT 2000 XP systems The application structure is presented in the following figure The user application programs which have been developed by the following designated tools VB Delphi and Borland C Builder etc can call the PIOCAN DLL driver in user mode And then the DLL driver will bypass the function call into the KP_CAN sys and windrvr6 sys to access the hardware system as shown in the following Figure Application piocan dll User Mode KP_CAN sys windrvr6 sys 4 1 DLL Function Definition and Description All the functions provided in the PIO CAN400 200 are listed in the following table and detailed information for every function is presented in the following sub section However in order to make the descriptions more simplified and clear the attributes for the both the input and output parameter functions are given as input and output respectively as shown in following table PIO CAN400 200 User s Manual Ver 1 1 01 27 05 12 Keyword Set parameter by user before Get the data from this parameter calling this function after calling this function input Yes No output No
20. mo programs How to install software amp utility Where is the diagnostic program FAQ s and answers Attention If any of these items are missing or damaged please contact your local field agent Keep aside the shipping materials and carton in case you want to ship or store the product in the future PIO CAN400 200 User s Manual Ver 1 l 01 27 05 5 2 Hardware Configuration This section will describe the hardware settings of the PIO CAN which includes the settings for both the PIO CAN400 and the PIO CAN200 2 1 Board Layout ES e2c2so smoor 7 s2c2s0 ec O SJA1000T O PCI bridge chip PIO CAN200 Figure2 1 PIO CAN200 Board LAYOUT PIO CAN400 200 User s Manual Ver 1 1 01 27 05 6 JP6 Bell fzczee smoor k EE L E O soor O JP8 Bef acaso suasooor PCI bridge chip met Le v2 O sonar keel PIO CAN400 Figure2 2 PIO CAN400 Board LAYOUT Figure2 3 ADP 9 Board LAYOUT For PIO CAN400 Only PIO CAN400 200 User s Manual Ver 1 1 01 27 05 7 2 2 Jumper Selection Table 2 1 Jumper Selections Description Status JP1 JP1 ows 1 CAN Port 3 Connector roe BE connecting PIO CAN400 board and ADP 9 board Pin1 CAN_L Pin2 CAN_H Pin3 Shield JP2 JP2 CAN Port 4 Connector 123 A connecting PIO CAN400 board and ADP 9 board Pint CAN_L Pin2 CAN_H Pin3 Shield Port 1 terminator resister 120Q selection Po
21. oard is not activated CAN_ConfigError Port has not been configured successfully CAN_ReceiveBufferEmpty CAN controller s RXFIFO is empty CAN_SoftBufferlsEmpty Software RX Buffer Is empty CAN _SoftBufferlsFull Software RX Buffer Is full 4 1 20 CAN ClearSoftBuffer e Description Clear the software buffer of the PIOCAN DLL driver e Syntax Int CAN _ClearSoftBuffer BYTE BoardNo BYTE Port eo Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 e Return CAN _NoError OK CAN BoardNumberError BoardNo is not correct or exceeds the current total board number CAN PortNumberError Port number is not correct PIO CAN400 200 User s Manual Ver 1 l 01 27 05 32 4 1 21 CAN ClearDataOverrun e Description Clear the data overrun status bit for the CAN controller e Syntax Int CAN ClearDataOverrun BYTE BoardNo BYTE Port Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 eo Return CAN_NoError OK CAN_BoardNumberError BoardNo is not correct or exceeds the current total board number CAN_PortNumberError Port number is not correct CAN_ActiveBoardError This board is not activated CAN_ConfigError CAN controller enter operating mode failure 4 1 22 CAN_GetSystemFreq e Description Get the system clock frequency It is useful for calculate the time of the time stamp of the reception message e Syntax LONGLONG CAN_
22. onononononenonenenos 38 6 UTILITY PROGRAM FOR WINDOWS so eso so so sooo sooo sooo oo oo oo oo sooo oo oo oo oo oo oe 41 APPENDIX sdiscscasccesdicssiicscscsdevesasscsiocesedesovcssiesecssecovosestcssocececesccesscococecsdovcsesscbeocesccessusssese 44 ACCEPTANCE FILTERING ccccsssssscsccccccccesssssesccecceccessssescccccessssussssccsesseseuessssscsscsseeauea 44 PIO CAN400 200 User s Manual Ver 1 1 01 27 05 3 1 General Information 1 1 Introduction The CAN Controller Area Network is a serial communication protocol which efficiently supports distributed real time control with a very high level of security It is especially suited for networking intelligent devices as well as sensors and actuators within a system or sub system In CAN networks there is no addressing of subscribers or stations in the conventional sense but instead prioritized messages are transmitted As a standalone CAN controller PIO CAN400 CAN200 represents an economic solution within which an active CAN board can have either two or four independent CAN bus communication ports with either a 5 pin screw terminal connector or a 9 pin D sub connector It can be used as master slave function to cover a wide range of CAN applications In addition the PIO CAN400 CAN200 uses the new Phillips SJA1000T and transceiver 82C250 251 which provide for bus arbitration and error detection with both an auto correction and re transmission function It can be installed in a 5V 3
23. or example BTO 0x04 BT1 0x1C then baud rate setting for the CAN controller is 100Kbps For more detail baud rate setting please refer to manual of SJA1000 CAN controller Return CAN _NoError OK PIO CAN400 200 User s Manual Ver 1 1 01 27 05 19 CAN _DriverError Kernel driver can t be opened CAN BoardNumberError BoardNo is not correct or exceeds the current total board number CAN PortNumberError Port number is not correct CAN ActiveBoardError This board is not activated CAN _SoftResetError CAN controller software reset error CAN_SetACRError Set Acceptance code to CAN controller error CAN_SetAMRError Set Acceptance mask to CAN controller error CAN_SetBaudRateError Set baud rate to CAN controller error CAN_ConfigError CAN controller enter operating mode failure PIO CAN400 200 User s Manual Ver 1 1 01 27 05 20 4 1 10 CAN EnableRxlrq e Description Enable receive interrupt for CAN controller e Syntax int CAN EnableRxlrg BYTE BoardNo BYTE Port eo Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 e Return CAN _NoError OK CAN _DriverError Kernel driver can t be opened CAN BoardNumberError BoardNo is not correct or exceeds the current total board number CAN PortNumberError Port number is not correct CAN_ActiveBoardError This board is not activated CAN _EnableRxlrgFailure Enable receive interrupt failure PIO CAN400 200 User s Manual
24. ort input CAN port number 1 4 or 1 2 CanPacket input The point of structure for CanPacket is defined as following typedef struct packet LONGLONG MsgTimeStamps BYTE mode DWORD id BYTE rtr BYTE len BYTE data 8 PacketStruct MsgTimeStamps Not use in this function mode 0 gt 11 bit identifier 1 gt 29 bit identifier id Identifier rtr Remote transmission request len Data length data 8 data byte Return CAN_NoError OK CAN_BoardNumberError BoardNo is not correct or exceeds the current total board number CAN_PortNumberError Port number is not correct PIO CAN400 200 User s Manual Ver 1 1 01 27 05 29 CAN_ActiveBoardError This board is not activated CAN_TransmitBufferLocked Transmit buffer in CAN chip is locked CAN_TransmitIncomplete Transmission is not yet completed CAN_ConfigError Port has not been configured successfully 4 1 18 CAN_RxMsgCount e Description Obtain the number of messages available within the CAN controller s RXFIFO or the software buffer 4KBytes After calling CAN_EnableRxIrq and CAN Installlrg the number of messages is within the software buffer otherwise it is within the CAN controller s RXFIFO e Syntax int CAN_RxMsgCount BYTE BoardNo BYTE Port Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 e Return The number of messages Note If the parameter for BoardNo or Port isn t correct the re
25. rdNo exceeds the current total board number CAN ActiveBoardError This board can not be activated or kernel driver can not be found 4 1 5 CAN CloseBoard e Description Stop and close the kernel driver and release the device resource from computer device resource This method must be called once before exiting the user s application program Syntax int CAN_CloseBoard BYTE BoardNo Parameter BoardNo input PIO CAN400 200 board number 0 7 e Return CAN_NoError OK CAN_ActiveBoardError The board is not activated CAN_BoardNumberError BoardNo exceeds the current total board number PIO CAN400 200 User s Manual Ver 1 1 01 27 05 16 4 1 6 CAN BoardisActive e Description Obtain the information about the specific board is active or not e Syntax int CAN_BoardlsActive BYTE BoardNo Parameter BoardNo input PIO CAN400 200 board number eo Return 0 means the board is inactive 1 means the board is active 4 1 7 CAN_Reset e Description Hardware reset CAN controller Syntax int CAN_Reset BYTE BoardNo BYTE Port Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 e Return CAN_NoError OK CAN_DriverError Kernel driver can t be opened CAN_BoardNumberError BoardNo is not correct or exceeds the current total board number CAN_PortNumberError Port number is not correct CAN_ActiveBoardError This board is not activated PIO CAN400 2
26. rt 2 terminator resister 1200 selection Port 3 terminator resister 1200 selection Port 4 terminator resister 1200 selection PIO CAN400 200 User s Manual Ver 1 1 01 27 05 2 3 Connector Pin Assignment The PIO CAN400 T PIO CAN200 T are equipped with four two sets of 5 pin screw terminal connectors and the PIO CAN400 D PIO CAN200 D are equipped with four two sets of 9 pin D sub male connectors for wire connection of the CAN bus The connectors pin assignment is specified as follows 2 3 1 5 pin screw terminal connector The 5 pin screw terminal connector for the CAN bus is shown in Figure 2 4 The details for the pin assignment are presented in Table 2 2 CAN L Shield CAN H Figure2 4 5 pin screw terminal connector Table 2 2 Pin assignment of 5 pin screw terminal connector 5 pin screw terminal connectors pin assignment No Use CAN_L Shield CAN_H No Use PIO CAN400 200 User s Manual Ver 1 1 01 27 05 9 2 3 2 9 pin D sub male connectors The 9 pin D sub male connector of the CAN bus interface is shown in Figure 2 5 and the corresponding pin assignments are given in Table 2 3 CAN L Shield CAN H Figure2 5 9 pin D sub male connector Table 2 3 Pin assignment of the 9 pin D sub male connector D sub male connector pin assignment No Use CAN _L No Use No Use Shield No Use CAN _H No Use No Use O MO N O 0d A O IN J gt
27. s the current total board number CAN ActiveBoardError This board is not activated PIO CAN400 200 User s Manual Ver 1 l 01 27 05 26 4 1 16 CAN Status e Description Obtain the status of CAN controller for PIO CAN400 200 board e Syntax int CAN_Status BYTE BoardNo BYTE Port BYTE bStatus Parameter BoardNo input PIO CAN board number 0 7 bStatus output Status value of CAN controller Table 4 2 Bit interpretation of the bStatus VALUE STATUS Bus Status bus off bus on Error Status error ok Transmit Status transmit idle Receive Status receive idle Transmission Complete Status complete incomplete Transmit Buffer Status release locked Data Overrun Status overrun absent Receive Buffer Status PIO CAN400 200 User s Manual Ver 1 1 01 27 05 full not empty ors O O gt O O O gt O O gt empty 27 eo Return CAN_NoError OK CAN BoardNumberError BoardNo is not correct or exceeds the current total board number CAN PortNumberError Port number is not correct CAN ActiveBoardError This board is not activated PIO CAN400 200 User s Manual Ver 1 l 01 27 05 28 4 1 17 CAN SendMsg Description Send a CAN message immediately Syntax int CAN_SendMsg BYTE BoardNo BYTE Port PacketStruct CanPacket Parameter BoardNo input PIO CAN board number 0 7 P
28. turn value will always be 0 PIO CAN400 200 User s Manual Ver 1 l 01 27 05 30 4 1 19 CAN ReceiveMsg e Description Obtain receive message from CAN controller s RXFIFO or software buffer After calling CAN EnableRxlrg and CAN Installlrg the messages is within the software buffer otherwise it is within the CAN controller s RXFIFO e Syntax Int CAN ReceiveMsg BYTE BoardNo BYTE Port PacketStruct CanPacket e Parameter BoardNo input PIO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 CanPacket output The point of structure for CanPacket is defined as following typedef struct packet LONGLONG MsgTimeStamps BYTE mode DWORD id BYTE rtr BYTE len BYTE data 8 PacketStruct MsgTimeStamps This parameter will record the time with system clock counter when the CAN message is received from SJA1000 The system clock counter starts to count after the PC boots up If more than one CAN messages are received and stored in the 64 byte SJA1000 FIFO the time stamps of these CAN messages may be closed PIO CAN400 200 User s Manual Ver 1 1 01 27 05 31 mode 0 gt 11 bit identifier 1 gt 29 bit identifier id Identifier rtr Remote transmission request len Data length data 8 data byte e Return CAN_NoError OK CAN BoardNumberError BoardNo is not correct or exceeds the current total board number CAN PortNumberError Port number is not correct CAN_ActiveBoardError This b

Download Pdf Manuals

image

Related Search

Related Contents

USB Slim Microscope 0.3 MP 1-200x Magnification    INSTRUCTION MANUAL GUIDE D`UTILISA TION MANUAL DE    Kensington K33192  インカ ラッシングシステム取扱説明書(0.95MB)    Engine Scan Tool - Automobili Lamborghini Holding Spa  

Copyright © All rights reserved.
Failed to retrieve file