diff --git a/src/Ionpump.cpp b/src/Ionpump.cpp index 8f93205d13f477ca7c915a1d92215819758de8b9..b006bceef0e26f63dff5ebe00f084462df3f21cd 100644 --- a/src/Ionpump.cpp +++ b/src/Ionpump.cpp @@ -210,7 +210,7 @@ void Ionpump::always_executed_hook() sprintf(mask,"StatMask%d",channel); string stat_attr(mask); - long statmask = 0; + Tango::DevLong statmask = 0; try { devps->read_attribute(stat_attr) >> statmask; @@ -218,13 +218,15 @@ void Ionpump::always_executed_hook() if ((statmask & 0x4) || (statmask & 0xE0)) { set_state(Tango::FAULT); s << "Ion pump ERROR" << endl; - } else if (statmask & 0x1) { - set_state(Tango::ON); - s << "Ion pump is ON" << endl; } else { - set_state(Tango::OFF); - s << "Ion pump is OFF" << endl; - } + if (statmask & 0x1) { + set_state(Tango::ON); + s << "Ion pump is ON" << endl; + } else { + set_state(Tango::OFF); + s << "Ion pump is OFF" << endl; + } + } } catch(Tango::DevFailed &e) { set_state(Tango::FAULT); s << "Error reading PS status" << endl;