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

📄 pb_if.h

📁 profibus dp主站于从站通信
💻 H
📖 第 1 页 / 共 4 页
字号:
FUNCTIONAL_DESCRIPTION

This function is used to send a Service-Request or a Service-Response
to a PROFIBUS service device.

IN:  hDevice                  -> device handle
IN:  pSdp                     -> pointer to SERVICE-DESCRIPTION-BLOCK
IN:  pData                    -> pointer to service specific data


Possible return values:

- E_OK                           -> no error occured

- E_IF_INVALID_LAYER             -> invalid layer
- E_IF_INVALID_SERVICE           -> invalid service identifier
- E_IF_INVALID_PRIMITIVE         -> invalid service primitive
- E_IF_RESOURCE_UNAVAILABLE      -> no resource available
- E_IF_NO_PARALLEL_SERVICES      -> no parallel services allowed
- E_IF_SERVICE_CONSTR_CONFLICT   -> service temporarily not executable
- E_IF_SERVICE_NOT_SUPPORTED     -> service not supported in subset
- E_IF_SERVICE_NOT_EXECUTABLE    -> service not executable

- E_IF_NO_CNTRL_RES              -> controller does not respond  (CMI_TIMEOUT)
- E_IF_INVALID_DATA_SIZE         -> not enough CMI memory available for REQ or RES
- E_IF_INVALID_PARAMETER         -> invalid wrong parameter in REQ or RES
- E_IF_CMI_ERROR                 -> serious CMI error
- E_IF_INVALID_CMI_CALL          -> invalid CMI call
- E_IF_OS_ERROR                  -> NT system error

-----------------------------------------------------------------------------*/
;



FUNCTION extern INT16 CALL_CONV profi_read_multi
         (
           OUT   T_PROFI_SERVICE_DESCR * pSdb,
           OUT   VOID                  * pData,
           INOUT USIGN16               * pDataLength,
           IN    USIGN16                 NrOfHandles,
           IN    HANDLE                * phDevices
          )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to receive a Service-Indication or a Service-Confirmation
from one ore more PROFIBUS service devices.

OUT:    pSdb           -> pointer to SERVICE-DESCRIPTION-BLOCK
OUT:    pData          -> pointer to data buffer
INOUT:  pDataLength    -> IN:   length of data buffer
                          OUT:  length of received data
IN:     NrOfHandles    -> number of device handles
IN:     phDevices      -> pointer to list of device handles

Possible return values:

- CON_IND_RECEIVED                 -> a confirmation or indication has been received
- NO_CON_IND_RECEIVED              -> no confirmation or indication has been received
- E_IF_NO_CNTRL_RES                -> controller does not respond
- E_IF_FATAL_ERROR                 -> unrecoverable error in PROTOCOL SW
- E_IF_CMI_ERROR                   -> serious CMI error
- E_IF_INVALID_DATA_SIZE           -> size of data block provided not sufficient
- E_IF_OS_ERROR                    -> NT system error
- E_IF_RESOURCE_UNAVAILABLE        -> no resource available

-----------------------------------------------------------------------------*/
;




FUNCTION extern INT16 CALL_CONV profi_read_data
         (
           IN    HANDLE    hDevice,
           OUT   VOID    * pData,
           OUT   USIGN16 * pDataLength
         )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to read DP-Slave-I/O-Data from a DP SLAVE DATA DEVICE.

IN:     hDevice           -> device handle
OUT:    pData             -> pointer to data buffer
OUT:    pDataLength       -> IN:   length of data buffer
                             OUT:  length of received data

Possible return values:
- E_OK                             -> no error occured
- E_IF_INVALID_DP_STATE            -> DP is not in operational state
- E_IF_SLAVE_ERROR                 -> no valid communication with DP-Slave
- E_IF_SLAVE_DIAG_DATA             -> new DP diagnostics data available
- E_IF_INVALID_CMI_CALL            -> invalid offset inside data image
- E_IF_CMI_ERROR                   -> serious CMI error
- E_IF_INVALID_DATA_SIZE           -> size of data block provided not sufficient
- E_IF_SERVICE_CONSTR_CONFLICT     -> service not executable at time
- E_IF_OS_ERROR                    -> NT system error

-----------------------------------------------------------------------------*/
;



FUNCTION extern INT16 CALL_CONV profi_write_data
         (
           IN HANDLE    hDevice,
           IN VOID    * pData,
           IN USIGN16   DataLength
         )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to write DP-Slave-I/O-Data to a DP SLAVE DATA DEVICE.

IN:  hDevice            -> device handle
IN:  pData              -> pointer to data buffer
IN:  DataLength         -> length of data to write

Possible return values:
- E_OK                             -> no error occured
- E_IF_INVALID_DP_STATE            -> DP is not in operational state
- E_IF_SLAVE_ERROR                 -> no valid communication with DP-Slave
- E_IF_SLAVE_DIAG_DATA             -> new DP diagnostics data available
- E_IF_INVALID_CMI_CALL            -> invalid offset inside data image
- E_IF_CMI_ERROR                   -> serious CMI error
- E_IF_INVALID_DATA_SIZE           -> size of data block provided not sufficient
- E_IF_SERVICE_CONSTR_CONFLICT     -> service not executable at time
- E_IF_OS_ERROR                    -> NT system error

-----------------------------------------------------------------------------*/
;




FUNCTION extern INT16 CALL_CONV profi_read_dps_data
         (
           IN    HANDLE   hDevice,
           OUT   USIGN8 * pData,
           INOUT USIGN8 * pDataLength,
           OUT   USIGN8 * pState
         )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to read data from CMI DPS_SLAVE_INPUT_IMAGE or
