diff --git a/pom.xml b/pom.xml index cc37f389ce9b688ef077858a1a80b28e8888a277..258dc7f8290236c5c6a6768f4685e3d1373e627d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ </parent> <groupId>fr.soleil.device</groupId> <artifactId>CryoCooler-${aol}-${mode}</artifactId> - <version>1.1.8</version> + <version>1.1.9</version> <packaging>nar</packaging> <name>CryoCooler</name> <!-- use for the name of executable --> diff --git a/src/CryoCoolerInterface.cpp b/src/CryoCoolerInterface.cpp index d81634c099bba65ff13b9a838adf85aab6352ee8..d740d46261e18b341b0c91b1eff41f864999aaa1 100755 --- a/src/CryoCoolerInterface.cpp +++ b/src/CryoCoolerInterface.cpp @@ -625,6 +625,59 @@ namespace CryoCooler_ns //----------------------------------------------- void CryoCoolerInterface::periodic_job_i (void) { - DEBUG_STREAM << "CryoCoolerInterface::periodic_job_i trying to read PLC Data " << std::endl; + + long l_com_error = 0; +#ifdef _DB_SEGMENTATION_BY_104_ + //- hwp_rd_start is alive + if (hwp_rd_start) + { + l_com_error += hwp_rd_start->get_com_error(); + this->com_state = hwp_rd_start->get_com_state(); + if (com_state == HWProxy_ns::HWP_COMMUNICATION_ERROR) + { + this->com_status = hwp_rd_start->get_com_status(); + this->last_error = hwp_rd_start->get_last_error(); + return; + } + } + //- hwp_rd_end is alive + if (hwp_rd_end) + { + l_com_error += hwp_rd_end->get_com_error(); + this->com_state = hwp_rd_end->get_com_state(); + if (com_state == HWProxy_ns::HWP_COMMUNICATION_ERROR) + { + this->com_status = hwp_rd_end->get_com_status(); + this->last_error = hwp_rd_end->get_last_error(); + return; + } + } +#else + if (hwp) + { + l_com_error += hwp->get_com_error(); + this->com_state = hwp->get_com_state(); + if (com_state == HWProxy_ns::HWP_COMMUNICATION_ERROR) + { + this->com_status = hwp->get_com_status(); + this->last_error = hwp->get_last_error(); + return; + } + } +#endif + //- hwp_wr is alive + if (hwp_wr) + { + l_com_error += hwp_wr->get_com_error(); + this->com_state = hwp_wr->get_com_state(); + if (com_state == HWProxy_ns::HWP_COMMUNICATION_ERROR) + { + this->com_status = hwp_wr->get_com_status(); + this->last_error = hwp_wr->get_last_error(); + return; + } + } + this->com_error = l_com_error; + } } //- namespace diff --git a/src/TypesAndConsts.h b/src/TypesAndConsts.h index 3bbcf57afd77baab37fe53c94f6a2f0b0d1d31dd..ef8997e31b1194716d58f8a60dc92db274e4e548 100755 --- a/src/TypesAndConsts.h +++ b/src/TypesAndConsts.h @@ -8,8 +8,6 @@ //============================================================================= #ifndef __TYPES_AND_CONSTS_H__ #define __TYPES_AND_CONSTS_H__ -#include <math.h> - namespace CryoCooler_ns { @@ -34,7 +32,14 @@ namespace CryoCooler_ns //- DB_WRITE constantes static unsigned int DB_WRITE_INPUT_OFFSET = 0; - static unsigned int DB_WRITE_INPUT_LEN = 0; + + // ------------------------------------------- + // - WRITE must be = READ_WRITE. + // At least one element in input zone otherwise + // the read_hard () method raises an exception. + // Pb corrected in PLCServerProxy version 3.0.5 + // ---------------------------------------------- + static unsigned int DB_WRITE_INPUT_LEN = 1; static unsigned int DB_WRITE_OUTPUT_OFFSET = 0; static unsigned int DB_WRITE_OUTPUT_LEN = 100;