Software Library API naibrd 2.24.0
See all documentation at naii.docs.com
naibrd_pb.c File Reference

Typedefs

typedef uint32_t naibrd_pb_gen5_config_ctrl_t
 
typedef uint32_t naibrd_pb_gen5_oper_ctrl_t
 
typedef uint32_t naibrd_pb_gen5_diag_ctrl_t
 

Functions

static nai_status_t naibrd_InitiatePBCommand (int32_t cardIndex, int32_t module, int32_t registerOffset, int32_t cmdID, bool_t waitForCompletion)
 Responsible for initiating the desired PB command and wating for completion if told to wait.
 
static bool_t naibrd_PB_LastFunctionCallPassed (int32_t cardIndex, int32_t module, int32_t *p_outpbStatus)
 Responsible for determining if the last function call actually passed or not.
 
NAIBRDFUNC int32_t NAIAPI naibrd_PB_GetChannelCount (uint32_t modId)
 Retrieves the number of channels for the specified PB Module ID.
 
NAIBRDFUNC int32_t NAIAPI naibrd_PB_GetChannelCountForModule (uint32_t cardIndex, uint32_t module)
 Returns the number of channels for the specified card and Module.
 
NAIBRDFUNC int32_t NAIAPI naibrd_PB_GetMaxFIFOCount (uint32_t modId)
 Returns the max FIFO count for the specified PB Module ID.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_BusParamReconfiguration (int32_t cardIndex, int32_t module, int32_t busParam, int32_t field1Value, int32_t field2Value)
 Responsible for allowing for the modification of 3 bus values: Setting a new Master State, a new highest active address or new min slave interval values.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetAndEnableMaxCycleCounter (int32_t cardIndex, int32_t module, int32_t maxCycleCount)
 Sets the number of data cycles that will take place prior to the bus being placed offline.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_StartReconfiguration (int32_t cardIndex, int32_t module, int32_t startReconfig)
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetPollCycleMode (int32_t cardIndex, int32_t module, int32_t pollCycleMode)
 Specifies if the poll cycle is Asynchronous or Synchronous.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetBusParams (int32_t cardIndex, int32_t module, NAIBRD_PB_BUS_PARAMS *p_busParams)
 Responsible for configuring the bus with new parameter values.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetNewIOConfig (int32_t cardIndex, int32_t module, int32_t slaveAddr, int32_t cfgDataLength, int8_t *p_cfgData)
 Assigns a new IO configuration.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetDynamicBusParams (int32_t cardIndex, int32_t module, int32_t stationAddr, int32_t maxRetryLimit, int32_t tSlot, int32_t maxTsdr)
 Responsible for performing a "bump-free" alteration of the bus parameters during operation. Thus parameters can be optimized while operation is going on. This function must be used with care since communication errors may occur if wrong bus parameters have been selected. The profibus DP application receives no feedback about successful alteration of bus parameters nor about invalid data. Any invalid bus parameters are ignored and no changes will be performed.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetSystemTime (int32_t cardIndex, int32_t module, uint32_t clockStatus, uint32_t sysTimeSeconds, uint32_t sysTimeNanoSeconds)
 A new reference time is passed to the PROFIBUS-DP Master configured as the time master. This reference time is then automatically distributed in the system. If there is a time master with a lower station address on the bus, it will assume the responsibility for time synchronization, and the PROFIBUS-DP Protocol Software will change to the time slave mode. In this case, the setting of a new system time by the PROFIBUS-DP Application is ignored and the system time of the current time master is used. In case the latter should fail, the PROFIBUS-DP Protocol Software changes back to the time master mode.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetPowerEnableForSegments (int32_t cardIndex, int32_t module, uint32_t powerEnable)
 Responsible for turning on the power supplies for the segments. Segments 1 - 8 share 4 power supplies. Segments 1 and 2 are powered by 1 power supply, Segments 2 and 4 by another and so on. The Aux segment is powered by its own power supply.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetTerminationEnableForSegments (int32_t cardIndex, int32_t module, uint32_t terminationEnable)
 Responsible for turning on/off termination for each segment.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetReceiverEnableForSegments (int32_t cardIndex, int32_t module, uint32_t receiverEnable)
 Responsible for turning on/off receiver for each segment.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_EnableSegmentForUse (int32_t cardIndex, int32_t module, int32_t segment, bool_t enable)
 This method enables a given segment for use which encompasses making sure the power supply tied to the segment is powered and the receiver for the given segment is on. NOTE: because the normal segments (all but Aux) each share a power supply with one other segment, when disabling a segment for use the power supply will not turn off when disabling a single segment. If conservation of power is needed, extra calls can be made to naibrd_PB_SetPowerEnableForSegments where banks of segments (2 segments per bank) can be turned off. For the Aux segment, power will be disabled when disabling the segment since the Aux segment has its own power supply. Valid Segments: 1, 2, 3, 4, 5, 6, 7, 8 and 0xFF for Aux.
 
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 bus communication.
 
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.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetMS0ConnectionStatus (int32_t cardIndex, int32_t module, int32_t slaveAddr, NAIBRD_PB_CONNECTION_STATUS *p_outconnectionStatus)
 Responsible for reporting the connection status.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetMS0ConnectionCounters (int32_t cardIndex, int32_t module, int32_t slaveAddr)
 Responsible for resetting connection counters for the given slave.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetAlarmCounters (int32_t cardIndex, int32_t module, int32_t slaveAddr, NAIBRD_PB_ALARM_COUNTERS *p_outalarmCounters)
 Responsible for returning alarm counter information for specified slave.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetAlarmCounters (int32_t cardIndex, int32_t module, int32_t slaveAddr)
 Responsible for resetting alarm counters for the specified slave.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetSlaveDiagnostics (int32_t cardIndex, int32_t module, int32_t slaveAddr, NAIBRD_PB_SLAVE_DIAGNOSTICS *p_outslaveDiagnostics)
 Responsible for retrieving slave diagnostic information for a given slave.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetCPULoad (int32_t cardIndex, int32_t module, NAIBRD_PB_CPU_LOAD *p_outcpuLoad)
 Responsible for reporting the load of the CPU.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_KickoffGetLiveList (int32_t cardIndex, int32_t module)
 Responsible for Kicking off the probing of the entire bus for slaves. NOTE: This probing / data collection can take several minutes to complete. Caller can make repeated calls to naibrd_PB_GetLiveListResults to see if task completed. If still in progress, an error indicating so will be returned.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetLiveListResults (int32_t cardIndex, int32_t module, NAIBRD_PB_LIVELIST_RESULTS *p_outliveListResults)
 Responsible for returning the results collected from making a call to naibrd_PB_KickoffGetLiveList. NOTE: The probing / data collection from the naibrd_PB_KickoffGetLiveList can take several minutes to complete. Caller can make repeated calls this function to see if task completed. If still in progress, an error indicating so will be returned. If the probing is finished, results will be returned in the NAIBRD_PB_LIVELIST_RESULTS struct.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetOperationMode (int32_t cardIndex, int32_t module, NAIBRD_PB_DPM_MASTER_STATE *p_outmasterState, NAIBRD_PB_DPM_OPERATION_MODE *p_outoperationMode)
 Responsible for returning the current mode of bus operation.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetStatistics (int32_t cardIndex, int32_t module, NAIBRD_PB_STATISTICS *p_outstatistics)
 Responsible for returning bus statistics.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetPSAKVersion (int32_t cardIndex, int32_t module, int32_t firmwareVersionMaxLength, char *p_outfirmwareVersion, int32_t psakVersionMaxLength, char *p_outpsakVersion)
 Responsible for returning the version of the underlying Profibus Software Access Kit (Softing).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetSystemTime (int32_t cardIndex, int32_t module, uint32_t *p_outclockStatus, uint32_t *p_outsysTimeSeconds, uint32_t *p_outsysTimeNanoSeconds)
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetLastAlarmData (int32_t cardIndex, int32_t module, int32_t slaveAddr, NAIBRD_PB_ALARM_DATA *p_outlastAlarmData)
 Responsible for returning the last alarm data that was detected.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetPowerEnableForSegments (int32_t cardIndex, int32_t module, uint32_t *p_outpowerEnable)
 Responsible for returning 32 bit value indicating which power supplies are currently enabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetTerminationEnableForSegments (int32_t cardIndex, int32_t module, uint32_t *p_outterminationEnable)
 Responsible for returning 32 bit value indicating which segments have termination enabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetReceiverEnableForSegments (int32_t cardIndex, int32_t module, uint32_t *p_outreceiverEnable)
 Responsible for returning 32 bit value indicating which segments have their receiver enabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetLockStatusForSegments (int32_t cardIndex, int32_t module, uint32_t *p_outlockStatus)
 Responsible for returning 32 bit value indicating which segments have been "locked" (i.e. forcibly taken offline)
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetLastFunctionCallStatus (int32_t cardIndex, int32_t module, int32_t *p_outpbStatus)
 Responsible for returning the the status of the last Profibus request that was made.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetTxFIFOCount (int32_t cardIndex, int32_t module, int32_t *p_outcount)
 Get the number of words used in the Tx FIFO.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetRxFIFOCount (int32_t cardIndex, int32_t module, int32_t *p_outcount)
 Get the number of words used in the Rx FIFO.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetTxFIFO (int32_t cardIndex, int32_t module)
 naibrd_PB_ResetTxFIFO forces the TX FIFO to be emptied without the need to force transmission to empty the FIFO.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetRxFIFO (int32_t cardIndex, int32_t module)
 naibrd_PB_ResetRxFIFO forces the RX FIFO to be emptied without the need to force receiving to empty the FIFO.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetTxAndRxFIFOs (int32_t cardIndex, int32_t module)
 naibrd_PB_ResetTxAndRxFIFOs forces the TX FIFO and RX FIFO to be emptied without the need to force transmitting and receiving to empty the FIFOs.
 