DPS_SLAVE_OUTPUT_IMAGE.

IN:     hDevice     -> device handle
OUT:    pData       -> destination buffer for input data
INOUT:  pDataLength -> IN:  length of destination buffer
                       OUT: number of bytes read
OUT:    pState      -> status of input or output data if read or write was successfully


Possible return values:
- E_OK                             -> no error occured
- E_IF_INVALID_CMI_CALL            -> invalid offset inside data image
- E_IF_CMI_ERROR                   -> serious CMI error
- E_IF_INVALID_DATA_SIZE           -> size of data block provided not sufficient
- E_IF_SERVICE_CONSTR_CONFLICT     -> service not executable at time
- E_IF_OS_ERROR                    -> NT system error

-----------------------------------------------------------------------------*/
;



FUNCTION extern INT16 CALL_CONV profi_write_dps_data
        (
          IN    HANDLE    hDevice,
          IN    USIGN8  * pData,
          IN    USIGN8    DataLength,
          OUT   USIGN8  * pState
        )

/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to write DP-Slave input data to DPS_SLAVE_INPUT_IMAGE

IN:   hDevice    -> device handle
IN:   pData      -> pointer to new input data
IN:   DataLength -> number bytes of input data
OUT:  pState     -> pointer to a status variable for the recent input data status

possible return values:
- E_OK                          -> OK
- E_IF_INVALID_DATA_SIZE        -> data_size does not match the expected input data size
- E_IF_OS_ERROR                 -> NT system error

-----------------------------------------------------------------------------*/
;



FUNCTION extern BOOL CALL_CONV profi_get_cntrl_info
         (
           IN  USIGN8   Board,
           OUT char*    pFirmwareVersion,
           OUT USIGN32* pSerialDeviceNumber
         )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to get the version of the firmware and the serial
device number of PROFIBUS controller.

IN:     Board                -> board number
OUT:    pFirmwareVersion     -> data buffer for firmware version string
OUT:    pSerialDeviceNumber  -> serial device number

NOTE: There must be at least 100 Bytes (VERSION_STRING_LENGTH) free space for
      firmware version buffer.

Possible return values:
- TRUE   -> function returns sucessfully
- FALSE  -> function returns not successfully

-----------------------------------------------------------------------------*/
;



FUNCTION extern BOOL CALL_CONV profi_set_timeout
         (
           IN HANDLE  hBasicMgmtDevice,
           IN USIGN32 ReadTimeout,
           IN USIGN32 WriteTimeout
         )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to set send and receive TIMEOUTs for SEND/RECEIVE interface
functions

IN:  hBasicMgmtDevice  -> basic management device handle
IN:  ReadTimeout       -> receive timeout in ms (WAIT_FOREVER for infinite wait)
IN:  WriteTimeout      -> send timeout in ms (WAIT_FOREVER for infinite wait)

Possible return values:
- TRUE   -> function returns sucessfully
- FALSE  -> function returns not successfully

-----------------------------------------------------------------------------*/
;



FUNCTION extern BOOL CALL_CONV profi_get_timeout
         (
           IN  HANDLE   hBasicMgmtDevice,
           OUT USIGN32* pReadTimeout,
           OUT USIGN32* pWriteTimeout
         )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to get the set send and receive TIMEOUTs for SEND/RECEIVE
interface functions

IN:   hBasicMgmtDevice  -> basic management device handle
OUT:  pReadTimeout      -> pointer to receive timeout in ms (WAIT_FOREVER for infinite wait)
OUT:  pWriteTimeout     -> pointer to send timeout in ms (WAIT_FOREVER for infinite wait)

Possible return values:
- TRUE   -> function returns sucessfully
- FALSE  -> function returns not successfully

-----------------------------------------------------------------------------*/
;



FUNCTION extern BOOL CALL_CONV profi_set_queue_size
         (
           IN HANDLE  hBasicMgmtDevice,
           IN USIGN32 QueueSize
         )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to set the max. receive queue size for the PROFIBUS driver.

IN:  hBasicMgmtDevice  -> basic management device handle
IN:  QueueSize         -> max. receive queue size

Possible return values:
- TRUE   -> function returns sucessfully
- FALSE  -> function returns not successfully

-----------------------------------------------------------------------------*/
;



FUNCTION extern BOOL CALL_CONV profi_get_queue_size
         (
           IN  HANDLE   hBasicMgmtDevice,
           OUT USIGN32* pQueueSize
         )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION

This function is used to get the set max. receive queue size for the PROFIBUS driver.

IN:  hBasicMgmtDevice  -> basic management device handle
OUT: pQueueSize        -> pointer to max. receive queue size

Possible return values:
- TRUE   -> function returns sucessfully
- FALSE  -> function returns not successfully

-----------------------------------------------------------------------------*/
;




FUNCTION extern BOOL CALL_CONV profi_get_overrun_count
         (
           IN  HANDLE   hBasicMgmtDevice,
           OUT USIGN32* pOverrunCount
         )
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION


IN:  hBasicMgmtDevice  -> basic management device handle
OUT: pOverrunCount     -> pointer to overrun counts

Possible return values:
- TRUE   -> function returns sucessfully
- FALSE  -> function returns not successfully

-----------------------------------------------------------------------------*/
;

#endif
#endif
#endif

#ifdef __cplusplus
 }
#endif



#pragma warning (disable : 4103)     /* used #pragma pack to reset alignment */
#ifdef WIN32
#pragma pack(pop)
#else
#pragma pack()
#endif
#pragma warning (default : 4103)


#endif

⌨️ 快捷键说明

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