Device Parameter Access

Overview

This group defines all functions for access of device parameters in a common way.

Each device contains an object dictionary. An object dictionary contains all objects (device parameters) that can be accessed via CSI. An object is identified by its index and subindex.

+ Collaboration diagram for Device Parameter Access:

Functions

CSI_API long CsiDevReadLargeObject (struct CsiDev *pDev, uint16_t ObjDicIdx, uint8_t ObjDicSub, void *pDataBuffer, uint16_t BufferSize)
 This function reads object dictionary entries with a data size > 4 bytes. More...
 
CSI_API long CsiDevReadObject (struct CsiDev *pDev, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t *pRxDWord)
 This function reads up to 4 bytes of data from device object dictionary. More...
 
CSI_API long CsiDevWriteLargeObject (struct CsiDev *pDev, uint16_t ObjDicIdx, uint8_t ObjDicSub, void *pDataBuffer, uint32_t DataSize, CsiDataTransferCallback Callback)
 This function writes object dictionary entries with a data size > 4 bytes. More...
 
CSI_API long CsiDevWriteObject (struct CsiDev *pDev, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t TxDWord)
 This function writes up to 4 bytes of data into device object dictionary. More...
 

Function Documentation

CSI_API long CsiDevReadLargeObject ( struct CsiDev pDev,
uint16_t  ObjDicIdx,
uint8_t  ObjDicSub,
void *  pDataBuffer,
uint16_t  BufferSize 
)

This function reads object dictionary entries with a data size > 4 bytes.

Parameters
[in]pDevDevice to read data from
[in]ObjDicIdxIndex into device object dictionary
[in]ObjDicSubSub entry of object dictionary entry
[in]pDataBufferStores the data
[in]BufferSizeSize of the buffer given in pDataBuffer
Return values
>=0 Data bytes stored into buffer
<0Error code
179 {
180  return CsiBusReadLargeData(pDev->pBus, pDev->NodeId, ObjDicIdx, ObjDicSub,
181  (uint8_t*)pDataBuffer, BufferSize);
182 }
struct CsiBus * pBus
the bus object the device is attached to
Definition: csi_types.h:90
long CsiBusReadLargeData(struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint8_t *pDataBuffer, uint16_t BufferSize)
Use this function if you need to read more than 4 bytes of data.
Definition: csi_bus.c:448
uint8_t NodeId
the node identifier for this device
Definition: csi_types.h:91

+ Here is the call graph for this function:

CSI_API long CsiDevReadObject ( struct CsiDev pDev,
uint16_t  ObjDicIdx,
uint8_t  ObjDicSub,
uint32_t *  pRxDWord 
)

This function reads up to 4 bytes of data from device object dictionary.

Parameters
[in]pDevDevice to read data from
[in]ObjDicIdxIndex into device object dictionary
[in]ObjDicSubSub entry of object dictionary entry
[in]pRxDWordPoints to DWord buffer for storage of received data
Returns
Error code - ERR_NOERR indicates success

Referenced by Nem_GetAxisLen(), Nem_GetDevCfg(), Nem_GetHomeOffset(), Nem_GetPosIs(), NemGetLastDevErr(), NemReadStatusWord(), NemV4DevInit(), NemV4EnableForceMonitoring(), NemV4GetLastDevErr(), NemV4GetPosIs(), NemV4ReadAnalogInput(), NemV4ReadDigitalInputs(), and NemV4ReadStatusWord().

161 {
162  if (CSI_SERIAL_PROTOCOL_V1 == pDev->SerProtocolVersion)
163  {
164  return CsiBusReadData(pDev->pBus, pDev->NodeId, ObjDicIdx, ObjDicSub, pRxDWord);
165  }
166  else
167  {
168  return CsiBusReadDataV2(pDev->pBus, pDev->NodeId, ObjDicIdx, ObjDicSub, pRxDWord);
169  }
170 }
long CsiBusReadData(struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t *pRxDWord)
This function reads up to 4 bytes of data from device object dictionary.
Definition: csi_bus.c:602
long CsiBusReadDataV2(struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t *pRxDWord)
This function reads up to 4 bytes of data from device object dictionary using the new serial protocol...
Definition: csi_bus.c:896
enum CsiSerialProtocolVersion SerProtocolVersion
the serial protocol version to use for this device
Definition: csi_types.h:92
struct CsiBus * pBus
the bus object the device is attached to
Definition: csi_types.h:90
uint8_t NodeId
the node identifier for this device
Definition: csi_types.h:91