Typedef Documentation

◆ naibrd_pb_gen5_config_ctrl_t

typedef uint32_t naibrd_pb_gen5_config_ctrl_t

◆ naibrd_pb_gen5_diag_ctrl_t

typedef uint32_t naibrd_pb_gen5_diag_ctrl_t

◆ naibrd_pb_gen5_oper_ctrl_t

typedef uint32_t naibrd_pb_gen5_oper_ctrl_t

Function Documentation

◆ naibrd_InitiatePBCommand()

static nai_status_t naibrd_InitiatePBCommand ( int32_t cardIndex,
int32_t module,
int32_t registerOffset,
int32_t cmdID,
bool_t waitForCompletion )
static

Responsible for initiating the desired PB command and wating for completion if told to wait.

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]).
registerOffset: (Input)
cmdID: (Input) PB command to initiate
waitForCompletion: (Input) True indicates to wait; False indicates make request and return right away.
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_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_BusParamReconfiguration()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_BusParamReconfiguration ( int32_t cardIndex,
int32_t module,
int32_t busParam,
int32_t field1Value,
int32_t field2Value )

Responsible for allowing for the modification of 3 bus values: Setting a new Master State, a new highest active address or new min slave interval values.

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]).
busParam: (Input) Parameter to be reconfigured
  • 0 = New Master Address Value
  • 1 = New HSA (Highest Active Address value)
  • 2 = New Min Slave Interval Hi and New Min Slave Interval Lo
