UniSet 2.32.1
Открытые члены | Открытые статические члены | Защищенные члены | Защищенные данные | Полный список членов класса
Класс uniset::MBTCPMultiMaster

#include <MBTCPMultiMaster.h>

Граф наследования:uniset::MBTCPMultiMaster:
Inheritance graph
[см. легенду]
Граф связей класса uniset::MBTCPMultiMaster:
Collaboration graph
[см. легенду]

Открытые члены

 MBTCPMultiMaster (uniset::ObjectId objId, uniset::ObjectId shmID, const std::shared_ptr< SharedMemory > &ic=nullptr, const std::string &prefix="mbtcp")
 
virtual uniset::SimpleInfogetInfo (const char *userparam=0) override
 
- Открытые члены унаследованные от uniset::MBExchange
 MBExchange (uniset::ObjectId objId, uniset::ObjectId shmID, const std::shared_ptr< SharedMemory > &ic=nullptr, const std::string &prefix="mb")
 
void execute ()
 
std::shared_ptr< LogAgregatorgetLogAggregator ()
 
std::shared_ptr< DebugStreamlog ()
 
bool reload (const std::string &confile)
 
- Открытые члены унаследованные от uniset::UniSetObject
 UniSetObject (const std::string &name, const std::string &section)
 
 UniSetObject (uniset::ObjectId id)
 
virtual CORBA::Boolean exist () override
 
virtual uniset::ObjectId getId () override
 
const uniset::ObjectId getId () const
 
std::string getName () const
 
virtual uniset::ObjectType getType () override
 
const std::string getStrType ()
 
virtual uniset::SimpleInfoapiRequest (const char *query) override
 
virtual void push (const uniset::TransportMessage &msg) override
 поместить сообщение в очередь
 
virtual void pushMessage (const char *msg, ::CORBA::Long mtype, const ::uniset::Timespec &tm, const ::uniset::ProducerInfo &pi, ::CORBA::Long priority, ::CORBA::Long consumer) override
 поместить текстовое сообщение в очередь
 
virtual Poco::JSON::Object::Ptr httpGet (const Poco::URI::QueryParameters &p) override
 
uniset::ObjectPtr getRef () const
 
std::shared_ptr< UniSetObjectget_ptr ()
 
virtual timeout_t askTimer (uniset::TimerId timerid, timeout_t timeMS, clock_t ticks=-1, uniset::Message::Priority p=uniset::Message::High) override
 
- Открытые члены унаследованные от uniset::LT_Object
timeout_t checkTimers (UniSetObject *obj)
 
timeout_t getTimeInterval (uniset::TimerId timerid) const
 
timeout_t getTimeLeft (uniset::TimerId timerid) const
 

Открытые статические члены

static std::shared_ptr< MBTCPMultiMasterinit_mbmaster (int argc, const char *const *argv, uniset::ObjectId shmID, const std::shared_ptr< SharedMemory > &ic=nullptr, const std::string &prefix="mbtcp")
 
static void help_print (int argc, const char *const *argv)
 
- Открытые статические члены унаследованные от uniset::MBExchange
static void help_print (int argc, const char *const *argv)
 
static uint8_t firstBit (uint16_t mask)
 
static uint16_t getBits (uint16_t value, uint16_t mask, uint8_t offset)
 
static uint16_t setBits (uint16_t value, uint16_t set, uint16_t mask, uint8_t offset)
 
static uint16_t forceSetBits (uint16_t value, uint16_t set, uint16_t mask, uint8_t offset)
 

Защищенные члены

virtual void sysCommand (const uniset::SystemMessage *sm) override
 
virtual void initIterators () override
 
virtual std::shared_ptr< ModbusClientinitMB (bool reopen=false) override
 
virtual bool deactivateObject () override
 Деактивация объекта (переопределяется для необходимых действий при завершении работы)
 
virtual bool reconfigure (const std::shared_ptr< uniset::UniXML > &xml, const std::shared_ptr< uniset::MBConfig > &mbconf) override
 
void initCheckConnectionParameters ()
 
void initGateList (uniset::UniXML::iterator it, const std::shared_ptr< uniset::MBConfig > &mbconf)
 
void poll_thread ()
 
void check_thread ()
 
void final_thread ()
 
- Защищенные члены унаследованные от uniset::MBExchange
virtual void step ()
 
