Home

Manual - ICP DAS USA`s I

image

Contents

1. 15 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 9 and the corresponding pin assignments are given in Table 2 7 CAN L Shield CAN H Figure2 9 9 pin D sub male connector Table 2 7 Pin assignment of the 9 pin D sub male connector D sub male connector pin assignment Reserved CAN_L Reserved Reserved CAN_SHLD Reserved CAN_H Reserved Reserved No Ga O CO CI PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 16 2 4 Installation 1 Configure the jumper settings on your PISO CAN PEX CAN PCM CAN in accordance with your particular requirements 2 Shutdown your system and take off the chassis of your machine 3 Plug in your PISO CAN PEX CAN or PCM CAN series CAN card into a suitable empty PCI slot 4 Replace your chassis 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 17 3 Software Installation The driver of PISO CAN or PCM CAN can be used in 2K XP Windows environments Users can find the driver in the path of ACAN PCI PISO CAN200 400 in the Fieldbus CD Execute the PISO CAN exe file to start install the driver Install the PISO CAN or PCM CAN card
2. DEMO2 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 65 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 w PIO CAN400 200 demo2 Port 1 IDthex RTR DLC 1 8 EXIT 2 4 4 5 6 id salon sii uf 28 ob af 5 f7 T Extened 29 bit ID Status C Send Port 2 01 Mode 0 ID 1h ATR O DLC 8 Datafhex 11 22 33 44 55 66 77 88 TimeStamp 3843 35030346036sec 02 Mode 0 ID 2h ATR O DLC 8 Datafhex 11 22 33 44 55 66 77 88 TimeStamp 3845 32033764068sec 03 Mode 0 ID 3h ATR O DLC 8 Datafhex 11 22 33 44 55 66 77 88 TimeStamp 3847 068891 71668sec 04 Mode 0 ID 4h ATR O DLC 8 Datafhex 11 22 33 44 55 66 77 88 TimeStamp 3848 84192571961sec 05 Mode 0 ID 5h ATR O DLC 8 Datafhex 11 22 33 44 55 66 77 88 TimeStamp 3850 62713166059sec Status GC
3. Figure 5 2 The form of demo2 program PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 66 6 CANUtility Program for Windows For PISO CAN PEX CAN or PCM CAN we provide a friendly CAN bus utility tool to allow users to send receive the CAN messages to from CAN network easily This utility tool can be thought as a useful tool for monitoring CAN messages or testing CAN devices on the CAN network It supplies several functions such as sending CAN messages receiving CAN messages storing CAN messages cyclic transmission and so forth The operation principle will be addressed in the following sub section 1 CAN Configure Dialog Please click the Board No combo box to select which CAN board plugged on the pc will be used Check the Port Enable check boxes to enable CAN ports Then select CAN port tag According to CAN communication requirement users need to set the proper baud rate acceptance code and acceptance mask The Baud Rate combo box has eight kinds of baud 10K 20K 50K 125K 250K 500K 800K and 1M Users can also define the special baud by using BTO and BT1 field If users select the user defined baud rate users must have the background of the CAN chip SJA1000 Afterwards click OK to save the configuration Configuration PISO CAN400U Board No Pert Enable M Port 1 M Port 2 Port3 Port 4 Port1 Port2 Port3 Port4 Acceptance Code Acceptance Mask Baud Rate ACC 0 00 ACM
4. input CAN port number 1 4 or 1 2 bStatus output 0 receive interrupt disable 1 5 receive interrupt enable Return CAN NoeError 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 40 4 1 15 CAN Installlrq Description Enable or start IRQ for PISO CAN board Before calling this function CAN EnableRyxylrq must to be called first Syntax int CAN Installlrq BYTE BoardNo Parameter BoardNo input PISO CAN board number 0 7 Return CAN NoeError 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 41 4 1 16 CAN Removelrq Description Disable or stop IRQ for PISO CAN board After calling this function the interrupts for all CAN controllers on board will be disabled Syntax int CAN Removelrq BYTE BoardNo Parameter BoardNo input PISO CAN board number 0 7 Return CAN NoeError OK CAN DriverError Kernel driver can t be opened CAN BoardNu
5. 03 Aug 2010 68 transmission list The transmission list can include maximum 20 CAN messages After adding the message into transmission list users can send this message to CAN network by using Send button Modify Button If users want to modify the content of some CAN message in the transmission list select this CAN messages in the transmission list firstly Then this CAN message information will be shown in the text boxes above the transmission list Users can modify the CAN message in these text boxes directly Finally click Modify button to save the modification in the transmission list Delete Button If some CAN message in the transmission list is useless users can select it and click delete button to delete this CAN message from transmission list Send Button After users select one CAN message from transmission list click Send button to send this CAN message once from the selected CAN port If the timer parameter of this CAN message is not 0 the CAN message will be send depending on this timer parameter periodically In this case the status filed of this CAN message in transmission list will display Running and the text shown on the Send button will be changed to Pause If uses want to stop the message transmission click this button again There are only 5 CAN message can be sending cyclically from one CAN port at the same time CAN Utility PISO CAN4000 File Configuration About Port Port2 P
6. NO YES y CAN_ReceiveMsg y CAN DisableRxlrq y CAN_Removelrq v CAN CloseBoard v End of Application Figure 4 3 Flow Chart Receive CAN Massage with IRQ PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 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 3 Demo program BCB3 gt for Borland C Builder 3 CAN H gt Header file PISOCAN LIB 3 Linkage library for BCB BOT gt for Delphi 4 I ACAN PAS 2 Declaration file VC6 gt for Visual C 6 CAN H gt Header file PISOCANLIB gt Linkage library for VC6 Rode 3 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 64 A brief introd
7. driver Step 1 Insert the product CD into the CD ROM and find the path CAN PCI PISO CAN200 40012K XP ex the OS is Windows 2000 or XP Then execute the PISO CAN exe to install the PISO CAN card driver PISO CAN200_400 BERO HE BAD BEREA Tad OS O BG Om amp mx HED DACANPCIPISO CAN200_400 v Ej EE PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 18 Step 2 Click Next to start the PISO CAN installation PISO CAN200400 D T Setup Welcome to the PISO CAN200400 D T Ver 1 17 for Windows XP Steup This wizard will install the driver of PISO CAN200400 D T on your computer Click Next to continue or Cancel to exit Setup Wizard Step 3 Select the folder where the PISO CAN setup would be installed and click Next button to continue PISO CAN200400 D T Setup Choose Destination Location Select folder where setup will install files eal Install PISO CAN200400 D T to C AICPDASSPISO CAN InstallShield PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 19 Step 4 Click the button Install to continue PISO CAN200400 D T Setup Ready to Install the Program The wizard is ready to begin installation Click Install to begin the installation If you want to review or change any of your installation settings click Back Click Cancel to exit the wizard Step 5 Finally restart the computer to compl
8. e 56 4 1 27 CAN _InputByte um maam aasa 57 4 1 28 CAN GetSystemFreq ss 58 4 1 29 CAN InstallUserlsr only for Windows 2000 XP 59 4 1 30 CAN RemoveUserlsr only for Windows 2000 XP 60 4 2 Flow Diagram for Application 61 Demo Programs for Windows 64 CANUtility Program for Windows 67 APpendiX EE 73 7 1 Acceptance Filtering ses 73 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 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 stand alone CAN controller PISO CAN PEX CAN and PCM CAN represents an economic solution within which an active CAN board can have 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 a master slave interface and be applied in various CAN applications In addition these CAN cards use the new NXP SJA1000T and transceiver 82C250 251 which provide the bus arbitration and error detection The differences between these CAN cards are the interface o
9. for acceptance filtering Receive FI FO Filter OR Extended Frame RTR bit 11 bit Identifier H 18 bit Identifier Bits used for acceptance filtering Figure A 1 Acceptance Filter PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 73 Example 1 Assume that a message with a Standard Frame is considered The Acceptance Code Registers ACRn and Acceptance Mask Registers AMRn is set as follows n 0 1 upper 4 bits ACRn O1xx x010 xxxx XXXX XXXX XXXX xXXXX AMRn 0011 1000 1111 1111 1111 1111 1111 Accepted messages ID 28 1D 18 RTR x don t care only the upper 4 bits of ACHT and AMR1 are used O1xx x010 xxxx In this case the ACRO and the AMRO are used for the upper 8 bits of message ID The upper 4 bits of the ACR1 and AMR1 are used for the lower 3 bits of the message ID and RTR bit The lower 4 bits of the ACR1 and AMR1 are useless The ACR2 and AMR2 are used for the first data byte of the CAN message The ACR3 and AMR3 are used for the second data byte of the CAN message Therefore no matter the CAN message is remote transmit request message or not the message ID with the format 01xx x010 xxx will be accepted x means don t care PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 74 Example 2 Assume that a message with an Extended Frame is considered The Acceptance Code Registers ACRn and Acceptan
10. 0 FF 125K v ACC 1 00 ACM 1 FF BT 0 00 ACC 2 00 ACM 2 FF ACC 3 00 ACM 3 FF aa 2 Main Dialog The CAN Utility main dialog is as following figure There are 1 tag 2 tags and 4 tags for one port card PCM CAN100 two port card PISO CAN200 200U PEX CAN200i and PCM CAN200 and four port card PISO CAN400 400U respectively In the bottom of the main dialog the status bar shows five parameters board number port status baud rate acceptance code and acceptance mask for the selected port CAN Utility PISO CAN4000 File Configuration About Port Port2 Port3 Port4 Mode IDhex RIR Dien DO DIM DAM DIY DA D5 Den D7 h Timertms promo edea UCI No Mode ID RTR Len DO Di D2 D3 D4 D5 D6 D7 Timer Status Port Status Enable Baud Rate 125K ACC Code 00 00 00 00 ACC Mask FF FF FF FF 3 CAN Transmission Function In the CAN port transmits part page as follow figure there are four function buttons for transmission list to use CAN Utility PISO CAN4000 File Configuration About Port Port2 Port3 Port4 Mode Dhe BIR Dien DO Dich DAY DIM D4th Dei Dei DM Timertms bien Al fnofs TEST ET IST Mode D RTR Len DO DI D2 D3 D4 D5 06 b7 Timer Suns Add Button User can key in the CAN message into the text boxes above the transmission list Then click add button to insert this CAN message into PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3
11. 03 Aug 2010 1 3 Specifications CAN controller Phillips SJA1000T CAN transceiver Phillips 82C250 251 Signal support CAN H CAN L CAN controller frequency 16 MHz Connector 5 pin screw terminal connector or 9 pin D sub male connector Isolation voltage 2500Vrms Power requirements PISO CAN200 5V 380mA PISO CAN400 5V 640mA PISO CAN200U 5V 165mA PISO CAN400U 5V 300mA PEX CAN200i 3 3V 100mA and 12V 200mA PCM CAN100 5V 140mA PCM CAN200 5V 165mA Environmental Operating temp 0 60 C Storage temp 20 80 C Humidity 0 90 non condensing Dimensions PISO CAN200 400 126mm X 85mm PISO CAN200U 400U 126mm X 85mm PEX CAN200i 120mm X 85mm PCM CAN100 200 96mm X 90mm PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 1 4 Product Check List Besides this manual the package includes the following items PISO CAN200 PISO CAN400 PISO CAN200U PISO CAN 400U PEX CAN200i PCM CAN200 PCM CAN 100 card ADP 9 Board for PISO CAN400 PISO CAN400U only Software CD ROM lt 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 m m Where you can find the software driver utility and demo 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 c
12. E BaudRate BYTE BTO BYTE BT 1 Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 AccCode Acceptance code for CAN controller AccMask Acceptance mask for CAN controller BaudRate 0 user defined must to set BTO BT1 1 510Kbps 2 20Kbps 3 50Kbps 4 5125Kbps 5 250Kbps 6 5500Kbps 7 800Kbps 8 1Mbps BTO BT1 user defined baud rate used only if BaudRate 0 For 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 36 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 37 4 1 12 CAN EnableRxirq Description Enable receive interrupt for CAN controller Syntax in
13. IFO is empty CAN SoftBufferlsEmpty Software RX Buffer is empty CAN SoftBufferIsFull Software RX Buffer is full PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 53 4 1 24 CAN ClearSoftBuffer e Description Clear the software buffer of the PISOCAN DLL driver Syntax int CAN ClearSoftBuffer BYTE BoardNo BYTE Port Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 Return CAN_NoError OK CAN_BoardNumber Error BoardNo is not correct or exceeds the current total board number CAN_PortNumberError Port number is not correct PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 54 4 1 25 CAN ClearDataOverrun e Description Clear the data overrun status bit for the CAN controller Syntax int CAN ClearDataOverrun BYTE BoardNo BYTE Port Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 55 4 1 26 CAN OutputByte e Description Write data to CAN chip SJA1000 Syntax v
14. N 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 PISO CAN board number 0 7 Return CAN_NoError OK CAN_ActiveBoardError The board is not activated CAN_BoardNumber Error BoardNo exceeds the current total board number PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 30 4 1 7 CAN BoardisActive e Description Obtain the information about the specific board is active or not Syntax int CAN BoardisActive BYTE BoardNo Parameter BoardNo input PISO CAN board number 0 7 Return 0 means the board is inactive 1 means the board is active PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 4 1 8 CAN Reset e Description Hardware reset CAN controller Syntax int CAN_Reset BYTE BoardNo BYTE Port Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 Return CAN_NoError OK CAN_DriverError Kernel driver can t be opened CAN_BoardNumber Error 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 PISO CAN PEX CAN PCM CAN Series Use
15. N400 D T Table 2 1 Jumper Selections Description Status CAN Port 3 Connector connecting PISO CAN400 board and ADP 9 board CAN Port 4 Connector connecting PISO CAN400 board and ADP 9 board Port 1 terminator resister 120Q selection JP1 JP1 4 en hp 123 3 Pint CAN L Pin2 CAN H Pin3 Shield JP2 JP2 en Pin1 CAN L Pin2 CAN H Pin3 Shield Port 2 terminator resister 120Q selection Port 3 terminator resister 120Q selection Port 4 terminator resister 1200 selection PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 PISO CAN200U D T and PISO CAN400U D T Table 2 2 Jumper Selections Description Status CAN Port 3 Connector connecting PISO CAN400U board and ADP 9 board JP5 0 0 0 123 Pint CAN L Pin2 CAN H Pin3 Shield CAN Port 4 Connector connecting PISO CAN400U board and ADP 9 board Port 1 terminator resister 1200 selection a JP7 123 BE Pin1 CAN L Pin2 CAN H Pin3 Shield Port 2 terminator resister 120Q selection Port 3 terminator resister 120Q selection Port 4 terminator resister 1200 selection PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 PEX CAN200i D T Table 2 3 Jumper Selections Jumper Description Status Enable Disable JP2 Port 1 terminator resister 120Q selection 321 321 JP3 Port 2 terminator resister 1200 selecti
16. ONG CAN_GetSystemFreq void Int CAN_InstallUserlsr BYTE BoardNo void UserlSR BYTE BoardNo Int CAN RemoveUserlsr BYTE BoardNo PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 Return Code Table 4 2 Interpretation of the return code Error ID Comment CAN NoeError OK CAN DriverError CAN ActiveBoardError Driver error This board can t be activated CAN BoardNumberError The board number exceeds the maximum board number 7 CAN PortNumberError The port number exceeds the maximum port number CAN ResetError CAN chip hardware reset error CAN SorftResetError CAN chip software reset error CAN InitError CAN chip initiation error CAN ConfigError CAN chip configure error CAN SetACRError Set to Acceptance Code Register error CAN SetAMRError Set to Acceptance Mask Register error CAN SetBaudRateError Set Baud Rate error CAN EnableRxlrgFailure Enable CAN chip receive interrupt failure CAN DisableRxlrqFailure Disable CAN chip receive interrupt failure CAN InstalllrqFailure CAN RemovelrqFailure Installing PCI board IRQ failure Removing PCI board IRQ failure CAN TransmitBufferLocked Transmit buffer in CAN chip is locked CAN Transmitlncomplete CAN ReceiveBufferEmpty Previously transmission is not yet completed CAN chip RXFIFO is empty CAN DataOverrun Data was lo
17. PISO CAN400 CAN200 D T PISO CAN400U CAN200U D T PEX CAN200i D T PCM CAN100 PCM CAN200 D 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 assume 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 nor for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 2003 by ICP DAS All rights are reserved Trademark The names used for identification only maybe registered trademarks of their respective companies PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 1 Tables of Content 1 General INfOrMALION ti caicsducccscaccsccccaduscswesdvensseaducceveadusacverdviacveadwasaveacvacevate 4 1 1 a AA AA 4 TT E 5 1 3 ER 6 LA PTOQUCT CHECK LISA ANAN ANAKAN ans nesasenusee 7 Hardware Configuration ummm rennes ane ane een edenracn ANNA 8 2 1 Board Layoub mamamana ma ERE AANI 8 E GE 12 2 3 Connector Pin Assignment ne 15 2 3 1 5 pin screw terminal connector 00eceeeeeeeeeeeeeeeeees 15 2 3 2 9 pin D sub male Connectors eee 16 2 4 INStAN ATION EE 17 Sof
18. SOCAN DLL driver in user mode And then the DLL driver will bypass the function call into the KP CAN sys and windrvr6 sys the windrvr6 sys is for windows 98 Me NT4 to access the hardware system as shown in the following Figure Application pisocan dll User Mode KP CAN sys windrvr6 sys PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 22 4 1 DLL Function Definition and Description All the functions provided in the PISO CAN PEX CAN or PCM CAN hereinafter referred to as PISO CAN 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 Keyword Gei parameter by user before calling this function Get the data from this parameter after calling this function input Yes No output No Table 4 1 DLL function definition PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 23 Function definition WORD CAN_GetDllVersion int CAN TotalBoard int CAN GetBoardInf BYTE BoardNo DWORD dwVID DWORD dwDID DWORD dwSVID DWORD dwSDID DWORD dwirqNo int CAN_GetCardPortNum BYTE BoardNo BYTE bGetPortNum int CAN_Act
19. ce Mask Registers AMRn is set as follows 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 1D 0 RTR x don t care only the upper 6 bits of ACR3 and AMR3 are used 1011 0100 1011 000x 1100 xxxx 0011 Ox In this case the lower 2 bits of AMR3 and AMR3 are useless All the other bits of Acceptance Code and Acceptance Mask will be used for the 29 bit message ID and the RTR bit Therefore no matter the CAN message is RTR remote transmit request message or not the message ID follows the format 1011 0100 1011 000x 1100 xxxx 0011 Ox x means don t care will be accepted PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 75
20. ete the installation Restarting Windows Setup has finished copying files to your computer Before you can use the program you must restart your computer Select one of the following options and click OK to finish setup aan restart my computer now PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 When finishing the installation The PISO CAN folder would be found at the Start menu shown as below MiniOS Utility Ver311 F9 MiniOS7 Studio Ver100 mi CAN Gateway ap PISO CAN b D Demo 3 Modbus Utility Driver 7 PISO CM100 Manual En CAN Slave A EZ Data Logger MN CA NU tity Remove the PISO CAN driver If the PISO CAN driver is not used any more users can click the Uninstall to remove the PISO CAN driver below Demo O Drive Hamal ReadMe NN EM PISOCANY gt EA MiniOs7 Utlity Ver311 gt G CANTtility E MiniOs7 Studio er 100 ONE ei CAN Gateway PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 21 4 Installation DLL Driver The DLL driver is the collection of function calls on the PISO CAN PEX CAN and PCM CAN series cards used for Windows 98 Me NT4 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 VC Delphi and Borland C Builder etc can call the PI
21. f PC Some are for PCI interface some are for PCI Express interface and some are for PCI 104 interface To get the detail information for the features and the specification of these CAN cards please refer to the section 1 2 and 1 3 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 4 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 PISO CAN200 D T and PISO CAN400 D T m 33MHz 32bit 5V PCI bus V2 1 plug and play technology H PCI card supports 5V PCI bus m 3KV galvanic isolation m 2 4 independent CAN channels for PISO CAN 200 400 PISO CAN200U D T and PISO CAN400U D T m PCI v2 2 compliant 32 bit 33MHz m Universal PCI card supports both 5V and 3 3V PCI bus m 3KV galvanic isolation m 2 4 independent CAN channels for PISO CAN 200U 400U PEX CAN200i D T Mm 32 bit 33MHz X1 PCI Express Bus m According to PCI Express specification R1 0 m 3KV galvanic isolation m 2 independent CAN channels PCM CAN100 D and PCM CAN200 D m PCI104 compliant WR 9 pin D sub connector m 1KV galvanic isolation m 1 2 independent CAN channels Driver supported for Windows 2000 XP PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3
22. fferent ID message in the ID mask list Afterwards if the CAN port receives the message with the ID set in ID mask list the CAN message will not shown in the reception list ID Masker Port NO Port 1 bd Port 1 Data Format ID 2bb Hex 2BB About Show the information about the CAN Utility version and the ICP DAS home page About CANU tility CANUtility Version 3 04 Beta Copyright C 2007 by ICP DAS CO LTD All rights are reserved Website http www icpdas com PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 72 7 Appendix 7 1 Acceptance Filtering Four 8 bits Acceptance Code registers ACO AC1 AC2 and AC3 and Acceptance Mask registers AMO AM1 AM2 and AM3 are available for a various filtering of messages These registers can be used for controlling a 4 byte filter which can check the specific bits of a CAN message and decide if this message will be passed to the CAN card or not The message filter general concept is shown in Figure A 1 The Acceptance Code Register is mainly used for deciding what kind of message ID the CAN card will accept The Acceptance Mask Register is mainly used for deciding which bit of message ID will need to check by using the Acceptance Code Register If the bit of the Acceptance Mask is set to O it means that the bit in the same position of message ID needs to be checked Acceptance Filtering CAN Message AMR1 AMR2 LINA CAB Bits used
23. figuration Menu File Configuration About Board Configuration Data Format f Software ID Mask lan PT III TT r m Board Configuration Users can click Board Configuration to re configure the CAN board Please refer to 1 CAN Configure Dialog of this section for more detail information m Data Format In this function user can set what kind of format such as hexadecimal decimal or ASCII the CAN message with specific ID will be displayed on the reception list The setting dialog is as follows For example set the data format of the byte2 byte6 of the CAN message with ID 0x1AA to the decimal format Then the reception list will display the byte2 byte 6 data of the message with ID 0x1AA by using decimal format and display the other bytes of this message by using hexadecimal format Any message without configuring data format will be shown by using hexadecimal format Users can configure maximum 20 different ID messages in this dialog PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 71 Data Converter Port NO Port 1 D Port 1 Data Format ID Byte 0 Bytel Byte2 Byte3 Byte4 Bytes Byte6 Byte Hex gt Hex v Dec r Dec Dec v Dec Hex D Delete NO DJ Bwen by te te m Software ID Mask If users don t want to show some message with specific ID on the reception list the ID mask function is useful for that As following figure users can set maximum 20 di
24. iveBoard BYTE wBoardNo int CAN_CloseBoard BYTE wBoardNo 30 int CAN BoardisActive BYTE BoardNo 31 int CAN Reset BYTE BoardNo BYTE Port 32 int CAN Init BYTE wBoardNo BYTE Port 33 int CAN Config BYTE BoardNo BYTE Port ConfigStruct CanConfig 34 int CAN ConfigWithoutStructure BYTE BoardNo BYTE Port DWORD 36 AccCode DWORD AccMask BYTE BaudRate BYTE BTO BYTE BT 1 int CAN EnableRxlrq BYTE BoardNo BYTE Port 38 int CAN DisableRxIrq BYTE BoardNo BYTE Port 39 int CAN RxlrqStatus BYTE BoardNo BYTE Port BYTE bStatus 40 int CAN Installlrq BYTE BoardNo 41 int CAN Removelrq BYTE BoardNo int CAN IrgStatus BYTE BoardNo BYTE bStatus int CAN Status BYTE BoardNo BYTE Port BYTE bStatus int CAN SendMsg BYTE BoardNo BYTE Port PacketStruct CanPacket int CAN SendWithoutStruct BYTE BoardNo BYTE Port BYTE Mode DWORD ld BYTE Rtr BYTE Dien BYTE Data int CAN_RxMsgCount BYTE BoardNo BYTE Port int CAN_ReceiveMsg BYTE BoardNo BYTE Port PacketStruct CanPacket int CAN_ReceiveWithoutStruct BYTE BoardNo BYTE Port BYTE Mode DWORD ld BYTE Rtr BYTE Dlen BYTE Data LONGLONG MsgTimeStamps int CAN ClearSoftBuffer BYTE BoardNo BYTE Port int CAN_ClearDataOverrun BYTE BoardNo BYTE Port void CAN OutputByte BYTE BoardNo BYTE Port WORD wOffset BYTE bValue BYTE CAN InputByte BYTE BoardNo BYTE Port WORD wOffset LONGL
25. ll not empty empty Receive Buffer Status D O Of O O O O S Om OJ gt Return CAN_NoError OK PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 44 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 45 4 1 19 CAN SendMsg Description Send a CAN message immediately Syntax int CAN SendMsg BYTE BoardNo BYTE Port PacketStruct CanPacket Parameter BoardNo input PISO CAN board number 0 7 Port 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 11 bit identifier 1 29 bit identifier id Identifier rtr Remote transmission request len Data length PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 46 data 8 data byte Return CAN_NoError OK CAN_BoardNumber Error 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_Tra
26. lt status of this button is pushed down 5 Menu Function There are three functions on the CAN Utility menu HA Configuration About Load Configuration S 3 Por Save Configuration Save Reception List x Update Firmware File Menu m Load Configuration If users had have saved the configuration by using CANUtility before users can click Load Configuration function to load the older records into these lists of CAN Utility m Save Configuration The function is used for saving the transmission list data format list and ID mask list of each CAN port to a txt file m Save Reception List Save Receive List is used for saving the CAN messages that is received on the reception list The data in PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 70 the reception list of each different CAN port will be saved into different txt file except that the reception list has no message For example if users want to save the data in the reception list to test txt file generally these data will be saved to four txt files text port01 txt text port02 txt text port03 txt and text port04 txt when users using PISO CAN400 If the reception list of the port 2 has no data the text port02 txt file will not be produced m Update Firmare Update firmware of the CAN board This function can not be used to the PISO CAN PEX CAN and PCM CAN it only for PISO CM100 U PISO CPM100 U and PISO DNM100 U Con
27. mberError BoardNo is not correct or exceeds the current total board number CAN ActiveBoardError This board is not activated CAN RemovelrgFailure Disable or stop IRQ failure PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 42 4 1 17 CAN IrqStatus Description Obtain IRQ status of the PISO CAN board Syntax int CAN IrgStatus BYTE BoardNo BYTE bStatus Parameter BoardNo input PISO CAN board number 0 7 bStatus output 0 IRQ disable 1 IRQ enable Return CAN_NoError OK CAN_DriverError Kernel driver can t be opened CAN_BoardNumber Error BoardNo is not correct or exceeds the current total board number CAN ActiveBoardError This board is not activated PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 43 4 1 18 CAN Status Description Obtain the status of CAN controller for PISO CAN board Syntax int CAN_Status BYTE BoardNo BYTE Port BYTE bStatus Parameter BoardNo input PISO CAN board number 0 7 bStatus output Status value of CAN controller Table 4 3 Bit interpretation of the bStatus STATUS bus off bus on Bus Status Error Status error ok transmit idle receive idle complete Transmit Status Receive Status Transmission Complete Status incomplete release locked Transmit Buffer Status Data Overrun Status overrun absent fu
28. n t receive CAN message correctly the CAN ReceiveWithoutStruct function can instead Syntax int CAN ReceiveWithoutStruct BYTE BoardNo BYTE Port BYTE Mode DWORD Id BYTE Rtr BYTE Dlen BYTE Data DWORD H_MsgTimeStamps DWORD L_MsgTimeStamps Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 Mode 0 11 bit identifier 1 29 bit identifier Id Identifier Rtr Remote transmission request Dien Data length Data data byte H MsgTimeStamps L MsgTimeStamps These parameters in Windows 98 Me NT4 will record the time with system clock counter and in Windows 2000 XP will record the system interrupt time count of 100 ns unit when the CAN message is received from SJA1000 The H MsgTimeStamps is the high PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 52 DWORD and the L MsgTimeStamps is the low DWORD The system clock counter starts to count after the PC boots up H 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 Return CAN_NoError OK CAN_BoardNumber Error 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 Port has not been configured successfully CAN ReceiveBufferEmpty CAN controller s RXF
29. ned baud rate used only if BaudRate 0 For PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 34 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 NoeError 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 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 35 4 1 11 CAN ConfigWithoutStructure e Description This function is the same as CAN Config But this function doesn t use ConfigStruct structure type To provide this function is for that the structure address of some application development is allocated different from the PISOCAN lib So if users use CAN Config and can t configure CAN card correctly the CAN ConfigWithoutStruct function can instead Syntax int CAN ConfigWithoutStructure BYTE BoardNo BYTE Port DWORD AccCode DWORD AccMask BYT
30. nsmitBufferLocked Transmit buffer in CAN chip is locked CAN Transmitlncomplete Transmission is not yet completed CAN_ConfigError Port has not been configured successfully PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 47 4 1 20 CAN SendWithoutStruct e Description This function is the same as CAN SendMsg But this function doesn t use PacketStruct structure type If users use CAN SendMsg and can t send CAN message correctly with some application development like dot Net 2003 the CAN SendWithoutStruct function can instead Syntax int CAN SendWithoutStruct BYTE BoardNo BYTE Port BYTE Mode DWORD Id BYTE Rtr BYTE Dien BYTE Data Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 Mode 0 11 bit identifier 1 29 bit identifier Id Identifier Rtr Remote transmission request Dlen Data length Data data byte e Return CAN_NoError OK CAN BoardNumberError BoardNo is not correct CAN_PortNumberError Port number is not correct CAN_ActiveBoardError This board is not activated CAN_TransmitBufferLocked Transmit buffer in CAN chip is locked CAN Transmitlncomplete Transmission is not yet completed CAN ConfigError Port has not been configured successfully PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 48 4 1 21 CAN RxMsgCount Description Obtain the amount of CAN messages a
31. oid CAN OutputByte BYTE BoardNo BYTE Port WORD wOffset BYTE bValue Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 wOffset input Address offset from base address bValue input Data byte Return None PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 4 1 27 CAN InputByte Description Read data from CAN chip SJA1000 Syntax BYTE CAN InputByte BYTE BoardNo BYTE Port WORD wOffset Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 wOffset input Address offset from base address Return Data Byte of CAN chip PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 57 4 1 28 CAN GetSystemFreq e Description Get the clock frequency It is useful for calculate the time of the time stamp for reception message Syntax LONGLONG CAN GetSystemFreq void Parameter None Return In Windows 98 Me NT4 is clock frequency in Windows 2000 XP is always 10000000 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 58 4 1 29 CAN InstallUserlsr only for Windows 2000 XP Description Using this function can allow users to apply ISR interrupt service routine When users put their ISR into this function the interrupt of receiving CAN message will trigger the users ISR Syntax in
32. on we will show the operation procedure of PISO CAN PEX CAN PCM 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 PISO CAN PEX CAN PCM 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 Start of Application CAN_ActiveBoard CAN_Reset CAN Init CAN Config CAN SendMsg CAN CloseBoard End of Application Figure 4 1 Flow Chart Send CAN Massage PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 61 start of Ouh A P CAN_ActiveBoard y CAN_Reset Vv CAN Init vy CAN_Config r CAN _RxMsgCount gt 0 NO YES y CAN_ReceiveMsg v CAN_CloseBoard y End of Application Figure 4 2 Flow Chart Receive CAN Massage PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 start of Application x CAN_ActiveBoard y CAN_Reset AA CAN Init L CAN Config y CAN EnableRxlrq v CAN Installlrq d CAN RxMsgCount50
33. on 321 321 PCM CAN100 and PCM CAN200 Table 2 3 shows the appropriate switch setting and signals used for each module in the stack Table 2 4 Rotary Switch Settings Switch Position Module Slot ID Select Oor4or8 IDSELO 1or5or9 IDSEL1 2 or 6 IDSEL2 3 or 7 IDSEL3 Table 2 5 Jumper Selections Description Status Port 1 terminator resister 1200 selection JP4 Port 2 terminator only for PCM CAN200 resister 120Q selection PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 14 2 3 Connector Pin Assignment The PISO CAN200 T 400 T 200U T 400U T and PEX CAN200i T are equipped with two four sets of 5 pin screw terminal connectors the PISO CAN200 D 400 D 200U D 400U D PEX CAN200i D and PCM CAN100 200 are equipped with two four sets of 9 pin D sub male connectors for wire connection of the CAN bus The connector s pin assignment is specified as follows 2 3 1 5 pin screw terminal connector The 5 pin screw terminal connector of the CAN bus interface is shown in Figure 2 8 The details for the pin assignment are presented in Table 2 6 CAN L Shield CAN H Figure2 8 5 pin screw terminal connector Table 2 6 Pin assignment of 5 pin screw terminal connector 5 pin screw terminal connectors pin assignment Reserved CAN L CAN SHLD CAN H Reserved PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010
34. ontact your local field agent Keep aside the shipping materials and carton in case you want to ship or store the product in the future PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 7 2 Hardware Configuration This section will describe the hardware settings of the PISO CAN PEX CAN and PCM CAN series CAN card This information includes the wire connection and terminal resistance configuration for the CAN network 2 1 Board Layout O g PISO CAN200 Figure2 1 PISO CAN200 Board LAYOUT PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 8 JP6 see See j P7 000 O SJA1000T O spa e e e HO oO SJA1000T e2 O ees 820250 pes eo SJA1000T Ce O PISO CAN400 Figure2 2 PISO CAN400 Board LAYOUT 1000LYPS 1000L9PS PISO CAN200U Figure2 3 PISO CAN200U Board LAYOUT PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 9 un y XU L gt gt ES O o E Figure2 4 PISO CAN400U Board LAYOUT Figure2 5 ADP 9 Board LAYOUT For PISO CAN400 PISO CAN400U Only PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 10 PEX CAN200i Figure2 6 PEX CAN200i Board LAYOUT Figure2 7 PCM CAN200 Board LAYOUT PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 11 2 2 Jumper Selection PISO CAN200 D T and PISO CA
35. or 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_BoardNumber Error BoardNo exceeds the current total board number PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 27 4 1 4 CAN GetCardPortNum Description Call this function to Get CAN port number of the PISO CAN card Syntax int CAN GetCardPortNum BYTE BoardNo BYTE bGetPortNum Parameter BoardNo input PISO CAN board number 0 7 bGetPortNum output Port number of the CAN card Return CAN NoeError OK CAN DriverError Kernel driver can not be opened CAN BoardNumberError BoardNo exceeds the current total board number PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 4 1 5 CAN ActiveBoard Description Activate the device It must be called once before using other functions of PISO CAN board Syntax int CAN_ActiveBoard BYTE BoardNo Parameter BoardNo input PISO CAN board number 0 7 Return CAN_NoError OK CAN_BoardNumber Error BoardNo exceeds the current total board number CAN_ActiveBoardError This board can not be activated or kernel driver can not be found PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 29 4 1 6 CA
36. ord the PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 50 time with system clock counter and in Windows 2000 XP will record the system interrupt time count of 100 ns unit 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 mode 0 11 bit identifier 1 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 CAN_ActiveBoardError This board 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 51 4 1 23 CAN ReceiveWithoutStruct e Description This function is the same as CAN ReceiveMsg But this function doesn t use PacketStruct structure type To provide this function is for that the structure address of some application development is allocated different from the PISOCAN lib like dot Net 2003 So if users use CAN ReceiveMsg and ca
37. ort3 Port4 Mode IDihex KI Dien DOM Di DAM DIM DA Dit De DAR Timer ms 11 bit ID 2cD No 8 88 77 66 55 44 E 22 11 500 No Moe RIL ten DOL DIT D DE pa psj DEL Dr Timer f Sets Add O1 11 bitID 1 B IA 2B 3C 4D SE 6F 77 77 0 O2 11 bitID ere LA LE LE D Le Lo LA OLA CI 500 Running E Mo ity Delete D 4 CAN Reception Function The following figure shows the receive part of a selected CAN port There are four functions for reception list PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 69 Mode ID RTR Len DO Di D2 D3 D4 D5 D6 D7 Time Stampsi a 11 bitID 81 N 8 00 00 00 00 00 OO OO OO 26895 56434 11 bitID 701 N 1 00 26895 90665 Clear No 1 2 4 Board No 0 Port Status Enable Baud Rate 125K ACC Code 00 00 00 00 ACC Mask FF FF FF FF Rx Pause Click this button to stop the CAN message reception from specific CAN port Click it again to continue the message reception Clear Button Click this button to delete all CAN messages shown in the reception list Goto Last Click this button to show the last received CAN message Scrolling Button When the button is pushed down the reception list is always scrolled automatically to the last received CAN message If this button is pushed up the reception list will stop to scroll automatically but reception list still get the CAN messages from CAN port The defau
38. r s Manual Ver 2 3 03 Aug 2010 32 4 1 9 CAN Init e Description Initiate CAN controller Syntax int CAN Init BYTE BoardNo BYTE Port Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 Return CAN_NoError OK CAN_DriverError Kernel driver can t be opened CAN_BoardNumber Error 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 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 33 4 1 10 CAN Config e 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 PISO 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 BTO BT1 ConfigStruct AccCode 4 Acceptance code for CAN controller AccMask 4 Acceptance mask for CAN controller BaudRate 0 user defined must to set BTO BT1 1 510Kbps 2 20Kbps 3 50Kbps 4 5125Kbps 5 5250Kbps 6 5500Kbps 7 800Kbps 8 1Mbps BTO BT1 user defi
39. st because there was not enough space in CAN chip RXFIFO CAN _ReceiveError Receive data is not completed CAN SoftBufferlsEmpty Software buffer in driver is empty CAN SorftBufferlsFull Software buffer in driver is full CAN TimeOut CAN InstalllsrError Function no response and timeout Installing user ISR failure PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 25 4 1 1 CAN GetDIIVersion Description Obtain the version information of PISOCAN dIl driver Syntax WORD CAN GetDIIVersion viod Parameter None Return DLL version information For example If 101 hex is return it means driver version is 1 01 4 1 2 CAN_TotalBoard Description Obtain the amount of all CAN boards installed in the PCI bus Syntax int CAN_TotalBoard void Parameter None Return Return the amount of all board PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 26 4 1 3 CAN _GetBoardinf Description Obtain the information of PISO CAN boards which include vender ID device ID and interrupt number Syntax int CAN GetBoardinf BYTE BoardNo DWORD dwVID DWORD dwDID DWORD dwSVID DWORD dwSDID DWORD dwSAuxID DWORD dwirqNo Parameter BoardNo input PISO CAN board number dwVID output vendor ID of this board dwDID output device ID of this board dwSVID output sub vend
40. t CAN EnableRxlrq BYTE BoardNo BYTE Port Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 Return CAN NoeError 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 EnableRxlrqFailure Enable receives interrupt failure PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 38 4 1 13 CAN DisableRxirq Description Disable receive interrupt of the CAN controller Syntax Int CAN DisableRxlrq BYTE BoardNo BYTE Port Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 Return CAN NoeError 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 DisableRxlrqFailure Disable receives interrupt failure PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 39 4 1 14 CAN RxirqStatus Description Obtain receive interrupt status of the CAN controller Syntax int CAN RxlrgStatus BYTE BoardNo BYTE Port BYTE bStatus Parameter BoardNo input PISO CAN board number 0 7 Port
41. t CAN InstallUserlsr BYTE BoardNo void UserlSR BYTE BoardNo Parameter BoardNo input PISO CAN board number 0 7 UserlSR BYTE BoardNo input The pointer which points a function with format void XXX BYTE BoardNo The XXX is the function name of users ISR The parameter BoardNo indicates the number of the board which produces an interrupt signal Return CAN_NoError OK CAN_DriverError Kernel driver can t be opened CAN_BoardNumber Error 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 CAN_InstalllsrError Enable or start ISR failure PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 59 4 1 30 CAN RemoveUserlsr only for Windows 2000 XP Description When users don t need the ISR function call this function to remove users ISR Syntax Int CAN RemoveUserlsr BYTE BoadNo Parameter BoardNo input PISO CAN board number 0 7 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 RemovelrgFailure Disable or stop IRQ failure PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 60 4 2 Flow Diagram for Application In this secti
42. tware Installation EE 18 Installation DEL DEIER 22 4 1 DLL Function Definition and Description 23 4 1 1 CAN GetDIIVersion aaa nanana nanaaaaanananaaaaanaaanasaaaa 26 4 1 2 ei Idee TT BE 26 4 1 3 CAN G IBOardIn mana needs 27 4 1 4 CAN_GetCardPortNum c1 cccccsccccesseecnssenensenenssenenseenenes 28 4 1 5 CAN ActiveBoard ccssscceesecccnseeeenssenenseeeeesseensnenenenenenes 29 4 1 6 CAN CloseBoard 11 cceessccensecuenseeeenseenenseeeenseeensseeenseesenes 30 4 1 7 CAN BoaardIsAGII Ven aNG 31 4 1 8 CAN ROSB iaasa 32 4 1 9 CAN TIVE EE 33 1 10 CAN CONIG NANANG 34 4 1 11 CAN ConfigWithoutStructure seen 36 41 12 CAN Enabiebtwireg oegoeugo eggegoeegeo goe ge EENS 38 4 1 13 CAN DisableRxIrq rrrrsssss 39 41 14 ei NR EE 40 4 1 15 e RE EE Ssang 41 4 1 16 CAN _ReMOvelir 0 ssssssssssssssssssssssssssssssssesssseseees 42 GC SS ER e Re ET 43 21 16 ei TEE 44 41 19 CAN SEHOMSG E 46 4 1 20 CAN SendWithoutStruct 1 ccccscceeeeeseeeeeneeeseeeeeeeneeeees 48 4 1 21 CAN_RxMsgCount seen 49 4 1 22 CAN Receiveleg ee EEN 50 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 2 xm 4 1 23 CAN ReceiveWithoutStruct aaa anna maanaamaaaaamaaaa 52 4 1 24 CAN ClearSoftBuffer 0 02000 nanana waaa anaaaaaaaa nanaman 54 4 1 25 CAN ClearDataOverrun 2 2 naawa waaa nnaman aanaaanwaaaaaaa 55 4 1 26 CAN
43. uction of the demo programs DEMO Demo1 is the example used for starting the PISO CAN PEX CAN PCM 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 PISO CAN PEX CAN PCM CAN board Before exercising this demo the user needs to finish the CAN median wiring connection between port 1 and port2 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 IDihexl RTR DLC 1 EXIT M Extened 29 bit ID Status E Send Port 2 01 Mode O 1D 123h ATR O DLC 8 Data hex 11 22 33 44 55 66 77 88 TimeStamp 3734 3343581377 sec Status C Clear Overrun T Figure 5 1 The form of demo1 program
44. vailable within the CAN controller s RXFIFO or the software buffer 4KBytes After calling the functions CAN EnableRxlrq and CAN Installlrq the amount of CAN messages is within the software buffer otherwise it is within the CAN controller s RXFIFO Syntax int CAN RxMsgCount BYTE BoardNo BYTE Port Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 Return The amount of CAN messages Note If the parameter for BoardNo or Port isn t correct the return value will always be 0 PISO CAN PEX CAN PCM CAN Series User s Manual Ver 2 3 03 Aug 2010 49 4 1 22 CAN ReceiveMsg Description Obtain receive message from CAN controller s RXFIFO or software buffer After calling the functions CAN EnableRxirq and CAN Installlrq the messages is within the software buffer otherwise it is within the CAN controller s RXFIFO Note If users PC go into Standby mode or Sleep mode this function will can t receive any message Syntax int CAN ReceiveMsg BYTE BoardNo BYTE Port PacketStruct CanPacket Parameter BoardNo input PISO CAN board number 0 7 Port input CAN port number 1 4 or 1 2 CanPacket output The structure for CanPacket is defined below typedef struct packet LONGLONG MsgTimeStamps BYTE mode DWORD id BYTE rtr BYTE len BYTE data 9 PacketStruct MsgTimeStamps This parameter in Windows 98 Me NT4 will rec

Download Pdf Manuals

image

Related Search

Related Contents

NRG 16-11 NRG 17-11 NRG 19-11  Instalar Fizz Traveller 2  Service Service Service  iMark マイクロプレートリーダー取扱説明書 - Bio-Rad  Bioruptor® Pico  SERVICE MANUAL  取扱説明書 HPー4372  Termostato touch screen GSM  Trampolin mit sicherheitsnetz  

Copyright © All rights reserved.
Failed to retrieve file