field1Value: (Input)
  • If busParam = 0 : field1Value = New Master Address
  • If busParam = 1 : field1Value = New HSA (Highest Active Address) Value
  • If busParam = 2 : field1Value = New Min Slave Interval Hi
field2Value: (Input)
  • If busParam = 2 : field2Value = New Min Slave Interval Lo
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_EnableSegmentForUse()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_EnableSegmentForUse ( int32_t cardIndex,
int32_t module,
int32_t segment,
bool_t enable )

This method enables a given segment for use which encompasses making sure the power supply tied to the segment is powered and the receiver for the given segment is on. NOTE: because the normal segments (all but Aux) each share a power supply with one other segment, when disabling a segment for use the power supply will not turn off when disabling a single segment. If conservation of power is needed, extra calls can be made to naibrd_PB_SetPowerEnableForSegments where banks of segments (2 segments per bank) can be turned off. For the Aux segment, power will be disabled when disabling the segment since the Aux segment has its own power supply. Valid Segments: 1, 2, 3, 4, 5, 6, 7, 8 and 0xFF for Aux.

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]).
segment: (Input) Segment number (1 - 8) or 0xFF (255) for Aug Segment
enable: (Input) True to enable segment, False to disable
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_GetAlarmCounters()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetAlarmCounters ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
NAIBRD_PB_ALARM_COUNTERS * p_outalarmCounters )

