Functions | |
void | apduStatusIndication (PNIO_UINT32 dev_handle, PNIO_UINT16 ar_number, PNIO_UINT16 session_key, PNIO_APDU_STATUS_IND apdu_status) |
This callback is called after the state of the Controller has changed. | |
void | arAbortIndication (PNIO_UINT32 dev_handle, PNIO_UINT16 ar_number, PNIO_UINT16 session_key, PNIO_AR_REASON reason_code) |
This callback is called by the IO Base Device interface as soon as the connection is terminated after a data exchange with the IO Controller began. | |
void | arCheckIndication (PNIO_UINT32 dev_handle, PNIO_UINT32 host_ip, PNIO_UINT16 ar_type, PNIO_UUID_TYPE ar_uuid, PNIO_UINT32 ar_properties, PNIO_UUID_TYPE cmi_obj_uuid, PNIO_UINT16 cmi_station_name_length, PNIO_UINT8 *p_cmi_station_name, PNIO_AR_TYPE *p_ar) |
This callback is called by the IO Base Device interface as soon as an IO controller establishes a connection with the IO Base Device user programm and transmits its expected configuration for the IO Base Device user program. As a result of this callback, application-relation global parameters are transferred to the IO Base user program for inspection. In case of errors in the application-relation layout, the IO Base Device user program can terminate the application-retional global parameters. | |
void | arIndataIndication (PNIO_UINT32 dev_handle, PNIO_UINT16 ar_number, PNIO_UINT16 session_key) |
This callback is called by the IO Base Device interface as soon as an IO controller has transmitted the IO data for the first time. It signals the beginning of cyclical data exchange. | |
void | arInfoIndication (PNIO_UINT32 dev_handle, PNIO_UINT16 ar_number, PNIO_UINT16 session_key, PNIO_AR_TYPE *p_ar) |
This callback is called by the IO Base Device interface as soon as the application-relation for the IO controller is laid out. Consequently, the IO-Base-Device user program is informed about the modules and submodules that will be operated in this application relation.. In this callback function user can initialize IO data in submodule to initial value 0 and can also set local consumer and provider status. | |
void | arOfflineIndication (PNIO_UINT32 dev_handle, PNIO_UINT16 ar_number, PNIO_UINT16 session_key, PNIO_AR_REASON reason_code) |
This callback is called by the IO Base Device interface as soon as the connection is terminated before a data exchange with the IO Controller began. | |
void | checkIndication (PNIO_UINT32 dev_handle, PNIO_UINT32 api, PNIO_UINT16 ar_number, PNIO_UINT16 session_key, PNIO_DEV_ADDR *p_addr, PNIO_UINT32 *p_mod_ident, PNIO_UINT16 *p_mod_state, PNIO_UINT32 *p_sub_ident, PNIO_UINT16 *p_sub_state) |
This callback is called for each and every submodule of the IO Base Device interface for which the configuration does not match that of the IO controller. The user program is consequently given the option of changing the submodule layout or marking the submodule as compatible or incorrect. In case of agreement of the configurations, this callback is not called. | |
void | cpStopRequest (PNIO_UINT32 dev_handle) |
This callback is called by the IO Base Device interface, as soon as an IO controller recieves stop request from PNIO_device_stop function. | |
PNIO_IOXS | dataRead (PNIO_UINT32 dev_handle, PNIO_DEV_ADDR *p_addr, PNIO_UINT32 buffer_length, PNIO_UINT8 *p_buffer, PNIO_IOXS io_provider_status) |
Passes the output data from stack to the application. | |
PNIO_IOXS | dataWrite (PNIO_UINT32 dev_handle, PNIO_DEV_ADDR *p_addr, PNIO_UINT32 buffer_length, PNIO_UINT8 *p_buffer, PNIO_IOXS io_consumer_status) |
Passes the input data from the application to the stack. | |
void | deviceStopped (PNIO_UINT32 dev_handle, PNIO_UINT32 reserved) |
This callback is called by the IO Base Device interface after the device is stopped. | |
void | prmEndIndication (PNIO_UINT32 dev_handle, PNIO_UINT16 ar_number, PNIO_UINT16 session_key, PNIO_UINT32 api, PNIO_UINT16 slot_number, PNIO_UINT16 subslot_number) |
This callback is called by the IO Base Device interface, as soon as an IO controller signals the end of the parametrizing phase. | |
void | recordRead (PNIO_UINT32 dev_handle, PNIO_UINT32 api, PNIO_UINT16 ar_number, PNIO_UINT16 sessi, PNIO_UINT32 sequence_number, PNIO_DEV_ADDR *p_addr, PNIO_UINT32 record_index, PNIO_UINT32 *p_buffer_length, PNIO_UINT8 *p_buffer, PNIO_ERR_STAT *p_pnio_state) |
Passes the output data from stack to the application. | |
void | recordWrite (PNIO_UINT32 dev_handle, PNIO_UINT32 api, PNIO_UINT16 ar_number, PNIO_UINT16 sessi, PNIO_UINT32 sequence_number, PNIO_DEV_ADDR *p_addr, PNIO_UINT32 record_index, PNIO_UINT32 *p_buffer_length, PNIO_UINT8 *p_buffer, PNIO_ERR_STAT *p_pnio_state) |
This callback is called to notify that a write record request has been received from the PNIO controller. | |
void | requestDone (PNIO_UINT32 dev_handle, PNIO_UINT32 user_handle, PNIO_UINT32 status, PNIO_ERR_STAT *p_pnio_state) |
This callback is called by the IO Base Device interface, as soon as an alarm is sent. | |
Variables | |
static const int | MAX_AR_INFO_COUNT = 500 |
max counter value for prm_ar_info_ind() callback |
void cp1616::pnio_device_callbacks::apduStatusIndication | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT16 | ar_number, | ||
PNIO_UINT16 | session_key, | ||
PNIO_APDU_STATUS_IND | apdu_status | ||
) |
This callback is called after the state of the Controller has changed.
[in] | dev_handle | device handle |
[in] | ar_number | application-relation number |
[in] | session_key | session key |
apdu_status |
Definition at line 457 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::arAbortIndication | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT16 | ar_number, | ||
PNIO_UINT16 | session_key, | ||
PNIO_AR_REASON | reason_code | ||
) |
This callback is called by the IO Base Device interface as soon as the connection is terminated after a data exchange with the IO Controller began.
[in] | dev_handle | device handle |
[in] | ar_number | application-relation number |
[in] | session_key | session key |
[in] | *p_ar | pointer to application-relation structure PNIO_AR_TYPE |
[in] | reason_code | reason code |
Definition at line 382 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::arCheckIndication | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT32 | host_ip, | ||
PNIO_UINT16 | ar_type, | ||
PNIO_UUID_TYPE | ar_uuid, | ||
PNIO_UINT32 | ar_properties, | ||
PNIO_UUID_TYPE | cmi_obj_uuid, | ||
PNIO_UINT16 | cmi_station_name_length, | ||
PNIO_UINT8 * | p_cmi_station_name, | ||
PNIO_AR_TYPE * | p_ar | ||
) |
This callback is called by the IO Base Device interface as soon as an IO controller establishes a connection with the IO Base Device user programm and transmits its expected configuration for the IO Base Device user program. As a result of this callback, application-relation global parameters are transferred to the IO Base user program for inspection. In case of errors in the application-relation layout, the IO Base Device user program can terminate the application-retional global parameters.
[in] | dev_handle | device handle |
[in] | api | api number |
[in] | host_ip | IP address of the host IO Controller |
[in] | ar_type | application-relation type |
[in] | ar_uuid | application-relation UUID |
[in] | ar_properties | application-relation properties |
[in] | cmi_obj_uuid | UUID of application-relation initiator e.g IO controller |
[in] | cmi_station_name_length | length of param station-name |
[in] | *p_cmi_station_name | station name |
[in] | *p_ar | pointer to application-relation structure PNIO_AR_TYPE |
Definition at line 291 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::arIndataIndication | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT16 | ar_number, | ||
PNIO_UINT16 | session_key | ||
) |
This callback is called by the IO Base Device interface as soon as an IO controller has transmitted the IO data for the first time. It signals the beginning of cyclical data exchange.
[in] | dev_handle | device handle |
[in] | ar_number | application-relation number |
[in] | session_key | session key |
[in] | *p_ar | pointer to application-relation structure PNIO_AR_TYPE |
Definition at line 371 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::arInfoIndication | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT16 | ar_number, | ||
PNIO_UINT16 | session_key, | ||
PNIO_AR_TYPE * | p_ar | ||
) |
This callback is called by the IO Base Device interface as soon as the application-relation for the IO controller is laid out. Consequently, the IO-Base-Device user program is informed about the modules and submodules that will be operated in this application relation.. In this callback function user can initialize IO data in submodule to initial value 0 and can also set local consumer and provider status.
[in] | dev_handle | device handle |
[in] | ar_number | application-relation number |
[in] | session_key | session key |
[in] | *p_ar | pointer to application-relation structure PNIO_AR_TYPE |
Definition at line 316 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::arOfflineIndication | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT16 | ar_number, | ||
PNIO_UINT16 | session_key, | ||
PNIO_AR_REASON | reason_code | ||
) |
This callback is called by the IO Base Device interface as soon as the connection is terminated before a data exchange with the IO Controller began.
[in] | dev_handle | device handle |
[in] | ar_number | application-relation number |
[in] | session_key | session key |
[in] | *p_ar | pointer to application-relation structure PNIO_AR_TYPE |
[in] | reason_code | reason code |
Definition at line 392 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::checkIndication | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT32 | api, | ||
PNIO_UINT16 | ar_number, | ||
PNIO_UINT16 | session_key, | ||
PNIO_DEV_ADDR * | p_addr, | ||
PNIO_UINT32 * | p_mod_ident, | ||
PNIO_UINT16 * | p_mod_state, | ||
PNIO_UINT32 * | p_sub_ident, | ||
PNIO_UINT16 * | p_sub_state | ||
) |
This callback is called for each and every submodule of the IO Base Device interface for which the configuration does not match that of the IO controller. The user program is consequently given the option of changing the submodule layout or marking the submodule as compatible or incorrect. In case of agreement of the configurations, this callback is not called.
[in] | dev_handle | device handle |
[in] | api | api number |
[in] | ar_number | application relation number |
[in] | sessi | session-key |
[in] | *p_addr | geographical address |
[out] | *p_mod_ident | pointer to the module identifier |
[out] | *p_mod_state | pointer to the module state |
[out] | *p_sub_ident | pointer to submodule identifier |
[out] | *p_sub_state | pointer to submodule state |
Definition at line 251 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::cpStopRequest | ( | PNIO_UINT32 | dev_handle | ) |
This callback is called by the IO Base Device interface, as soon as an IO controller recieves stop request from PNIO_device_stop function.
[in] | dev_handle | device handle |
Definition at line 435 of file cp1616_io_device_callbacks.cpp.
PNIO_IOXS cp1616::pnio_device_callbacks::dataRead | ( | PNIO_UINT32 | dev_handle, |
PNIO_DEV_ADDR * | p_addr, | ||
PNIO_UINT32 | buffer_length, | ||
PNIO_UINT8 * | p_buffer, | ||
PNIO_IOXS | io_provider_status | ||
) |
Passes the output data from stack to the application.
[in] | dev_handle | device handle |
[in] | *p_addr | geographical address |
[in] | buffer_length | length of the submodule input data |
[in] | *p_buffer | pointer to data buffer to read from |
[in] | io_provider_status | remote (io controller) provider status |
Definition at line 31 of file cp1616_io_device_callbacks.cpp.
PNIO_IOXS cp1616::pnio_device_callbacks::dataWrite | ( | PNIO_UINT32 | dev_handle, |
PNIO_DEV_ADDR * | p_addr, | ||
PNIO_UINT32 | buffer_length, | ||
PNIO_UINT8 * | p_buffer, | ||
PNIO_IOXS | io_consumer_status | ||
) |
Passes the input data from the application to the stack.
[in] | dev_handle | device handle |
[in] | *p_addr | geographical address |
[in] | buffer_length | length of the submodule input data |
[out] | *p_buffer | pointer to data buffer to write to |
[in] | io_consumer_status | remote (io controller) consumer status |
Definition at line 83 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::deviceStopped | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT32 | reserved | ||
) |
This callback is called by the IO Base Device interface after the device is stopped.
[in] | dev_handle | device handle |
Definition at line 441 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::prmEndIndication | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT16 | ar_number, | ||
PNIO_UINT16 | session_key, | ||
PNIO_UINT32 | api, | ||
PNIO_UINT16 | slot_number, | ||
PNIO_UINT16 | subslot_number | ||
) |
This callback is called by the IO Base Device interface, as soon as an IO controller signals the end of the parametrizing phase.
[in] | dev_handle | device handle |
[in] | ar_number | application-relation number |
[in] | session_key | session key |
[in] | api | associated API |
[in] | slot_number | slot number |
[in] | subslot_number | subslot number |
Definition at line 405 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::recordRead | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT32 | api, | ||
PNIO_UINT16 | ar_number, | ||
PNIO_UINT16 | sessi, | ||
PNIO_UINT32 | sequence_number, | ||
PNIO_DEV_ADDR * | p_addr, | ||
PNIO_UINT32 | record_index, | ||
PNIO_UINT32 * | p_buffer_length, | ||
PNIO_UINT8 * | p_buffer, | ||
PNIO_ERR_STAT * | p_pnio_state | ||
) |
Passes the output data from stack to the application.
[in] | dev_handle | device handle |
[in] | api | qpi number |
[in] | ar_number | application relation number |
[in] | sessi | session-key |
[in] | sequence_number | sequence number |
[in] | *p_addr | geographical address |
[in] | record_index | record index |
[in] | *p_buffer_length | pointer to buffer length |
[in] | buffer_length | length of the submodule input data |
[in] | *p_buffer | pointer to data buffer to read from |
[in] | *p_pnio_state | 4 byte PNIOStatus (ErrCode, ErrDecode, ErrCode1, ErrCode2), see IEC61158-6 |
Definition at line 193 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::recordWrite | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT32 | api, | ||
PNIO_UINT16 | ar_number, | ||
PNIO_UINT16 | sessi, | ||
PNIO_UINT32 | sequence_number, | ||
PNIO_DEV_ADDR * | p_addr, | ||
PNIO_UINT32 | record_index, | ||
PNIO_UINT32 * | p_buffer_length, | ||
PNIO_UINT8 * | p_buffer, | ||
PNIO_ERR_STAT * | p_pnio_state | ||
) |
This callback is called to notify that a write record request has been received from the PNIO controller.
[in] | dev_handle | device handle |
[in] | api | api number |
[in] | ar_number | application relation number |
[in] | sessi | session-key |
[in] | sequence_number | sequence number |
[in] | *p_addr | geographical address |
[in] | record_index | record index |
[in/out] | *p_buffer_length pointer to buffer length | |
[in] | buffer_length | length of the submodule input data |
[in] | *p_buffer | pointer to data buffer to read from |
[in] | *p_pnio_state | 4 byte PNIOStatus (ErrCode, ErrDecode, ErrCode1, ErrCode2), see IEC61158-6 |
Definition at line 134 of file cp1616_io_device_callbacks.cpp.
void cp1616::pnio_device_callbacks::requestDone | ( | PNIO_UINT32 | dev_handle, |
PNIO_UINT32 | user_handle, | ||
PNIO_UINT32 | status, | ||
PNIO_ERR_STAT * | p_pnio_state | ||
) |
This callback is called by the IO Base Device interface, as soon as an alarm is sent.
[in] | dev_handle | device handle |
[in] | user_handle | user definned handle |
status | ||
[out] | *p_pnio_state | pointer to submodule state |
Definition at line 448 of file cp1616_io_device_callbacks.cpp.
const int cp1616::pnio_device_callbacks::MAX_AR_INFO_COUNT = 500 [static] |
max counter value for prm_ar_info_ind() callback
Definition at line 307 of file cp1616_io_device_callbacks.h.