⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 objacces.h

📁 This library is Copyright (c) Raphael Zulliger <zulli@gmx.net>. It is licensed under the GNU L
💻 H
字号:
/***************************************************************************                         objacces.h  -  description                             -------------------    begin                : Fri May 17 2002    copyright            : (C) 2002 by Raphael Zulliger    email                : zulli@hsr.ch ***************************************************************************//*************************************************************************** *                                                                         * *   This library is Copyright (c) Raphael Zulliger <zulli@gmx.net>.       * *   It is licensed under the GNU Library General Public License (LGPL).   * *                                                                         * ***************************************************************************//** \file *  \brief Responsible for accessing the object dictionary. * *  This file contains functions for accessing the object dictionary and *  variables that are contained by the object dictionary. *  Accessing the object dictionary contains setting local variables *  as PDOs and accessing (read/write) all entries of the object dictionary *  \warning Only the basic entries of an object dictionary are included *           at the moment. */#ifndef __objacces_h__#define __objacces_h__#include <def.h>/** Reads an entry from the object dictionary.\n *  \code *  // Example usage: *  BYTE XHUGE *pbData; *  DWORD Length; *  DWORD returnValue; * *  returnValue = getODEntry( (WORD)0x100B, (BYTE)0, (void XHUGE* XDATA*)&pbDaten, (DWORD XDATA*)&Length ); *  if( returnValue != SUCCESSFUL ) *  { *      // error handling *  } *  \endcode *  \param wIndex The index in the object dictionary where you want to read *                an entry *  \param bSubindex The subindex of the Index. e.g. mostly subindex 0 is *                   used to tell you how many valid entries you can find *                   in this index. Look at the canopen standard for further *                   information *  \param ppbData Pointer to the pointer which points to the variable where *                 the value of this object dictionary entry should be copied *  \param pdwSize This function writes the size of the copied value (in Byte) *                 into this variable. *  \return SUCCESSFUL or NO_SUCH_INDEX */BYTE getODEntry( WORD wIndex,                 BYTE bSubindex,                 void XHUGE* XDATA* ppbData,                 DWORD XDATA* pdwSize );/** Defines a variable as a PDO. example: you have a temperature capture *  system connected with your system, so the temperatur could be a process *  variable (PDO = Process Data Object), which has to be sent to foreign *  nodes. In this case, you should set the temperature variable by this *  function * *  \code *  // Example usage: *  BYTE bTemp;\n *  BYTE* pBTemp;\n *  BYTE  returnValue; * *  pBTemp = &bTemp; * *  returnValue = setVariable( (WORD)0x6000, (BYTE)1, &pBTemp ); *  if( returnValue != SUCCESSFUL ) *  { *       // error *  } *  \endcode *  \param wIndex The index in the object dictionary where this variable *               should be put. *  \param bSubindex The subindex of the Index, where this variable has *                   to be set. *  \param ppvLocation The pointer to the pointer which points to the *                     variable (the one that should be used as PDO) *  \return SUCCESSFUL or NO_SUCH_INDEX */BYTE setVariable( WORD wIndex,                  BYTE bSubindex,                  void XHUGE* XDATA* ppvLocation );/** By this function you can write an entry into the object dictionary\n *  \code *  // Example usage: *  BYTE B; *  B = 0xff; // set transmission type * *  retcode = Put_Obj( (WORD)0x1800, (BYTE)2, &B, siezof(BYTE) ); *  \endocde *  \param wIndex The index in the object dictionary where you want to write *                an entry *  \param bSubindex The subindex of the Index. e.g. mostly subindex 0 is *                   used to tell you how many valid entries you can find *                   in this index. Look at the canopen standard for further *                   information *  \param pbData Pointer to the variable that holds the value that should *                 be copied into the object dictionary *  \param dwSize The size of the value (in Byte). *  \return SUCCESSFUL or NO_SUCH_INDEX */BYTE setODEntry( WORD wIndex,                 BYTE bSubindex,                 void XHUGE* pbData,                 DWORD dwSize );#endif // __objacces_h__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -