// I7565CPM.h : main header file for the I7565CPM DLL // #ifndef __I7565_CPM_HEADER__ #define __I7565_CPM_HEADER__ #define I7565CPM_API #define CALLBACK typedef unsigned char bool; typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; // CANopen Master Error Code Define #define CPM_NoError 0 #define CPM_OpenComErr 2 #define CPM_ComPortErr 3 #define CPM_MasterFull 4 #define CPM_ConfigErr 5 #define CPM_MasterInitErr 6 #define CPM_MasterNotInit 7 #define CPM_ListenMode 8 #define CPM_NodeErr 9 #define CPM_NodeExist 10 #define CPM_AddModeErr 11 #define CPM_TxBusy 12 #define CPM_UnknowCmd 13 #define CPM_CmdReceErr 14 #define CPM_DataEmpty 15 #define CPM_MemAllocErr 16 #define CPM_SendCycMsgErr 17 #define CPM_StatusErr 18 #define CPM_SetGuardErr 20 #define CPM_SetHbeatErr 21 #define CPM_SegLenErr 22 #define CPM_SegToggleErr 23 #define CPM_SegWriteErr 24 #define CPM_Abort 25 #define CPM_PDOLenErr 26 #define CPM_COBIDErr 27 #define CPM_PDOInstErr 28 #define CPM_PDODynaErr 29 #define CPM_PDONumErr 30 #define CPM_PDOSetErr 31 #define CPM_PDOEntryErr 32 #define CPM_SetCobIdErr 33 #define CPM_CycFullErr 34 #define CPM_Timeout 35 #define CPM_DataLenErr 36 #define CPM_SendLose 38 #define CPM_SendCmdErr 39 #define CPM_Wait 40 #define CPM_Processing 41 #define CPM_LoadEDSErr 50 #define CPM_EDSFormatErr 51 //////// CANopen Master NMTErr Event Define #define CPM_Node_Guarding_Event 1 #define CPM_Heartbeat_Event 2 //////////////////////////////////////////////////////////////// //////////////////////////////////////// // I-7565-CPM function library //////////////////////////////////////// //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetVersion // Description: Return I7565CPM.dll version // Parameter: void //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetVersion(void); //////////////////////////////////////// // Driver Version: 2.01 // Firmware Version: 2.01 // Function: I7565CPM_SetFunctionTimeout // Description: Set function timeout // Parameter: ComPort: I-7565-CPM USB Com Port // FunTimeout: Max timeout ms of per function //////////////////////////////////////// I7565CPM_API void CALLBACK I7565CPM_SetFunctionTimeout(BYTE ComPort, DWORD FunTimeout); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_InitMaster // Description: Initial Master, must be call once before all others function // Parameter: ComPort: I-7565-CPM USB Com Port // Node: 0 is for normal Master, 1 ~ 127 are for Master of slave-mode. // The slave-mode Master has node id and can be controled by other CANopen device. // We have provided some ISR function for user to do this. // BaudRate: 0 ~ 7 ==> 10 k ~ 1000 k bps // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_InitMaster(BYTE ComPort, BYTE Node, BYTE BaudRate, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_ShutdownMaster // Description: Let I-7565-CPM shutdown (reset) // Parameter: ComPort: I-7565-CPM USB Com Port //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_ShutdownMaster(BYTE ComPort); //////////////////////////////////////// // Driver Version: 2.02 // Firmware Version: 2.01 // Function: I7565CPM_MasterSendBootupMsg // Description: Let I-7565-CPM send a boot up message (only for Master Node >= 1) // Parameter: ComPort: I-7565-CPM USB Com Port // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_MasterSendBootupMsg(BYTE ComPort, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.01 // Firmware Version: 2.01 // Function: I7565CPM_GetCANStatus // Description: Get CAN error status of the I-7565-CPM // Parameter: ComPort: I-7565-CPM USB Com Port // *bStatus: get CAN error status //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetCANStatus(BYTE ComPort, BYTE *bStatus); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_SetMasterMode // Description: Set Master to normal mode or listen mode // Parameter: ComPort: I-7565-CPM USB Com Port // Mode: 0 is normal mode (default), 1 is listen mode (default) // If set the Master to listen mode, the Master will can't send any CANopen message // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_SetMasterMode(BYTE ComPort, BYTE Mode, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetMasterMode // Description: Get Master mode // Parameter: ComPort: I-7565-CPM USB Com Port // *Mode: 0 is normal mode (default), 1 is listen mode // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetMasterMode(BYTE ComPort, BYTE *Mode, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetFirmwareVersion // Description: Get I7565CPM firmware version // Parameter: ComPort: I-7565-CPM USB Com Port // *Fir_Ver: I-7565-CPM firmware version // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetFirmwareVersion(BYTE ComPort, WORD *Fir_Ver, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.01 // Firmware Version: 2.01 // Function: I7565CPM_EDS_Load // Description: Load EDS File // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node // *FilePath: EDS file path (ex: "\\Temp\\ABC.EDS") // DelayTime: After send a CAN message will delay some time // ResTimeout: Set CAN message timeout //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_EDS_Load(BYTE ComPort, BYTE Node, char* FilePath, WORD DelayTime, WORD ResTimeout, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_AddNode // Description: Add Slave Node to Master // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node // AddMode: 1:Auto Add Node, 2:Add Manual // DelayTime: After send a CAN message will delay some time // ResTimeout: Set CAN message timeout // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_AddNode(BYTE ComPort, BYTE Node, BYTE AddMode, WORD DelayTime, WORD ResTimeout, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_RemoveNode // Description: Remove Slave Node from Master // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_RemoveNode(BYTE ComPort, BYTE Node, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_RemoveAndResetNode // Description: Remove Slave and then Reset Node from Master // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_RemoveAndResetNode(BYTE ComPort, BYTE Node, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.03 // Firmware Version: 2.02 // Function: I7565CPM_DelayAndResponseTimeout // Description: Change delay time and response timeout value of the node // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // DelayTime: After send a CAN message will delay some time // ResTimeout: Set CAN message timeout // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_DelayAndResponseTimeout(BYTE ComPort, BYTE Node, WORD DelayTime, WORD ResTimeout, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_ScanNode // Description: Scan real node id on the CANopen bus // Parameter: ComPort: I-7565-CPM USB Com Port // S_Node: Start scan node id // E_Node: End scan node id // If S_Node > E_Node or E_Node = 0, will scan all node id (1~127) // *NodeList: 16 BYTE Array. Return Node Id List of the CANopen Bus. Each bit represents a slave node // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_ScanNode(BYTE ComPort, BYTE S_Node, BYTE E_Node, BYTE *NodeList, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetNodeList // Description: Get Node Id List of the Master had added // Parameter: ComPort: I-7565-CPM USB Com Port // *NodeList: 16 BYTE Array. Return Node Id List of the Master had added. Each bit represents a slave node // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetNodeList(BYTE ComPort, BYTE *NodeList, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_NMTChangeState // Description: Set Node State // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // State: NMT State // (1:Operation mode, 2:Stop mode, 128:Pre-operation mode, 129:Reset node, 130:Reset communication) // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_NMTChangeState(BYTE ComPort, BYTE Node, BYTE State, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_NMTGetState // Description: Get Node State // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // *State: Return NMT State // (4:Stop mode, 5:Operation mode, 127:Pre-operation mode) // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_NMTGetState(BYTE ComPort, BYTE Node, BYTE *State, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_NMTGuarding // Description: Start Guarding // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // GuardTime: set index 0x100C // (Master will send Guarding message per GuardTime ms). // LiftTime: set index 0x100D // (If Master doesn't receive Guarding response over LiftTime times, it will timeout and Node_Guarding_Event occur) // (The Guarding timeout = GuardTime * LiftTime ) // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 // Note 1: It is not allowed for one slave to use both Guarding protocol and Heartbeat protocol at the same time. // Node 2: In listen mode, the function will listen the Guarding message send from other Master to slave on the CANopen bus. //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_NMTGuarding(BYTE ComPort, BYTE Node, WORD GuardTime, BYTE LiftTime, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_NMTHeartbeat // Description: Start Heartbeat // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // ProduceTime: set index 0x1017 // ConsumeTime: Timeout of Heartbeat // (ConsumeTime must more then ProduceTime) // (If Master doesn't receive slave Heartbeat over ConsumeTime ms, it will timeout and Heartbeat_Event occur) // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 // Note: It is not allowed for one slave to use both Guarding protocol and Heartbeat protocol at the same time. // Node 2: In listen mode, the function will listen only and can't start Heartbeat protocol. So Heartbeat protocol must start from other Master. //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_NMTHeartbeat(BYTE ComPort, BYTE Node, WORD ProduceTime, WORD ConsumeTime, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_SDOReadData // Description: SDO Read Data // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Index: Index of Object Dectionary // SubIndex: SubIndex of Object Dectionary // *RDLen: Response Data Length // *RData: Response Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_SDOReadData(BYTE ComPort, BYTE Node, WORD Index, BYTE SubIndex, DWORD *RDLen, BYTE *RData, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_SDOReadFile // Description: SDO Read File. After I7565CPM_SDOReadData, if the data length is more than 1024 bytes, // user need uses this function to read the SDO data file. // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node // Index: Index of Object Dectionary // SubIndex: SubIndex of Object Dectionary // Start: Start position to read the SDO data file // Len: Max read byte // RDLen: Return read data length // RData: Return data //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_SDOReadFile(BYTE ComPort, BYTE Node, WORD Index, BYTE SubIndex, DWORD Start, DWORD Len, DWORD *RDLen, BYTE *RData); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_SDOWriteData // Description: SDO Write Data // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Index: Index of Object Dectionary // SubIndex: SubIndex of Object Dectionary // TDLen: Write Data Length // *TData: Write Data // *RDLen: Response Data Length // *RData: Response Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_SDOWriteData(BYTE ComPort, BYTE Node, WORD Index, BYTE SubIndex, DWORD TDLen, BYTE *TData, WORD *RDLen, BYTE *RData, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_SDOAbortTransmit // Description: Send SDO Abort Message // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Index: Index of Object Dectionary // SubIndex: SubIndex of Object Dectionary // TData: Abort Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_SDOAbortTransmit(BYTE ComPort, BYTE Node, WORD Index, BYTE SubIndex, DWORD TData, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_PDOWrite // Description: Output PDO data // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cob Id // Offset: Start data offset // DLen: Data Length // *Data: PDO Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_PDOWrite(BYTE ComPort, WORD Cobid, BYTE Offset, BYTE DLen, BYTE *Data, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.02 // Firmware Version: 2.01 // Function: I7565CPM_PDOWrite_Fast // Description: Output PDO data directly // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cob Id // Offset: Start data offset // DLen: Data Length // Data: PDO Data //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_PDOWrite_Fast(BYTE ComPort, WORD Cobid, BYTE Offset, BYTE DLen, BYTE *Data); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_PDORemote // Description: Remote PDO data // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cob Id // *DLen: Response Data Length // *Data: Response PDO Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_PDORemote(BYTE ComPort, WORD Cobid, BYTE *DLen, BYTE *RData, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.02 // Firmware Version: 2.01 // Function: I7565CPM_PDORemote_Fast // Description: Send requst to remote PDO data, but do not check the response // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cob Id // DLen: Data Length // Data: PDO Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_PDORemote_Fast(BYTE ComPort, WORD Cobid); //////////////////////////////////////// // Driver Version: 2.01 // Firmware Version: 2.01 // Function: I7565CPM_SetPDORemotePolling // Description: Set PDO polling list for remote PDO (max 125 PDO one time) // Parameter: ComPort: I-7565-CPM USB Com Port // PDOCnt: Total PDO number that want to be polling // Cobid: PDO list that want to be polling // PollingTime: Min. polling Time // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_SetPDORemotePolling(BYTE ComPort, BYTE PDOCnt, WORD *Cobid, WORD PollingTime, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetPDOLastData // Description: Get PDO last data // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cob Id // *IsNew: Is new data, 0 is old data, 1 is new data // *DLen: Get PDO Data Length // *Data: Get PDO Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetPDOLastData(BYTE ComPort, WORD Cobid, BYTE *IsNew, BYTE *DLen, BYTE *RData, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.01 // Firmware Version: 2.01 // Function: I7565CPM_GetMultiPDOData // Description: Get multi PDO data (this function can get max 25 PDO data every times) // Parameter: ComPort: I-7565-CPM USB Com Port // PDOCnt: Total PDO number that want to get // Cobid: All PDO Cob Id that want to get // IsNew: Is new data, 0 is old data, 1 is new data // DLen: PDO Data Length // Data: PDO Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetMultiPDOData(BYTE ComPort, BYTE PDOCnt, WORD *Cobid, BYTE *IsNew, BYTE *DLen, BYTE *Data, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetRxPDOID // Description: Get Rx PDO Cob ID List of slave // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // *PDO_Cnt: Response RxPDO ID total number // *Id_List: Response *PDO_Cnt number RxPDO ID List // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetRxPDOID(BYTE ComPort, BYTE Node, BYTE *PDO_Cnt, WORD *Id_List, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetTxPDOID // Description: Get Tx PDO Cob ID List of slave // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // *PDO_Cnt: Response TxPDO ID total number // *Id_List: Response *PDO_Cnt number TxPDO ID List // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetTxPDOID(BYTE ComPort, BYTE Node, BYTE *PDO_Cnt, WORD *Id_List, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_InstallPDO // Description: Install PDO ID to Master // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Cobid: PDO Cob ID // RxTx: 0 is RxPDO, 1 is TxPDO // PDO_No: PDO No. 0 ~ 511 // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_InstallPDO(BYTE ComPort, BYTE Node, WORD Cobid, BYTE RxTx, WORD PDO_No, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_DynamicPDO // Description: Dynamic PDO Mapping to Master // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Cobid: PDO Cob ID // RxTx: 0 is RxPDO, 1 is TxPDO // Entry: Mapping Entry // EntryData: Mapping Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_DynamicPDO(BYTE ComPort, BYTE Node, WORD Cobid, BYTE RxTx, BYTE Entry, DWORD EntryData, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_RemovePDO // Description: Remove POD Entry // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Cobid: PDO Cob ID // Entry: Remove Entry, 0 is for whole PDO // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_RemovePDO(BYTE ComPort, BYTE Node, WORD Cobid, BYTE Entry, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_ChangePDOID // Description: Change POD ID // Parameter: ComPort: I-7565-CPM USB Com Port // Old_Cobid: Old Cobid // New_Cobid: Want to change to New Cobid // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_ChangePDOID(BYTE ComPort, WORD Old_Cobid, WORD New_Cobid, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetPDOMapInfo // Description: Change POD ID // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cobid // *PDONo: PDO No // *RxTx: 0 is RxPDO, 1 is TxPDO // *Tx_Type: Transmission Type // *Event_Timer: Event Timer // *Entry_Cnt: Total entry number // *Map_Data: Mapping Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetPDOMapInfo(BYTE ComPort, WORD Cobid, WORD *PDONo, BYTE *RxTx, BYTE *Tx_Type, WORD *Event_Timer, BYTE *Entry_Cnt, DWORD *Map_Data, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_InstallPDO_List (Virtual List) // Description: Install PDO and Mapping PDO Data to Master List. // This function like I7565CPM_InstallPDO_List, but it only build a virtual PDO let Master // can control the PDO. The virtual PDO is not the real node slave necessarily. // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Cobid: PDO Cob ID // RxTx: 0 is RxPDO, 1 is TxPDO // PDO_No: PDO No. // Tx_Type: Set transmission type // Event_Timer: Set event timer // EntryUse: Total Mapping Entry // *EntryData: DWORD array for Total Mapping Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_InstallPDO_List(BYTE ComPort, BYTE Node, WORD Cobid, BYTE RxTx, WORD PDO_No, BYTE Tx_Type, WORD Event_Timer, BYTE EntryUse, DWORD *EntryData, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_RemovePDO_List (Virtual List) // Description: Remove PDO build from I7565CPM_InstallPDO_List function // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Cobid: PDO Cob ID // Entry: Remove Entry, 0 is for whole PDO // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_RemovePDO_List(BYTE ComPort, BYTE Node, WORD Cobid, BYTE Entry, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_PDOUseEntry // Description: Change useful entry // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cob ID // Entry: useful entry // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_PDOUseEntry(BYTE ComPort, WORD Cobid, BYTE Entry, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_PDOTxType // Description: Set PDO Transmission Type // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cob ID // Tx_Type: Transmission Type // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_PDOTxType(BYTE ComPort, WORD Cobid, BYTE Tx_Type, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_PDOEventTimer // Description: Set PDO Event Timer // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cob ID // Timer: Event Timer // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_PDOEventTimer(BYTE ComPort, WORD Cobid, WORD Timer, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.03 // Firmware Version: 2.02 // Function: I7565CPM_PDOInhibitTime // Description: Set PDO Inhibit Time // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: PDO Cob ID // Time: Inhibit Time // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_PDOInhibitTime(BYTE ComPort, WORD Cobid, WORD Time, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_ChangeSYNCID // Description: Change SYNC ID // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Cobid: SYNC ID // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_ChangeSYNCID(BYTE ComPort, BYTE Node, WORD Cobid, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_SetSYNC_List (Virtual List) // Description: Set or Change SYNC ID from Master // The function only build a virtual SYNC ID let Master can control it. // The virtual SYNC ID is not the real one necessarily. // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Cobid: PDO Cob ID // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_SetSYNC_List(BYTE ComPort, BYTE Node, WORD Cobid, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetSYNCID // Description: Get SYNC ID // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // *Cobid: SYNC ID // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetSYNCID(BYTE ComPort, BYTE Node, WORD *Cobid, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_SendSYNCMsg // Description: Send SYNC message, most send 5 different SYNC at the same time // Parameter: ComPort: I-7565-CPM USB Com Port // Cobid: SYNC ID // Timer: Cyclic timer, 0 is stop or send 1 time SYNC message // Times: Cyclic times, 0 is always contiune // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_SendSYNCMsg(BYTE ComPort, WORD Cobid, WORD Timer, DWORD Times, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: CPM_GetCyclicSYNCInfo // Description: Get Cyclic SYNC Info // Parameter: ComPort: I-7565-CPM USB Com Port // *Cobid: 5 WORD Array, SYNC ID // *Timer: 5 WORD Array, Cyclic timer, 0 is stop or 1 time and // *Times: 5 DWORD Array, Cyclic times, 0 is always contiune // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetCyclicSYNCInfo(BYTE ComPort, WORD *Cobid, WORD *Timer, DWORD *Times, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_ChangeEMCYID // Description: Change EMCY ID // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Cobid: EMCY ID // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_ChangeEMCYID(BYTE ComPort, BYTE Node, WORD Cobid, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_SetEMCY_List (Virtual List) // Description: Set or Change EMCY ID from Master // The function only build a virtual EMCY ID let Master can control it. // The virtual EMCY ID is not the real one necessarily. // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // Cobid: PDO Cob ID // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_SetEMCY_List(BYTE ComPort, BYTE Node, WORD Cobid, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetEMCYID // Description: Get EMCY ID // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node // *Cobid: EMCY ID // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetEMCYID(BYTE ComPort, BYTE Node, WORD *Cobid, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.01 // Firmware Version: 2.01 // Function: I7565CPM_ReadLastEMCY // Description: Get last message of the slave node // Parameter: ComPort: I-7565-CPM USB Com Port // Node: Slave Node Id // *IsNew: Is new data, 0 is old data, 1 is new data // *Data: EMCY Data // BlockMode: Function Mode: Non-block function mode = 0, Block function mode = 1 //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_ReadLastEMCY(BYTE ComPort, BYTE Node, BYTE *IsNew, BYTE *RData, BYTE BlockMode); //////////////////////////////////////// // Driver Version: 2.02 // Firmware Version: 2.01 // Function: I7565CPM_GetBootUpNodeAfterAdd // Description: Get Boot up message after add node // Parameter: *ComPort: I-7565-CPM USB Com Port // *Node: Slave Node Id //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetBootUpNodeAfterAdd(BYTE *ComPort, BYTE *Node); // I7565CPM_InstallBootUpISR: // Driver Version: 2.02 // Firmware Version: 2.01 // After called I7565CPM_InstallBootUpISR to install Boot ISR function. // When the Master received a Boot up message send from other slave device witch // had been added to the Master by calling I7565CPM_AddNode, the Boot up ISR will be executed. I7565CPM_API WORD CALLBACK I7565CPM_InstallBootUpISR(BYTE ComPort, void (*BOOTISR)()); I7565CPM_API WORD CALLBACK I7565CPM_RemoveBootUpISR(BYTE ComPort); // I7565CPM_InstallRxSDOISR: // Driver Version: 2.00 // Firmware Version: 2.01 // After called I7565CPM_InstallEMCYISR to install EMCY ISR function. // When the Master received a EMCY message send from other slave device witch // had been added to the Master by calling I7565CPM_AddNode, the EMCY ISR will be executed. I7565CPM_API WORD CALLBACK I7565CPM_InstallEMCYISR(BYTE ComPort, void (*EMCYISR)()); I7565CPM_API WORD CALLBACK I7565CPM_RemoveEMCYISR(BYTE ComPort); // I7565CPM_InstallNMTErrISR: // Driver Version: 2.00 // Firmware Version: 2.01 // After called I7565CPM_InstallNMTErrISR to install NMTErr ISR function. // When the Master occured a Node_Guarding_Event or Heartbeat_Event, the NMTErr ISR will be executed. I7565CPM_API WORD CALLBACK I7565CPM_InstallNMTErrISR(BYTE ComPort, void (*NMTERRISR)()); I7565CPM_API WORD CALLBACK I7565CPM_RemoveNMTErrISR(BYTE ComPort); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetEMCYData // Description: Get EMCY data received from the I-7565-CPM // Parameter: *ComPort: I-7565-CPM USB Com Port // *Node: Slave Node Id // *Data: EMCY Data //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetEMCYData(BYTE *ComPort, BYTE *Node, BYTE *Data); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetNMTError // Description: Get NMT Error Control message from CANopen slave. // Parameter: *ComPort: I-7565-CPM USB Com Port // *Node: Slave Node Id // *NMTErrMode: Get NMT Error mode // If Node_Guarding_Event, Mode = CPM_Node_Guarding_Event // And if Heartbeat_Event, Mode = CPM_Heartbeat_Event //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetNMTError(BYTE *ComPort, BYTE *Node, BYTE *NMTErrMode); /////////////////////////////////////////////////////////////////////////////////////////////////// // Following ISR Funtions are only for Master with node id > 0. // It means if the "Node" parameter of I7565CPM_InitMaster is 0, the following functions will useless. /////////////////////////////////////////////////////////////////////////////////////////////////// // I7565CPM_InstallReadSDOISR: // Driver Version: 2.00 // Firmware Version: 2.01 // If the Master had called I7565CPM_InitMaster to initial Master with node n (128 > n > 0). // After installed I7565CPM_InstallReadSDOISR, when the Master received a Read RxSDO message (message Cob ID is 0x600+n) // and the Master will produce an interrupt to execute the RSDOISR ISR function. I7565CPM_API WORD CALLBACK I7565CPM_InstallReadSDOISR(BYTE ComPort, void (*RSDOISR)()); I7565CPM_API WORD CALLBACK I7565CPM_RemoveReadSDOISR(BYTE ComPort); // I7565CPM_InstallWriteSDOISR: // Driver Version: 2.00 // Firmware Version: 2.01 // If the Master had called I7565CPM_InitMaster to initial Master with node n (128 > n > 0). // After installed I7565CPM_InstallWriteSDOISR, when the Master received a Write RxSDO message (message Cob ID is 0x600+n) // and the Master will produce an interrupt to execute the WSDOISR ISR function. I7565CPM_API WORD CALLBACK I7565CPM_InstallWriteSDOISR(BYTE ComPort, void (*WSDOISR)()); I7565CPM_API WORD CALLBACK I7565CPM_RemoveWriteSDOISR(BYTE ComPort); // I7565CPM_InstallRxPDOISR: // Driver Version: 2.00 // Firmware Version: 2.01 // If the Master had called I7565CPM_InitMaster to initial Master with node n (128 > n > 0). // And if the Master also had called I7565CPM_InstallPDO_List to install a RxPDO to itself (ex: PDO Cob ID is 0x200+n). // After installed I7565CPM_InstallRxPDOISR, when the Master received the RxPDO message // and the Master will produce an interrupt to execute the RXPDOISR ISR function. I7565CPM_API WORD CALLBACK I7565CPM_InstallRxPDOISR(BYTE ComPort, void (*RXPDOISR)()); I7565CPM_API WORD CALLBACK I7565CPM_RemoveRxPDOISR(BYTE ComPort); // I7565CPM_InstallRemotePDOISR: // Driver Version: 2.00 // Firmware Version: 2.01 // If the Master had called I7565CPM_InitMaster to initial Master with node n (128 > n > 0). // And if the Master also had called I7565CPM_InstallPDO_List to install a TxPDO to itself (ex: PDO Cob ID is 0x180+n). // After installed I7565CPM_InstallRemotePDOISR, when the Master received the TxPDO message // and the Master will produce an interrupt to execute the REMOTEPDOISR ISR function. I7565CPM_API WORD CALLBACK I7565CPM_InstallRemotePDOISR(BYTE ComPort, void (*REMOTEPDOISR)()); I7565CPM_API WORD CALLBACK I7565CPM_RemoveRemotePDOISR(BYTE ComPort); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetMasterReadSDOEvent // Description: Get the Read SDO message for Master node id. // Parameter: *ComPort: I-7565-CPM USB Com Port // *Index: Index of Object Dectionary // *SubIndex: SubIndex of Object Dectionary //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetMasterReadSDOEvent(BYTE *ComPort, WORD *Index, BYTE *SubIndex); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetMasterWriteSDOEvent // Description: Get the Write SDO message for Master node id. // Parameter: *ComPort: I-7565-CPM USB Com Port // *Index: Index of Object Dectionary // *SubIndex: SubIndex of Object Dectionary // *WLen: Write Data Length // *WData: Write Data //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetMasterWriteSDOEvent(BYTE *ComPort, WORD *Index, BYTE *SubIndex, BYTE *WLen, BYTE *WData); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_ResponseMasterSDO // Description: Response SDO message from I7565CPM // Parameter: ComPort: I-7565-CPM USB Com Port // ResType: Response read/write to SDO message (0 is read response, 1 is write response) // Index: Response Index of Object Dectionary // SubIndex: Response SubIndex of Object Dectionary // Len: Response data length (0 ~ 4) (Note: Write response must 0-byte) // *Data: Response data array (max. 4-bytes) //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_ResponseMasterSDO(BYTE ComPort, BYTE ResType, WORD Index, BYTE SubIndex, BYTE Len, BYTE *Data); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetMasterRemotePDOEvent // Description: Get the Remote PDO message for Master's PDO COB-ID. // Parameter: *ComPort: I-7565-CPM USB Com Port // *CobId: PDO Cob Id //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetMasterRemotePDOEvent(BYTE *ComPort, WORD *CobId); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_GetMasterRxPDOEvent // Description: Get the Write PDO message for Master's PDO COB-ID. // Parameter: *ComPort: I-7565-CPM USB Com Port // *CobId: PDO Cob Id // *WLen: Write Data Length // *WData: Write Data //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_GetMasterRxPDOEvent(BYTE *ComPort, WORD *CobId, BYTE *WLen, BYTE *WData); //////////////////////////////////////// // Driver Version: 2.00 // Firmware Version: 2.01 // Function: I7565CPM_ResponseMasterPDO // Description: Response remote PDO message from I7565CPM // Parameter: ComPort: I-7565-CPM USB Com Port // CobId: Response remote PDO Cob Id // Len: Response data length (1 ~ 8) // *Data: Response data array (max. 8-bytes) //////////////////////////////////////// I7565CPM_API WORD CALLBACK I7565CPM_ResponseMasterPDO(BYTE ComPort, WORD CobId, BYTE Len, BYTE *Data); #endif // __I7565_CPM_HEADER__