Software Library API naibrd 1.62
See all documentation at naii.docs.com
Module Operation Functions

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ReadIOData (int32_t cardIndex, int32_t module, int32_t slaveAddr, int32_t offset, int32_t readCount, int8_t *p_outioData)
 Responsible for reading the cyclic data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_WriteIOData (int32_t cardIndex, int32_t module, int32_t slaveAddr, int32_t offset, int32_t numBytesToWrite, int8_t *p_bytesToWrite)
 Responsible for writing new values for cyclic data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_AcyclicRead (int32_t cardIndex, int32_t module, int32_t slaveAddr, int32_t slotNum, int32_t paramIndex, int32_t paramDataLength, int32_t *p_outdataCount, int8_t *p_outdata)
 Responsible for reading acyclic data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_AcyclicWrite (int32_t cardIndex, int32_t module, int32_t slaveAddr, int32_t slotNum, int32_t paramIndex, int32_t paramDataLength, int32_t *p_paramData)
 Responsible for writing acyclic data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_InitiateCommunication (int32_t cardIndex, int32_t module, int32_t slaveAddr, int32_t commRef, int32_t maxTimeoutInMS)
 Responsible for initiating a communication request.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_AbortCommunication (int32_t cardIndex, int32_t module, int32_t slaveAddr, int32_t commRef)
 Responsible for aborting all communication on the bus to and from specified slave address.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetOffline (int32_t cardIndex, int32_t module, int32_t redMode)
 Responsible for putting the entire bus offline.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetStop (int32_t cardIndex, int32_t module)
 Responsible for stopping bus communication. The master exchanges the token with other masters in the network. If there is no further master available in the PROFIBUS network the master sends the token to itself. There is no data exchange between the master and the slaves.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetClear (int32_t cardIndex, int32_t module, int32_t redMode)
 When the bus is forced into "clear" mode, only input data of the connected slaves are read but no output data is passed on to the peripherals.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetOperate (int32_t cardIndex, int32_t module, int32_t redMode)
 Responsible for putting the bus in operate mode. Process data is transferred between the master and the slaves. The current input data is read cyclically and new output data is written.
 

Detailed Description


Function Documentation

◆ naibrd_PB_AbortCommunication()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_AbortCommunication ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
int32_t commRef )

Responsible for aborting all communication on the bus to and from specified slave address.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
slaveAddr: (Input) Address of slave target
commRef: (Input)
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PB_AcyclicRead()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_AcyclicRead ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
int32_t slotNum,
int32_t paramIndex,
int32_t paramDataLength,
int32_t * p_outdataCount,
int8_t * p_outdata )

Responsible for reading acyclic data.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
slaveAddr: (Input) Address of slave target
slotNum: (Input) Number of the slot whose data are to be read
paramIndex: (Input) Index of parameter to read
paramDataLength: (Input) Number of Bytes to be read from acyclic param
p_outdataCount: (Output) Number of Bytes to actually read from acyclic param
p_outdata: (Output) Byte buffer storing data read
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PB_AcyclicWrite()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_AcyclicWrite ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
int32_t slotNum,
int32_t paramIndex,
int32_t paramDataLength,
int32_t * p_paramData )

Responsible for writing acyclic data.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
slaveAddr: (Input) Address of slave target
slotNum: (Input) Number of the slot whose data are to be written
paramIndex: (Input) Index of parameter to write
paramDataLength: (Input) Number of Bytes to write to acyclic param
p_paramData: (Output) Bytes of Data to be written
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PB_InitiateCommunication()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_InitiateCommunication ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
int32_t commRef,
int32_t maxTimeoutInMS )

Responsible for initiating a communication request.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
slaveAddr: (Input) Address of slave target
commRef: (Input) The communication reference represents a logical communication channel to the service partner. In master mode it is always provided by the application.
maxTimeoutInMS: (Input)
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PB_ReadIOData()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ReadIOData ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
int32_t offset,
int32_t readCount,
int8_t * p_outioData )

Responsible for reading the cyclic data.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
slaveAddr: (Input) Address of slave target
offset: (Input) Byte Offset into slave buffer from which to retrieve data
readCount: (Input) Number of Bytes to be read
p_outioData: (Output) Byte buffer storing data read
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PB_SetClear()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetClear ( int32_t cardIndex,
int32_t module,
int32_t redMode )

When the bus is forced into "clear" mode, only input data of the connected slaves are read but no output data is passed on to the peripherals.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
redMode: (Input) Specifies redundancy mode or not
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PB_SetOffline()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetOffline ( int32_t cardIndex,
int32_t module,
int32_t redMode )

Responsible for putting the entire bus offline.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
redMode: (Input) Redundancy Mode
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PB_SetOperate()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetOperate ( int32_t cardIndex,
int32_t module,
int32_t redMode )

Responsible for putting the bus in operate mode. Process data is transferred between the master and the slaves. The current input data is read cyclically and new output data is written.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
redMode: (Input) Specified redundancy mode or not
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PB_SetStop()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetStop ( int32_t cardIndex,
int32_t module )

Responsible for stopping bus communication. The master exchanges the token with other masters in the network. If there is no further master available in the PROFIBUS network the master sends the token to itself. There is no data exchange between the master and the slaves.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PB_WriteIOData()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_WriteIOData ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
int32_t offset,
int32_t numBytesToWrite,
int8_t * p_bytesToWrite )

Responsible for writing new values for cyclic data.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
slaveAddr: (Input) Address of slave target
offset: (Input) Byte Offset into slave buffer from which to start writing data
numBytesToWrite: (Input) Number of bytes to write
p_bytesToWrite: (Output) Buffer of bytes to write
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.