Home

Description - ICP DAS USA`s I

image

Contents

1. 59 4 5 29 CPM100_ GetMultiPDOData Description This can get the last data of the RxPDO and TxPDO from the PDO data buffer such as the function CPM100_GetPDOLastData But the difference between these two functions is that user can use the function CPM100_GetMultiPDOData to get maximum 50 PDO data at the same time Syntax WORD CPM100_GetMuliPDOData BYTE BoardNo BYTE PDOCnt WORD Cobid BYTE IsNew BYTE DLen BYTE RData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 PDOCnt input Total PDO number that want to get Cobid input Maximum 50 COB ID used by the PDO objects IsNew output Check these PDO data if they have been read before 0 is to be read before and 1 is new one DLen output The total data length obtained from the PDO buffer RData output The PDO messages get from the PDO buffer BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 60 4 5 30 CPM
2. 103 5 1 1 Listen _Mode Initialize the PISO CPM100 U with the listen mode and add slave nodes with the manual mode or EDS file then the PISO CPM100 U listens CANopen messages only and does not send any message to the CANopen network In this demo the PISO CPM100 U will listen NMT state 4 TxPDO messages with the COB ID 0x180 Node ID 0x280 Node ID 0x380 Node ID and 0x480 Node ID 4 RxPDO messages with the COB ID 0x200 Node ID 0x300 Node ID 0x400 Node ID and 0x500 Node ID and the EMCY messages Listen _Mode vso TTS T State Pre operation mode MCY 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Applied function list CPM100 _ InitMaster CPM100 Shutdown CPM100 AddNode CPM100 RemoveNode CPM100 EDS Load CPM100 SetMasterMode CPM100 NMTGetState CPM100 InstallPDO List CPM100 GetPDOLastData CPM100 GetRxPDOID CPM100 GetTxPDOID CPM100 SetEMCY List CPM100 GetEMCYID CPM100 ReadLastEMCY PISO CPM100 U user manual ver 2 01 Jan 12 2011 104 5 1 2 NMT_Protocol This is a NMT network control demo The demo not only tells users how to control the NMT status of a specific slave node but also how to protect the slave through the Guarding and Heartbeat functions NMT Pr
3. 26 CPM_PDOLenErr PDO output data error 27 CPM_COBIDErr The COB ID isn t exist or isn t correct one 28 CPM_PDOlInstErr Install the PDO object error 29 CPM_PDODynaErr The PDO mapping data is setting error 30 CPM_PDONumErr The PDO number and COB ID is not match 31 CPM_PDOSetErr PDO parameter is setting error 32 CPM_PDOEntryErr The PDO entry parameter is more then useful entry PISO CPM100 U user manual ver 2 01 Jan 12 2011 24 33 CPM_SetCobldErr The EMCY or SYNC COB ID is setting error 34 CPM_CycFullErr There are already 5 cyclic message running 35 CPM_Timeout Message response timeout 36 CPM_DataLenErr Data length setting error 40 CPM_Wait Command is uncompleted only for non block mode 41 CPM_Processing Command is running only for non block mode 50 CPM_LoadEDSErr Loading the EDS file fails 51 CPM_EDSFormatErr The format of the EDS file is incorrect Table 4 2 Description of return code PISO CPM100 U user manual ver 2 01 Jan 12 2011 25 4 3 CANopen Master Library Application Flowchart In this section it describes that the operation procedure about how to use the CANopen Master Library to build users applications This information is helpful for users to apply the CANopen Master Library easily Besides the CANopen operation principles must be obeyed when build a CANopen master application For example if the CANopen node is i
4. 65535 ms ConsumetTime input Consume Time of master 1 65535 ms BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 51 4 5 21 CPM100_ SDOReadData Description The function CPM100_SDOReadData is useful to the SDO upload from a specified slave When users use this function pass the slave device node ID object index and object subindex into this function This function supports both expedition mode less then 4 byte data length and segment mode more then 4 byte data length Syntax WORD CPM100_SDOReadData BYTE BoardNo BYTE Node WORD Index BYTE Subindex DWORD RDLen BYTE RData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Index input Object index of object dictionary of slave devices SubIndex input Object subindex of object dictionary of slave devices RDLen output Total data length RData output SDO data respond
5. 4 5 68 CPM100 RemoveRxPDOISR Description When the user doesn t need the RxPDO IST function call this function to remove the user IST Syntax WORD CPM100_RemoveRxPDOISR BYTE BoardNo Parameter BoardNo input PISO CPM100 U board number 0 7 PISO CPM100 U user manual ver 2 01 Jan 12 2011 100 4 5 69 CPM100_InstallRemotePDOISR Description This function allows the user to apply the RemotePDO IST interrupt service routine of the PISO CPM100 U When the user puts his process into this function all the Remote PDO messages of the PISO CPM100 U s PDO objects will trigger the IST For example the PISO CPM100 U has used CPM100_InstalIPDO_List to install a TxPDO object with the COB ID 0x444 of the PISO CPM100 U If some one sends a Remote PDO message with the COB ID 0x444 to the PISO CPM100 U the I 8213W will go into the IST if the user had installed it Note The function will usefully when the Node parameter of the function CPM100_InitMaster is gt 0 Syntax WORD CPM100_InstallRemotePDOISR BYTE BoardNo void REMOTEPDOISR Parameter BoardNo input PISO CPM100 U board number 0 7 REMOTEPDOISR input The pointer which points a function with format void XXX y The XXX is the function name of user s process This process is usually used with the function CPM100_GetMasterRemotePDOE vent PISO CPM100 U user manual ver 2 01 Jan 12 201
6. figure 2 3 and the corresponding pin assignments are given in following table Figure 2 3 9 pin D sub male connector Pin No Signal Description 1 N A No use 2 CAN_L CAN_L bus line dominant low 3 N A No use 4 N A No use 5 CAN_SHLD Optional CAN Shield 6 N A No use 7 CAN_H CAN_H bus line dominant high 8 N A No use 9 N A No use Table 2 3 Pin assignment of the 9 pin D sub male connector PISO CPM100 U user manual ver 2 01 Jan 12 2011 13 2 1 3 Wire Connection In order to minimize the reflection effects on the CAN bus line the CAN bus line has to be terminated at both ends by two terminal resistances as in the following figure According to the ISO 11898 2 spec each terminal resistance is 120Q or between 108 Q 132 The length related resistance should have 70m Q2 m Users should check the resistances of the CAN bus before they install a new CAN network Moreover to minimize the voltage drop over long distances the terminal resistance should be higher than the value defined in the ISO 11898 2 The Device N CAN_L Figure 2 4 CANopen network topology following table can be used as a good reference GCI Bus Cable Parameters Terminal Bus Length Length Related l Cross Section Resistance meter Resistance Type Q m m yp 0 40 70 0 25 23AWG 0 34 124 0 1 mm 22AWG le 40 300 60 Denese DE ATA mm 2
7. parameters of this function If the master doesn t receive the confirmation of guarding message from the salve the PISO CPM100 U will produce a Node_Guarding_Event event to users Users may use the function CPM100_InstalINMTErrlSR to install a user defined process to get the guarding fail event and process the guarding fail procedure However if the slave doesn t receive the guarding message during the Node Life time period Node Life time GuardTime LifeTime it will be triggered to send the EMCY message It is recommended that LifeTime value is set to more than 1 Take a note that following the CANopen specification it is not allowed for one slave device to use both error control mechanisms Guarding Protocol and Heartbeat Protocol at the same time Syntax WORD CPM100_NMGuarding BYTE BoardNo BYTE Node WORD GuardTime BYTE LifeTime BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 GuardTime input Guard Time 1 65535 ms LifeTime input Life Time Factor 1 255 BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users ap
8. DynamicPDO CPM100 ChangePDOID CPM100 PDOTxType CPM100 PDOUseEntry CPM100 PDOEventTimer CPM100 GetIxPDOID CPM100 GetRxPDOID CPM100 GetPDOMapInfo PISO CPM100 U user manual ver 2 01 Jan 12 2011 106 5 1 4 PDO Protocol The PDO protocol is the main protocol to control the I O of the specific slave device in the CANopen network This demo shows how to read and write data to the slave device with the PDO functions Slot No fo au Rate ron lt Len ERP PREF 1552C 00 00 Remote OK Clear Applied function list CPM100 InitMaster CPM100 Shutdown CPM100 AddNode CPM100 RemoveNode CPM100 PDOWrite CPM100 PDORemote CPM100 GetPDOLastData PISO CPM100 U user manual ver 2 01 Jan 12 2011 107 5 1 5 Scan_Node When users want to know which slave nodes exist on the CANopen network or which slave nodes are under the control of the PISO CPM100 U this demo will is useful cs Master Node List Applied function list CPM100 InitMaster CPM100 Shutdown CPM100 AddNode CPM100 RemoveNode CPM100 SetFunctionTimeout CPM100 ScanNode CPM100 GetNodeList PISO CPM100 U user manual ver 2 01 Jan 12 2011 108 5 1 6 SDO_PDO_ISR In this demo it is allowed to configure the PISO CPM100 U as a CANopen slave Users can use another CANopen master to read write the users defined object dictionary of the PISO CPM100 U by SDO pr
9. 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 PISO CPM100 U user manual ver 2 01 Jan 12 2011 18 PISO CPM100 Setup Setup Status PISO CPM100 Setup is performing the requested operations Installing C ICPDAS PISO CPM100 Demo beb6 PD0 demo pdodemo tds 9 Step 7 Finally restart the computer to complete 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 Step 8 When finishing the installation The PISO CPM100 U folder would be found at the Start menu shown as below E gt m Microsoft Developer Network e 2020 gt gt Microsoft Visual Studio 6 0 gt fa ICPDAS gt PLX SDK v5 10 Lite gt PISO CM100 gt 2 Borland C Builder 6 gt NORE UI E Demo PISO DNM100 Driver Manual ReadMe O Test Program ET Uninstall E WhatNew of CPM_Utility PISO CPM100 U user manual ver 2 01 Jan 12 2011 19 Remove the PISO CPM100 U driver If the PISO CPM100 U driver is not used any more users can click the Uninstall to remove the PISO CPM100 U driver below B Microsoft Developer
10. cyclic transmission Support EDS file Support EMCY protocol Timestamp of CAN message with at least 1ms precision Jumper select 1200 terminator resistor for CANopen network Support firmware update Two indication LEDs Tx Rx and Err LEDs Provide Listen Mode to listen the slave status of the CANopen network Block function and non block function selected Demos and utility are provided Library provides VC C Net2005 and VB Net2005 developments PISO CPM100 U user manual ver 2 01 Jan 12 2011 9 2 Hardware Configuration This section would describe the hardware setting of the PISO CPM100 U This information includes the wire connection and terminal resistance configuration for the CAN network 2 1 Board Layout 120 mm On PCI bridge chip PISO CPM100 Figure 2 1 PISO CPM100 board layout LO o gt eee We p4 JP2 127 mm 105 mm PISO CPM100U Coo o l 38 mm o Figure 2 2 PISO CPM100U board layout PISO CPM100 U user manual ver 2 01 Jan 12 2011 10 Jumper Selection The following table shows the definition of jumpers and DIP switch Users need to refer to this table to configure the PISO CPM100 U hardware JP1 CAN Port 120 Qterminal Hi H PISO CPM100 resistance Enable Disable JP4 CAN Port 120 Q terminal ede foe PISO CPM100U resistance Enable Disable DIP switch is used to set the PISO CPM100 U board No Sw
11. for obtaining this SDO message and respond some information to the SDO sender The parameter BoardNo indicates the number of the PISO CPM100 U which receives the read SDO message The parameters Index and Sublndex are the object indicator The function CPM100_ GetMasterReadSDOEvent is usually applied with the function CPM100_InstallReadSDOISR About the demo please refer to the section 4 1 6 SDO_PDO_ISR Note The function is valid while the Node parameter of the function CPM100_InitMaster is gt 0 Syntax WORD CPM100_GetMasterReadSDOEvent BYTE BoardNo WORD Index BYTE SubIndex Parameter BoardNo output Get the board number of the PISO CPM100 U which receives the read SDO message Index output Get the object index of the SDO message Subindex output Get the object subindex of the SDO message PISO CPM100 U user manual ver 2 01 Jan 12 2011 89 G COR 4 5 58 CPM100_GetMasterWriteSDOEvent Description Using this function can get all the write SDO messages sent to the specific node ID of the PISO CPM100 U For example the PISO CPM100 U is initialized with node ID 2 If someone sends an SDO message with the COB ID 0x602 to the PISO CPM100 U for writing an object users can use the function CPM100_GetMasterWriteSDOEvent for obtaining this SDO message The parameter BoardNo indicates the number of the PISO CPM100 U which receives the write SDO message The parameter
12. from the specified slave device BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 52 4 5 22 CPM100_SDOReadFile Description The function CPM100_SDOReadFile is useful as uploading the SDO data more then 1024 bytes While users use the CPM100_ReadData to read the SDO data and the return data length is more then 1024 byte The SDO data are stored in a file Users can use the function CPM100_SDOReadFile for reading the SDO data from the file Syntax WORD CPM100_SDOReadFile BYTE BoardNo BYTE Node WORD Index BYTE Subindex DWORD Start DWORD Len DWORD RLen BYTE RData Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Index input Object index of object dictionary of slave devices SubIndex input Object subindex of object dictionary of slave devices Start input Start position for reading the SDO data from file The range is from 0 to maximum length Le
13. maximum timeout value of all functions for application Default timeout value is 1 second Syntax void CPM100_SetFunctionTimeout BYTE BoardNo WORD Timeout Parameter BoardNo input PISO CPM100 U board number 0 7 Timeout input Maximum timeout value of all functions ms PISO CPM100 U user manual ver 2 01 Jan 12 2011 36 4 5 7 CPM100_InitMaster Description The function must be applied when configuring the CAN controller and initialize the PISO CPM100 U It must be called once before using other functions of the 18123W lib Syntax WORD CPM100_InitMaster BYTE BoardNo BYTE Node BYTE BaudRate BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Master s node ID If the parameter is 0 the master will be a normal master and no other master can control it If the parameter is 1 127 different from other slave other master can do some control to it through some ISR function BaudRate input The baudrate of the PISO CPM100 U Value Baud rate 0 10Kbps 20Kbps 50Kbps 125Kbps 250Kbps 500Kbps 800Kbps 1Mbps NN OD o AION BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will
14. objects defined in the CANopen specification DS401 and they are mapped to the relative parameters of the DI DO AI AO channels After calling the function CPM100_InstallPDO and CPM100_DynamicPDO the PDO communication object will be mapped and activated If the PDO communication object is not needed no more use the function CPM100_RemovePDO to remove it When you want to output data via PDO the function CPM100_PDOWriteData is useful This function can write all PDO 8 byte data or write some parts of PDO 8 byte data Calling this function will send the specific data to the corresponding node via PDO protocol and put the output data into PDO buffer at the same time Therefore you can check the output history of the PDO But if the connection between the PISO CPM100 U and the slave is lost the history output information may be not the same with the real status on the slave In CANopen specification you can get the TxPDOs data by applying the remote transmit request CAN frame The function CPM100_PDORemote is needed in this case Or you can use CPM100_GetPDOLastData to get the last RxPDO and TxPDO data from the PDO buffer PISO CPM100 U user manual ver 2 01 Jan 12 2011 29 SYNC Services Calling the function CPM100_SendSYNCMsg starts the SYNC object transmission This function supports single SYNC message transmission and cyclic SYNC message transmission The parameter Timer of the function CPM100_SendSYNCMsg c
15. output SDO data responded from the specified slave device BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 54 4 5 24 CPM100 SDOAbortTransmit Description Call the function CPM100_SDOAbortTransmit to cancel the SDO transmission The parameter node of this function is used to specify which SDO communication will be terminated between the master and the specified salve device Syntax WORD CPM100_SDOAbortTransmit BYTE BoardNo BYTE Node WORD Index BYTE SubIndex DWORD AData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Index input The object index value of the object dictionary SubIndex input The object subindex value of the object dictionary AData input Abort data to be send to slave BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the run
16. parameter Entry is 0 it means that the PDO have no useful object mapping entry Syntax WORD CPM100_PDOUseEntry BYTE BoardNo WORD Cobid BYTE Entry BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Cobid input COB ID used by the PDO object Entry input Useful entry number of PDO mapping object BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 71 4 5 40 CPM100_ PDOTxType Description Use this function to change transmission type of TxPDO The default transmission type is 255 Syntax WORD CPM100_PDOTxType BYTE BoardNo WORD Cobid BYTE Tx_Type BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Cobid input COB ID used by the PDO object Tx_Type input Transmission type of TxPDO 0 255 Description of transmission type transmission type PDO transmission cyclic acyclic synchronous asynchr
17. procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 82 4 5 51 CPM100_GetEMCYData Description If users don t know that which slave node occurred the EMCY message and which PISO CPM100 U received it Users can use the function CPM100_GetEMCYData This function can get not only the EMCY message with the slave node ID but also the board number of the PISO CPM100 U The parameter BoardNo indicates the number of the PISO CPM100 U which receives the EMCY message The parameter Node is the ID of the slave node which produces the EMCY The parameters RData is the 8 bytes EMCY message data The function CPM100_GetEMCYData is usually applied with the function CPM100_InstallEMCYISR About the demo please refer to the section 4 1 2 NMT_Protocol Syntax WORD CPM100_GetEMCY Data BYTE BoardNo BYTE Node BYTE RData Parameter BoardNo output Get the board number of the PISO CPM100 U which receives the EMCY message Node output Get the slave node ID of the received EMCY message RData output 8 byte EMCY message obtained from the EMCY buffer PISO CPM100
18. same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 67 G COR 4 5 37 CPM100_InstallPDO_List Description This function is similar with the CPM100_InstallPDO function It can install the old or new PDO object in the PDO object list of the PISO CPM100 U It is the same as CPM100_InstalIPDO But the CPM100_InstallPDO_List doesn t send any message to check if the PDO object exists in the real slave It just changes the list in the memory of the PISO CPM100 U It means that user can use this function to install PDO and change PDO mapping data arbitrarily without disturbing the CANopen network After using this function the PISO CPM100 U will process the slave PDOs which have the same IDs configured by the function CPM100_InstalIPDO List It is very useful when the PISO CPM100 U is running in listen mode User can use the function CPM100_RemovePDO List to remove the PDO object which is installed by CPM100_InstallPDO_List Syntax WORD CPM100_InstallIPDO_List BYTE BoardNo BYTE Node WORD Cobid BYTE RxTx WORD PDO_No BYTE EntryUse DWORD EntryData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 If the Node parameter is the PISO CPM100 U Node ID the parameters EntryUse amp EntryData will be useless In
19. themselves the CPM_Utility can be used to be an easily CANopen master program The following description displays the step by step procedures about how to install the PISO CPM100 U driver Install the PISO CPM100 U CAN card driver Step 1 Insert the product CD into the CD ROM and find the path CANopen Master PISO CPM100 Install Then execute the PISO CPM100 exe to install the PISO CPM100 U CAN card driver File Edit View Favorites Tools Help w Q ax X P Search E Folders E Address GACANopen MasterPISO CPM100nstl EJ co PISO CPM100 exe PISO CPM100 Setup Preparing Setup Please wait while the InstallShield Wizard prepares the setup PISO CPM100 Setup is preparing the InstalShield Wizard which will guide you through the rest of the setup process Please wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 17 Step 3 Click Next to start the PISO CPM100 U installation PISO CPM100 Setup Welcome to the PISO CPM100 D T Ver 1 00 for Windows XP Steup This wizard will install the driver of PISO CPM100 D T on your computer Click Next to continue or Cancel to exit Setup Wizard Step 4 Select the folder where the PISO CPM100 U setup would be installed and click Next button to continue PISO CPM100 Setup Choose Destination Location Select folder where setup will install files Install PISO CPM100 to C ICPDAS PISO CPM100 PISO CPM100 Setup Ready to
20. this case users can use the function CPM100_InstallRxPDOISR or CPM100_InstallRemotePDOISR to install the users callback function to process the received PDOs of the PISO CPM100 U Cobid input COB ID used by the PDO object RxTx input PDO type 0 RxPDO 1 TxPDO PDO_No input PDO mapping object No 1 512 EntryUse input Total entry of mapping object that will be installed EntryData input Double Word array information of mapped application PISO CPM100 U user manual ver 2 01 Jan 12 2011 68 object For example If the configuration is Cobid 0x333 RxTx 0 PDO_No 10 Entry 2 EntryData 0 0x64110310 EntryData 1 0x62000108 it will map the RxPDO10 with COB ID 0x333 The 1 entry is 16 bit data of index 0x6411 and subindex 0x03 object and the 2 entry is 8 bit data of index 0x6200 and subindex 0x01 object BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 69 4 5 38
21. this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 78 4 5 47 CPM100_ChangeEMCYID Description Use the function CPM100_ChangeEMCYID to change the EMCY COB ID of a specific slave device Syntax WORD CPM100_ChangeEMCYID BYTE BoardNo BYTE Node WORD Cobid BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Cobid input COB ID used by the EMCY object BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 719 G COR 4 5 48 CPM100_SetEMCY
22. users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 58 4 5 28 CPM100_GetPDOLastData Description Using the function CPM100_GetPDOLastData can get the last data of the RxPDO and TxPDO from the PDO data buffer The last PDO data is saved in PDO buffer so it may not the same with the real situation Syntax WORD CPM100_GetPDOLastData BYTE BoardNo WORD Cobid BYTE IsNew BYTE DLen BYTE RData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Cobid input COB ID used by the PDO object IsNew output Check the data if had been read before 0 is been read before and 1 is new one DLen output The data length of the PDO message RData output The PDO message gets from the PDO buffer BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011
23. 0AWG a 300 600 40 ey 150 300 lt 20AWG 0 75 0 8mm 600 1K 20 150 300 lt 18AWG Table 2 4 Relationship between cable feature and terminal resistance PISO CPM100 U user manual ver 2 01 Jan 12 2011 2 2 Green LED After PISO CPM100 U has been activated the greed LED would be flashed once when PISO CPM100 receives or transmits one message to CAN bus successfully If the bus loading is heavy the green LED would turn on always 2 3 Red LED When some error occurs the red LED would turn on until the error has been solved Users can use CPM100_GetCANStatus function to get the situation except buffer status 2 4 Hardware Installation When users want to use PISO CPM100 U the hardware installation needs to be finished as following steps 1 Shutdown your personal computer 2 Configure the DIP switch and JP1 of PISO CPM100 U for the board No and the terminal resistance The more detail information could be found on the section 2 1 3 Find an empty PCI slot for the PISO CPM100 U on the mother board of the personal computer Plug the configured PISO CPM100 U into this empty PCI slot 4 Plug the CAN bus cable s into the 5 pin screw terminal connector or the 9 pin D sub connector When the procedure described above is completed turn on the PC PISO CPM100 U user manual ver 2 01 Jan 12 2011 15 3 Software Installation 3 1 Software Structure The CPM DLL driver is the CANopen
24. 1 101 G 4 5 70 CPM100_RemoveRemotePDOISR Description When the user doesn t need the RemotePDO IST function call this function to remove the user IST Syntax WORD CPM100_RemoveRemotePDOISR BYTE BoardNo Parameter BoardNo input PISO CPM100 U board number 0 7 PISO CPM100 U user manual ver 2 01 Jan 12 2011 102 5 Demo Programs The PISO CPM100 U provides 10 demos of the various applications for NMT protocol SDO protocol PDO protocol NMT Error IST etc All these demos support VC VB net 2005 and C 2005 There is also a tool CPMUtility to control monitor CANopen slaves with PISO CPM100 U easily and quickly Users can find these demos and utility tool in the fieldbus CD or on the web site The path of CAN CD fieldbus _cd canopen master piso cpm100 The address of the web site is http www icpdas com products Remote 1O can_bus piso cpm100 htm 5 1 Brief of the demo programs These demo programs are developed for demonstrating how to use the CANopen master library to apply the general CANopen communication protocol These demo programs provide the SDO PDO NMT SYNC communication applications Each demo program includes some functions of the CANopen master library The relationship between CANopen master library functions and demo programs are displayed in the following description PISO CPM100 U user manual ver 2 01 Jan 12 2011
25. 100 U s firmware Syntax WORD CPM100_GetFirmwareVersion BYTE BoardNo WORD Fir_ Ver BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Fir_Ver output PISO CPM100 U firmware version information BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 41 4 5 12 CPM100 EDS Load Description The function CPM100_ EDS Load can let users load EDS file for adding a CANopen slave with specified Node ID into the master node list Using this function will not send any message to check if the slave is existent or not Syntax WORD CPM100_EDS_Load BYTE BoardNo BYTE Node char FilePath WORD DelayTime WORD ResTimeout BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 FilePath input Absolute or relative file path of the EDS file DelayTime input The parameter defines the time interval between sending two messages from the
26. 100_GetRxPDOID Description Use the function CPM100_GetRxPDOID to get all the RxPDO COB IDs of the specified slave which have been installed to the master Syntax WORD CPM100_GetRxPDOID BYTE BoardNo BYTE Node BYTE PDO Cnt WORD ID List BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 PDO_Cnt output The number of installed RxPDO ID_List output The RxPDO COB ID list BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 61 4 5 31 CPM100_GetTxPDOID Description Use the function CPM100_GetIxPDOID to get all the TxPDO COB IDs of the specified slave which have been installed to the master Syntax WORD CPM100_GetTxPDOID BYTE BoardNo BYTE Node BYTE PDO Cnt WORD ID List BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 PDO_Cnt output Th
27. 4 2 Function Return Code The following table interprets all the return code returned by the CANopen Master Library functions hini Error ID Description 0 CPM_NoError OK 1 CPM_DriverError Kernel driver is not opened 3 CPM_BoardNumberErr There is no PISO CPM100 U on the specific board No 5 CPM_ConfigErr The PISO CPM100 U hasnt been configured successfully 6 CPM_MasterlnitErr The PISO CPM100 U initialization error 7 CPM_MasterNotlnit The PISO CPM100 U hasn t been initialized 8 CPM_ListenMode The PISO CPM100 U is in listen mode now 9 CPM_NodeErr Set node number error 10 CPM_NodeExist The node had been added to the Master 12 CPM_TxBusy Tx buffer is busy please wait a minute to send again 13 CPM_UnknowCmd This version of firmware doesn t support the function 14 CPM_CmdReceErr PISO CPM100 U receive command of wrong length 15 CPM_DataEmpty There is no data to receive 16 CPM_MemAllocErr PISO CPM100 U has not enough memory 17 CPM_SendCycMsgErr Cyclic message send error 18 CPM_StatusErr NMT state of CANopen slave is error 20 CPM_SetGuardErr Set Guarding and LifeTime parameter error 21 CPM_SetHbeatErr Set Heartbeat parameter error 22 CPM_SegLenErr SDO Segment receive error length 23 CPM_SegToggleErr SDO Segment receive error toggle 24 CPM_SegWriteErr SDO write segment error 25 CPM_Abort The return message is an Abort message
28. COB ID used by the PDO object Entry input PDO mapping object subindex value 0 8 If this value is set to 0 the specified PDO object will be removed If others 1 8 the specified subindex content of the PDO will be removed BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 65 G 4 5 35 CPM100_ChangePDOID e Description Use the function CPM100_ChangePDOID to change the PDO COB ID from old Old_Cobid to new New_Cobid of a slave device e Syntax WORD CPM100_ChangePDOID BYTE BoardNo WORD Old_Cobid WORD New_Cobid BYTE BlockMode e Parameter BoardNo input PISO CPM100 U board number 0 7 Old_Cobid input Old COB ID used by the PDO object New_Cobid input New COB ID used by the PDO object BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the fu
29. COB ID used by the PDO object Offset input The start byte position of PDO data 0 7 DLen input data size dlen offset lt 8 total length of the PDO TData output The data pointer point to the PDO data BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 56 4 5 26 CPM100_ PDORemote Description Use the function CPM100 PDORemote to send a RTR remote transmit request PDO message to the slave device Syntax WORD CPM100_PDORemote BYTE BoardNo WORD Cobid BYTE DLen BYTE TData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Cobid input COB ID used by the PDO object DLen output The data length of the RTR PDO message TData output The PDO message received from the slave device BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users applica
30. CPM100_ RemovePDO List Description The function CPM100_RemovePDO List can remove a TxPDO or RxPDO object had installed by the CPM100_ InstalIPDO List This function also can remove single object mapped in the TxPDO or RxPDO Syntax WORD CPM100_RemovePDO _List BYTE BoardNo BYTE Node WORD Cobid BYTE Entry BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Cobid input COB ID used by the PDO object Entry input PDO mapping object subindex value 0 8 If this parameter is set to 0 the specified PDO object will be removed If others 1 8 the specified subindex content of the PDO will be removed BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 70 4 5 39 CPM100_ PDOUseEntry Description Use this function to change the useful object mapping entry of PDO object The useful entry starts from 1 to the parameter Entry Therefore if the
31. E BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Cobid output Return the COB ID used by the EMCY object BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 81 4 5 50 CPM100_ ReadLastEMCY Description This function can check if one slave had produced EMCY If yes this function will return the last EMCY message of the specific slave Syntax WORD CPM100_ReadLastEMCY BYTE BoardNo BYTE Node BYTE IsNew BYTE RData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 IsNew output Check the data if had been read before 0 is been read before and 1 is new one RData output 8 byte EMCY message gets from the EMCY buffer BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running
32. Network 2020 gt gt Microsoft Visual Studio 6 0 gt EE o PLX SDK v5 10 Lite gt PISO CM100 gt Borland C Builder 6 Aa PISO CPM Demo PISO DNM100 Driver O Manual PISO CPM100 U user manual ver 2 01 Jan 12 2011 20 G dons 4 PISO CPM100 U Function Library 4 1 Function List In order to use the PISO CPM100 U more easily we provide some useful and easy to use functions in CPM100 library There are three function libraries for different compiler such as VC VB and BCB Users can use these functions to control the PISO CPM100 U by using the functions The following table shows all functions provided by the CPM100 library Listen eee Mode Function Name Description O CPM100_GetVersion Get the version of the PISO CPM100 U library O CPM100_TotalBoard Get the total number of PISO CPM100 U Get the board number from the dip switch number O CPM100_GetBoardSwitchNo of the PISO CPM100 U O CPM100_GetBoardInf Get board information of the PISO CPM100 U O CPM100_GetCANStatus Obtain the status of the CAN controller O CPM100_SetFunctionTimeout Set the max timeout value of all functions O CPM100_InitMaster Activate the PISO CPM100 U module O CPM100_ShutdownMaster Remove all nodes and stop the master O CPM100_SetMasterMode Set the master to normal mode or listen mode O CPM100_GetMasterMode Get
33. ORD Cobld BYTE Len BYTE Data Parameter BoardNo input PISO CPM100 U board number 0 7 Cobld input TxPDO COB ID for replying the PDO message Len input The data length of the response data Data input Return the COB ID of the TxPDO PDO message PISO CPM100 U user manual ver 2 01 Jan 12 2011 98 G 4 5 67 CPM100_InstallRxPDOISR Description This function allows the user to apply the RxPDO IST interrupt service routine of the PISO CPM100 U When the user puts his process into this function all the RxPDO messages with the PISO CPM100 U s PDO objects will trigger the IST For example the PISO CPM100 U has used CPM100_InstallPDO_List to install a PDO object with the COB ID 0x333 of the PISO CPM100 U If some one sends a PDO message with the COB ID 0x333 to the PISO CPM100 U the I 8213W will go into the IST if the user had installed it Note The function will usefully when the Node parameter of the function CPM100_InitMaster is gt 0 Syntax WORD CPM100_InstallRxPDOISR BYTE BoardNo void RXPDOISR Parameter BoardNo input PISO CPM100 U board number 0 7 RXPDOISR input The pointer which points a function with format void XXX The XXX is the function name of user s process This process is usualy used with the function CPM100_GetMasterRxPDOE vent PISO CPM100 U user manual ver 2 01 Jan 12 2011 99 G
34. PISO CPM100 DT PISO CPM100U DT CANopen Master PCI Card 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 2008 by ICP DAS All rights are reserved Trademark The names used for identification only maybe registered trademarks of their respective companies PISO CPM100 U user manual ver 2 01 Jan 12 2011 1 G COR Tables of Content 1 General Information waste scueistruieseoceucteadcsusievtceuedendcsucceunisacdeutcnassrutiantseuddeatl 5 1 1 CANopen Introduction ic cissicesdinnimneieesseestnidntnniinnneentnuaacralinamnaiuanns 5 1 2 CANopen Applications scccicccssccdicsascstecssccstsenscasincsccssesccacesaadnanasees 6 1 3 PISO CPM100 U Library Characteristics cccccceeee 7 Hardware Configuration cccccccssseessseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 10 2 1 Board LAYOUT soenen ea eeaeee aeaea eeoa e aeee 10 2 1 1 5 pin screw
35. PISO CPM100 U It can avoid the master frequently sending messages that may overrun the buffer of the slave Too large value of this parameter reduces the performance of the PISO CPM100 U The unit of the parameter is ms This parameter will be applied to the specified slave after finishing the ESD loading ResTimeout input The timeout value of the response of the CANopen slaves When the master sends a CANopen message to the slave it will wait the response until timeout if there is a response The unit of this parameter is millisecond This parameter will be applied to the specified slave after finishing the ESD loading BlockMode input 0 means this function is non block function and 1 is block function If set this parameter to 1 the running procedure of the users application is held until finishing this function If 0 this function returns CPM_ Processing directly While users apply it with the same BoardNo again it returns the process status If the procedure is still not complete it returns CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 42 G COR 4 5 13 CPM100_AddNode Description The function CPM100_AddNode can add a CANopen slave with specified Node ID into the master node list There are three mode of the function Mode 1 is adding node automatically mode 2 is adding node manually and mode 3 is allowing the automatic adding the node while it boots up In
36. R Description This function allows the user to apply the EMCY IST interrupt service thread When the user puts his EMCY process into this function all the EMCY triggered by the slaves will go to the EMCY IST If the EMCY of a slave is happen the PISO CPM100 U will go into the EMCY process to do some security mechanism which follows the user s EMCY process Syntax WORD CPM100_InstallEMCYISR BYTE BoardNo void EMCYISR Parameter BoardNo input PISO CPM100 U board number 0 7 EMCYISR input The pointer which points a function with format void XXX y The XXX is the function name of the user s EMCY process This process is usually applied with the function CPM100_GetEMCYData PISO CPM100 U user manual ver 2 01 Jan 12 2011 85 G 4 5 54 CPM100 RemoveEMCYISR Description When the user doesn t need the EMCY IST function call this function to remove the user s IST Syntax WORD CPM100_RemoveEMCYISR BYTE BoardNo Parameter BoardNo input PISO CPM100 U board number 0 7 PISO CPM100 U user manual ver 2 01 Jan 12 2011 86 4 5 55 CPM100_InstalINMTErriISR Description This function allows the user to apply NMTErr IST interrupt service thread When the user puts his NMTErr process into this function all the Heartbeat_Event and Node Guarding Event triggered by the slaves will go to the IST If the user
37. TxPDO PDO_No input PDO mapping object No 1 512 BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 63 4 5 33 CPM100_DynamicPDO Description This function can modify the mapping data of PDO object in the PDO object list of the CANopen Master Library stack Take a note that before calling this function user must check if the PDO had been installed in the PISO CPM100 U Syntax WORD CPM100_DynamicPDO BYTE BoardNo BYTE Node WORD Cobid BYTE RxTx BYTE Entry DWORD EnitryData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Cobid input COB ID used by the PDO object RxTx input PDO type 0 RxPDO 1 TxPDO Entry input PDO mapping object subindex value 1 8 EntryData input A Double Word 4 byte information of mapped application object Users need to look up the user manual of the CANopen slave device to find the informati
38. U user manual ver 2 01 Jan 12 2011 83 4 5 52 CPM100_GetNMTError Description User can use the function CPM100_GetNMTError to check if the PISO CPM100 U gets NMT Error Event for any slave node The parameters of the function indicate that which PISO CPM100 U gets the NMT Error Event which node produces this event and what kind of event it is The parameter BoardNo indicates the number of the PISO CPM100 U which indicates the Heartbeat_Event or Node_Guarding_ Event The parameter Node is the ID of the slave node which responds the heartbeat protocol or guarding protocol The parameter NMTErr is the NMTErr event mode If the NMTErr event is Node_Guarding_Event the NMTErr parameter is CPM_Node_Guarding_Event or else the CPM_ Heartbeat_Event is obtained The function CPM100_GetNMTError is usually applied with the function CPM100_InstalINMTErrlSR About the demo please refer to the section 4 1 2 NMT_Protocol Syntax WORD CPM100_GetNMTErr BYTE BoardNo BYTE Node BYTE NMTErr Parameter BoardNo output Get the board number of the PISO CPM100 U which receives the NMT Error Event Node output Get the slave node ID of the NMT Error Event NMTErr output The value CPM_Node_Guarding_Event indicates the Node Guarding Event and the CPM_Heartbeat_Event is the Heartbeat Event PISO CPM100 U user manual ver 2 01 Jan 12 2011 84 G 4 5 53 CPM100_InstallEMCYIS
39. _List Description If the user uses CPM100_AddNode function to add the slave with manual mode the function CPM100 SetEMCY_List must be called while the EMCY ID of the slave needs to be changed or be set CPM100_SetEMCY_List only can change the EMCY COB ID in the COB ID list of the PISO CPM100 U Afterwards the PISO CPM100 U process the EMCY messages with the specific EMCY COB ID which is configured by the function CPM100_SetEMCY_List Syntax WORD CPM100_SetEMCY_List BYTE BoardNo BYTE Node WORD Cobid BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Cobid input COB ID used by the EMCY object BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 80 4 5 49 CPM100_GetEMCYID Description This function can get the EMCY ID from the COB ID list of the PISO CPM100 U Syntax WORD CPM100_GetEMCYID BYTE BoardNo BYTE Node WORD Cobid BYT
40. a gt Update Finnware CPM10201 EXE Modified 2011 2 15 13 20 5t Size 160726 bytes Only exe file can be downloaded into PISO CPM100 U PISO CPM100 U user manual ver 2 01 Jan 12 2011 114 Look in Se Local Disk C vi amp ex EE QrxPoll _ System Yolume Information Tc test update O WinConMBConfigAgent 1_0_0 gt File name CM1S104 EXE Open D Files of type Execution Files exe x Cancel When finishing the download procedure the Download OK dialog is popped up Click OK button to continue Firmware CM1 104 EXE Modified 2007 11 10 11 50 1 Size 111894 bytes PISO CPM100 U user manual ver 2 01 Jan 12 2011 115
41. acteristics In order to use the PCI CAN board of PISO CPM100 U we provide CPM100 library for VC VB net and C development and users can use it to establish the CANopen communication network rapidly Most of the CANopen communication protocols such as PDO SDO and NMT would be handled by the library automatically Therefore it is helpful to reduce the complexity of developing a CANopen master interface and let users ignore the detail CANopen protocol technology This library mainly supports connection sets of master slave architecture which include some useful functions to control the CANopen slave device in the CANopen network The following figure describes the general application architecture of PISO CPM100 U CANopen Gateway CANopen Converter CANopen CANopen I O Slave Sensor Figure 1 2 Example of application architecture The PISO CPM100 U follows the CiA CANopen specification DS 301 V4 02 and supports the several CANopen features The CANopen communication general concept is shown as Figure 1 3 PISO CPM100 U user manual ver 2 01 Jan 12 2011 7 CANopen Master Device PDO Communication SDO Communication Figure 1 3 CANopen communication general concept m Node Manager NMT Master Functions for changing the slave device state Node Guarding and Heartbeat Protocol for error control Support Emergency EMCY messages E SDO Manager Expedited segmented and block metho
42. an adjust the cyclic period of the SYNC COB ID sent by master And the parameter Times can set the sending times of the SYNC message If the timer parameter is set to 0 the SYNC object transmission will be stopped When the times parameter is set to non zero value the function will send the SYNC message until the timer is set to 0 or the parameter Times is achieved EMCY Services The Emergency messages are triggered by the occurrence of a device internal error situation Users can call the function CPM100_ReadLastEMCY to receive the EMCY message or the function CPM100_InstalIEMCYISR to install user defined EMCY interrupt process In this case if there are CAN slaves sending the EMCY these EMCY messages will be processed by the user defined EMCY interrupt process PISO CPM100 U user manual ver 2 01 Jan 12 2011 30 G 4 5 Function Description 4 5 1 CPM100_GetVersion e Description This function is used to obtain the version information of the CPM100 lib library e Syntax WORD CPM100_ GetVersion void e Parameter None e Return LIB library version information PISO CPM100 U user manual ver 2 01 Jan 12 2011 31 G 4 5 2 CPM100_TotalBoard e Description Obtain the total board number of PISO CPM100 U plugged in the PCI bus e Syntax WORD CPM100_TotalBoard void e Parameter None e Return Return the scanned total PISO CPM100 U num
43. arameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 39 4 5 10 CPM100_GetMasterMode Description If user want to know what operation mode of the master is call the function to get it Syntax WORD CPM100_GetMasterMode BYTE BoardNo BYTE Mode BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Mode output 0 is normal mode default mode and 1 is listen mode BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 40 4 5 11 CPM100_ GetFirmwareVersion Description The function can let users know what is the version number of the PISO CPM
44. ber PISO CPM100 U user manual ver 2 01 Jan 12 2011 32 G 4 5 3 CPM100_GetBoardSwitchNo e Description Obtain the DIP switch No of PISO CPM100 U e Syntax WORD CPM100_GetBoardSwitchNo BYTE BoardCntNo BYTE BoardNo e Parameter BoardCntNo input The number of specified PISO CPM100 U For example if the first PISO CPM100 U is applied this value is 0 If the second board is applied this value is 1 BoardNo output The address of a variable used to get the DIP switch No of PISO CPM100 U PISO CPM100 U user manual ver 2 01 Jan 12 2011 33 G 4 5 4 CPM100_GetBoardinf e Description Obtain the information of PISO CPM100 U which includes vendor ID device ID and the interrupt number e Syntax WORD CPM100_GetBoardInf BYTE BoardNo DWORD dwVID DWORD dwDID DWORD dwSVID DWORD dwSDID DWORD dwSAuxID DWORD dwirqNo e Parameter BoardNo input Switch No of PISO CPM100 U DIP The value is from 0 to 15 dwVID output The address of a variable which is used to receive the vendor ID dwDID output The address of a variable used to receive device ID dwSVID output The address of variable applied to receive sub vendor ID dwSDID output The address of variable applied to receive sub device ID dwSAuxID output The address of a variable used to receive sub auxiliary ID dwirqNo output The address of a variab
45. casiessciencanactenansa inaa En 107 5 1 5 Scan Nodesersnoier a ae a pide Sead i eae 108 5 1 6 SDO PDO ISR nissin ieoa ENA 109 5 1 7 SDO Read es e ea e E a E 110 5 1 8 SDO Witenes ae RRR E EAS 111 5 1 9 SYNG Protocol ne E Emurene Fenereeae ere orm 112 5 110 PDO IMM AGA scsscastcesaconegs sneer seecnsarsvanseduesneecaunentenviaessmabancivege 113 6 Update FirmWate siina 114 PISO CPM100 U user manual ver 2 01 Jan 12 2011 4 1 General Information 1 1 CANopen Introduction The CAN Controller Area Network is a kind of serial communication protocols which efficiently supports distributed real time control with a very high level of security It is an 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 CANopen is one kind of the network protocols based on the CAN bus and it is applied in a low level network that provides the connections between simple industrial devices sensors actuators and higher level devices controllers as shown in the Figure 1 1 Figure 1 1 Example of the CANopen network CANopen was developed as a standardized embedded network with highly flexible configuration capabilities It provides standardized communication objects for real time data Process Data Objects PDO confi
46. cccesseececccccccessesseeceeccessessenens 34 4 5 5 CPM100_GetCANS1atus c cc ccccccssssscecececeesessssaeceseceeeesenens 35 4 5 6 CPM100_ SetFunction Timeout oo eececccccccesseeeseesseseeseenenees 36 4 5 7 CPM100_InitMaster ccccccccccccecesssssssececececeesesesseaeeeeeceeseneeas 37 4 5 8 CPM100_ShutdownMaster c cccccccceessececccccecessesseesecseeseenenens 38 4 5 9 CPM100_SetMasterMode cccccccssssssscececeesesssssaeceseceeeeeenens 39 4 5 10 CPM100 GetMasterMode c cccccccccsescccccccscesseseseeseccsseeenenens 40 4 5 11 CPM100_GetFirmwareVersion cccccccccccececsessssnseceeeceeeeeenens 41 4512 CPMI00 EDS Load noria TRA 42 4 5 13 ASP NLOO AGOIN GU ss deniaaassssticnsevadelesetataiecdsanidensssinceselalbecedadgusins 43 4 5 14 CPM100 RemoveNode c cece ccccccsseseseececceecessesseeesecveseeenenees 45 4 5 15 CPMI100_ ScanNode cccccccsccccccccecsesssscecececeesesessseeeseceesenenens 46 PISO CPM100 U user manual ver 2 01 Jan 12 2011 2 CG dO 4 5 16 4 5 17 4 5 18 4 5 19 4 5 20 4 5 21 4 5 22 45 23 4 5 24 4 5 25 4 5 26 4 5 21 4 5 28 4 5 29 4 5 30 4 5 31 4 5 32 4 5 33 4 5 34 4 5 35 4 5 36 4 5 37 4 5 38 4 5 39 4 5 40 4 5 41 4 5 42 4 5 43 4 5 44 4 5 45 4 5 46 4 5 47 4 5 48 4 5 49 4 5 50 4 5 51 4 5 52 4 5 53 COPIMT OG SGetINGdEL Sts s cnsscncdestesanenascapideensddiapaienit
47. ckMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 46 4 5 16 CPM100_GetNodeList Description User can use the function CPM100_GetNodeList to know how many slave nodes are added to the node list of the PISO CPM100 U Syntax WORD CPM100_GetNodeList BYTE BoardNo BYTE NodeList BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 NodeList output This is a 16 byte array parameter Each bit of the parameter means a node ID the bit is 0 means the node ID not exist and 1 means the node ID now on the CANopen bus For example if the NodeList 0 is 0x16 0001 0110 it means that the nodes with ID 1 2 and 4 have been added into node list and the nodes with ID 0 3 5 6 and 7 don t If the NodeList 1 is 0x41 0100 0001 it means that the nodes with ID 8 and 14 have been added into node list and the nodes with ID 9 10 11 12 13 and 15 don t BlockMode input 0 means this function is non block function an
48. csscceeeesseeeeeesseeees 89 4 5 58 CPM100_GetMasterWriteSDOEVent cceccceeeesteceeeeseeeees 90 4 5 59 CPM100_ResponseMasterSDO eecceeesceeesseeeenteeeenteeeenaeeees 91 4 5 60 CPM100_InstallReadSDOISR c cee eccceeeseceteceeeeeeeeeeseeenaeeees 92 4 5 61 CPM100_RemoveReadSDOISR ccccccccesssscecesesseeceesssneeees 93 4 5 62 CPMIOO Install WiteSDOISR ju sscisisissacvanessaniteoavvnnineniarnedevanctiies 94 4 5 63 CPM100_RemoveWriteSDOISR cccecccecessseceeeesteeeessseeeees 95 4 5 64 CPM100_GetMasterRemotePDOE vent ccccceeeesseeeeeeeeeeees 96 4 5 65 CPM100_GetMasterRxPDOE Vent ccccceceesseceeeesteceesssseeees 97 4 5 66 CPM100_ResponseMasterPDO cccceeeeceeeeeceesseeeeeteeeeneeees 98 4 5 67 CPM100_InstalIRXPDOISR 00 ee eeececeeeeeeeteeeeneeeeneeeenaeeees 99 4 5 68 CPM100_RemoveRXPDOISR ccc eccesseceeeesseceenssseeeeeeeeaes 100 4 5 69 CPM100_InstallRemotePDOISR cc ceccceessceeeeeseeeeeeeeaes 101 4 5 70 CPM100_RemoveRemotePDOISR 0 0 0 ceessececeeseeeeeeeeees 102 5 Demo Programs ssisisacnicissensadiianinnaisenerediueainndaeninandisnanesianuniadanoniwaduurnle 103 5 1 Brief of the demo programs csseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 103 5 1 1 Listen Mode sir dareuaaie silat dtsasaivaidsestantedunss e a 104 5 1 2 NM L Protocoles edee eiae 105 5 1 3 PDO P ramietet saison EE R EOR E 106 5 1 4 PDO PrOtOCOl sicercecsst
49. ction CPM100_InstallRxPDOISR About the demo please refer to the section 4 1 6 SDO_PDO_ISR Note The function is valid while the Node parameter of the function CPM100_InitMaster is gt 0 Syntax WORD CPM100_GetMasterRxPDOEvent BYTE BoardNo WORD Cobld BYTE WLen BYTE WData Parameter BoardNo output Get the board number of the PISO CPM100 U which receives the RxPDO message Cobld output Return the RxPDO COB ID WLen output The data length of the RxPDO data WData output Return 0 4 bytes of the RxPDO data PISO CPM100 U user manual ver 2 01 Jan 12 2011 97 4 5 66 CPM100_ResponseMasterPDO Description Using this function can reply the Remote PDO messages to the sender For example the PISO CPM100 U has used CPM100_InstallPDO_List to install a TxPDO object with the COB ID 0x444 If someone sends a Remote PDO message with the COB ID 0x444 to the PISO CPM100 U and the PISO CPM100 U needs to reply a TxPDO message users can use this function to do it When users implement the function CPM100_ResponseMasterPDO the PISO CPM100 U will send a TxPDO message to the CANopen network This function is usually used with the CPM100_InstallRemotePDOISR function About the demo please refer to the section 4 1 6 SDO_PDO_ISR Note The function is valid while the Node parameter of the function CPM100_InitMaster is gt 0 Syntax WORD CPM100_ResponseMasterPDO BYTE BoardNo W
50. d If the timer is 0 the SYNC message will be stopped Times input SYNC message transmission times If the time is 0 the SYNC message will be sending until Timer is set to 0 BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 77 4 5 46 CPM100_ GetCyclicSYNCInfo Description This function can get at most 5 SYNC messages information which have been configured by the function CPM100_SendSYNCMsg User can know what SYNC ID had been set Syntax WORD CPM100_GetCyclicSYNCInfo BYTE BoardNo WORD Cobid WORD Timer DWORD Times BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Cobid input COB ID array Return most 5 SYNC ID Timer input 5 WORD array Each value is the cyclic period of the SYNC message Times input 5 Double WORD array Each one is the SYNC message sending times that set before BlockMode input 0 means this function is non block function and 1 means
51. d 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 47 4 5 17 CPM100_NMTChangeState Description The function CPM100_NMTChangeState is used to change the NMT state of a slave If the node parameter of this function is set to 0 the state of all nodes on the same CANopen network will be changed Syntax WORD CPM100_NMTChangeState BYTE BoardNo BYTE Node BYTE State BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Set this parameter to 0 to indicate all slave devices State input NMT command specifier 1 start 2 stop 128 enter PRE OPERATIONAL 129 Reset_Node 130 Reset_Communication BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while
52. ds for SDO download and upload m PDO Manager Support all transmission types and event timer SYNC Manager SYNC message production SYNC cycles of 0 1ms resolution m EMCY Manager EMCY message consumer For more information about the CANopen functions described above please refer to the function descriptions and demo programs shown in the chapter 3 and chapter 4 PISO CPM100 U user manual ver 2 01 Jan 12 2011 8 Specifications PISO CPM100 D T gt 33 MHz 32bit 5 V PCI bus V2 1 plug and play technology PISO CPM100U D T gt Universal PCI card supports both 5 V and 3 3 V PCI bus CPU 80186 compactable CPU 80 MHz CAN controller NXP SJA1000T with 16 MHz CAN transceiver NXP 82C250 CAN bus interface Follow ISO 11898 2 specification Connector 5 pin screw terminal or 9 pin D sub male connector isolation voltage 2500 Vrms photo isolation protection on CAN side Power requirements 5 V 400 mA Operating Temperature 0 60 C Storage Temperature 20 80 C Humidity 0 90 non condensing Dimensions please refer to section 2 1 Features One CAN communication port Follow CiA DS 301 V4 02 Support 8 kinds baud 10 kbps 20 kbps 50 kbps 125 kbps 250 kbps 500 kbps 800 kbps and 1 Mbps Support the node id range from 1 127 Support upload and download SDO Segment Support Node Guarding protocol and Heartbeat protocol Provide 5 sets of SYNC
53. e number of installed TxPDO ID_List output The TxPDO COB ID list BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 62 G COR 4 5 32 CPM100_InstallPDO Description After calling the CPM100_InstallPDO function a PDO COB ID will be installed in the PDO object list of the CANopen Master Library stack If the slave device has defined the default PDO object in RxPDO1 RxPDO10 and TxPDO1 TxPDO10 in this case these default PDO will be installed automatically while using the function CPM100_AddNode with automatic mode Otherwise the TxPDOs or RxPDOs need to be installed manually by calling the function CPM100_InstallPDO Syntax WORD CPM100_InstallPDO BYTE BoardNo BYTE Node WORD Cobid BYTE RxTx WORD PDO_No BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Cobid input COB ID used by the PDO object RxTx input PDO type 0 RxPDO 1
54. en use the CPM100_GetMultiPDOData function to obtain these PDO data from the buffer at the same time PDO_MultiData Board fo Baud Rate Shutdown Set Event Timer For Or Set Remote Polling All TxPDO For All TxPDO TXPDO 181 TXPDO 281 00 00 00 00 00 00 00 00 TxXPDO 381 00 00 00 00 00 00 00 00 TxPDO 481 Applied function list CPM100 InitMaster CPM100 Shutdown CPM100 AddNode CPM100 RemoveNode CPM100 GetTxPDOID CPM100 SetPDORemotePolling CPM100 PDOEventTimer CPM100 GetMultiPDOData PISO CPM100 U user manual ver 2 01 Jan 12 2011 113 6 Update Firmware If users want to update the firmware of the PISO CPM100 U use the CANUtility tool to do it Where to find the CANUtility tool The path of field bus CD fieldbus _cd can pci piso cm100u tools 2000 xp The address of the web site http ftp 1cpdas com pub cd fieldbus_cd can pci piso cm100u tools 2000_xp The following steps describe the method about how to update the PISO CPM100 U firmware by CANUtility tool After executes the CANUtility click the File gt Update Firmware on the toolbar below CAN Utility No board is used IE Configuration About Load Configuration Save Configuration Update Firmware When users apply the Update Firmware function select the specified board firstly Then click Update button to select the proper firmware for the specified board Update Firmware Board No AAA W
55. et the NMT Error event from the NMT event O CPM100_GetNMTError buffer O CPM100_InstallIEMCYISR Install user defined EMCY process O CPM100_RemoveEMCYISR Remove the EMCY process Install user defined Guarding Heartbeat event O CPM100_InstalINMTErriSR process O CPM100_RemoveNMTErrlSR Remove the Guarding Heartbeat event process PISO CPM100 U user manual ver 2 01 Jan 12 2011 22 G dons Get the read SDO message sent to the O CPM100_GetMasterReadSDOEvent PISO CPM100 U Get the write SDO message sent to the O CPM100_GetMasterWriteSDOEvent PISO CPM100 U X CPM100_ResponseMasterSDO Response the SDO message to the SDO sender Get the remote PDO message send to the O CPM100_GetMasterRemotePDOEvent PISO CPM100 U O CPM100_GetMasterRxPDOEvent Get the RxPDO RTR sent to the PISO CPM100 U X CPM100_ResponseMasterPDO Response the RxPDO RTR to the RTR sender O CPM100_InstallRxSDOISR Install the user defined Master SDO process O CPM100_RemoveRxSDOISR Remove the master SDO process O CPM100_InstallRxPDOISR Install the user defined Write Master PDO process O CPM100_RemoveRxPDOISR Remove the Write Master PDO process Install the user defined Remote Master PDO O CPM100_InstallTxPDOISR process O CPM100_RemoveTxPDOISR Remove the Remote Master PDO process Table 4 1 PISO CPM100 U user manual ver 2 01 Jan 12 2011 Description of functions G CO
56. evice Node ID 1 127 Cobid output Return the COB ID used by the SYNC object BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 76 G COR 4 5 45 CPM100 SendSYNCMsg Description Use the function CPM100_SendSYNCMsg to send a SYNC message with specified COB ID cyclically If the parameter Timer is 0 the SYNC message will be stopped If the parameter Timer is more than 0 the function will send SYNC message per Timer millisecond until finish the parameter Times When the Times is set to 0 the function will send SYNC message continuously until set Timer to 0 Users can set at most 5 SYNC messages with different ID to be sent cyclically Syntax WORD CPM100_SendSYNCMsg BYTE BoardNo WORD Cobid WORD Timer DWORD Times BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Cobid input COB ID used by the SYNC object Timer input SYNC message transmission perio
57. f someone sends an SDO message with the COB ID 0x602 for reading the object of the PISO CPM100 U the I 8213W will go into the IST if the user has installed it Note The function is valid while the Node parameter of the function CPM100_InitMaster is gt 0 Syntax WORD CPM100_InstallReadSDOISR BYTE BoardNo void RSDOISR Parameter BoardNo input PISO CPM100 U board number 0 7 RSDOISR input The pointer which points a function with format void XXX y The XXX is the function name of the user s process This process is usually used with the function CPM100_GetMasterReadSDOE vent PISO CPM100 U user manual ver 2 01 Jan 12 2011 92 G 4 5 61 CPM100_RemoveReadSDOISR Description When the user doesn t need the ReadSDO IST function call this function to remove the user IST Syntax WORD CPM100_RemoveReadSDOISR BYTE BoardNo Parameter BoardNo input PISO CPM100 U board number 0 7 PISO CPM100 U user manual ver 2 01 Jan 12 2011 93 G 4 5 62 CPM100_ InstallWriteSDOISR Description This function allows the user to apply the WriteSDO IST interrupt service routine of the PISO CPM100 U When the user puts the process into this function all the written SDO messages sent to the specified PISO CPM100 U will trigger the IST For example the PISO CPM100 U is initialized with node ID 2 If someone sends an SDO message
58. get this PDO message The parameter BoardNo indicates the number of the PISO CPM100 U which receives the Remote PDO message The parameter Cobid is the PDO COB ID sent to the PISO CPM100 U This function is usually used with the function CPM100_InstallRemotePDOISR About the demo please refer to the section 4 1 6 SDO_PDO_ISR Note The function is valid while the Node parameter of the function CPM100_InitMaster is gt 0 Syntax WORD CPM100_GetMasterRemotePDOE vent BYTE BoardNo WORD Cobld Parameter BoardNo output Get the board number of the PISO CPM100 U which receives the Remote PDO message Cobld output Return the COB ID of the Remote PDO message PISO CPM100 U user manual ver 2 01 Jan 12 2011 96 4 5 65 CPM100 GetMasterRxPDOEvent Description Using this function can get all the RxPDO messages sent to the PISO CPM100 U For example the PISO CPM100 U has used the function CPM100_InstalIPDO List to install an PISO CPM100 U s RxPDO object with the COB ID 0x333 If someone sends an RxPDO message with the COB ID 0x333 to the PISO CPM100 U users can use this function to get this RxPDO message The parameter BoardNo indicates the number of the PISO CPM100 U which receives the RxPDO message The parameter Cobid is the RxPDO COB ID ID The two parameters WLen and WData are the data length and contents of the RxPDO message This function is usually applied with the fun
59. guration data Service Data Objects SDO network management data NMT message and Error Control and special functions Time Stamp Sync message and Emergency message Nowadays CANopen is used for many various application fields such as medical equipment off road vehicles maritime electronics public transportation building automation and so on PISO CPM100 U user manual ver 2 01 Jan 12 2011 5 G eS 1 2 CANopen Applications CANopen is the standardized network application layer optimized for embedded networks Its specifications cover the standardized application layer frameworks for the various applications e g general I O motion control system maritime electronics and so forth as well as device interface and application profiles The main CANopen protocol and products are generally applied in the low volume and mid volume embedded systems The following examples show some parts of the CANopen application fields For more information please refer to the web site http www can cia org Truck based superstructure control systems Off highway and off road vehicles Passenger and cargo trains Maritime electronics Factory automation Industrial machine control Lifts and escalators Building automation Medical equipment and devices Non industrial control Non industrial equipment PISO CPM100 U user manual ver 2 01 Jan 12 2011 6 1 3 PISO CPM100 U Library Char
60. had used the CPM100_NMTGuarding to enable the guarding protocol or had used the CPM100 Heartbeat to enable the heartbeat protocol the PISO CPM100 U will go into the NMTErr IST to do the user s NMTErr process while the guarding confirms or heartbeat indicator doesn t be received Syntax WORD CPM100_InstalINMTErrlSR BYTE BoardNo void NMTERRISR Parameter BoardNo input PISO CPM100 U board number 0 7 NMTERRISR input The pointer which points a function with format void XXX y The XXX is the function name of the user s process This process is usually applied with the function CPM100_GetNMTError PISO CPM100 U user manual ver 2 01 Jan 12 2011 87 G 4 5 56 CPM100 RemoveNMTErrlISR Description When the user doesn t need the NMTErr IST function call this function to remove the user s IST Syntax WORD CPM100_RemoveNMTErrlSR BYTE BoardNo Parameter BoardNo input PISO CPM100 U board number 0 7 PISO CPM100 U user manual ver 2 01 Jan 12 2011 88 4 5 57 CPM100_GetMasterReadSDOEvent Description Using this function can get all the read SDO messages sent to the specific node ID of the PISO CPM100 U For example the PISO CPM100 U is initialized with node ID 2 If someone sends an SDO message with the COB ID 0x602 to the PISO CPM100 U for reading an object users can use the function CPM100_GetMasterReadSDOEvent
61. hutdown CPM100_ShutdownMaster Program End Manual Setting CPM100_AddNode CPM100_InstalIPDO_List CPM100_EDS_Load CPM100_ SetSYNC_List CPM100_SetEMCY List Interrupt ISR Figure 4 1 Main programming sequences PISO CPM100 U user manual ver 2 01 Jan 12 2011 EMCY ISR NMT Error Control ISR Read SDO ISR Remote PDO ISR 4 4 Communication Services Introduction NMT Services The CANopen Master Library provides several NMT services functions such as the functions CPM100 AddNode CPM100 EDS Load CPM100_RemoveNode CPM100_NMTChangeState CPM100_NMTGetState CPM100_NMTHeartbeat and CPM100_NMTGuarding As the prerequisite for the master the slave nodes have to be registered by the function CPM100_AddNode or CPM100_EDS_Load with providing its Node ID The registered slave nodes can be individually removed from the node list by the function CPM100_RemoveNode Through NMT services the NMT Master controls the state of the slaves Table 4 3 is the command value and corresponding NMT command for the input parameters of the CPM100_NMTChangeState function When using the function CPM100_NMTGetState the slave status value and their descriptions are shown in the table 4 4 The Node Guarding and Heartbeat protocol are implemented via the function CPM100_NMTGuarding and the function CPM100_NMTHeartbeat If the slave nodes are in the node list users can change the node guarding or heartbeat parameters defined in the slave nodes by cal
62. irsdooiwensdvestes 47 CPM100_NMTChangeState ic sscssdeudes ace snsesctesdaedancescenieidsseniesins 48 PINE OO NM UGB US tates sictseiesci scietnceddnconthendanistepadiadaancededeadadvanecd 49 CPM100 NMTG arding sinisiin 50 CPIMT0O INMIV HEAD GAL s0 lt enssaessssassaguonuoesdsesucraatennsseastneeenbeervssns 51 CPM100_SDOReadData s sccsaseaseaeteanarie derteetisnnieeencnnnetes 52 CPM 100 _SDOR adFile scenens e 53 CPM100_SDOWrtiteData eeeeeeeeeeseneseeeeseesseesersersseessesersseesee 54 CPM100_SDOAbortTransmit s asiscsiesnssdentesssnnsscontesssasseusancesetes 55 CPM100_PDOW rite sissccicssicrsrsisrersisstesecsiitseesoassesssasssreonsisirensaa 56 CPM100 _PDORemote eneee e ER 57 CPM100_SetPDORemotePolling csscecaecescedccseceedecsssceacesevetstenevens 58 CPNTOO GetP DOL Ast Ala sc cvsadesssativoscsvensascswmantensszessenetvancorvenes 59 CPM100_GetMultiPDODat a eee cesececsseceesseeeenseeeenaeeeenes 60 CPM100 GetRXPDOID siscs ces aassscccsasdeeatiactepessasnd sniasavacecsationsdvaanas 61 CPM100 Get ixPhOID ccco cai eee 62 CPIM TOO Mista PDO ocencie isens aeeiiaii 63 CPM100_DynamicPDO sessseseseeeeeeseeeeserssesriesressreeresresseesresreses 64 CPM100 RemoveP DO niseni 65 CPM100 ChangePDOID veses 66 CPM100_GetPDOMapl nfo ssccvsrcasssanieasseviesdvesdenaareswcacsnasselaapenvenee 67 CP NLIOO Install PIO Lisi cose easeaeseananiacdeteseasnnerencauneces 68 CPM 100 RemovePDO _Loistsecs ssicssashevesssatsscesesnsecsasdeseseadensneves
63. itch1 is for bitO switch2 is for DIP Switch biti and so forth For example if ON the left hand side switch switch1 E m m m DIP switch TE ed is ON the board No is set to 1 The range of board No is from 0 to 15 Be careful that the board No for each board must be unique in the PC Table 2 1 Jumper or DIP switch selections The situation indicates the board No 1 PISO CPM100 U user manual ver 2 01 Jan 12 2011 11 Connector Pin Assignment The PISO CPM100 U has two kinds of connector One is 5 pin screw terminal connector PISO CPM100 U T and the other is 9 pin D sub male connector PISO CPM100 U D for wire connection of the CANopen network The connector s pin assignment is specified as follows 2 1 1 5 pin screw terminal connector The 5 pin screw terminal connector of the CAN bus interface is shown in figure 2 2 The details for the pin assignment are presented in the following table N A CANL CAN _H NIA CAN_SHLD Figure 2 2 5 pin screw terminal connector Pin No Signal Description 1 N A No use 2 CAN_L CAN_L bus line dominant low 3 CAN_SHLD Optional CAN shield 4 CAN_H CAN_H bus line dominant high 5 N A No use Table 2 2 Pin assignment of 5 pin screw terminal connector PISO CPM100 U user manual ver 2 01 Jan 12 2011 12 2 1 2 9 pin D sub male connector The 9 pin D sub male connector of the CAN bus interface is shown in
64. le used to receive logical interrupt number PISO CPM100 U user manual ver 2 01 Jan 12 2011 34 4 5 5 CPM100_GetCANStatus e Description Obtain the status of the CAN controller of the specific PISO CPM100 U board e Syntax int CPM100_GetCANStatus BYTE BoardNo BYTE bStatus e Parameter BoardNo input PISO CPM100 U DIP switch No 0 15 bStatus output The address of a variable is applied to get the status value of CAN controller The bit interpretation of the bStatus parameter is as below Bit Name Value Status 1 Bus off Bit 7 Bus Status c 0 Bus on Bit 6 Error Stat ele i rror Status 0 OK 1 Transmit Bit 5 Transmit Status 0 Idle 1 Receive Bit 4 Receive Status a 0 Idle 1 Complete Bit 3 Transmission Complete Status p 0 Incomplete f 1 Release Bit 2 Transmit Buffer Status 0 Locked f 1 Overrun Bit 1 Data Overrun Status 0 Absent 1 Not Empty Bit 0 Receive Buffer Status 0 Empty PISO CPM100 U user manual ver 2 01 Jan 12 2011 35 4 5 6 CPM100_ SetFunctionTimeout Description Sometimes some function cost more time to complete its task such as CPM100_ScanNode If some API of the PISO CPM100 U library never gets the feedback from the PISO CPM100 U until timeout value goes by the error code CPM_Timeout will be returned Through this function the user can adjust the suitable
65. ling the function CPM100_NMTGuarding or CPM100_NMTHeartbeat 10304 2 0x02 128 0x60 129 Ox 130 0x62 Table 4 3 NMT Command Specifier State of Save 4 0x04 STOPPED 5 0x05 OPERATIONAL 127 Ox7F PRE OPERATIONAL Table 4 4 State of the Slave PISO CPM100 U user manual ver 2 01 Jan 12 2011 28 G COR SDO Services Initiate SDO download protocol or Initiate SDO upload protocol is used when the object data length lt 4 bytes If the object data length gt 4 bytes Download SDO segment protocol or Upload SDO segment protocol will be used Calling these two functions CPM100 SDOReadData and CPM100_SDOWriteData the initial protocol and segment protocol will be selected automatically according to the object data length CPM100_SDOAbortTransmit function can abort a pending SDO transfer at any time Applying the abort service will have no confirmation from the salve PDO Services After using the CPM100_AddNode to add a slave the default TxPDOs and RxPDOs TxPDO 1 10 RxPDO 1 10 will also be added to the PISO CPM100 U s control list If there are PDOs other than the default setting the function CPM100_InstallPDO is used for enabling these TxPDOs or RxPDOs object After installing the PDOs the function CPM100_DynamicPDO can add or change the PDOs mapping objects Each PDO object supports 0 8 application objects These application
66. n input Data length for reading the SDO data RDLen output Returned data length in reality RData output The SDO data respond from the specified slave device PISO CPM100 U user manual ver 2 01 Jan 12 2011 53 G COR 4 5 23 CPM100_SDOWriteData Description The function CPM100_SDOWriteData can send out a SDO message to the specified salve device This procedure is also called download SDO protocol The parameter node of the function CPM100_SDOWriteData is used to point which slave device will receive this SDO message Because the data length of each object stored in object dictionary is different users need to know the data length when writing the object of the object dictionary of the specified slave devices This function supports both expedition mode less then 4 byte data length and segment mode more then 4 byte data length Syntax WORD CPM100_SDOWriteData BYTE BoardNo BYTE Node WORD Index BYTE SubIndex DWORD TDLen BYTE TData WORD RDLen BYTE RData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Index input The index value of object of the object dictionary Sublndex input The subindex value of object of the object dictionary TDLen input Total data size to be written TData input The SDO data written to slave device RLen output Total data size of responded data RData
67. n the pre operational status the PDO communication object is not allowed to use For more detail information please refer to the demo programs in the section 5 When users programs apply the CANopen Master Library functions the function CPM100_InitMaster must be called first The functions is used to initialize CPM100 and configure the CAN port After initializing the CAN interface successfully users need to use the function CPM100_ AddNode or CPM100_EDS Load to install at least one CANopen device into the node list The function CPM100_AddNode can install slave node automatically or manually When the user applies the function to install node manually the PDO ID SYNC ID and EMCY ID of the node must be added manually by the functions CPM100_InstallPDO_List CPM100_SetSYNC_List and CPM100_SetEMCY_List If the function CPM100_InitMaster and CPM100_AddNode CPM100_EDS_ Load have been executed the communication services NMT SYNC EMCY SDO and PDO services can be used at any time before calling the functions CPM100_ShutdownMaster because the CPM100_ShutdownMaster would stop all process created by the function CPM100_InitMaster PISO CPM100 U user manual ver 2 01 Jan 12 2011 26 Program Start CANopen Master Initialization CPM100_InitMaster Add Slave Nodes CANopen Master Functionalities NWT Services T SYNC Senices T EmeY Senices T J s00 Services T PO Services CANopen Master S
68. nction until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Old_Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 66 4 5 36 CPM100_ GetPDOMapInfo e Description The function CPM100_GetPDOMaplinfo can get the mapping data information of the PDO object e Syntax WORD CPM100_GetPDOMapinfo BYTE BoardNo WORD Cobid BYTE RxTx BYTE Tx_Type WORD Event_Timer BYTE Entry_Cnt DWORD Map_ Data BYTE BlockMode e Parameter BoardNo input PISO CPM100 U board number 0 7 Cobid input COB ID used by the PDO object RxTx output PDO type 0 RxPDO 1 TxPDO Tx_Type output Transmission type Event_Timer output PDO event timer Entry_Cnt output Useful PDO entry number of the PDO object Map_Data output Double Word array parameter Response the mapping data of the PDO object s every useful entry BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the
69. nes 70 CPM 100 PDOUSCEMTY sisone 71 CPM 100 PDOTX Ty Be seasccieutrariceasasusteancntusentesianbarsnnteensneieassueeinans 12 CPM100_PDOEventTimer ss ssesesseeeseseseseseressseesseesseesseessseesseee 73 CPM100 Changes YNCID j icsscsccesessasareasiecdesaandsedvaseasdacsavscnceaoncs 74 CPM100 ets YING List sais nctasees cytecay eensagaartentrensveeesti need 75 CPM100 AGES YING IID 5 sonsstcaccnnerdotenstannessyteuanevvdcarentsamtaretvancorstes 76 CPM100_SendSYNCMsg vs cccaseceserecpancosecranceanninaecannnes 77 CPM100_GetCyclicS YNCInf0 c s cccccsscsssccsssnssecsnncssessecessnceonis 78 CPM100 Change Bi YID uenn a 79 CPM100 SetEMCY iSt a iccotsitcdezautesancaiieicetasdeademtibentasuwesuenvhtes 80 CPM100 GetEMCYID scires anieri niass irarria aaa 81 CPM100_ReadLastEMCY ciccssssscccssssssecssstescesssssecenssssessacensncvonnes 82 CPM100_GetEMCY Dat aa aascscix do snaeatatenaantinen eaneadeaacas naa es 83 CPM100_GetNMTETror si 15 ccpssaessesessaguereesadteoansosdersszonstnenwancervases 84 CPMI00 InstallEMC YISR ssscscesseecsenssesassursanrsestansecennsecctwnsennerves 85 PISO CPM100 U user manual ver 2 01 Jan 12 2011 3 G dons 4 5 54 CPMI100 RemoveEMCYISR woe ccccccccccccceceesssessecsecseessseeeees 86 4 5 55 CPM100_InstalINMTETrrlSR ccccecccssccecesssseeeecssseeeessseeees 87 4 5 56 CPM100_RemoveNMTErrISR ccecsececesssseceessseeesnssseeees 88 4 5 57 CPM100_GetMasterReadSDOEVvent ce
70. ning procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 55 G COR 4 5 25 CPM100_PDOWrite Description Call the function CPM100_PDOWrite to send out a PDO message to the specified slave device Before using this function users need to use the function CPM100_InstallPDO to install the PDO object into PISO CPM100 U if users want to use non default PDO Then change the NMT state of the target slave device to operational mode by using the function CPM100_NMTChangeState if the slave is not in the operational mode Use the parameter offset to set the start position of the PDO data and use the parameters TData and DLen to point the data and data length Then this function will follow the data length to cover the slave PDO buffer of the PISO CPM100 U with the data from the specified start position and send the data to the specified slave via PDO protocol at the same time Syntax WORD CPM100_PDOWrite BYTE BoardNo WORD Cobid BYTE Offset BYTE DLlen BYTE TData BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Cobid input
71. o long the performance of the PISO CPM100 U is down The unit of the parameter is ms ResTimeout input The timeout value of the responded messages from the CANopen slaves When the master sends a CANopen message to the slave it will wait the feedback until timeout if there is a feedback The unit of this parameter is millisecond BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 44 4 5 14 CPM100_RemoveNode Description The function CPM100_RemoveNode removes the slave with the specified Node ID from node list of the master It requires a valid Node ID which has installed by the function CPM100_AddNode before Syntax WORD CPM100_RemoveNode BYTE BoardNo BYTE Node BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter
72. o the CANopen network This function is usually applied with the SDO ISR series function About the demo please refer to the section 4 1 6 SDO_PDO_ISR Note1 The function is valid while the Node parameter of the function CPM100_InitMaster is gt 0 Note2 If the PISO CPM100 U want to reply a SDO Abort message please use the function CPM100 SDOAbortTransmit section 3 5 20 to do it Syntax WORD CPM100_ResponseMasterSDO BYTE BoardNo BYTE ResType WORD Index BYTE Sublndex BYTE Len BYTE Data Parameter BoardNo input PISO CPM100 U board number 0 7 ResType input Response type of SDO message 0 for replying the read SDO message and 1 for the write SDO message Index input Object index of object dictionary of slave devices Subindex input Object subindex of object dictionary of slave devices Len input The data length of the response data If the ResType is 1 write type the Len and Data parameter is useless Data input Return 0 4 bytes of the SDO response data PISO CPM100 U user manual ver 2 01 Jan 12 2011 91 G 4 5 60 CPM100_InstallReadSDOISR Description This function allows the user to apply the ReadSDO IST interrupt service thread of PISO CPM100 U When the user puts his read SDO process into this function all the read SDO messages sent to the specified PISO CPM100 U will trigger the IST For example the PISO CPM100 U is initialized with node ID 2 I
73. on of the application object and obey the following example format to fill this parameter For Example EntryData 0x64110310 Mapping to index 0x6411 and subindex 0x03 with data length 0x10 bit 2 byte If the function parameters are as following Cobid 0x333 RxTx 0 Entry 2 EntryData 0x64110310 This example will map the 16 bit data of index 0x6411 and subindex 0x03 object to the 2 entry of COB ID 0x333 RxPDO BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 64 4 5 34 CPM100_ RemovePDO Description The function CPM100_RemovePDO can remove a TxPDO or RxPDO object had installed by the CPM100_InstallPDO or CPM100_AddNode This function also can remove single object mapped in TxPDO or RxPDO Syntax WORD CPM100_RemovePDO BYTE BoardNo BYTE Node WORD Cobid BYTE Entry BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Cobid input
74. onary You can write any data to the specific object of the object dictionary through the object address index and sub index by SDO protocol This demo is a good model to do that Slot No fo arikat Index hex SubIndex MESTI 0000 FFFF 00 FF Len 1000 00 02 00 01 06 Write Abort Applied function list CPM100 InitMaster CPM100 Shutdown CPM100 AddNode CPM100 RemoveNode CPM100 SDOWriteData PISO CPM100 U user manual ver 2 01 Jan 12 2011 111 5 1 9 SYNC _ Protocol SYNC protocol is a synchronous function of the PDO communication It is always used with the transmission type of the PDO communication In this demo users can know how to use the SYNC related functions wea T Renovo SYNC ID h feo Change SYNC ID SYNC Timer Send Times C NC 80 Timer 1000 Times 20 Applied function list CPM100 InitMaster CPM100 Shutdown CPM100 AddNode CPM100 RemoveNode CPM100 ChangeSYNCID CPM100 GetSYNCID CPM100 SendSYNCMsgq CPM100 GetCyclicSYNCInfo PISO CPM100 U user manual ver 2 01 Jan 12 2011 112 5 1 10 PDO_MultiData Sometimes users want to poll several PDO objects data at the same time for increasing the performance But it is slower that sending the Remote PDO to poll each PDO data one by one So users can set event timer or remote list for these PDO When the PDO data are polled by the PISO CPM100 U or are replied from slave automatically th
75. onous RTR only 0 X X 1 240 X X 241 251 reserved 252 X X 253 X X 254 X 255 X BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 72 4 5 41 CPM100_PDOEventTimer Description Use this function to change the event timer of the TxPDO The default event timer is 0 When the event timer of the PDO object of the slave is more than 0 the PDO will be sent to master due to the parameter Timer automatically Syntax WORD CPM100_PDOEventTimer BYTE BoardNo WORD Cobid WORD Timer BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Cobid input COB ID used by the PDO object Timer input Event timer of TxPDO The unit is millisecond BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set
76. operation mode of the master O CPM100_GetFirmwareVersion Get the version of the PISO CPM100 U firmware O CPM100_EDS_Load Add a slave node from the EDS file Add a slave node into the PISO CPM100 U O CPM100_AddNode master manager Remove a node from the PISO CPM100 U O CPM100_RemoveNode master manager X CPM100_ScanNode Scan all nodes on the CANopen network Get the node list of the PISO CPM100 U master O CPM100_GetNodeList manager X CPM100_NMTChangeState Change the CANopen node state O CPM100_NMTGetState Get the CANopen node state O CPM100_NMT Guarding Start to the node guarding function O CPM100_NMTHeartbeat Start to the node heartbeat function X CPM100_SDOReadData Read data by using the upload SDO protocol X CPM100_SDOReadFile Read the huge SDO data for specific slave node PISO CPM100 U user manual ver 2 01 Jan 12 2011 21 G dons CPM100_ SDOWriteData Write data by using the download SDO protocol CPM100_SDOAbortTransmit Send the SDO abort message CPM100_PDOWrite Use the PDO to write data to the CANopen node CPM100_PDORemote Use the PDO to get data from the CANopen node CPM100_SetPDORemotePolling Set PDO polling list table and poll them CPM100_GetPDOLastData Get the last input or output PDO data CPM100_GetMultiPDOData Get the several input or output PDO data once CPM100_GetRxPDOID Get all COB ID of the RxPDO of the specific slave CPM100_Ge
77. otocol fok lt Slot No 0 pad Rt Node State Operation v Set Status Guarding Time Life 1000 2 Set Guarding Heartbeat ms Consumer ms 1000 2500 Set Heartbeat 1000 kbps EMCY 00 00 00 00 00 00 00 00 Clear Applied function list CPM100 InitMaster CPM100 Shutdown CPM100 AddNode CPM100 RemoveNode CPM100 NMTChangeState CPM100 NMTGuarding CPM100 NMTHeartbeat CPM100 GetEMCYData CPM100 GetNMTError CPM100 InstalINMTErrlSR CPM100 RemoveNMTErrlSR CPM100 InstallEMCYISR CPM100 RemoveEMCYISR PISO CPM100 U user manual ver 2 01 Jan 12 2011 105 5 1 3 PDO Parameter Sometimes the default PDO configuration can t satisfy users Users need to change the configuration of the PDO related parameters such as transmission type PDO ID event timer dynamic PDO and so forth This demo will demonstrate how to change settings of these PDO parameters and show the configuration result slot No 0 PDO 1h Baud Rate 1000 kbps Shutdown Eoo Install Node 1 i PDO Type RPDO 181 J Entry Entry Data h New ID h Transmission Type 255 Event Timer 0 Remove PDO Dynamic PDO Change PDO ID Mapping Data Entry 1 60000108 Transmit Type PDO Entry Event Timer Entry 2 60000208 Set Tx Type Set Entry No Set Event Timer Applied function list CPM100 InitMaster CPM100 Shutdown CPM100 AddNode CPM100 RemoveNode CPM100 InstallIPDO CPM100 RemovePDO CPM100
78. otocol or to get set the DIO status by PDO protocol when the PISO CPM100 U the Il 8053W DI module and the I 8057W DO module are plugged in the same MCU If the user has an application like this this demo may be a good reference SDO_PDO_ISR ead 1000 00 eceponse 91 01 03 00 ead 6000 00 eceponse 02 201 Output FF 00 Applied function list CPM100 InitMaster CPM100 Shutdown CPM100 GetMasterReadSDOEvent CPM100 GetMasterWriteSDOEvent CPM100 GetMasterRemotePDOEvent CPM100 GetMasterRxPDOEvent CPM100 ResponseMasterSDO CPM100 ResponseMasterPDO CPM100 InstallPDO List CPM100 _ InstallReadSDOISR CPM100 _ InstallWriteSDOISR CPM100 InstallIRxPDOISR CPM100 InstallRemotePDOISR PISO CPM100 U user manual ver 2 01 Jan 12 2011 109 5 1 7 SDO_ Read SDO protocol is a kind of the communication functions used to read write CANopen object dictionary You can read any object data of the object dictionary through the object address index and sub index by SDO protocol This demo is a good model to do that SDO _ Read Index hex 0000 FFFF 00 FF ooo fo 1000 00 91 01 01 00 Applied function list CPM100 InitMaster CPM100 Shutdown CPM100 AddNode CPM100 RemoveNode CPM100 SDOReadData PISO CPM100 U user manual ver 2 01 Jan 12 2011 110 5 1 8 SDO_Write SDO protocol is a kind of the communication functions used to read write CANopen object dicti
79. ply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 50 G COR 4 5 20 CPM100_NMTHeartbeat Description Use the function CPM100_ NMTHeartbeat to set heartbeat time of the slave with the specified node ID and consume time with the PISO CPM100 U Then the slave will automatically send the heartbeat message to master according to the ProduceTime parameters of this function If the master doesn t receive the heartbeat message from the slave until the ConsumeTime time unit is millisecond is up the PISO CPM100 U will produce a Heartbeat_Event event to users Users may use the function CPM100_InstalINMTErrlSR to install a user defined process to get the heartbeat fail event and process the heartbeat fail procedure It is recommended that ConsumeTime value is set to bigger than the ProduceTime value Take a note that following the CANopen specification it is not allowed for one slave device to use both error control mechanisms Guarding Protocol and Heartbeat Protocol at the same time Syntax WORD CPM100_NMHartbeat BYTE BoardNo BYTE Node WORD ProduceTime WORD ConsumeTime BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 ProduceTime input Produce Time of slave device 1
80. return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 37 G 4 5 8 CPM100_ShutdownMaster Description The function CPM100_ShutdownMaster removes all the slaves that had added to master and stop all the functions of the PISO CPM100 U The function must be called before exit the users application programs Syntax WORD CPM100_ShutdownMaster BYTE BoardNo Parameter BoardNo input PISO CPM100 U board number 0 7 PISO CPM100 U user manual ver 2 01 Jan 12 2011 38 4 5 9 CPM100_SetMasterMode Description This function can configure if the master is into listen mode or normal mode default mode In listen mode the PISO CPM100 U can t send any CANopen message and some functions will be useless in this mode User can select normal mode or listen mode at any time after calling function CPM100_InitMaster Syntax WORD CPM100_SetMasterMode BYTE BoardNo BYTE Mode BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Mode input 1 is listen mode and others are normal mode default mode BlockMode input 0 means this function is non block function and 1 means this function is block function If set this p
81. s Index and SubIndex are the object indicator The parameter WLen is the data length of the parameter WData The function CPM100_GetMasterWriteSDOEvent is usually applied with the function CPM100_InstallWriteSDOISR About the demo please refer to the section 4 1 6 SDO_PDO_ISR Note The function is valid while the Node parameter of the function CPM100_InitMaster is gt 0 Syntax WORD CPM100_GetMasterWriteSDOEvent BYTE BoardNo WORD Index BYTE Sublndex BYTE WLen BYTE WData Parameter BoardNo output Get the board number of the PISO CPM100 U which receives the write SDO message Index output Get the object index of the SDO message Subindex output Get the object subindex of the SDO message WLen output The data length of the write data WData output Return 0 4 bytes of the SDO write data PISO CPM100 U user manual ver 2 01 Jan 12 2011 90 G COR 4 5 59 CPM100_ResponseMasterSDO Description Using this function can reply the SDO messages to the SDO sender For example the PISO CPM100 U is initialized with node ID 2 If someone sends a SDO message with the COB ID 0x602 for reading or writing the object of the PISO CPM100 U the PISO CPM100 U need to reply the corresponding SDO message use the function CPM100_ResponseMasterSDO to do it When users implement the function CPM100_ResponseMasterSDO the PISO CPM100 U will send a SDO message with COB ID 0x582 t
82. specification function collections for the PISO CPM100 U cards used in Windows 2000 XP Vista 7 with 32 bit systems The application structure is presented in the following figure The users CANopen master application programs can be developed by the following program development tools VC VB net and C The driver architecture is shown in the following Figure Users Programs Application PISO CPM100 U Function Library PISO CM100 U Function Library User Mode PISO CM100 U Kernel Driver KP_CM100 sys Kernel Mode Windows Operation PCI Bus amp DPRAM PISO cPM100 u CPM10XXX exe Firmware Firmware MiniOS7 Operation Figure 3 1 Driver concept of PISO CPM100 U PISO CPM100 U user manual ver 2 01 Jan 12 2011 16 3 2 Installation Driver Step by Step When users want to use the PISO CPM100 U CAN card the PISO CPM100 U driver must be installed firstly After finishing the installation process the CPM_Utility and the demo programs would also be installed to the PC The demo programs may be a good reference for users to build their CANopen master interface by using VC C and VB net The demo programs also give a simple interface to show the basic functions of master slave connection and CANopen master program architectures It is very helpful for users to understand how to use these functions and develop their CANopen master application If users do not want to develop this application by
83. tTxPDOID Get all COB ID of the TxPDO of the specific slave CPM100_InstallPDO Install and enable a specific PDO CPM100_DynamicPDO New or change a PDO mapping to the slave CPM100_RemovePDO Remove a specific PDO mapping entry or object CPM100_ChangePDOID Change the PDO COB ID of a specific slave CPM100_GetPDOMapInfo Obtain all the PDO related information CPM100_InstallPDO_List Install a PDO manually without check if it exists CPM100_RemovePDO List Remove PDO object without check real states CPM100_PDOUseEntry Change the valid entry number of the PDO objects CPM100_PDOTxType Set transmission type of the specific TxPDO CPM100_PDOEventTimer Set event timer of the specific TxPDO CPM100_ChangeSYNCID Change the SYNC COB ID CPM100_SetSYNC_List Set the SYNC COB ID without check if it exists CPM100_GetSYNCID Get the SYNC COB ID CPM100_SendSYNCMsg Send the SYNC message CPM100_GetCyclicSYNCInfo Get all the cyclic sending SYNC information CPM100_ChangeEMCYID Change the EMCY COB ID CPM100_SetEMCY_List Set the EMCY COB ID and don t check if it exists CPM100_GetEMCYID Get the EMCY COB ID CPM100_ReadLastEMCY Get the last EMCY message of the slave OJOJOJO X XI X OOJ XI X X XI OJOO xk x lt lt x lt x O O O0 0 X X X Xx X lt CPM100_GetEMCYData Get the EMCY message from the EMCY buffer G
84. terminal Connector eeesesseeeseseresteeresressreererreesresee 12 2 1 2 Opin D sub male connector sesseeseseeseesrrereeressrrsresrersresereeresee 13 2 1 3 Wire CONNECHON eine n E ten Lechiastavieees aise 14 2 2 Green LED sian ah cxantaehlnanlasscuanbsontinnnnahouaninanbinntiiniaantadacusninaninnntasnuens 15 Bide POG UBD a a E E 15 2 4 Hardware Installation siicsiscsciscicntiancisssisscucsaaiieeodenaaiseneniiemodsawas 15 Software Installation oe eee mn ee ere 16 3 1 Software Structure cccccsseeeeeeeseceessesseeeeeeesseeeeessseeeeeeeeseaoes 16 3 2 Installation Driver Step by Step cceccccesseeeseeeeeeeeeeeeeeeeees 17 PISO CPM100 U Function Library ccccccceseeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 21 Als F ncton RISD dicteiesrtisaturttaneuineieurinnienmiainedinieesietieten 21 4 2 Function Return Code cccccccessssessssssseeeeeeeseceeeesssseeeeeeenseeoes 24 4 3 CANopen Master Library Application Flowchart 0 26 4 4 Communication Services Introduction sessssseees 28 4 5 Function Description sicececisecccicsccececseeranecensecetaneserescecswecscenenesan 31 4 5 1 CPM100_GetVersion cccccccccccccceessssssececceeceesessssaeeeeeceeseneneas 31 4 5 2 CPM100_TotalBoard oii ccecccccccccccessssssceseccescesseesecessccesseaeenens 32 4 5 3 CPM 100_GetBoardSwitchNo cccccccccsssceceessceceesseeeeeseseeeenees 33 4 5 4 CPM100_ GetBoardI nf ccc cc
85. the SYNC ID of the slave needs to be changed or be set The function CPM100_SetSYNC_List can only change the SYNC COB ID in the COB ID list of the PISO CPM100 U the real value stored in the slave device may be different from the configuration which is set by the function CPM100_SetSYNC_ List The users need to confirm that by themselves Syntax WORD CPM100_SetSYNC_List BYTE BoardNo BYTE Node WORD Cobid BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Cobid input COB ID used by the SYNC object BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 75 4 5 44 CPM100_GetSYNCID Description This function can get the SYNC ID from the COB ID list of the PISO CPM100 U Syntax WORD CPM100_GetSYNCID BYTE BoardNo BYTE Node WORD Cobid BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave d
86. the automatic mode after calling this function to add a slave the slave will be into the operational state directly And master will scan the TxPDO1 TxPDO10 and RxPDO1 RxPDO10 and install them into the firmware of the PISO CPM100 U if the slave supports these PDO objects In the manual mode this function will add a CANopen slave into the master node list only and will not send any message to check if the slave is existent or not Besides the manual mode doesn t install the SYNC ID EMCY ID and any PDO object into the firmware of the PISO CPM100 U Users must call CPM100_SetSYNC_List CPM100_SetEMCY_List and CPM100_InstallPDO_List to complete the object installation to finish the adding node process The added node can be removed from the master node list by the function CPM100_RemoveNode Syntax WORD CPM100_AddNode BYTE BoardNo BYTE Node BYTE AddMode WORD DelayTime WORD ResTimeout BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 AddMode input 1 Automatic mode 2 Manual mode 3 Wait Boot up mode DelayTime input The parameter is the shortest time interval between sending two messages from the PISO CPM100 U It can avoid the master to send too much CANopen messages PISO CPM100 U user manual ver 2 01 Jan 12 2011 43 CG dO in a short time that may let some slaves occur the errors But if the delay time is to
87. tion will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 57 G COR 4 5 27 CPM100_SetPDORemotePolling Description If the CANopen slaves do not support the event timer function of the TxPDOs using the function CPM100_SetPDORemotePolling can config the most 125 TxPDO objects into the remote polling list Then the PISO CPM100 U will poll the configured TxPDOs and update the data into buffer automatically Users can use CPM100_GetMultiPDOData to get these TxPDOs data from the buffer faster and easily Syntax WORD CPM100_SetPDORemotePoling BYTE BoardNo BYTE PDOCnt WORD Cobid BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 PDOCnt input The number of the Cobid array Cobid input COB ID array used by the TxPDO objects BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while
88. to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 73 4 5 42 CPM100_ChangeSYNCID Description Use the function CPM100_ChangeSYNCID to change the SYNC COB ID of a slave device Syntax WORD CPM100_ChangeSYNCID BYTE BoardNo BYTE Node WORD Cobid BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 Cobid input COB ID used by the SYNC object BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Cobid again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 74 G COR 4 5 43 CPM100_SetSYNC_List Description If the user uses CPM100_AddNode function to add the slave with manual mode the function CPM100_ SetSYNC_List must be called while
89. to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 45 4 5 15 CPM100_ ScanNode Description User can use the function CPM100_ScanNode to know how many slave nodes are on the CANopen network Syntax WORD CPM100_ScanNode BYTE BoardNo BYTE S_Node BYTE E Node BYTE NodeList BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 S_ Node input Start node ID E Node input End node ID This function will scan node ID from S_Node to E_Node If S Node gt E_Node it will scan all slave node ID 1 127 on the CANopen network NodeList output This is a 16 byte array parameter Each bit of the parameter means a node ID the bit is 0 means that the node ID doesn t exist and 1 means the node ID is on the CANopen network For example if the NodeList 0 is 0x16 0001 0110 it means that the nodes with ID 1 2 and 4 exist and the nodes with ID 0 3 5 6 and 7 don t exist If the NodeList 1 is 0x41 0100 0001 it means that the nodes with ID 8 and 14 exist and the nodes with ID 9 10 11 12 13 and 15 don t exist Blo
90. users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 48 4 5 18 CPM100_NMTGetState Description The function CPM100_ NMTGetState can get the NMT state from slaves Syntax WORD CPM100_NMTGetState BYTE BoardNo BYTE Node BYTE State BYTE BlockMode Parameter BoardNo input PISO CPM100 U board number 0 7 Node input Slave device Node ID 1 127 State output The NMT state of the slave 4 STOPPED 5 OPERATIONAL 127 PRE OPERATIONAL BlockMode input 0 means this function is non block function and 1 means this function is block function If set this parameter to 1 the running procedure of the users application will be held in the function until return If set to 0 this function will return CPM_ Processing directly This function will return its process status while users apply it with the same BoardNo and Node again If the procedure is still not complete it will return CPM_Wait PISO CPM100 U user manual ver 2 01 Jan 12 2011 49 G COR 4 5 19 CPM100_NMTGuarding Description Use the function CPM100_NMTGuarding to set guard time and life time factor of the slave with the specified node ID Then the master will automatically send the guarding message to slave device according to the GuardTime
91. with the COB ID 0x602 to the PISO CPM100 U for writing an object the I 8213W will go into the IST if the user has installed it Note The function is valid while the Node parameter of the function CPM100_InitMaster is gt 0 Syntax WORD CPM100_InstallWriteSDOISR BYTE BoardNo void WSDOISR Parameter BoardNo input PISO CPM100 U board number 0 7 WSDOISR input The pointer which points a function with format void XXX The XXX is the function name of user s process This process is usualy used with the function CPM100_GetMasterWriteSDOE vent PISO CPM100 U user manual ver 2 01 Jan 12 2011 94 G 4 5 63 CPM100_RemoveWriteSDOISR Description When the user doesn t need the WriteSDO IST function call this function to remove the user IST Syntax WORD CPM100_RemoveWriteSDOISR BYTE BoardNo Parameter BoardNo input PISO CPM100 U board number 0 7 PISO CPM100 U user manual ver 2 01 Jan 12 2011 95 4 5 64 CPM100_GetMasterRemotePDOEvent Description Using this function can get all the Remote PDO messages sent to the PISO CPM100 U For example the PISO CPM100 U has used the function CPM100_InstallPDO List to install an PISO CPM100 U s TxPDO object with the COB ID 0x444 If someone sends a Remote PDO message with the COB ID 0x444 to the PISO CPM100 U users can use the function CPM100_GetMasterRemotePDOEvent to

Download Pdf Manuals

image

Related Search

Related Contents

308368aj , Husky 2150 Metall Druckluft-Membranpumpen  Transition from MELSEC-A/QnA (Large Type), AnS/QnAS (Small  Fujitsu FI-553PR User's Manual  Operator`s Manual  manual do proprietário  Okki Nokki  S/AARM - IMESA SpA  C2006 - Prada Nargesa  2月号 No131(P4-5)(PDF文書)  Lenco EP-004 headphone  

Copyright © All rights reserved.
Failed to retrieve file