Responsible for returning alarm counter information for specified slave.

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
p_outalarmCounters: (Output) Structure containing alarm counter information
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_GetCPULoad()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetCPULoad ( int32_t cardIndex,
int32_t module,
NAIBRD_PB_CPU_LOAD * p_outcpuLoad )

Responsible for reporting the load of the CPU.

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]).
p_outcpuLoad: (Output) Pointer to structure containing CPU load information
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_GetLastAlarmData()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetLastAlarmData ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
NAIBRD_PB_ALARM_DATA * p_outlastAlarmData )

Responsible for returning the last alarm data that was detected.

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 target slave
p_outlastAlarmData: (Output) Pointer to struct containing last alarm data info
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetLastFunctionCallStatus()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetLastFunctionCallStatus ( int32_t cardIndex,
int32_t module,
int32_t * p_outpbStatus )

Responsible for returning the the status of the last Profibus request that was made.

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]).
p_outpbStatus: (Output)32 bit value indicating PB status of last PB request
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetLiveListResults()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetLiveListResults ( int32_t cardIndex,
int32_t module,
NAIBRD_PB_LIVELIST_RESULTS * p_outliveListResults )

Responsible for returning the results collected from making a call to naibrd_PB_KickoffGetLiveList. NOTE: The probing / data collection from the naibrd_PB_KickoffGetLiveList can take several minutes to complete. Caller can make repeated calls this function to see if task completed. If still in progress, an error indicating so will be returned. If the probing is finished, results will be returned in the NAIBRD_PB_LIVELIST_RESULTS struct.

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]).
p_outliveListResults: (Output) Pointer to struct containing the results of the bus probing for slaves.
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetLockStatusForSegments()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetLockStatusForSegments ( int32_t cardIndex,
int32_t module,
uint32_t * p_outlockStatus )

Responsible for returning 32 bit value indicating which segments have been "locked" (i.e. forcibly taken 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]).
p_outlockStatus: (Output)32 bit value indicating which segments have been locked: 1 indicates locked
  • D0 - Segment 1 locked
  • D1 - Segment 2 locked
  • D2 - Segment 3 locked
  • D3 - Segment 4 locked
  • D4 - Segment 5 locked
  • D5 - Segment 6 locked
  • D6 - Segment 7 locked
  • D7 - Segment 8 locked
  • D8 - Segment Aux locked
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetMS0ConnectionStatus()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetMS0ConnectionStatus ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
NAIBRD_PB_CONNECTION_STATUS * p_outconnectionStatus )

Responsible for reporting the connection status.

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
p_outconnectionStatus: (Output) Struct containing connection status information
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_GetOperationMode()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetOperationMode ( int32_t cardIndex,
int32_t module,
NAIBRD_PB_DPM_MASTER_STATE * p_outmasterState,
NAIBRD_PB_DPM_OPERATION_MODE * p_outoperationMode )

Responsible for returning the current mode of bus operation.

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]).
p_outmasterState: (Output) Pointer to struct containing the current state of the master.
p_outoperationMode: (Output) Pointer to struct containing operation mode of bus.
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetPowerEnableForSegments()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetPowerEnableForSegments ( int32_t cardIndex,
int32_t module,
uint32_t * p_outpowerEnable )

