Loading…

方法名称: PST_calib_method

方法ID: 0x433C

方法标签: PST Calibration

方法描述:


  • {
  • float qa, qb, qc, qd, qe, mpp; int q, q0, q1, q2, q3, q4, q5, q6, q7, q8; char S[3];
  • int q01, q02, q03, q04, q05, q06, q07, q08, q09, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, q21, q22, q23, q24, q25, q26, q27, q28, q29, q30, q31, q32, q33, q34, q35, q36, q37, q38, q39, q40, qj, qk, qm; float qa0, qa1, qa2, qa3, qa4, qa5, qa6, qa7, qa8, qa9, qb0, qb1, qb2, qb3, qb4, qb5, qb6, qb7, qb8, qb9, qc0, qc1, qc2, qc3, qc4, qc5, qc6, qc7, qc8, qc9, qd0, qd1, qd2, qd3, qd4, qd5, qd6, qd7, qd8, qd9, qe0, qe1, qe2, qe3, qe4, qe5, qe6, qe7, qe8, qx, qy, qz;
  • int i;
  • float fRoundingFactor;
  • long ids[3];
  • _set_device_status(0xFF,0);
  • _set_xmtr_device_status(0xFF,0);
  • _set_all_resp_code(1);
  • _set_resp_code((8),0);
  • send(151,S); if(_ivar_value(16804)>2) { ACKNOWLEDGE("|en|The DD revision is not compatible with the firmware in the device.\nContact your Fisher sales office for an upgrade to your DD."); return; };
  • if(((_ivar_value(16532)&0x18)>0)) { ACKNOWLEDGE("|en|This instrument's Relay Type is set to a High Cv Spool Valve. This is not supported by this version of the DD. Please use a version of ValveLink Software or ValveLink Mobile that supports the High Cv Relay Type to properly configure this instrument."); process_abort(); };
  • q = 0.9; fRoundingFactor = 0.0; if(q < 1) fRoundingFactor = 0.5;
  • if(_ivar_value(16509) == 0x02)
  • {
  • ACKNOWLEDGE("|en|This operation is not supported in Press Control Mode. Please switch the device to Tvl Control mode and try again.");
  • process_abort();
  • }
  • send_trans(129,0,S); _vassign(16452,16427); save_values(); if(1==_ivar_value(167)) { ACKNOWLEDGE("|en|Protection must be disabled to perform this operation."); process_abort(); } if((_ivar_value(16427))) { if(((_ivar_value(16465) & 0x01C0) == 0x0100)) { _get_dev_var_value(("|en|WARNING! Output will not track input and the SIS safety function will be disabled when Instrument Mode is Out of Service."),0,16452); } else { _get_dev_var_value(("|en|WARNING! Output will not track input when Instrument Mode is Out of Service."),0,16452); } save_values(); if(_ivar_value(16452)>0) { ACKNOWLEDGE("|en|Instrument Mode is still In Service."); process_abort(); } else { send_trans(130,6,S); } } send_trans(129,0,S); if((1==_ivar_value(16472)) || (5==_ivar_value(16472))) { if(1==_ivar_value(16472)) { ACKNOWLEDGE("|en|Access restricted\n\nInstrument was set to 'Out of Service' by a secondary master."); } else { ACKNOWLEDGE("|en|Access restricted\n\nInstrument was set to 'Out of Service' by a primary master."); } process_abort(); } _add_abort_method(17167); DELAY(1,"|en|Please wait...");
  • if(1 - SELECT_FROM_LIST("|en|WARNING! Calibration will cause sudden changes in instrument output and loss of process control.","|en|Continue;Exit"))
  • {
  • send(138,S); q0 = 0; q1 = 1; while((_ivar_value(16792) & 0x08) > 0) { if(1 == q1) { send_trans(129,35,S); if((1 == _ivar_value(16464)) && ((_ivar_value(16794)) & 0x08)) { q0 = SELECT_FROM_LIST("|en|The Auxiliary Terminal Action is configured for a connected local control panel, but no local control panel is detected. You will need to correct the Auxiliary Terminal Action configuration or exit and fix the connected local control panel.","|en|Change Configuration;Exit"); if(0 == q0) { q == SELECT_FROM_LIST("|en|Aux Term Action","|en|Disabled;PST Diagnostic"); _iassign(16464,((2 * q))); send_trans(130,89,S); } } } if(0 == q0) { q0 = SELECT_FROM_LIST("|en|Instrument is locked in safety and must be unlocked before proceeding.\nWARNING! Unlocking the device may cause the valve to move.","|en|Unlock;Exit"); } if(1 == q0) { remove_all_abort(); _add_abort_method(17167); process_abort(); } if(1 == q1) { q2 = _ivar_value(16529); if(2 == q2) q2 = -1; q2 = q2 * ((-2 * _ivar_value(16508)) + 1); if(0 == 0) { if((_ivar_value(171) == 0)) { if(2 == _ivar_value(16529)) { qa = 0.0; } else { qa = 1.0; } _fassign(16640,(qa)); send_trans(130,77,S); } _iassign(16452,(1)); save_values(); send_trans(130,6,S); } } if((_ivar_value(171) == 0)) { if(1 == q1) { q1 = 2; _fassign(16405,((qa * 100.0))); save_values(); send_trans(130,4,S); } if(1 == _ivar_value(16464)) { ACKNOWLEDGE("|en|To unlock the device, press the button next to GREEN light on Local Control Panel for more than 1/2 sec."); } else { ACKNOWLEDGE("|en|To unlock the device, short the Aux. terminals between 3 and 5 secs."); } } else { if(1 == _ivar_value(16464)) { if(q2 < 0) { ACKNOWLEDGE("|en|To unlock the device\n1. Set the input current to 8 mA if the Local Control Panel is loop powered or 4 mA if the LCP has a seperate power supply.\n2. Press the button next to GREEN light on Local Control Panel for more than 1/2 sec."); } else { ACKNOWLEDGE("|en|To unlock the device\n1. Set the input current to 20 mA.\n2. Press the button next to GREEN light on Local Control Panel for more than 1/2 sec."); } } else { if(q2 < 0) { ACKNOWLEDGE("|en|To unlock the device\n1. Set the input current to 4 mA.\n2. Short the Aux. terminals between 3 and 5 secs."); } else { ACKNOWLEDGE("|en|To unlock the device\n1. Set the input current to 20 mA.\n2. Press the button next to GREEN light on Local Control Panel for more than 1/2 sec."); } } } send(138,S); } if(0 == 0) { _iassign(16452,(0)); save_values(); send_trans(130,6,S); send_trans(129,0,S); };
  • if(((_ivar_value(16496) & 0x01) > 0)) { if((_ivar_value(171) == 0)) { ACKNOWLEDGE("|en|The Hardware Shutdown DIP switch on the main electronics board must be Disabled to operate in multidrop mode."); process_abort(); } else { send(3,S); if((3 == _ivar_value(16496))) { while (_fvar_value(237) > 9.0) { if(select_from_list("|en|Adjust the Analog Input current to move the valve to its normal (not tripped) position.", ids,"|en|Adjust Analog Input and continue;Exit")) { process_abort(); } send(3,S); } } if((1 == _ivar_value(16496))) { while (_fvar_value(237) < 15.0) { if(select_from_list("|en|Adjust the Analog Input current to move the valve to its normal (not tripped) position.", ids,"|en|Adjust Analog Input and continue;Exit")) { process_abort(); } send(3,S); } } } } else { send(138,S); if((_ivar_value(171) > 0)) { send(3,S); while (_fvar_value(237) < 3.8) { if(select_from_list("|en|Input must exceed 3.8 mA (7.8 mA if loop powered local control panel is attached.)", ids,"|en|Adjust Analog Input and continue;Exit")) { process_abort(); } send(3,S); } }; };
  • send(138,S); send_trans(129,0,S); if(((_ivar_value(16790) & 0x31) > 0) || (_ivar_value(10098) == 0)) { send_trans(142,8,S); send_trans(142,1,S); send_trans(157,0,S); if(1 != _ivar_value(167)) { _iassign(16622,(0)); save_values(); send_trans(130,75,S); } if((_ivar_value(171) == 0)) _iassign(16453,(2)); else _iassign(16453,(3)); save_values(); send_trans(130,7,S); send_trans(129,0,S); DELAY(1,"|en|Please wait..."); };
  • send_trans(129, 29, S);
  • send_trans(129, 62, S);
  • send_trans(129, 35, S);
  • send_trans(129, 18, S);
  • q03 = local_var_117;
  • q04 = act_style;
  • qb4 = supply_press;
  • qe7 = _fvar_value(16585);
  • if(((_ivar_value(16508) == 0) && (_ivar_value(16529) == 1)) || ((_ivar_value(16508) == 1) && (_ivar_value(16529) == 2)) )
  • {
  • q01 = 1;
  • }
  • else if(((_ivar_value(16508) == 0) && (_ivar_value(16529) == 2)) || ((_ivar_value(16508) == 1) && (_ivar_value(16529) == 1)) )
  • {
  • q01 = 2;
  • }
  • else
  • {
  • q01 = 0;
  • }
  • q02 = 0;
  • if(((_ivar_value(16530) & 0x01) == 0) && ((_ivar_value(16532) & 0x01) == 0) && (q01 == 1))
  • {
  • q02 = 1;
  • }
  • else if(((_ivar_value(16530) & 0x01) == 0) && ((_ivar_value(16532) & 0x01) == 0) && (q01 == 2))
  • {
  • q02 = 2;
  • }
  • else if(((_ivar_value(16530) & 0x01) == 0) && ((_ivar_value(16532) & 0x01) == 1) && (q01 == 1))
  • {
  • q02 = 3;
  • }
  • else if(((_ivar_value(16530) & 0x01) == 0) && ((_ivar_value(16532) & 0x01) == 1) && (q01 == 2))
  • {
  • q02 = 4;
  • }
  • else if(((_ivar_value(16530) & 0x01) == 1) && (q01 == 1))
  • {
  • q02 = 5;
  • }
  • else if(((_ivar_value(16530) & 0x01) == 1) && (q01 == 2))
  • {
  • q02 = 6;
  • }
  • if(q02 == 0)
  • {
  • ACKNOWLEDGE("|en|Partial Stroke Calibration failed due to an invalid configuration. Please run Device Setup or enter pst parameters manually.");
  • _fassign(16557,(45)); _iassign(16561,(0)); _iassign(16563,(1)); _iassign(18269,(0)); _iassign(18270,(0)); save_values(); send_trans(130, 43, S); send_trans(130, 102, S); send_trans(130, 82, S); remove_all_abort(); _add_abort_method(17167); process_abort();;
  • }
  • else
  • {
  • q29 = 0;
  • q18 = 0;
  • q19 = 0;
  • q20 = 0;
  • q05 = 0;
  • send_trans(129, 30, S);
  • if(((_ivar_value(16532)&0x18)>0))
  • {
  • if(((q02 == 1) || (q02 == 2)) && ((_ivar_value(16539) & 0x05) == 0x05))
  • {
  • q29 = 1;
  • }
  • else if(((q02 != 1) && (q02 != 2)) && ((_ivar_value(16539) & 0x06) == 0x06))
  • {
  • q29 = 1;
  • }
  • }
  • else if(_ivar_value(16539) == 0x07)
  • {
  • q29 = 1;
  • }
  • if(q29 == 1)
  • {
  • send(138,S);
  • if((_ivar_value(16789) & 0x02) > 0)
  • {
  • if(0x7FA00000 == _lvar_value(16940)) q18 = 1;
  • if(0x7FA00000 == _lvar_value(16938)) q19 = 1;
  • if(0x7FA00000 == _lvar_value(16939)) q20 = 1;
  • if(((_ivar_value(16530) & 0x01) == 0) && ((((_ivar_value(16532)&0x01) == 0) && q19) || (((_ivar_value(16532)&0x01) > 0) && q20)))
  • {
  • if(((_ivar_value(16532)&0x01) == 0) && q19)
  • ACKNOWLEDGE("|en|Press A Sensor Failure occurred");
  • else
  • ACKNOWLEDGE("|en|Press B Sensor Failure occurred");
  • q05 = 1;
  • }
  • else if(((_ivar_value(16530) & 0x01) > 0) && (q19 || q20))
  • {
  • if(q19 && q20)
  • ACKNOWLEDGE("|en|Press A and Press B Sensor Failures occurred");
  • else if(q19)
  • ACKNOWLEDGE("|en|Press A Sensor Failure occurred");
  • else
  • ACKNOWLEDGE("|en|Press B Sensor Failure occurred");
  • q05 = 1;
  • }
  • }
  • }
  • else
  • {
  • ACKNOWLEDGE("|en|Partial Stroke Calibration failed due to a disabled pressure sensor.");
  • q05 = 1;
  • }
  • if(q05)
  • {
  • _fassign(16557,(45)); _iassign(16561,(0)); _iassign(16563,(1)); _iassign(18269,(0)); _iassign(18270,(0)); save_values(); send_trans(130, 43, S); send_trans(130, 102, S); send_trans(130, 82, S); remove_all_abort(); _add_abort_method(17167); process_abort();;
  • }
  • send_trans(129,13,S);
  • if((1 != _ivar_value(16551)) && (4 != _ivar_value(16810)))
  • {
  • remove_all_abort();
  • _add_abort_method(17213);
  • process_abort();
  • }
  • if((_ivar_value(171) > 0))
  • {
  • qa = 3.8;
  • if(1 == _ivar_value(16464) && (4 == _ivar_value(16513) || 5 == _ivar_value(16513)|| 1 == _ivar_value(16513))) qa += 4.0;
  • send(3,S);
  • q05 = 0;
  • while (_fvar_value(237) < qa)
  • {
  • q05 = select_from_list("|en|Input must exceed 3.8 mA (7.8 mA if loop powered local control panel is attached.)", ids,"|en|Adjust Analog Input and continue;Exit");
  • if(1 == q05)
  • {
  • remove_all_abort();
  • process_abort();
  • }
  • send(3,S);
  • }
  • }
  • send(138,S);
  • if((_ivar_value(16790) & 0x10) == 1)
  • {
  • send_trans(157,0,S);
  • }
  • switch(_ivar_value(16434))
  • {
  • case 7:
  • if(((_ivar_value(16532)&0x18)>0)) qb5 = 2.41;
  • else qb5 = 0.689;
  • qb3 = 0.0689476;
  • qc1 = 14.50377;
  • break;
  • case 12:
  • if(((_ivar_value(16532)&0x18)>0)) qb5 = 241.3;
  • else qb5 = 68.9;
  • qb3 = 6.89476;
  • qc1 = 0.1450377;
  • break;
  • case 10:
  • if(((_ivar_value(16532)&0x18)>0)) qb5 = 2.46;
  • else qb5 = 0.703;
  • qb3 = 0.070307;
  • qc1 = 14.2233;
  • break;
  • default:
  • if(((_ivar_value(16532)&0x18)>0)) qb5 = 35.0;
  • else qb5 = 10.0;
  • qb3 = 1;
  • qc1 = 1;
  • break;
  • }
  • if(q18)
  • {
  • qb4 = _fvar_value(16947);
  • }
  • else
  • {
  • ids[0] = 16439;
  • ids[1] = 16434;
  • q08 = 0;
  • q09 = 10;
  • send_trans(129,29,S);
  • qb4 = _fvar_value(16439);
  • do
  • {
  • if(q08 > 60)
  • {
  • q08 = 0;
  • q09 = 0;
  • if(select_from_list("|en|Timeout waiting for Supply Press to stabilize. Use current Supply Press?\nSupply Press: %{0} %{1}", ids,"|en|Yes;No"))
  • {
  • if(SELECT_FROM_LIST("|en|Continue to monitor Supply Press?","|en|Yes;No"))
  • {
  • qb4 = _fvar_value(16947);
  • }
  • else
  • {
  • q09 = 10;
  • }
  • }
  • }
  • else
  • {
  • delay(1,"|en|Determining Steady State Supply Pressure: %{0} %{1}\n\nPlease wait...", ids);
  • send_trans(129,29,S);
  • qx = qb4 - _fvar_value(16439);
  • qb4 = _fvar_value(16439);
  • if(qx < 0.0) qx = qx * -1.0;
  • if(qx < (0.08 * qb5))
  • {
  • q09--;
  • if((q09 < 1) && (qb4 < qb5))
  • {
  • q05 = select_from_list("|en|The Supply Press is not sufficient to move the valve.\nSupply Press: %{0} %{1}\n\n", ids,"|en|Adjust Supply and retry;Abort;Continue with Current Press");
  • if(1 == q05) process_abort();
  • if(q05)
  • qb4 = _fvar_value(16947);
  • else
  • q09 = 10;
  • }
  • }
  • else
  • {
  • q09 = 10;
  • }
  • q08++;
  • }
  • } while (q09 > 0);
  • }
  • _iassign(16405,(qb4));
  • save_values();
  • _iassign(16563,(1));


请登录以获得完整内容