virtual void sensorInfo (const uniset::SensorMessage *sm) override
 
virtual void timerInfo (const uniset::TimerMessage *tm) override
 
virtual void askSensors (UniversalIO::UIOCommand cmd)
 
virtual void initOutput ()
 
virtual bool activateObject () override
 Активизация объекта (переопределяется для необходимых действий после активизации)
 
virtual void initValues ()
 
virtual Poco::JSON::Object::Ptr httpHelp (const Poco::URI::QueryParameters &p) override
 
virtual Poco::JSON::Object::Ptr httpRequest (const std::string &req, const Poco::URI::QueryParameters &p) override
 
void firstInitRegisters ()
 
bool preInitRead (MBConfig::InitList::iterator &p)
 
bool initSMValue (ModbusRTU::ModbusData *data, int count, MBConfig::RSProperty *p)
 
virtual bool poll ()
 
bool pollRTU (std::shared_ptr< MBConfig::RTUDevice > &dev, MBConfig::RegMap::iterator &it)
 
void updateSM ()
 
void updateRTU (MBConfig::RegMap::iterator &it)
 
void updateMTR (MBConfig::RegMap::iterator &it)
 
void updateRTU188 (MBConfig::RegMap::iterator &it)
 
void updateRSProperty (MBConfig::RSProperty *p, bool write_only=false)
 
virtual void updateRespondSensors ()
 
bool isUpdateSM (bool wrFunc, long devMode) const noexcept
 
bool isPollEnabled (bool wrFunc) const noexcept
 
bool isSafeMode (std::shared_ptr< MBConfig::RTUDevice > &dev) const noexcept
 
bool isProcActive () const
 
void setProcActive (bool st)
 
bool waitSMReady ()
 
bool readItem (const std::shared_ptr< UniXML > &xml, UniXML::iterator &it, xmlNode *sec)
 
bool initItem (UniXML::iterator &it)
 
void initOffsetList ()
 
std::string initPropPrefix (const std::string &def_prop_prefix)
 
- Защищенные члены унаследованные от uniset::UniSetObject
virtual void processingMessage (const uniset::VoidMessage *msg)
 
virtual void onTextMessage (const uniset::TextMessage *tm)
 
VoidMessagePtr receiveMessage ()
 
VoidMessagePtr waitMessage (timeout_t msec=UniSetTimer::WaitUpTime)
 
void termWaiting ()
 
size_t countMessages ()
 
size_t getCountOfLostMessages () const
 
void uterminate ()
 
void thread (bool create)
 
void offThread ()
 
void onThread ()
 
virtual void callback ()
 
void setID (uniset::ObjectId id)
 
void setThreadPriority (Poco::Thread::Priority p)
 
void setMaxSizeOfMessageQueue (size_t s)
 
size_t getMaxSizeOfMessageQueue () const
 
bool isActive () const
 
void setActive (bool set)
 
virtual Poco::JSON::Object::Ptr httpGetMyInfo (Poco::JSON::Object::Ptr root)
 
Poco::JSON::Object::Ptr request_configure (const std::string &req, const Poco::URI::QueryParameters &p)
 
Poco::JSON::Object::Ptr request_configure_get (const std::string &req, const Poco::URI::QueryParameters &p)
 
Poco::JSON::Object::Ptr request_configure_by_name (const std::string &name, const std::string &props)
 
Poco::JSON::Object::Ptr request_params (const std::string &req, const Poco::URI::QueryParameters &p)
 
virtual Poco::JSON::Object::Ptr request_params_get (const std::string &req, const Poco::URI::QueryParameters &p)
 
virtual Poco::JSON::Object::Ptr request_params_set (const std::string &req, const Poco::URI::QueryParameters &p)
 
- Защищенные члены унаследованные от uniset::LT_Object
virtual std::string getTimerName (int id) const
 
TimersList getTimersList () const
 

Защищенные данные

uniset::uniset_rwmutex mbMutex
 
bool force_disconnect
 
timeout_t checktime
 
timeout_t defaultIgnoreTimeout
 
timeout_t channelTimeout
 
- Защищенные данные унаследованные от uniset::MBExchange
bool allInitOK
 
xmlNode * cnode = { 0 }
 
std::shared_ptr< SMInterfaceshm
 
timeout_t initPause = { 3000 }
 
