Changeset 19923


Ignore:
Timestamp:
Jan 15, 2020, 5:54:56 PM (5 days ago)
Author:
tbretz
Message:
Added a temp limit of 55°C for all sensors
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/fscctrl.cc

    r19585 r19923  
    3535    uint16_t fTempMin;
    3636    uint16_t fTempMax;
     37
     38    uint16_t fTempExceeded55;
    3739
    3840    size_t fNumConsecutiveErrors;   // Number of consecutive messages with errors
     
    259261        //1300=76
    260262        //DD 2019/09/01: changed from 970 to 980 as sensor 19 had values slighly larger than -7.6
     263        // Note that these values are not only the temperature sensors in the compartment
     264        // but also all other tempereture sensors in the electronics!
    261265
    262266        const auto min = GetTempPT1000(fTempMin);
    263267
     268        bool tempgt50 = false;
    264269        for (int *pt=mapt; *pt>=0; pt++)
    265270        {
    266271            const bool valid = resist[*pt]>=fTempMin && resist[*pt]<=fTempMax;
    267272            temperatures.push_back(valid ? GetTempPT1000(resist[*pt]) : 0);
     273
     274            if (temperatures.back()>55)
     275            {
     276                Warn("Temperature sensor "+to_string(temperatures.size()-1)+" exceeds 55 degC!");
     277                tempgt50 = true;
     278            }
    268279
    269280            if (valid && temperatures.back()<min+1)
    270281                Warn(Tools::Form("Temperature sensor %2d has reading (%d=%.2f degC) closer than 1K to lower limit (%d=%.2f degC)",
    271282                                 temperatures.size()-1, resist[*pt], temperatures.back(), fTempMin, min));
    272 
     283        }
     284
     285        if (tempgt50)
     286            fTempExceeded55++;
     287        else
     288            fTempExceeded55 = 0;
     289
     290        if (fTempExceeded55==3)
     291        {
     292            Error("EMERGENCY: This is the third time in a row that any of the tempereture sensors exceeds 50 degC.");
     293            Dim::SendCommandNB("BIAS_CONTROL/VOLTAGE_OFF");
     294            Error("Sending 'BIAS_CONTROL/VOLTAGE_OFF'.");
     295
     296            Dim::SendCommandNB("PWR_CONTROL/CAMERA_POWER", uint8_t(0));
     297            Error("Sending 'PWR_CONTROL/CAMERA_POWER off'.");
     298
     299            Dim::SendCommandNB("AGILENT_CONTROL_50V/SET_POWER", uint8_t(0));
     300            Error("Sending 'AGILENT_CONTROL_50V/SET_POWER off'.");
     301
     302            Dim::SendCommandNB("AGILENT_CONTROL_80V/SET_POWER", uint8_t(0));
     303            Error("Sending 'AGILENT_CONTROL_80V/SET_POWER off'.");
    273304        }
    274305
     
    575606public:
    576607    ConnectionFSC(ba::io_service& ioservice, MessageImp &imp) : Connection(ioservice, imp()),
    577         fIsVerbose(false), fIsAutoReconnect(false), fTempMin(0), fTempMax(65535), fReconnectTimeout(ioservice)
     608        fIsVerbose(false), fIsAutoReconnect(false),
     609        fTempMin(0), fTempMax(65535), fTempExceeded55(0),
     610        fReconnectTimeout(ioservice)
    578611    {
    579612        SetLogStream(&imp);
Note: See TracChangeset for help on using the changeset viewer.