Loading…

方法名称: device_setup_method

方法ID: 0x434F

方法标签: Device Setup

方法描述:


  • {
  • 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(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;
  • send_trans(129,37,S);
  • if(0 == _ivar_value(16642))
  • {
  • pc = 1;
  • cFlag = 0;
  • ACKNOWLEDGE("|en|Magnetic array is not functioning properly.");
  • }
  • 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(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(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(17167); 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 _iassign(16453,(3)); save_values(); send_trans(130,7,S); send_trans(129,0,S); DELAY(1,"|en|Please wait..."); };
  • remove_all_abort();
  • _add_abort_method(17230);
  • 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(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(17108,16861); _vassign(17109,16862); _vassign(17112,16863); save_values();
  • do
  • {
  • if(1 == s)
  • {
  • _get_dev_var_value(("|en|Relay Type"),0,16532);
  • save_values();
  • _iassign(16509,(0x00));
  • 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();
  • save_values();
  • _iassign(16464,(0));
  • _iassign(16562,(0));
  • 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)));
  • }
  • _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();
  • 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,17108); save_values(); if(act_mfg != _ivar_value(17108)) { act_mfg = _ivar_value(17108); 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(17109,(q)); save_values(); } if(0x00FFFFFF != act_mfg) { if(((_ivar_value(16532) & 0x03) > 0)) { _vassign(17111,17109); save_values(); _get_dev_var_value(("|en|Actuator Model"),0,17111); _vassign(17109,17111); } else if(0x00 != _ivar_value(16509)) { _vassign(17110,17109); save_values(); _get_dev_var_value(("|en|Actuator Model"),0,17110); _vassign(17109,17110); } else { _get_dev_var_value(("|en|Actuator Model"),0,17109); } save_values(); if(act_model != _ivar_value(17109)) { act_model = _ivar_value(17109); 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(17112,(q)); save_values(); } if(0xFFFF != q) { _get_dev_var_value(("|en|Actuator Size"),0,17112); save_values(); act_size = _ivar_value(17112); } else { act_size = 0xFFFF; _iassign(17112,(0xFFFF)); } } else { _iassign(17109,(0xFFFF)); act_model = 0xFFFF; act_size = 0xFFFF; _iassign(17112,(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;
  • case 10:
  • i = 0x0414;
  • switch (act_size)
  • {
  • case 17:
  • case 18:
  • case 19:
  • if(((_ivar_value(16465) & 0x0040) == 0x0040))
  • {
  • t = 21;
  • }
  • break;
  • default:
  • if(((_ivar_value(16465) & 0x0040) == 0x0040))
  • {
  • t = 20;
  • }
  • break;
  • }
  • break;
  • case 11:
  • case 12:
  • case 13:
  • case 14:
  • i = 0x0613;
  • if(12 == act_model)
  • {
  • i = 0x07F2;
  • }
  • if(13 == act_model)
  • {
  • i = 0x0772;
  • }
  • if(14 == act_model)
  • {
  • i = 0x0752;
  • }
  • switch (act_size)
  • {
  • case 30:
  • case 33:
  • t = 11;
  • break;
  • case 37:
  • case 41:
  • t = 12;
  • break;
  • case 38:
  • case 43:
  • case 48:
  • case 51:
  • case 53:
  • case 56:
  • case 57:
  • t = 13;
  • break;
  • default:
  • t = 8;
  • break;
  • }
  • break;
  • case 15:
  • case 16:
  • case 17:
  • i = 0x0403;
  • break;
  • case 18:
  • case 19:
  • case 25:
  • i = 0x0433;
  • switch (act_size)
  • {
  • case 4:
  • t = 10;
  • break;
  • case 29:
  • t = 9;
  • break;
  • case 33:
  • t = 11;
  • break;
  • case 6:
  • case 43:
  • case 48:


请登录以获得完整内容