canopen函数

更新时间:2024-01-02 10:22:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

用于Search the SDO Response table,有要请求信息的索引号返回该索引号,无则返回255 /************************************************************************** DOES: Search the SDO Response table for a specifc index and subindex. RETURNS: 255 if not found, otherwise the number of the record found (staring at zero)

**************************************************************************/ UNSIGNED8 MCO_Search_OD (

UNSIGNED16 index, // Index of OD entry searched UNSIGNED8 subindex // Subindex of OD entry searched )

/************************************************************************** DOES: Generates an SDO Abort Response 产生一个SDO错误应答 RETURNS: nothing

**************************************************************************/ void MCO_Send_SDO_Abort (

UNSIGNED32 ErrorCode // 4 byte SDO abort error code )

/************************************************************************** DOES: Handle an incoimg SDO request. 处理an incoimg SDO request RETURNS: returns 1 if SDO access success, returns 0 if SDO abort generated

**************************************************************************/ UNSIGNED8 MCO_Handle_SDO_Request (

UNSIGNED8 *pData // pointer to 8 data bytes with SDO data )

/************************************************************************** DOES: Called when going into the operational mode.

Prepares all TPDOs for operational.对所有TPDOs预处理 RETURNS: nothing

**************************************************************************/ void MCO_Prepare_TPDOs (

void )

/************************************************************************** DOES: Called when a TPDO needs to be transmitted 传送一个PDO RETURNS: nothing

**************************************************************************/ void MCO_TransmitPDO (

UNSIGNED8 PDONr // PDONr要传送的TPDO号,0~4 )

/************************************************************************** PUBLIC FUNCTIONS

***************************************************************************/

/************************************************************************** DOES: Initializes the MicroCANopen stack 初始化CANopen It must be called from within MCOUSER_ResetApplication RETURNS: nothing

**************************************************************************/ void MCO_Init (

UNSIGNED16 Baudrate, // CAN baudrate in kbit (1000,800,500,250,125,50,25 or 10) UNSIGNED8 Node_ID, // CANopen node ID (1-126)

UNSIGNED16 Heartbeat // Heartbeat time in ms (0 for none) )

本文来源:https://www.bwwdw.com/article/cn5x.html

Top