Responsible for returning 32 bit value indicating which power supplies are currently enabled.

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]).
p_outpowerEnable: (Output)32 bit value indicating which power supplies are enabled: 1 indicates enable
  • D0: Enables power for segments 1 and 2
  • D1: Enables power for segments 3 and 4
  • D2: Enables power for segments 5 and 6
  • D3: Enables power for segments 7 and 8
  • D16: Enables power for segment Aux
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetPSAKVersion()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetPSAKVersion ( int32_t cardIndex,
int32_t module,
int32_t firmwareVersionMaxLength,
char * p_outfirmwareVersion,
int32_t psakVersionMaxLength,
char * p_outpsakVersion )

Responsible for returning the version of the underlying Profibus Software Access Kit (Softing).

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]).
firmwareVersionMaxLength: (Input) Max number characters allowed to be used for firmware version .
p_outfirmwareVersion: (Output) Buffer containing detected firmware version.
psakVersionMaxLength: (Input) Max number characters allowed to be used for psak version .
p_outpsakVersion: (Output) Buffer containing detected psak version.
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetReceiverEnableForSegments()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetReceiverEnableForSegments ( int32_t cardIndex,
int32_t module,
uint32_t * p_outreceiverEnable )

Responsible for returning 32 bit value indicating which segments have their receiver enabled.

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]).
p_outreceiverEnable: (Output)32 bit value indicating which segments have receivers enabled: 1 indicates enable
  • D0 - Enables receiver for segment 1
  • D1 - Enables receiver for segment 2
  • D2 - Enables receiver for segment 3
  • D3 - Enables receiver for segment 4
  • D4 - Enables receiver for segment 5
  • D5 - Enables receiver for segment 6
  • D6 - Enables receiver for segment 7
  • D7 - Enables receiver for segment 8
  • D8 - Enables receiver for segment Aux
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetRxFIFOCount()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetRxFIFOCount ( int32_t cardIndex,
int32_t module,
int32_t * p_outcount )

Get the number of words used in the Rx FIFO.

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]).
p_outcount: (Output) Number of words currently in the Rx FIFO.
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_GetSlaveDiagnostics()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetSlaveDiagnostics ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
NAIBRD_PB_SLAVE_DIAGNOSTICS * p_outslaveDiagnostics )

Responsible for retrieving slave diagnostic information for a given slave.

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
p_outslaveDiagnostics: (Output) Pointer to structure containing collected diagnostic information for given slave.
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_GetStatistics()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetStatistics ( int32_t cardIndex,
int32_t module,
NAIBRD_PB_STATISTICS * p_outstatistics )

Responsible for returning bus statistics.

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]).
p_outstatistics: (Output) Pointer to struct containing the collected statistics information.
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetSystemTime()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetSystemTime ( int32_t cardIndex,
int32_t module,
uint32_t * p_outclockStatus,
uint32_t * p_outsysTimeSeconds,
uint32_t * p_outsysTimeNanoSeconds )

◆ naibrd_PB_GetTerminationEnableForSegments()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetTerminationEnableForSegments ( int32_t cardIndex,
int32_t module,
uint32_t * p_outterminationEnable )

Responsible for returning 32 bit value indicating which segments have termination enabled.

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]).
p_outterminationEnable: (Output)32 bit value indicating which segments have termination enabled: 1 indicates enable
  • D0: Enables termination for segment 1
  • D1: Enables termination for segment 2
  • D2: Enables termination for segment 3
  • D3: Enables termination for segment 4
  • D4: Enables termination for segment 5
  • D5: Enables termination for segment 6
  • D6: Enables termination for segment 7
  • D7: Enables termination for segment 8
  • D8: Enables termination for segment Aux
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.
  • NAI_ERROR_FUNCTION_SPECIFIC_ERROR : caller can call naibrd_PB_GetLastFunctionCallStatus to get PB specific error.

◆ naibrd_PB_GetTxFIFOCount()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_GetTxFIFOCount ( int32_t cardIndex,
int32_t module,
int32_t * p_outcount )

Get the number of words used in the Tx FIFO.

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]).
p_outcount: (Output) Number of words currently in the Tx FIFO.
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 bus communication.

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_KickoffGetLiveList()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_KickoffGetLiveList ( int32_t cardIndex,
int32_t module )

