Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

objacces.h File Reference

Responsible for accessing the object dictionary. More...

#include <def.h>

Go to the source code of this file.

Functions

BYTE getODEntry (WORD wIndex, BYTE bSubindex, void XHUGE *XDATA *ppbData, DWORD XDATA *pdwSize)
BYTE setVariable (WORD wIndex, BYTE bSubindex, void XHUGE *XDATA *ppvLocation)


Detailed Description

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.

Function Documentation

BYTE getODEntry WORD    wIndex,
BYTE    bSubindex,
void XHUGE *XDATA *    ppbData,
DWORD XDATA *    pdwSize
 

Reads an entry from the object dictionary.

  // 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
  }
Parameters:
wIndex  The index in the object dictionary where you want to read an entry
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
ppbData  Pointer to the pointer which points to the variable where the value of this object dictionary entry should be copied
pdwSize  This function writes the size of the copied value (in Byte) into this variable.
Returns :
SUCCESSFUL or NO_SUCH_INDEX

BYTE setVariable WORD    wIndex,
BYTE    bSubindex,
void XHUGE *XDATA *    ppvLocation
 

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

  // Example usage:
  BYTE bTemp;\n
  BYTE* pBTemp;\n
  BYTE  returnValue;

  pBTemp = &bTemp;

  returnValue = setVariable( (WORD)0x6000, (BYTE)1, &pBTemp );
  if( returnValue != SUCCESSFUL )
  {
       // error
  }
Parameters:
wIndex  The index in the object dictionary where this variable should be put.
bSubindex  The subindex of the Index, where this variable has to be set.
ppvLocation  The pointer to the pointer which points to the variable (the one that should be used as PDO)
Returns :
SUCCESSFUL or NO_SUCH_INDEX


Generated on Wed Dec 25 01:04:57 2002 for CANopen SlaveLib by doxygen1.2.17