This class defines ROS-Profinet IO Controller implementation for communication processor Siemens CP1616. More...
#include <cp1616_io_controller.h>
Public Member Functions | |
| int | addInputModule (unsigned int input_size, unsigned int input_start_address) |
| Adds input module to Controller data structre. | |
| int | addOutputModule (unsigned int output_size, unsigned int output_start_address) |
| Adds output module to Controller data structure. | |
| int | changePnioMode (PNIO_MODE_TYPE requested_mode) |
| Changes IO Controller mode. | |
| void | configureControllerData () |
| Initialize Controller data structures. | |
| PNIO_MODE_TYPE | getCpCurrentModeFlag () |
| int | getCpReady () |
| int | init () |
| Initializes and starts IO Controller. | |
| void | printInputData (unsigned int module) |
| void | printOutputData (unsigned int module) |
| void | setCpCurrentModeFlag (PNIO_MODE_TYPE mode) |
| void | setCpReady (int cp_ready_value) |
| void | setSemModChange (int mod_change) |
| int | uinit () |
| Closes and uninitializes IO Controller. | |
| int | updateCyclicInputData () |
| Reads recieved data from IO Base layer. | |
| int | updateCyclicOutputData () |
| Writes data to IO Base library layer for transmission. | |
| ~Cp1616IOController () | |
| Destructs an IOController object. | |
Static Public Member Functions | |
| static Cp1616IOController * | getControllerInstance () |
| Public instance accesssor. | |
Public Attributes | |
| std::vector< std::vector < PNIO_UINT8 > > | input_module_data_ |
| 2D array of input module data | |
| std::vector< std::vector < PNIO_UINT8 > > | output_module_data_ |
| 2D array of output module data | |
Private Member Functions | |
| Cp1616IOController () | |
Private Attributes | |
| volatile PNIO_MODE_TYPE | cp_current_mode_ |
| PNIO_UINT32 | cp_handle_ |
| PNIO_UINT32 | cp_id_ |
| volatile PNIO_IOXS | cp_local_state_ |
| int | cp_ready_ |
| std::vector< PNIO_ADDR > | input_module_address_ |
| PNIO_UINT32 | input_module_count_ |
| std::vector< PNIO_UINT32 > | input_module_data_length_ |
| std::vector< PNIO_IOXS > | input_module_state_ |
| unsigned int | input_module_total_data_size_ |
| std::vector< PNIO_ADDR > | output_module_address_ |
| PNIO_UINT32 | output_module_count_ |
| std::vector< PNIO_UINT32 > | output_module_data_length_ |
| std::vector< PNIO_IOXS > | output_module_state_ |
| unsigned int | output_module_total_data_size_ |
| int | sem_mod_change_ |
Static Private Attributes | |
| static Cp1616IOController * | controller_instance_ = 0 |
| static const int | INIT_DATA_VALUE = 0 |
| static const int | MAX_NUM_OF_INIT_ATTEMPTS = 1000 |
| static const int | WAIT_FOR_CALLBACKS_PERIOD = 100000 |
This class defines ROS-Profinet IO Controller implementation for communication processor Siemens CP1616.
Definition at line 40 of file cp1616_io_controller.h.
Destructs an IOController object.
Definition at line 64 of file cp1616_io_controller.cpp.
| cp1616::Cp1616IOController::Cp1616IOController | ( | ) | [private] |
Definition at line 41 of file cp1616_io_controller.cpp.
| int cp1616::Cp1616IOController::addInputModule | ( | unsigned int | input_size, |
| unsigned int | input_start_address | ||
| ) |
Adds input module to Controller data structre.
| input_size | input data length according to STEP7 setup |
| input_start_address | I address according to STEP7 setup |
Definition at line 143 of file cp1616_io_controller.cpp.
| int cp1616::Cp1616IOController::addOutputModule | ( | unsigned int | output_size, |
| unsigned int | output_start_address | ||
| ) |
Adds output module to Controller data structure.
| output_size | output data length according to STEP7 setup |
| output_start_address | Q address according to STEP7 setup |
Definition at line 177 of file cp1616_io_controller.cpp.
| int cp1616::Cp1616IOController::changePnioMode | ( | PNIO_MODE_TYPE | requested_mode | ) |
Changes IO Controller mode.
| requested_mode | OFFLINE/OPERATE/CLEAR |
Definition at line 311 of file cp1616_io_controller.cpp.
Initialize Controller data structures.
Definition at line 69 of file cp1616_io_controller.cpp.
Public instance accesssor.
Definition at line 32 of file cp1616_io_controller.cpp.
| PNIO_MODE_TYPE cp1616::Cp1616IOController::getCpCurrentModeFlag | ( | ) |
Definition at line 441 of file cp1616_io_controller.cpp.
Definition at line 428 of file cp1616_io_controller.cpp.
| int cp1616::Cp1616IOController::init | ( | ) |
Initializes and starts IO Controller.
Definition at line 211 of file cp1616_io_controller.cpp.
| void cp1616::Cp1616IOController::printInputData | ( | unsigned int | module | ) |
Definition at line 410 of file cp1616_io_controller.cpp.
| void cp1616::Cp1616IOController::printOutputData | ( | unsigned int | module | ) |
Debugging functions
Definition at line 397 of file cp1616_io_controller.cpp.
| void cp1616::Cp1616IOController::setCpCurrentModeFlag | ( | PNIO_MODE_TYPE | mode | ) |
Definition at line 433 of file cp1616_io_controller.cpp.
| void cp1616::Cp1616IOController::setCpReady | ( | int | cp_ready_value | ) |
Definition at line 423 of file cp1616_io_controller.cpp.
| void cp1616::Cp1616IOController::setSemModChange | ( | int | mod_change | ) |
Data encapsulation
Definition at line 446 of file cp1616_io_controller.cpp.
Closes and uninitializes IO Controller.
Definition at line 289 of file cp1616_io_controller.cpp.
Reads recieved data from IO Base layer.
Definition at line 348 of file cp1616_io_controller.cpp.
Writes data to IO Base library layer for transmission.
Definition at line 374 of file cp1616_io_controller.cpp.
Cp1616IOController * cp1616::Cp1616IOController::controller_instance_ = 0 [static, private] |
Definition at line 141 of file cp1616_io_controller.h.
volatile PNIO_MODE_TYPE cp1616::Cp1616IOController::cp_current_mode_ [private] |
Definition at line 148 of file cp1616_io_controller.h.
PNIO_UINT32 cp1616::Cp1616IOController::cp_handle_ [private] |
Definition at line 143 of file cp1616_io_controller.h.
PNIO_UINT32 cp1616::Cp1616IOController::cp_id_ [private] |
Definition at line 144 of file cp1616_io_controller.h.
volatile PNIO_IOXS cp1616::Cp1616IOController::cp_local_state_ [private] |
Definition at line 149 of file cp1616_io_controller.h.
int cp1616::Cp1616IOController::cp_ready_ [private] |
Definition at line 146 of file cp1616_io_controller.h.
const int cp1616::Cp1616IOController::INIT_DATA_VALUE = 0 [static, private] |
Definition at line 165 of file cp1616_io_controller.h.
std::vector<PNIO_ADDR> cp1616::Cp1616IOController::input_module_address_ [private] |
Definition at line 155 of file cp1616_io_controller.h.
PNIO_UINT32 cp1616::Cp1616IOController::input_module_count_ [private] |
Definition at line 151 of file cp1616_io_controller.h.
| std::vector<std::vector<PNIO_UINT8> > cp1616::Cp1616IOController::input_module_data_ |
2D array of input module data
Definition at line 119 of file cp1616_io_controller.h.
std::vector<PNIO_UINT32> cp1616::Cp1616IOController::input_module_data_length_ [private] |
Definition at line 153 of file cp1616_io_controller.h.
std::vector<PNIO_IOXS> cp1616::Cp1616IOController::input_module_state_ [private] |
Definition at line 154 of file cp1616_io_controller.h.
unsigned int cp1616::Cp1616IOController::input_module_total_data_size_ [private] |
Definition at line 152 of file cp1616_io_controller.h.
const int cp1616::Cp1616IOController::MAX_NUM_OF_INIT_ATTEMPTS = 1000 [static, private] |
Definition at line 164 of file cp1616_io_controller.h.
std::vector<PNIO_ADDR> cp1616::Cp1616IOController::output_module_address_ [private] |
Definition at line 161 of file cp1616_io_controller.h.
PNIO_UINT32 cp1616::Cp1616IOController::output_module_count_ [private] |
Definition at line 157 of file cp1616_io_controller.h.
| std::vector<std::vector<PNIO_UINT8> > cp1616::Cp1616IOController::output_module_data_ |
2D array of output module data
Definition at line 124 of file cp1616_io_controller.h.
std::vector<PNIO_UINT32> cp1616::Cp1616IOController::output_module_data_length_ [private] |
Definition at line 159 of file cp1616_io_controller.h.
std::vector<PNIO_IOXS> cp1616::Cp1616IOController::output_module_state_ [private] |
Definition at line 160 of file cp1616_io_controller.h.
unsigned int cp1616::Cp1616IOController::output_module_total_data_size_ [private] |
Definition at line 158 of file cp1616_io_controller.h.
int cp1616::Cp1616IOController::sem_mod_change_ [private] |
Definition at line 147 of file cp1616_io_controller.h.
const int cp1616::Cp1616IOController::WAIT_FOR_CALLBACKS_PERIOD = 100000 [static, private] |
Definition at line 163 of file cp1616_io_controller.h.