?? pb_if.h
字號:
- E_IF_INVALID_DATA_SIZE -> not enough CMI memory available for REQ or RES
- E_IF_INVALID_VERSION -> invalid version (only PROFDI-IF)
- E_IF_INVALID_PARAMETER -> invalid parameter in REQ or RES
- E_IF_PAPI_NOT_INITIALIZED -> API not initialized
----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_rcv_con_ind
(
OUT T_PROFI_SERVICE_DESCR * pSdb,
OUT VOID * pData,
INOUT USIGN16 * pDataLength
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to receive a Service-Indication or a Service-Confirmation
from the PROFIBUS controller.
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
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_FATAL_ERROR -> unrecoverable error in PROTOCOL SW
- E_IF_INVALID_DATA_SIZE -> size of data block provided not sufficient
- E_IF_PAPI_NOT_INITIALIZED -> API not initialized
----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_set_data
(
IN USIGN8 DataId,
IN USIGN16 Offset,
IN USIGN16 DataLength,
IN VOID * pData
)
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to write data to CMI data area
IN: DataId -> data image identifier
- ID_DP_SLAVE_IO_IMAGE (DPM: image for slave io data)
- ID_DP_STATUS_IMAGE (DPM: image for status data)
IN: Offset -> write at offset in data image
IN: DataLength -> length of data to write
IN: pData -> pointer to data to write
possible return values:
- E_OK -> OK
- E_IF_SERVICE_CONSTR_CONFLICT -> service not executable at time
- E_IF_SERVICE_NOT_SUPPORTED -> service not supported
- E_IF_INVALID_DATA_SIZE -> invalid user data size
- E_IF_PAPI_NOT_INITIALIZED -> API not initialized
-----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_get_data
(
IN USIGN8 DataId,
IN USIGN16 Offset,
INOUT USIGN16 * pDataLength,
OUT VOID * pData
)
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to read data from CMI data area
IN: DataId -> data image identifier
- ID_DP_SLAVE_IO_IMAGE (DPM: image for slave io data)
- ID_DP_STATUS_IMAGE (DPM: image for status data)
IN: Offset -> read at offset in data image
INOUT: pDataLength IN: length of data buffer
OUT: length of received data
OUT: pData -> pointer to data buffer
possible return values:
- E_OK -> OK
- E_IF_SERVICE_CONSTR_CONFLICT -> service not executable at time
- E_IF_SERVICE_NOT_SUPPORTED -> service not supported
- E_IF_INVALID_DATA_SIZE -> invalid user data size
- E_IF_PAPI_NOT_INITIALIZED -> API not initialized
- E_IF_OS_ERROR -> NT system error
-----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_set_dps_input_data
(
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: 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_NO_CNTRL_RES -> timeout controller does not response
- E_IF_PAPI_NOT_INITIALIZED -> API not initialized
-----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_get_dps_input_data
(
OUT USIGN8 * pData,
INOUT USIGN8 * pDataLength,
OUT USIGN8 * pState
)
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to read data CMI DPS_SLAVE_INPUT_IMAGE
OUT: pData -> destination buffer for input data
INOUT: pDataLength -> sizeof destination buffer and number of bytes read
OUT: pState -> status of input data if read successfully
possible return values:
- E_OK -> OK
- E_IF_INVALID_DATA_SIZE -> invalid user data size
- E_IF_PAPI_NOT_INITIALIZED -> API not initialized
-----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_get_dps_output_data
(
OUT USIGN8 * pData,
INOUT USIGN8 * pDataLength,
OUT USIGN8 * pState
)
/*-----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to read data from DPS_SLAVE_OUTPUT_IMAGE.
OUT: pData -> destination buffer for output data
INOUT: pDataLength -> sizeof destination buffer and number of bytes read
OUT: pState -> status of output data if read successfully
possible return values:
- E_OK -> OK
- E_IF_SERVICE_NOT_SUPPORTED -> service not supported
- E_IF_SERVICE_CONSTR_CONFLICT -> service not executable at time
- E_IF_INVALID_DATA_SIZE -> invalid user data size
- E_IF_PAPI_NOT_INITIALIZED -> API not initialized
-----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_get_versions
(
OUT CSTRING * pPapiVersion,
OUT CSTRING * pFirmwareVersion
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to get the vesrion strings of PAPI and firmware.
OUT: pPapiVersion -> data buffer for PAPI version string
OUT: pFirmwareVersion -> data buffer for firmware version string
NOTE: There must be at least 100 Bytes (VERSION_STRING_LENGTH) free space for
each INOUT buffer.
Possible return values:
- E_OK
-----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_get_serial_device_number
(
OUT USIGN32 * pSerialDeviceNumber
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to get the serial device number of the PROFIBUS
controller
OUT: pSerialDeviceNumber -> serial device number
Possible return values:
- E_OK
- E_IF_PAPI_NOT_INITIALIZED -> API not initialized
-----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_get_last_error(VOID)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is returns the additional last error code for INTERFACE-ERRORs
controller
Possible return values:
- additional last error code
-----------------------------------------------------------------------------*/
;
#else
FUNCTION GLOBAL INT16 CALL_CONV profi_rtx_init
(
IN USIGN8 Board,
IN USIGN32 ReadTimeout,
IN USIGN32 WriteTimeout,
IN USIGN32 InterruptThreadPriority
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to initialize the PROFIBUS WinXP/Win2K RTAPI. The function
has to be called before any otherfunction of PROFIBUS-API is called.
IN: Board -> number of the PROFIBUS board (0..7)
IN: Channel -> channel number (0)
IN: ReadTimeout -> receive timeout in ms (WAIT_FOREVER for infinite wait)
IN: Writetimeout -> send timeout in ms (WAIT_FOREVER for infinite wait)
IN: InterruptThreadPriority -> 0.127
Possible return values:
- E_OK -> Interface is initialized
- E_IF_NO_CNTRL_RES -> controller does not respond
- E_IF_INVALID_CNTRL_TYPE_VERSION -> invalid controller type or software version
- E_IF_INIT_INVALID_PARAMETER -> invalid initialize parameter
- E_IF_INVALID_VERSION -> invalid version
- E_IF_NO_CNTRL_PRESENT -> no controller present
- E_IF_INIT_FAILED -> initialization failed
-----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_rtx_end(VOID)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to shutdown the PROFIBUS WinXP/Win2K RTAPI and shutdown the
PROFIBUS controller.
Possible return values:
- E_OK
-----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_rtx_snd_req_res
(
IN T_PROFI_SERVICE_DESCR * pSdb,
IN VOID * pData,
IN PB_BOOL dummy
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to send a Service-Request or a Service-Response
via PROFIBUS WinXP/Win2K RTAPI to the PROFIBUS controller.
IN: pSdb -> pointer to SERVICE-DESCRIPTION-BLOCK
IN: pData -> pointer to service specific data
IN: dummy -> dummy
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_VERSION -> invalid version (only PROFDI-IF)
- E_IF_INVALID_PARAMETER -> invalid parameter in REQ or RES
- E_IF_PAPI_NOT_INITIALIZED -> API not initialized
----------------------------------------------------------------------------*/
;
FUNCTION extern INT16 CALL_CONV profi_rtx_rcv_con_ind
(
OUT T_PROFI_SERVICE_DESCR * pSdb,
OUT VOID * pData,
INOUT USIGN16 * pDataLength
)
/*----------------------------------------------------------------------------
FUNCTIONAL_DESCRIPTION
This function is used to receive a Service-Indication or a Service-Confirmation
via PROFIBUS WinXP/Win2K RTAPI from the PROFIBUS controller.
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
Possible return values:
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -