Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
cp1616::Cp1616IOController Class Reference

This class defines ROS-Profinet IO Controller implementation for communication processor Siemens CP1616. More...

#include <cp1616_io_controller.h>

List of all members.

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 Cp1616IOControllergetControllerInstance ()
 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 Cp1616IOControllercontroller_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

Detailed Description

This class defines ROS-Profinet IO Controller implementation for communication processor Siemens CP1616.

Definition at line 40 of file cp1616_io_controller.h.


Constructor & Destructor Documentation

Destructs an IOController object.

Definition at line 64 of file cp1616_io_controller.cpp.

Definition at line 41 of file cp1616_io_controller.cpp.


Member Function Documentation

int cp1616::Cp1616IOController::addInputModule ( unsigned int  input_size,
unsigned int  input_start_address 
)

Adds input module to Controller data structre.

Parameters:
input_sizeinput data length according to STEP7 setup
input_start_addressI address according to STEP7 setup
Returns:
0 if input module added successfully

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.

Parameters:
output_sizeoutput data length according to STEP7 setup
output_start_addressQ address according to STEP7 setup
Returns:
0 if input module added successfully

Definition at line 177 of file cp1616_io_controller.cpp.

int cp1616::Cp1616IOController::changePnioMode ( PNIO_MODE_TYPE  requested_mode)

Changes IO Controller mode.

Parameters:
requested_modeOFFLINE/OPERATE/CLEAR
Returns:
error_code (see pnioerrx.h for detailed description)

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.

Definition at line 441 of file cp1616_io_controller.cpp.

Definition at line 428 of file cp1616_io_controller.cpp.

Initializes and starts IO Controller.

Returns:
error_code if succeded (see pnioerrx.h for detailed description)

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.

Data encapsulation

Definition at line 446 of file cp1616_io_controller.cpp.

Closes and uninitializes IO Controller.

Returns:
error_code if succeded (see pnioerrx.h for detailed description)

Definition at line 289 of file cp1616_io_controller.cpp.

Reads recieved data from IO Base layer.

Returns:
error_code (see pnioerrx.h for detailed description)

Definition at line 348 of file cp1616_io_controller.cpp.

Writes data to IO Base library layer for transmission.

Returns:
error_code (see pnioerrx.h for detailed description)

Definition at line 374 of file cp1616_io_controller.cpp.


Member Data Documentation

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.

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.

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.

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.

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.

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.

Definition at line 158 of file cp1616_io_controller.h.

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.


The documentation for this class was generated from the following files:


cp1616
Author(s):
autogenerated on Fri Aug 28 2015 13:08:36