diff --git a/device/expmag.cxx b/device/expmag.cxx index 7354c95..2259218 100644 --- a/device/expmag.cxx +++ b/device/expmag.cxx @@ -3906,12 +3906,17 @@ mode_again: if (value == 0.0) { // if this device was set to 0.0 int i; + float chk[EMNDEVS]; newmode = 1; // assume ACTIVE mode // and check other magnets + if (get_demand_array(info, chk) != DB_SUCCESS) + for (i = 0; i < EMNDEVS; i++) + chk[i] = info->set_values[i]; + for (i=0;iexpmag_settings.used[i] == 'Y') { - if (info->set_values[i] != 0.0) { + if (chk[i] != 0.0) { // HELM == -1 and HELMH2DAC or WEH82 == -1 are special cases. // special case: HELM is not used to set field (-1). // -1 is used to change polarity to attach another power @@ -3924,7 +3929,7 @@ mode_again: #else (strcmp(info->expmag_settings.device[i],"HELMH2DAC") == 0) #endif - ) && (info->set_values[i] == -1.0)) { + ) && (chk[i] == -1.0)) { /* do nothing */; } else { newmode = 2; // switch to TABLE mode