This class defines ROS-Profinet IO Device implementation for communication processor Siemens CP1616. More...
#include <cp1616_io_device.h>
Public Member Functions | |
int | addApi () |
Adds associated Api. | |
int | addModSubMod () |
Adds Modules and submodules (to mirror STEP7 configuration) | |
void | configureDeviceData () |
Initializes Device data structures. | |
int | doAfterIndataIndCbf () |
This function is called after the PNIO_cbf_ar_indata_ind callback has been called, it calls PNIO_initiate_data_write() and PNIO_initiate_data_read() | |
int | doAfterPrmEndIndCbf () |
This function is called after the PNIO_cbf_prm_end_ind callback has been called, it calls PNIO_initiate_data_write(), PNIO_initiate_data_read for the first time and PNIO_set_appl_state_ready. | |
int | getArInfoIndFlag () |
PNIO_UINT16 | getCpArNumber () |
PNIO_UINT16 | getCpSessionKey () |
int | getIndataIndFlag () |
PNIO_IOXS | getInputDataIocs (int slot_number, int subslot_number) |
PNIO_IOXS | getInputDataIops (int slot_number, int subslot_number) |
PNIO_UINT32 | getInputDataLength (int slot_number, int subslot_number) |
int | getOfflineIndFlag () |
PNIO_IOXS | getOutputDataIocs (int slot_number, int subslot_number) |
PNIO_IOXS | getOutputDataIops (int slot_number, int subslot_number) |
PNIO_UINT32 | getOutputDataLength (int slot_number, int subslot_number) |
int | getPrmEndIndFlag () |
int | GetSubmodNum (PNIO_UINT32 mod, PNIO_UINT32 sub) |
int | init () |
Initializes and starts IO Device. | |
int | removeApi () |
Removes associated Api. | |
int | removeModSubMod () |
Removes existing Modules and submodules. | |
void | setArInfoIndFlag (int value) |
void | setCpArNumber (PNIO_UINT16 value) |
void | setCpSessionKey (PNIO_UINT16 value) |
void | setIndataIndFlag (int value) |
void | setInputDataIocs (int slot_number, int subslot_number, PNIO_IOXS status) |
void | setInputDataIops (int slot_number, int subslot_number, PNIO_IOXS status) |
void | setInputDataLength (int slot_number, int subslot_number, PNIO_UINT32 value) |
void | setOfflineIndFlag (int value) |
void | setOutputDataIocs (int slot_number, int subslot_number, PNIO_IOXS status) |
void | setOutputDataIops (int slot_number, int subslot_number, PNIO_IOXS status) |
void | setOutputDataLength (int slot_number, int subslot_number, PNIO_UINT32 value) |
void | setPrmEndIndFlag (int value) |
int | startOperation () |
Starts IO device operation. | |
int | stopOperation () |
Stops IO device operation. | |
int | uinit () |
Closes and uninitializes IO Device. | |
int | updateCyclicInputData () |
Updates Input (from IO Controller perspective) data - write CP output data. | |
int | updateCyclicOutputData () |
Updates Output (from IO Controller perspective) data - read CP input data. | |
~Cp1616IODevice () | |
Destructs an IOController object. | |
Static Public Member Functions | |
static Cp1616IODevice * | getDeviceInstance () |
Public instance accesssor. | |
Public Attributes | |
std::vector< std::vector < std::vector< PNIO_UINT8 > > > | input_data_ |
Table of input controller data - IO Device output data. | |
std::vector< std::vector < std::vector< PNIO_UINT8 > > > | output_data_ |
Table of Output controller data - IO Device input data. | |
DeviceData * | p_device_data_ |
pointer to device_data table which holds STEP7 configuration params | |
Private Member Functions | |
Cp1616IODevice () | |
Private Attributes | |
int | ar_info_ind_flag_ |
PNIO_UINT16 | cp_ar_number_ |
PNIO_UINT32 | cp_handle_ |
PNIO_UINT32 | cp_id_ |
unsigned int | cp_max_number_of_subslots_ |
unsigned int | cp_number_of_slots_ |
PNIO_UINT16 | cp_session_key_ |
int | idx_table_ [DEVICE_DATA_ENTRIES] |
int | indata_ind_flag_ |
std::vector< std::vector < PNIO_IOXS > > | input_data_iocs_ |
std::vector< std::vector < PNIO_IOXS > > | input_data_iops_ |
std::vector< std::vector < PNIO_UINT32 > > | input_data_length_ |
int | offline_ind_flag_ |
std::vector< std::vector < PNIO_IOXS > > | output_data_iocs_ |
std::vector< std::vector < PNIO_IOXS > > | output_data_iops_ |
std::vector< std::vector < PNIO_UINT32 > > | output_data_length_ |
int | prm_end_ind_flag_ |
Static Private Attributes | |
static Cp1616IODevice * | device_instance_ = 0 |
static const int | MAX_INDATA_IND_COUNT = 500 |
static const int | MAX_OFFLINE_IND_COUNT = 100 |
static const int | MAX_PRM_END_COUNT = 500 |
static const int | WAIT_FOR_CALLBACK_PERIOD = 100000 |
This class defines ROS-Profinet IO Device implementation for communication processor Siemens CP1616.
Definition at line 81 of file cp1616_io_device.h.
Destructs an IOController object.
Definition at line 120 of file cp1616_io_device.cpp.
cp1616::Cp1616IODevice::Cp1616IODevice | ( | ) | [private] |
Definition at line 41 of file cp1616_io_device.cpp.
int cp1616::Cp1616IODevice::addApi | ( | ) |
Adds associated Api.
Definition at line 200 of file cp1616_io_device.cpp.
Adds Modules and submodules (to mirror STEP7 configuration)
Definition at line 295 of file cp1616_io_device.cpp.
Initializes Device data structures.
Definition at line 626 of file cp1616_io_device.cpp.
This function is called after the PNIO_cbf_ar_indata_ind callback has been called, it calls PNIO_initiate_data_write() and PNIO_initiate_data_read()
Here we need to call "PNIO_initiate_data_write" so that the Device user program can initialize the incoming data (from the perspective of the IO controller) for the functional submodules and set the local status to "GOOD". For all non-functional submodules, the local status should be set to "BAD" We have already initialized the local buffer in "PNIO_cbf_ar_info_ind" callback
We also have to call "PNIO_initiate_data_read" so that the Device user program can set the local status for functional submodules of all the outgoing data (from the perspective of the IO controller) to GOOD. For all non-functional submodules, the local status has to be set to "BAD".
Definition at line 738 of file cp1616_io_device.cpp.
This function is called after the PNIO_cbf_prm_end_ind callback has been called, it calls PNIO_initiate_data_write(), PNIO_initiate_data_read for the first time and PNIO_set_appl_state_ready.
Here we need to call "PNIO_initiate_data_write" so that the IO Base Device user program can initialize the incoming data (from the perspective of the IO controller) for the functional submodules and set the local status to "GOOD". For all non-functional submodules, the local status should be set to "BAD" We have already initialized the local buffer in "PNIO_cbf_ar_info_ind" callback
We also have to call "PNIO_initiate_data_read" so that the IO Base Device user program can set the local status for functional submodules of all the outgoing data (from the perspective of the IO controller) to GOOD. For all non-functional submodules, the local status has to be set to "BAD".
Here we need to call PNIO_set_appl_state_ready so that the IO Base Device user program registers a list of the non-functional submodules and the extent of readiness to get into a data exchange at the IO controller
Definition at line 687 of file cp1616_io_device.cpp.
Definition at line 775 of file cp1616_io_device.cpp.
PNIO_UINT16 cp1616::Cp1616IODevice::getCpArNumber | ( | ) |
Definition at line 826 of file cp1616_io_device.cpp.
PNIO_UINT16 cp1616::Cp1616IODevice::getCpSessionKey | ( | ) |
Definition at line 815 of file cp1616_io_device.cpp.
Cp1616IODevice * cp1616::Cp1616IODevice::getDeviceInstance | ( | ) | [static] |
Public instance accesssor.
Definition at line 32 of file cp1616_io_device.cpp.
Definition at line 795 of file cp1616_io_device.cpp.
PNIO_IOXS cp1616::Cp1616IODevice::getInputDataIocs | ( | int | slot_number, |
int | subslot_number | ||
) |
Definition at line 851 of file cp1616_io_device.cpp.
PNIO_IOXS cp1616::Cp1616IODevice::getInputDataIops | ( | int | slot_number, |
int | subslot_number | ||
) |
Definition at line 871 of file cp1616_io_device.cpp.
PNIO_UINT32 cp1616::Cp1616IODevice::getInputDataLength | ( | int | slot_number, |
int | subslot_number | ||
) |
Definition at line 831 of file cp1616_io_device.cpp.
Definition at line 805 of file cp1616_io_device.cpp.
PNIO_IOXS cp1616::Cp1616IODevice::getOutputDataIocs | ( | int | slot_number, |
int | subslot_number | ||
) |
Definition at line 861 of file cp1616_io_device.cpp.
PNIO_IOXS cp1616::Cp1616IODevice::getOutputDataIops | ( | int | slot_number, |
int | subslot_number | ||
) |
Definition at line 881 of file cp1616_io_device.cpp.
PNIO_UINT32 cp1616::Cp1616IODevice::getOutputDataLength | ( | int | slot_number, |
int | subslot_number | ||
) |
Definition at line 841 of file cp1616_io_device.cpp.
Definition at line 785 of file cp1616_io_device.cpp.
int cp1616::Cp1616IODevice::GetSubmodNum | ( | PNIO_UINT32 | mod, |
PNIO_UINT32 | sub | ||
) |
Definition at line 604 of file cp1616_io_device.cpp.
int cp1616::Cp1616IODevice::init | ( | ) |
Initializes and starts IO Device.
Definition at line 125 of file cp1616_io_device.cpp.
Removes associated Api.
Definition at line 259 of file cp1616_io_device.cpp.
Removes existing Modules and submodules.
Definition at line 455 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setArInfoIndFlag | ( | int | value | ) |
Data encapsulation
Definition at line 770 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setCpArNumber | ( | PNIO_UINT16 | value | ) |
Definition at line 820 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setCpSessionKey | ( | PNIO_UINT16 | value | ) |
Definition at line 810 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setIndataIndFlag | ( | int | value | ) |
Definition at line 790 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setInputDataIocs | ( | int | slot_number, |
int | subslot_number, | ||
PNIO_IOXS | status | ||
) |
Definition at line 856 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setInputDataIops | ( | int | slot_number, |
int | subslot_number, | ||
PNIO_IOXS | status | ||
) |
Definition at line 876 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setInputDataLength | ( | int | slot_number, |
int | subslot_number, | ||
PNIO_UINT32 | value | ||
) |
Definition at line 836 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setOfflineIndFlag | ( | int | value | ) |
Definition at line 800 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setOutputDataIocs | ( | int | slot_number, |
int | subslot_number, | ||
PNIO_IOXS | status | ||
) |
Definition at line 866 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setOutputDataIops | ( | int | slot_number, |
int | subslot_number, | ||
PNIO_IOXS | status | ||
) |
Definition at line 886 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setOutputDataLength | ( | int | slot_number, |
int | subslot_number, | ||
PNIO_UINT32 | value | ||
) |
Definition at line 846 of file cp1616_io_device.cpp.
void cp1616::Cp1616IODevice::setPrmEndIndFlag | ( | int | value | ) |
Definition at line 780 of file cp1616_io_device.cpp.
Starts IO device operation.
Definition at line 512 of file cp1616_io_device.cpp.
Stops IO device operation.
Definition at line 583 of file cp1616_io_device.cpp.
int cp1616::Cp1616IODevice::uinit | ( | ) |
Closes and uninitializes IO Device.
Definition at line 187 of file cp1616_io_device.cpp.
Updates Input (from IO Controller perspective) data - write CP output data.
Definition at line 674 of file cp1616_io_device.cpp.
Updates Output (from IO Controller perspective) data - read CP input data.
Definition at line 662 of file cp1616_io_device.cpp.
int cp1616::Cp1616IODevice::ar_info_ind_flag_ [private] |
Definition at line 247 of file cp1616_io_device.h.
PNIO_UINT16 cp1616::Cp1616IODevice::cp_ar_number_ [private] |
Definition at line 252 of file cp1616_io_device.h.
PNIO_UINT32 cp1616::Cp1616IODevice::cp_handle_ [private] |
Definition at line 234 of file cp1616_io_device.h.
PNIO_UINT32 cp1616::Cp1616IODevice::cp_id_ [private] |
Definition at line 235 of file cp1616_io_device.h.
unsigned int cp1616::Cp1616IODevice::cp_max_number_of_subslots_ [private] |
Definition at line 237 of file cp1616_io_device.h.
unsigned int cp1616::Cp1616IODevice::cp_number_of_slots_ [private] |
Definition at line 236 of file cp1616_io_device.h.
PNIO_UINT16 cp1616::Cp1616IODevice::cp_session_key_ [private] |
Definition at line 251 of file cp1616_io_device.h.
Cp1616IODevice * cp1616::Cp1616IODevice::device_instance_ = 0 [static, private] |
Definition at line 232 of file cp1616_io_device.h.
int cp1616::Cp1616IODevice::idx_table_[DEVICE_DATA_ENTRIES] [private] |
Definition at line 254 of file cp1616_io_device.h.
int cp1616::Cp1616IODevice::indata_ind_flag_ [private] |
Definition at line 249 of file cp1616_io_device.h.
std::vector<std::vector <std::vector<PNIO_UINT8> > > cp1616::Cp1616IODevice::input_data_ |
Table of input controller data - IO Device output data.
Definition at line 194 of file cp1616_io_device.h.
std::vector<std::vector<PNIO_IOXS> > cp1616::Cp1616IODevice::input_data_iocs_ [private] |
Definition at line 240 of file cp1616_io_device.h.
std::vector<std::vector<PNIO_IOXS> > cp1616::Cp1616IODevice::input_data_iops_ [private] |
Definition at line 241 of file cp1616_io_device.h.
std::vector<std::vector<PNIO_UINT32> > cp1616::Cp1616IODevice::input_data_length_ [private] |
Definition at line 239 of file cp1616_io_device.h.
const int cp1616::Cp1616IODevice::MAX_INDATA_IND_COUNT = 500 [static, private] |
Definition at line 258 of file cp1616_io_device.h.
const int cp1616::Cp1616IODevice::MAX_OFFLINE_IND_COUNT = 100 [static, private] |
Definition at line 259 of file cp1616_io_device.h.
const int cp1616::Cp1616IODevice::MAX_PRM_END_COUNT = 500 [static, private] |
Definition at line 257 of file cp1616_io_device.h.
int cp1616::Cp1616IODevice::offline_ind_flag_ [private] |
Definition at line 250 of file cp1616_io_device.h.
std::vector<std::vector<std::vector<PNIO_UINT8> > > cp1616::Cp1616IODevice::output_data_ |
Table of Output controller data - IO Device input data.
Definition at line 199 of file cp1616_io_device.h.
std::vector<std::vector<PNIO_IOXS> > cp1616::Cp1616IODevice::output_data_iocs_ [private] |
Definition at line 244 of file cp1616_io_device.h.
std::vector<std::vector<PNIO_IOXS> > cp1616::Cp1616IODevice::output_data_iops_ [private] |
Definition at line 245 of file cp1616_io_device.h.
std::vector<std::vector<PNIO_UINT32> > cp1616::Cp1616IODevice::output_data_length_ [private] |
Definition at line 243 of file cp1616_io_device.h.
pointer to device_data table which holds STEP7 configuration params
Definition at line 189 of file cp1616_io_device.h.
int cp1616::Cp1616IODevice::prm_end_ind_flag_ [private] |
Definition at line 248 of file cp1616_io_device.h.
const int cp1616::Cp1616IODevice::WAIT_FOR_CALLBACK_PERIOD = 100000 [static, private] |
Definition at line 256 of file cp1616_io_device.h.