Responsible for Kicking off the probing of the entire bus for slaves. NOTE: This probing / data collection can take several minutes to complete. Caller can make repeated calls to naibrd_PB_GetLiveListResults to see if task completed. If still in progress, an error indicating so will be returned.

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_LastFunctionCallPassed()

static bool_t naibrd_PB_LastFunctionCallPassed ( int32_t cardIndex,
int32_t module,
int32_t * p_outpbStatus )
static

Responsible for determining if the last function call actually passed or not.

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]).
p_outpbStatus: (Input) Indicates actual PB status (as opposed to naibrd_status_t) from last function call request
Returns
True if last function passed; False if last function failed

◆ 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_ResetAlarmCounters()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetAlarmCounters ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr )

Responsible for resetting alarm counters for the specified slave.

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
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_ResetMS0ConnectionCounters()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetMS0ConnectionCounters ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr )

Responsible for resetting connection counters for the given slave.

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
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_ResetRxFIFO()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetRxFIFO ( int32_t cardIndex,
int32_t module )

naibrd_PB_ResetRxFIFO forces the RX FIFO to be emptied without the need to force receiving to empty the FIFO.

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_ResetTxAndRxFIFOs()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetTxAndRxFIFOs ( int32_t cardIndex,
int32_t module )

naibrd_PB_ResetTxAndRxFIFOs forces the TX FIFO and RX FIFO to be emptied without the need to force transmitting and receiving to empty the FIFOs.

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_ResetTxFIFO()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_ResetTxFIFO ( int32_t cardIndex,
int32_t module )

naibrd_PB_ResetTxFIFO forces the TX FIFO to be emptied without the need to force transmission to empty the FIFO.

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_SetAndEnableMaxCycleCounter()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetAndEnableMaxCycleCounter ( int32_t cardIndex,
int32_t module,
int32_t maxCycleCount )

Sets the number of data cycles that will take place prior to the bus being placed 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]).
maxCycleCount: (Input) Number of data cycles to be completed before the bus is placed offline
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_SetBusParams()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetBusParams ( int32_t cardIndex,
int32_t module,
NAIBRD_PB_BUS_PARAMS * p_busParams )

Responsible for configuring the bus with new parameter values.

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]).
p_busParams: (Input) Pointer to struct containing configurable bus parameters. See description of NAIBRD_PB_BUS_PARAMS in naibrd_pb.h
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_SetDynamicBusParams()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetDynamicBusParams ( int32_t cardIndex,
int32_t module,
int32_t stationAddr,
int32_t maxRetryLimit,
int32_t tSlot,
int32_t maxTsdr )

Responsible for performing a "bump-free" alteration of the bus parameters during operation. Thus parameters can be optimized while operation is going on. This function must be used with care since communication errors may occur if wrong bus parameters have been selected. The profibus DP application receives no feedback about successful alteration of bus parameters nor about invalid data. Any invalid bus parameters are ignored and no changes will be performed.

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]).
stationAddr: (Input) Specifies the station address of the PROFIBUS-DP Master in the bus system.
maxRetryLimit: (Input) The maximum number of frame repetitions indicates how often, after the end of the slot time, the PROFIBUS-DP Master will repeat a request before marking the responder as not reachable.
tSlot: (Input) Slot time is the maximum time that the master (requester/initiator) has to wait for the first byte of either the response or a frame from the token receiver after a token exchange.
maxTsdr: (Input) The maxTsdr is the time after which the sink must have processed a request and sent a response, if applicable, i.e. the waiting time of the master after an unacknowledged request. The valid range lies between 37 and 65535
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_SetNewIOConfig()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetNewIOConfig ( int32_t cardIndex,
int32_t module,
int32_t slaveAddr,
int32_t cfgDataLength,
int8_t * p_cfgData )

Assigns a new IO configuration.

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 target slave
cfgDataLength: (Input) Length (count of bytes) of configuration data being sent
p_cfgData: (Input) pointer to buffer of configuration bytes
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_SetPollCycleMode()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetPollCycleMode ( int32_t cardIndex,
int32_t module,
int32_t pollCycleMode )