+ Here is the call graph for this function:

CSI_API long CsiDevWriteLargeObject ( struct CsiDev pDev,
uint16_t  ObjDicIdx,
uint8_t  ObjDicSub,
void *  pDataBuffer,
uint32_t  DataSize,
CsiDataTransferCallback  Callback 
)

This function writes object dictionary entries with a data size > 4 bytes.

Parameters
[in]pDevDevice to write to
[in]ObjDicIdxIndex into device object dictionary
[in]ObjDicSubSub entry of object dictionary entry
[in]pDataBufferStores the data
[in]DataSizeSize of the data given in pDataBuffer
[in]CallbackA callback function that will be called after each packet that has been transfered (e.g. to show a progress bar)
Returns
Error code - ERR_NOERR indicates success
211 {
212  return CsiBusWriteLargeData(pDev->pBus, pDev->NodeId, ObjDicIdx, ObjDicSub,
213  (uint8_t*)pDataBuffer, DataSize, Callback);
214 }
long CsiBusWriteLargeData(struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint8_t *pDataBuffer, uint32_t DataSize, CsiDataTransferCallback Callback)
Use this function if you need to write more than 4 bytes of data.
Definition: csi_bus.c:523
struct CsiBus * pBus
the bus object the device is attached to
Definition: csi_types.h:90
uint8_t NodeId
the node identifier for this device
Definition: csi_types.h:91

+ Here is the call graph for this function:

CSI_API long CsiDevWriteObject ( struct CsiDev pDev,
uint16_t  ObjDicIdx,
uint8_t  ObjDicSub,
uint32_t  TxDWord 
)

This function writes up to 4 bytes of data into device object dictionary.

Parameters
[in]pDevDevice to write to
[in]ObjDicIdxIndex into device object dictionary
[in]ObjDicSubSub entry of object dictionary entry
[in]TxDWordPoints to DWord that contains data to write
Returns
Error code - ERR_NOERR indicates success

Referenced by Nem_ClearErrHist(), Nem_MoveToPos(), Nem_SetControlWord(), Nem_SetHomePos(), Nem_SetHomingMode(), Nem_SetHomingSpeed(), Nem_SetOpMode(), NemSwitchValve(), NemV4_ClearErrHist(), NemV4_SetControlWord(), NemV4_SetOpMode(), NemV4EnableForceMonitoring(), NemV4MoveToPos(), NemV4WriteDigitalOutputs(), and NemV4WriteForceLimit().

192 {
193  if (CSI_SERIAL_PROTOCOL_V1 == pDev->SerProtocolVersion)
194  {
195  return CsiBusWriteData(pDev->pBus, pDev->NodeId, ObjDicIdx, ObjDicSub, TxDWord);
196  }
197  else
198  {
199  return CsiBusWriteDataV2(pDev->pBus, pDev->NodeId, ObjDicIdx, ObjDicSub, TxDWord);
200  }
201 }
long CsiBusWriteDataV2(struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t TxDWord)
This function writes up to 4 bytes of data into device object dictionary using the new serial protoco...
Definition: csi_bus.c:909
enum CsiSerialProtocolVersion SerProtocolVersion
the serial protocol version to use for this device
Definition: csi_types.h:92
struct CsiBus * pBus
the bus object the device is attached to
Definition: csi_types.h:90
long CsiBusWriteData(struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t TxDWord)
This function writes up to 4 bytes of data into device object dictionary.
Definition: csi_bus.c:615
uint8_t NodeId
the node identifier for this device
Definition: csi_types.h:91

+ Here is the call graph for this function: