Loading…

Method Name: device_setup_method

Method ID: 0x4354

Method Label: Device Setup

Method Help:


  • {
  • float qa, qb, qc, qd, qe; int q, q0, q1, q2, q3; 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, q23, q24, qj, qk; float qa0, qa1, qa2, qa3, qa4, qa5, qa6, qa7, qa8, qa9, qb0, qb1, qb2, qb3, qb4, qb5, qx;
  • long ids[5];
  • unsigned long act_mfg;
  • unsigned int act_model, act_size;
  • int pc,
  • i,
  • j,
  • cFlag,
  • ActFlag,
  • s,
  • iAct,
  • t,
  • p,
  • r,
  • PSTsp_0,
  • as_0,
  • rt_0,
  • zpc_0;
  • float c;
  • float psi_3,
  • psi_6,
  • psi_15,
  • psi_30;
  • float tGain, tRate, tMLFB;
  • float pProp, pInteg, pMLFB;
  • _set_device_status(0xFF,0);
  • _set_xmtr_device_status(0xFF,0);
  • _set_all_resp_code(1);
  • _set_resp_code((8),0);
  • _set_no_device(2);
  • send(151,S); if(_ivar_value(16804) > 1) { ACKNOWLEDGE("|en|The DD revision is not compatible with the firmware in the device.\nContact your Fisher sales office for an upgrade to your Device Description."); return; };
  • send(138,S); if((_ivar_value(171) > 0)) { send(3,S); while (_fvar_value(16418) < 3.8) { if(1 != _ivar_value(16464)) { if(select_from_list("|en|Input must exceed 3.8 mA", ids,"|en|Adjust Analog Input and continue;Exit")) { process_abort(); } } else { 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_trans(136,2,S);
  • save_values();
  • if(0 == (_ivar_value(16784)))
  • {
  • send_trans(136,0,S);
  • }
  • cFlag = 2;
  • pc = 0;
  • if((_ivar_value(171) == 0))
  • {
  • if(((_ivar_value(16496) & 0x01) > 0))
  • {
  • cFlag = 1 - SELECT_FROM_LIST("|en|The Hardware Shutdown DIP switch on the main electronics board must be Disabled to operate in multidrop mode.","|en|Continue;Exit");
  • }
  • }
  • else
  • {
  • if(((_ivar_value(16465) & 0x01C0) == 0x0100))
  • {
  • if(((_ivar_value(16496) & 0x01) == 0))
  • {
  • cFlag = 2 * (1 - SELECT_FROM_LIST("|en|The Hardware Shutdown DIP switch on the main electronics board must be Enabled in order to realize the published failure rate metrics.","|en|Continue;Exit"));
  • }
  • }
  • if(((_ivar_value(16465) & 0x01C0) != 0x0100))
  • {
  • if(((_ivar_value(16496) & 0x01) > 0))
  • {
  • cFlag = 1 - SELECT_FROM_LIST("|en|The Hardware Shutdown DIP Switch on the main electronics board must be 'Disabled' for throttling control.","|en|Continue;Exit");
  • }
  • }
  • }
  • if(cFlag != 0)
  • {
  • 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(17169); DELAY(1,"|en|Please wait...");
  • send(138,S); send_trans(129,0,S); if(((_ivar_value(16790) & 0x31) > 0) || (_ivar_value(10098) == 0)) { send_trans(142,6,S); send_trans(142,1,S); send_trans(157,0,S); if(1 != _ivar_value(167)) { _iassign(16622,(0)); save_values(); send_trans(130,74,S); } if((_ivar_value(171) == 0)) _iassign(16453,(2)); else if(((_ivar_value(16465) & 0x01C0) == 0x0100)) _iassign(16453,(3)); else { ACKNOWLEDGE("|en|Calibration or diagnostics was in progress.\nReset Control Mode, if required."); if(0 == _ivar_value(10098)) { _iassign(16453,(3)); } else { _vassign(16453,10098); } save_values(); _get_dev_var_value(("|en|Control Mode"),0,16453); } save_values(); send_trans(130,7,S); send_trans(129,0,S); DELAY(1,"|en|Please wait..."); };
  • remove_all_abort();
  • _add_abort_method(17235);
  • send_trans(129,28,S);
  • _get_dev_var_value(("|en|Pressure Units"),0,16434);
  • _iassign(4167,(8));
  • save_values();
  • send(53,S);
  • ActFlag = 0;
  • s = 1;
  • _iassign(16414,(0));
  • _iassign(16417,(0));
  • _iassign(16412,(0));
  • save_values();
  • send_trans(129,34,S);
  • send_trans(129,38,S);
  • PSTsp_0 = _ivar_value(16529);
  • as_0 = _ivar_value(16530);
  • rt_0 = _ivar_value(16532);
  • zpc_0 = _ivar_value(16508);
  • send(132,S);
  • send_trans(129,33,S);
  • send_trans(164,4,S); if(0 == _ivar_value(16861)) { _iassign(16861,(0x005100)); _iassign(16862,(14)); _iassign(16863,(27)); } else if(0 == _ivar_value(16862)) { _iassign(16862,(0xFFFF)); _iassign(16863,(0xFFFF)); } else if(0 == _ivar_value(16863)) { _iassign(16863,(0xFFFF)); } save_values(); act_mfg = _ivar_value(16861); act_model = _ivar_value(16862); _vassign(17110,16861); _vassign(17111,16862); _vassign(17114,16863); save_values();
  • do
  • {
  • if(1 == s)
  • {
  • _get_dev_var_value(("|en|Relay Type"),0,16532);
  • save_values();
  • if(((_ivar_value(16465) & 0x01C0) == 0x0100))
  • {
  • _iassign(16509,(0x00));
  • }
  • else
  • {
  • if(1 == pc)
  • {
  • _iassign(16509,(0x02));
  • }
  • else
  • {
  • _get_dev_var_value(("|en|Select Tvl/Press Control\n\n Double-Acting actuators without a spring use Tvl Control only.\n"),0,16509);
  • if((0x01 == _ivar_value(16509)) || (0x05 == _ivar_value(16509)))
  • {
  • _get_dev_var_value(("|en|Select Manual Recovery or Auto Recovery."),0,16510);
  • }
  • }
  • }
  • if(_ivar_value(16509) != 0x02)
  • {
  • _iassign(16412,(0));
  • save_values();
  • }
  • else
  • {
  • cFlag = 1;
  • }
  • _get_dev_var_value(("|en|Max Supply Pressure"),0,16947);
  • save_values();
  • if(((_ivar_value(16465) & 0x01C0) != 0x0100))
  • {
  • if(0x02 == _ivar_value(16509))
  • {
  • psi_3 = 0.21;
  • if(_ivar_value(16434) == 12) psi_3 = 21.0;
  • if(_ivar_value(16434) == 6) psi_3 = 3.0;
  • psi_6 = psi_3 * 2.0;
  • psi_15 = psi_3 * 5.0;
  • psi_30 = psi_3 * 10.0;
  • ids[0] = 16434;
  • ids[1] = 16548;
  • ids[2] = 16549;
  • switch(_ivar_value(16434))
  • {
  • case 7:
  • r = select_from_list ("|en|Select Pressure Range\n Current Range: %[.2f]{1}-%[.2f]{2} %{0}", ids,
  • "|en|Keep Current Range;Range A: 0.21-1.05 bar;Range B: 0.42-2.10 bar;User Defined");
  • break;
  • case 12:
  • r = select_from_list ("|en|Select Pressure Range\n Current Range: %[.0f]{1}-%[.0f]{2} %{0}", ids,
  • "|en|Keep Current Range;Range A: 21-105 kPa;Range B: 42-210 kPa;User Defined");
  • break;
  • case 10:
  • r = select_from_list ("|en|Select Pressure Range\n Current Range: %[.2f]{1}-%[.2f]{2} %{0}", ids,
  • "|en|Keep Current Range;Range A: 0.21-1.05 kg/cm2;Range B: 0.42-2.10 kg/cm2;User Defined");
  • break;
  • default:
  • r = select_from_list ("|en|Select Pressure Range\n Current Range: %[.1f]{1}-%[.0f]{2} %{0}", ids,
  • "|en|Keep Current Range;Range A: 3-15 psi;Range B: 6-30 psi;User Defined");
  • break;
  • }
  • if(r > 2)
  • {
  • do
  • {
  • _get_dev_var_value(("|en|Pressure Range Lo"),0,16548);
  • _get_dev_var_value(("|en|Pressure Range Hi"),0,16549);
  • save_values();
  • if((_fvar_value(16548) + psi_6) > _fvar_value(16549))
  • {
  • switch(_ivar_value(16434))
  • {
  • case 7:
  • acknowledge("|en|%[L]{2}: %{2}%{0}\n%[L]{1}: %{1}%{0}\nPressure Range Hi must be at least 0.21 bar greater than Pressure Range Lo", ids);
  • break;
  • case 12:
  • acknowledge("|en|%[L]{2}: %{2}%{0}\n%[L]{1}: %{1}%{0}\nPressure Range Hi must be at least 21.0 kPa greater than Pressure Range Lo", ids);
  • break;
  • case 10:
  • acknowledge("|en|%[L]{2}: %{2}%{0}\n%[L]{1}: %{1}%{0}\nPressure Range Hi must be at least 0.21 kg/cm2 greater than Pressure Range Lo", ids);
  • break;
  • default:
  • acknowledge("|en|%[L]{2}: %{2}%{0}\n%[L]{1}: %{1}%{0}\nPressure Range Hi must be at least 6 psi greater than Pressure Range Lo", ids);
  • break;
  • }
  • }
  • } while((_fvar_value(16548) + psi_6) > _fvar_value(16549));
  • }
  • else if(r > 0)
  • {
  • _fassign(16548,((psi_3 * r)));
  • _fassign(16549,((psi_15 * r)));
  • }
  • _vassign(16459,16549);
  • send_trans(130,9,S);
  • save_values();
  • if(((_ivar_value(16465) & 0x0040) != 0x0040))
  • {
  • _get_dev_var_value(("|en|Is the Output Pressure connected to an actuator or bellows?"),0,16412);
  • }
  • }
  • }
  • save_values();
  • _iassign(16464,(0));
  • _iassign(16562,(0));
  • if(((_ivar_value(16465) & 0x0100) == 0x0100))
  • {
  • if(((_ivar_value(16496) & 0x01) == 0))
  • {
  • do
  • {
  • ids[0] = 16508;
  • _get_dev_var_value(("|en|Partial Stroke Start Pt:\n(%[L]{0} = %{0})"),(ids),16529);
  • if(!(_ivar_value(16529)))
  • {
  • ACKNOWLEDGE("|en|The PST Start Point must be configured to proceed.");
  • }
  • } while (!(_ivar_value(16529)));
  • }
  • if(((_ivar_value(16465) & 0x01C0) == 0x0100))
  • {
  • _get_dev_var_value(("|en|Is the instrument connected to a Local Control Panel (LCP100 or LCP200)?"),0,16417);
  • save_values();
  • if(_ivar_value(16417))
  • {
  • _iassign(16464,(1));
  • _iassign(16562,(1));
  • }
  • else
  • {
  • _iassign(16464,(2));
  • }
  • save_values();
  • }
  • }
  • else
  • {
  • _iassign(16529,(0));
  • }
  • save_values();
  • t = 99;
  • iAct = 0x0000;
  • if(_ivar_value(16412))
  • {
  • t = 2;
  • _get_dev_var_value(("|en|When Bellows pressure is zero, valve is:"),0,16508);
  • save_values();
  • }
  • else
  • {
  • _get_dev_var_value(("|en|Actuator Manufacturer"),0,17110); save_values(); if(act_mfg != _ivar_value(17110)) { act_mfg = _ivar_value(17110); switch(act_mfg) { case 0x005100: q = 14; break; case 0xFF0016: q = 2000; break; case 0xFF0001: q = 4000; break; case 0xFF0010: q = 6000; break; case 0x0B87A3: q = 8000; break; case 0xFF0005: q = 10000; break; case 0xFF0013: q = 12000; break; case 0xFF0006: q = 14000; break; case 0x000E05: q = 16000; break; case 0x524149: q = 18000; break; case 0x014A7E: q = 20000; break; case 0xFF0017: q = 22000; break; default: q = 0xFFFF; break; } _iassign(17111,(q)); save_values(); } if(0x00FFFFFF != act_mfg) { if(((_ivar_value(16532) & 0x03) > 0)) { _vassign(17113,17111); save_values(); _get_dev_var_value(("|en|Actuator Model"),0,17113); _vassign(17111,17113); } else if(0x00 != _ivar_value(16509)) { _vassign(17112,17111); save_values(); _get_dev_var_value(("|en|Actuator Model"),0,17112); _vassign(17111,17112); } else { _get_dev_var_value(("|en|Actuator Model"),0,17111); } save_values(); if(act_model != _ivar_value(17111)) { act_model = _ivar_value(17111); switch(act_model) { case 1: q = 21; break; case 2: case 3: case 22000: q = 33; break; case 5: case 10: q = 10; break; case 4: case 6: case 7: case 18: case 19: case 21: case 22: q = 19; break; case 8: case 9: case 8000: case 20000: q = 23; break; case 11: case 12: case 13: case 14: case 20: case 29: case 30: q = 27; break; case 15: q = 93; break; case 16: q = 37; break; case 17: q = 130; break; case 23: case 24: case 27: case 28: q = 65; break; case 25: q = 1; break; case 26: q = 72; break; case 2000: q = 8; break; case 2002: q = 4; break; case 4000: case 4001: q = 17; break; case 4002: q = 14; break; case 6000: q = 144; break; case 6001: case 6002: q = 154; break; case 6003: q = 203; break; case 6004: q = 258; break; case 10000: case 10001: q = 2; break; case 10002: q = 494; break; case 12000: q = 37; break; case 12001: q = 24; break; case 14000: case 14002: case 14003: q = 497; break; case 14001: q = 9; break; case 16000: q = 500; break; case 16001: q = 11; break; case 18000: q = 504; break; default: q = 0xFFFF; break; } _iassign(17114,(q)); save_values(); } if(0xFFFF != q) { _get_dev_var_value(("|en|Actuator Size"),0,17114); save_values(); act_size = _ivar_value(17114); } else { act_size = 0xFFFF; _iassign(17114,(0xFFFF)); } } else { _iassign(17111,(0xFFFF)); act_model = 0xFFFF; act_size = 0xFFFF; _iassign(17114,(0xFFFF)); } save_values();
  • i = 0x0000;
  • switch (act_mfg)
  • {
  • case 0x005100:
  • switch (act_model)
  • {
  • case 1:
  • case 4:
  • i = 0x0016;
  • switch (act_size)
  • {
  • case 57:
  • case 58:
  • t = 13;
  • break;
  • case 33:
  • case 45:
  • case 54:
  • t = 7;
  • break;
  • case 38:
  • case 43:
  • case 51:
  • case 55:
  • t = 10;
  • break;
  • case 40:
  • case 47:
  • case 52:
  • case 53:
  • t = 12;
  • break;
  • default:
  • t = 3;
  • break;
  • }
  • break;
  • case 2:
  • i = 0x07FA;
  • case 3:
  • if(3 == act_model)
  • {
  • i = 0x015A;
  • }
  • switch (act_size)
  • {
  • case 53:
  • t = 9;
  • break;
  • case 57:
  • case 58:
  • t = 12;
  • break;
  • default:
  • t = 5;
  • break;
  • }
  • break;
  • case 5:
  • i = 0x0416;
  • switch (act_size)
  • {
  • case 13:
  • case 14:
  • t = 11;
  • break;
  • case 15:
  • case 16:
  • case 19:
  • t = 13;
  • break;
  • default:
  • t = 10;
  • break;
  • }
  • break;
  • case 6:
  • i = 0x07F2;
  • t = 4;
  • break;
  • case 7:
  • i = 0x0752;
  • t = 4;
  • break;
  • case 8:
  • i = 0x0402;
  • case 9:
  • if(9 == act_model)
  • {
  • i = 0x0002;
  • }
  • switch (act_size)
  • {
  • case 41:
  • t = 9;
  • break;
  • case 43:
  • if(((_ivar_value(16465) & 0x0040) == 0x0040))
  • {
  • t = 17;
  • }
  • else
  • {
  • t = 10;
  • }
  • break;
  • case 47:
  • case 53:
  • if(((_ivar_value(16465) & 0x0040) == 0x0040))
  • {
  • t = 18;
  • }
  • else
  • {
  • t = 12;
  • }
  • break;
  • case 57:
  • case 58:
  • if(((_ivar_value(16465) & 0x0040) == 0x0040))
  • {
  • t = 19;
  • }
  • else
  • {
  • t = 13;
  • }
  • break;
  • default:
  • t = 5;
  • break;
  • }
  • break;


Please login for more