Specifies if the poll cycle is Asynchronous or Synchronous.

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]).
pollCycleMode: (Input) 0 = Asynchronous poll cycle mode; 1 = Synchronous poll cycle mode NOTE: Asynchronous poll cycle mode is a free running polling cycle without synchronicity with the application - only controlled by the configured minimum slave interval. Synchronous poll cycle mode - the application controls the start of the new polling cycle. This, however, may not violate the configured minimum slave interval. This mode is not possible if isochronous data is configured.
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_SetPowerEnableForSegments()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetPowerEnableForSegments ( int32_t cardIndex,
int32_t module,
uint32_t powerEnable )

Responsible for turning on the power supplies for the segments. Segments 1 - 8 share 4 power supplies. Segments 1 and 2 are powered by 1 power supply, Segments 2 and 4 by another and so on. The Aux segment is powered by its own power supply.

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]).
powerEnable: (Input) Specifies which segments will be powered.
  • D0: Enables power for segments 1 and 2
  • D1: Enables power for segments 3 and 4
  • D2: Enables power for segments 5 and 6
  • D3: Enables power for segments 7 and 8
  • D16: Enables power for segment Aux
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_SetReceiverEnableForSegments()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetReceiverEnableForSegments ( int32_t cardIndex,
int32_t module,
uint32_t receiverEnable )

Responsible for turning on/off receiver for each segment.

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]).
receiverEnable: (Input) Specifies which segments will have receivers enabled.
  • D0: Enables receiver for segment 1
  • D1: Enables receiver for segment 2
  • D2: Enables receiver for segment 3
  • D3: Enables receiver for segment 4
  • D4: Enables receiver for segment 5
  • D5: Enables receiver for segment 6
  • D6: Enables receiver for segment 7
  • D7: Enables receiver for segment 8
  • D8: Enables receiver for segment Aux
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_SetSystemTime()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetSystemTime ( int32_t cardIndex,
int32_t module,
uint32_t clockStatus,
uint32_t sysTimeSeconds,
uint32_t sysTimeNanoSeconds )

A new reference time is passed to the PROFIBUS-DP Master configured as the time master. This reference time is then automatically distributed in the system. If there is a time master with a lower station address on the bus, it will assume the responsibility for time synchronization, and the PROFIBUS-DP Protocol Software will change to the time slave mode. In this case, the setting of a new system time by the PROFIBUS-DP Application is ignored and the system time of the current time master is used. In case the latter should fail, the PROFIBUS-DP Protocol Software changes back to the time master mode.

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]).
clockStatus: (Input) Contains the resolution, the time zone, the daylight saving time adjustment and status information supplied to the PROFIBUS-DP Protocol Software. For available bit options that can be logically OR'ed together see naibrd_pb.h
sysTimeSeconds: (Input) Specifies the current second according to UTC; 0 corresponds to 01/01/1900
sysTimeNanoSeconds: (Input) Specifies the current nanosecond in multiples of 232 picoseconds
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_SetTerminationEnableForSegments()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_SetTerminationEnableForSegments ( int32_t cardIndex,
int32_t module,
uint32_t terminationEnable )

Responsible for turning on/off termination for each segment.

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]).
terminationEnable: (Input) Specifies which segments will be terminated.
  • D0: Enables termination for segment 1
  • D1: Enables termination for segment 2
  • D2: Enables termination for segment 3
  • D3: Enables termination for segment 4
  • D4: Enables termination for segment 5
  • D5: Enables termination for segment 6
  • D6: Enables termination for segment 7
  • D7: Enables termination for segment 8
  • D8: Enables termination for segment Aux
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_StartReconfiguration()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PB_StartReconfiguration ( int32_t cardIndex,
int32_t module,
int32_t startReconfig )

Responsible for kicking off the reconfiguration process.

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]).
startReconfig: (Input) Value 0x01 starts reconfiguration. Any other value passed will not start reconfiguration
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.