uniset::uniset_rwmutex mutex_start
 
bool force = { false }
 
bool force_out = { false }
 
PassiveTimer ptHeartBeat
 
uniset::ObjectId sidHeartBeat = { uniset::DefaultObjectId }
 
long maxHeartBeat = { 10 }
 
IOController::IOStateList::iterator itHeartBeat
 
uniset::ObjectId sidTestSMReady = {uniset::DefaultObjectId }
 
uniset::ObjectId sidExchangeMode = { uniset::DefaultObjectId }
 
IOController::IOStateList::iterator itExchangeMode
 
long exchangeMode = { MBConfig::emNone }
 
std::atomic_bool activated = { false }
 
std::atomic_bool canceled = { false }
 
timeout_t activateTimeout = { 20000 }
 
bool notUseExchangeTimer = { false }
 
timeout_t stat_time = { 0 }
 
size_t poll_count = { 0 }
 
PassiveTimer ptStatistic
 
std::string statInfo = { "" }
 
std::shared_ptr< ModbusClientmb
 
PassiveTimer ptReopen
 
Trigger trReopen
 
PassiveTimer ptInitChannel
 
std::shared_ptr< LogAgregatorloga
 
std::shared_ptr< DebugStreammblog
 
std::shared_ptr< LogServerlogserv
 
std::string logserv_host = {""}
 
int logserv_port = {0}
 
const std::shared_ptr< SharedMemoryic
 
VMonitor vmon
 
size_t ncycle = { 0 }
 
std::shared_ptr< uniset::MBConfigmbconf
 
uniset::uniset_rwmutex mutex_conf
 
- Защищенные данные унаследованные от uniset::UniSetObject
std::shared_ptr< UInterfaceui
 
std::string myname
 
std::weak_ptr< UniSetManagermymngr
 
- Защищенные данные унаследованные от uniset::LT_Object
timeout_t sleepTime
 

Дополнительные унаследованные члены

- Открытые типы унаследованные от uniset::MBExchange
enum  Timer { tmExchange }
 
- Защищенные типы унаследованные от uniset::LT_Object
typedef std::deque< TimerInfoTimersList
 

Подробное описание

Реализация Modbus TCP MultiMaster для обмена с многими ModbusRTU устройствами
через один modbus tcp шлюз, доступный по нескольким ip-адресам.
Чтобы не зависеть от таймаутов TCP соединений, которые могут неопределённо зависать
на создании соединения с недоступным хостом. Обмен вынесен в отдельный поток. При этом в этом же потоке обновляются данные в SM. В свою очередь информация о датчиках связи обновляется в основном потоке (чтобы не зависеть от TCP).

Методы

◆ deactivateObject()

bool MBTCPMultiMaster::deactivateObject ( )
overrideprotectedvirtual

Деактивация объекта (переопределяется для необходимых действий при завершении работы)

Переопределяет метод предка uniset::MBExchange.

◆ getInfo()

uniset::SimpleInfo * MBTCPMultiMaster::getInfo ( const char * userparam = 0)
overridevirtual

Переопределяет метод предка uniset::MBExchange.

◆ init_mbmaster()

std::shared_ptr< MBTCPMultiMaster > MBTCPMultiMaster::init_mbmaster ( int argc,
const char *const * argv,
uniset::ObjectId shmID,
const std::shared_ptr< SharedMemory > & ic = nullptr,
const std::string & prefix = "mbtcp" )
static

глобальная функция для инициализации объекта

◆ initIterators()

void MBTCPMultiMaster::initIterators ( )
overrideprotectedvirtual

Переопределяет метод предка uniset::MBExchange.

◆ initMB()

std::shared_ptr< ModbusClient > MBTCPMultiMaster::initMB ( bool reopen = false)
overrideprotectedvirtual

Замещает uniset::MBExchange.

◆ reconfigure()

bool MBTCPMultiMaster::reconfigure ( const std::shared_ptr< uniset::UniXML > & xml,
const std::shared_ptr< uniset::MBConfig > & mbconf )
overrideprotectedvirtual

Переопределяет метод предка uniset::MBExchange.

◆ sysCommand()

void MBTCPMultiMaster::sysCommand ( const uniset::SystemMessage * sm)
overrideprotectedvirtual

Переопределяет метод предка uniset::MBExchange.