diff --git a/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsPLC.cpp b/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsPLC.cpp index dbb1c9c50dfb7328506e27a3a8ba289c908cbdc6..666340075bbe35b58b6eab3344c6ff1f75ccf21a 100644 --- a/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsPLC.cpp +++ b/silecs-communication-cpp/src/silecs-communication/interface/equipment/SilecsPLC.cpp @@ -243,7 +243,7 @@ namespace Silecs { if( pDeviceIter->second->hasBlock((*blockIter)->getName())) { - LOG(COMM) << "Updating block '" << (*blockIter)->getName() << "' for device '" << pDeviceIter->second->getLabel()<< "'"; + LOG(COMM) << "Updating block '" << (*blockIter)->getName() << "' for device '" << pDeviceIter->second->getLabel()<< "'"; pDeviceIter->second->recv((*blockIter)->getName()); } } @@ -449,9 +449,7 @@ namespace Silecs case S7Protocol: theConn = new SNAP7Connection(this); break; case MBProtocol: -#ifdef MODBUS_SUPPORT_ENABLED theConn = new MBConnection(this); break; -#endif case CNVProtocol: #ifdef NI_SUPPORT_ENABLED theConn = new CNVConnection(this);break; @@ -552,56 +550,50 @@ namespace Silecs PLCModel PLC::whichPLCModel(std::string model) { StringUtilities::toLower(model); - if (model == "simatic_et-200s") return ET200S; - else if (model == "simatic_s7-300") return S7300; - else if (model == "simatic_s7-400") return S7400; - else if (model == "simatic_s7-1200") return S71200; - else if (model == "simatic_s7-1500") return S71500; - else if (model == "premium") return Premium; - else if (model == "quantum") return Quantum; - else if (model == "m340") return M340; - else if (model == "bc9020") return BC9020; - else if (model == "cx9020") return CX9020; - else if (model == "rabbit_rcm_4010") return RCM4010; - else if (model == "rabbit_rcm_2000") return RCM2000; - else if (model == "compact_rio") return CompactRIO; - else if (model == "pxi_rt") return PXIRT; - else if (model == "pxi_windows") return PXIWindows; - else if (model == "pc_windows") return PCWindows; - else if (model == "linux_x64") return PCLinux64; - else if (model == "linux_i386") return PCLinux32; - else if (model == "other_support_cnv") return OtherSupportCNV; + if (model == "simatic_et-200s") return ET200S; + else if (model == "simatic_s7-300") return S7300; + else if (model == "simatic_s7-400") return S7400; + else if (model == "simatic_s7-1200") return S71200; + else if (model == "simatic_s7-1500") return S71500; + else if (model == "premium") return Premium; + else if (model == "quantum") return Quantum; + else if (model == "m340") return M340; + else if (model == "bc9020") return BC9020; + else if (model == "cx9020") return CX9020; + else if (model == "rcm_4010") return RCM4010; + else if (model == "rcm_2000") return RCM2000; + else if (model == "compact_rio") return CompactRIO; + else if (model == "pxi_rt") return PXIRT; + else if (model == "pxi_windows") return PXIWindows; + else if (model == "pc_windows") return PCWindows; + else if (model == "other_support_cnv") return OtherSupportCNV; else throw SilecsException(__FILE__, __LINE__, DATA_UNKNOWN_PLC_MODEL, model); } PLCSystem PLC::whichPLCSystem(std::string system) { - StringUtilities::toLower(system); - if (system == "step-7") return Step7; - if (system == "tia-portal") return TiaPortal; - else if (system == "unity pro") return Unity; - else if (system == "twincat") return TwinCat; - else if (system == "standard-c") return StdC; - else if (system == "s7 virtual controller") return ServerS7; - else if (system == "modbus virtual controller")return ServerMB; - else if (system == "labview") return Labview; + StringUtilities::toLower(system); + if (system == "step-7") return Step7; + if (system == "tia-portal") return TiaPortal; + else if (system == "unity pro") return Unity; + else if (system == "twincat") return TwinCat; + else if (system == "standard-c") return StdC; + else if (system == "labview") return Labview; else throw SilecsException(__FILE__, __LINE__, DATA_UNKNOWN_PLC_SYSTEM, system); } ProtocolType PLC::whichProtocolType(std::string system) - { + { StringUtilities::toLower(system); - if (system == "step-7") return S7Protocol; - if (system == "tia-portal") return S7Protocol; - else if (system == "unity pro") return MBProtocol; - else if (system == "twincat") return MBProtocol; - else if (system == "standard-c") return MBProtocol; - else if (system == "s7 virtual controller") return S7Protocol; - else if (system == "modbus virtual controller") return MBProtocol; - else if (system == "labview") return CNVProtocol; + if (system == "step-7") return S7Protocol; + if (system == "tia-portal") return S7Protocol; + else if (system == "unity pro") return MBProtocol; + else if (system == "twincat") return MBProtocol; + else if (system == "standard-c") return MBProtocol; + else if (system == "labview") return CNVProtocol; else throw SilecsException(__FILE__, __LINE__, DATA_UNKNOWN_PLC_SYSTEM, system); - } + } ProtocolMode PLC::whichProtocolMode(std::string mode)