Loading…
Loading…
Method Name: tvl_auto_calib_method
Method ID: 0x4348
Method Label: Auto Calibration
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;
- float fRoundingFactor;
- int iVar45, iVar46;
- int i;
- long ids[5];
- _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) > 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; };
- q = 0.9; fRoundingFactor = 0.0; if(q < 1) fRoundingFactor = 0.5;
- send_trans(129,34,S); if(0x02 == _ivar_value(16509)) { ACKNOWLEDGE("|en|This action cannot be performed in Pressure Control."); return; } send(138,S); if((_ivar_value(16789) & 0x01) > 0) { ACKNOWLEDGE("|en|The instrument is reporting a Travel Sensor failure."); return; };
- 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..."); };
- send_trans(129, 34,S);
- if(1 - SELECT_FROM_LIST("|en|WARNING! Calibration will cause sudden changes in instrument output and loss of process control.","|en|Continue;Exit"))
- {
- i = 0; send(138,S); if((_ivar_value(16789) & 0x02) > 0) { send_trans(142,0,S); send_trans(129,29,S); send_trans(142,1,S); if(0x7FA00000==_lvar_value(16940)) i=0x01; if(0x7FA00000==_lvar_value(16938)) i=i | 0x02; if(0x7FA00000==_lvar_value(16939)) i=i | 0x04; if(((i & 0x01)>0) && ((_ivar_value(16465) & 0x0200) == 0x0200)) { ACKNOWLEDGE("|en|Supply Pressure Sensor Failure occurred"); } if((i & 0x02)>0) { ACKNOWLEDGE("|en|Pressure A Sensor Failure occurred"); } if((i & 0x04)>0) { ACKNOWLEDGE("|en|Pressure B Sensor Failure occurred"); } } switch(_ivar_value(16434)) { case 7: qb=0.689; qd=0.1; break; case 12: qb=68.9; qd=10.0; break; case 10: qb=0.703; qd=0.1; break; default: qb=10.0; qd=5.0; break; } if(!(i & 0x01)) { qa = _fvar_value(16947); _fassign(16947,((qb * 15.0))); send_trans(130,88,S); send(42,S); send_trans(142,0,S); send_trans(129,28,S); q=0; while ((_fvar_value(16439)
send_trans(129,28,S); q=SELECT_FROM_LIST("|en|The Supply Pressure is not sufficient to move the valve.","|en|Adjust Supply and retry;Abort;Continue with Current Pressure"); } send_trans(142,1,S); qc=_fvar_value(16439); if (qc>qa) { qa=qc + qb / 2.0; q0=qa / qd; qa=q0 * qd; } _fassign(16947,(qa)); send_trans(130, 88,S); send_command(42); if (1==q) process_abort(); if(_fvar_value(16439) | 0x08; } }; - send(138,S); q0 = 0; q1 = 1; while((_ivar_value(16792) & 0x08) > 0) { if(1 == q1) { send_trans(129,34,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 Terminal Action","|en|Disabled;PST Diagnostic"); _iassign(16464,((2 * q))); send_trans(130,86,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,78,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 second."); } else { ACKNOWLEDGE("|en|To unlock the device, short the Aux. terminals between 3 and 5 seconds."); } } 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 second."); } 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 second."); } } 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 seconds."); } 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 second."); } } } 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(16418) > 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(16418) < 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(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); } }; };
- if(((_ivar_value(16530) & 0x01) > 0))
- {
- ACKNOWLEDGE ("|en|It is recommended to run relay adjustment for double acting relays in new installations.");
- if(1 - SELECT_FROM_LIST("|en|Run Relay Adjust now?","|en|Yes;No"))
- {
- if((i & 0x07) > 0)
- {
- ACKNOWLEDGE("|en|Relay Adjust requires all three pressure sensors.");
- }
- else
- {
- if(0x08 == (i & 0x08))
- {
- ACKNOWLEDGE("|en|The Supply Pressure is not sufficient to perform the relay adjust.");
- }
- else
- {
- DELAY(1,"|en|Please wait..."); send_trans(142,0,S); send_trans(129,31,S); save_values(); remove_all_abort(); _add_abort_method(17203); ACKNOWLEDGE("|en|Remove the instrument front cover. Then continue."); DELAY(1,"|en|Please wait..."); _iassign(16453,(0)); send_trans(130,7,S); send_trans(129,0,S); _iassign(16478,(4062)); send_trans(130,15,S); _iassign(16476,(9137)); send_trans(130,14,S); send_trans(129,6,S); if((_ivar_value(16617) > 13312) || (_ivar_value(16617) < 9216)) { _iassign(16617,(12032)); send_trans(130,73,S); } _fassign(16941,(50.0)); save_values(); send_trans(130,5,S); q0=1; while(q0 == 1) { for(q=15; q>0; q--) { send_trans(129,5,S); ids[0] = 16454; delay(1,"|en|Rotate relay adjustment disc until value is 50 - 70 %\n%[L]{0}: %{0}\n\nTime remaining (sec): %{q}", ids); } q0 = !(SELECT_FROM_LIST("|en|Continue monitoring the relay adjustment for another 15 seconds?","|en|Yes;No")); } send_trans(142,1,S); DELAY(1,"|en|Please wait..."); _vassign(16453,16942); send_trans(130,7,S); send_trans(129,0,S); _vassign(16478,16479); send_trans(130,15,S); _vassign(16476,16477); send_trans(130,14,S); _vassign(16617,16619); send_trans(130,73,S); remove_all_abort(); _add_abort_method(17167); ACKNOWLEDGE("|en|Replace the instrument front cover. Then continue.");
- }
- }
- DELAY(2,"|en|Returning to Auto Tvl Calib...");
- }
- }
- DELAY(1,"|en|Please wait..."); _vassign(16942,10098); save_values(); ids[1] = 16517; ids[0] = 16441; q3 = 5; ; remove_all_abort(); _add_abort_method(17225); while (q3 > 0) { send_trans(142,q3,S); q0 = 0; do { send_trans(129, 12,S); q = _ivar_value(16517); if(q > 6) { send_trans(129, 30,S); delay(5,"|en|Auto Calibration Progress:\n\n%{1}\n\nTravel: %{0}", ids); } else if(q > 2) { if(q != q0) { delay(1,"|en|Auto Calibration Progress:\n\n%{1}\n", ids); q0 = q; } else DELAY_TIME(1); } } while (q > 2); if(1 != q) process_abort(); q3 = 0; } send_trans(142, 1,S); DELAY(3,"|en|Travel Control calibration successful."); if((_ivar_value(16530) != 1) && ((_ivar_value(16465) & 0x01C0) != 0x0100)) { DELAY(3,"|en|Entering Pressure Control calibration."); ids[2] = 16434; _iassign(16817,(0xA8)); save_values(); remove_all_abort(); _add_abort_method(17199); _iassign(16453,(0)); send_trans(130, 7,S); for(q = 0; q <= 1; q++) { q2 = 0; send_trans(157,0,S); q1 = 2130 + q * 8020; _iassign(16816,(q1)); qa = (q1 - 2048.0)/81.92; send_command_trans(155, 0); if(((_ivar_value(16530) & 0x01) > 0)) { ids[1] = 16438; } else if(((_ivar_value(16532) & 0x01) > 0)) { ids[1] = 16437; } else { ids[1] = 16433; } do { for (q1 = 0; q1 < 50; q1++) { send_trans(129, 28,S); send_trans(129, 30,S); delay(1,"|en|Target: %[.1f]{qa} %\nTravel: %{0} %\n\n%[L]{1}: %{1}", ids); if(((qa - _fvar_value(16441)) > -2.0) && ((qa - _fvar_value(16441)) < 2.0) && (0 == q2)) { q1 = 50; q2 = 1; DELAY(15,"|en|Please wait..."); } } if(0 == q2) { if(0 == SELECT_FROM_LIST("|en|Continue setting Pressure Range Hi and Lo?","|en|Yes;No")) { q1 = 0; } } } while(q1 < 50); if(q2 > 0) { send_trans(129, 28,S); if(((_ivar_value(16530) & 0x01) > 0)) { if(q) qc = _fvar_value(16438); else qb = _fvar_value(16438); } else { if(((_ivar_value(16532) & 0x01) > 0)) { if(q) qc = _fvar_value(16437); else qb = _fvar_value(16437); } else { if(q) qc = _fvar_value(16433); else qb = _fvar_value(16433); } } } else q = 3; } if(q < 3) { if(qb > qc) { qa = qb; qb = qc; qc = qa; } _fassign(16548,(qb)); send_trans(130, 95,S); _fassign(16549,(qc)); send_trans(130, 96,S); _fassign(16459,(qc)); send_trans(130, 9,S); } } _vassign(16453,16942); save_values(); send_trans(130,7,S); send_trans(129,0,S); send_trans(129, 34,S); remove_all_abort(); _add_abort_method(17167);
- if(((_ivar_value(16465) & 0x0100) == 0x0100))
- {
- DELAY(2,"|en|Auto Tvl Calib has completed. PST Calibration will now begin.");
- send_trans(129,12,S);
- if((1 != _ivar_value(16551)) && (4 != _ivar_value(16810)))
- {
- remove_all_abort();
- _add_abort_method(17213);
- process_abort();
- }
- send_trans(129,34,S);
- _fassign(16608,(0));
- send_trans(130,125,S);
- _iassign(16563,(1));
- send_trans(130,99,S);
- send_trans(129,18,S);
- if((_fvar_value(16583) < 0.99) || (1 == _ivar_value(16464)))
- {
- _fassign(16583,(0.99));
- send_trans(130,119,S);
- }
- if((_fvar_value(16584) > 0.01) || (1 == _ivar_value(16464)))
- {
- _fassign(16584,(0.01));
- send_trans(130,120,S);
- }
- remove_all_abort();
- _add_abort_method(17214);
- q = 0.9; qb3 = 0.0; if(q < 1) qb3 = 0.5;
- do
- {
- q1 = _ivar_value(16529);
- q = !q1;
- if(((_ivar_value(16530) & 0x01) > 0) && ((_ivar_value(16532) & 0x03) > 0)) q = q + 2;
- if(1 == q) ACKNOWLEDGE("|en|The Partial Stroke Start Pt is not configured.");
- if(2 == q) ACKNOWLEDGE("|en|INVALID CONFIGURATION\nA Double-Acting actuator must be used with a Relay Type A.");
- if(3 == q) ACKNOWLEDGE("|en|INVALID CONFIGURATION\nThe The Partial Stroke Start Pt is not configured is not configured and a Double-Acting actuator must be used with a Relay Type A.");
- if(q)
- {
- if(SELECT_FROM_LIST("|en|Do you wish to edit the configuration manually or exit and run the Device Setup?","|en|Edit;Exit"))
- {
- process_abort();
- }
- else
- {
- if(2 != q)
- {
- ids[0] = 16508;
- _get_dev_var_value(("|en|Partial Stroke Start Pt:\n(%[L]{0} = %{0})"),(ids),16529);
- send_trans(130,98,S);
- }
- if(q > 1)
- {
- _get_dev_var_value(("|en|Actuator Style"),0,16530);
- _get_dev_var_value(("|en|Relay Type"),0,16532);
- send_trans(130,94,S);
- }
- }
- }
- } while(q);
- if(2 == q1) q1 = -1;
- q2 = (-2 * _ivar_value(16508)) + 1;
- q01 = q1 * q2;
- if((_ivar_value(171) > 0))
- {
- if(-1 == q01)
- {
- qa = 3.8;
- }
- else
- {
- qa = 8.0;
- }
- send(3,S);
- q08 = 0;
- while (_fvar_value(16418) < qa)
- {
- if(1 != _ivar_value(16464))
- {
- if(-1 == q01)
- {
- q08 = select_from_list("|en|Input must exceed 3.8 mA", ids,"|en|Adjust Analog Input and continue;Exit");
- }
- else
- {
- q08 = select_from_list("|en|Input must exceed 8.0 mA", ids,"|en|Adjust Analog Input and continue;Exit");
- }
- }
- else
- {
- if(-1 == q01)
- {
- q08 = 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");
- }
- else
- {
- q08 = select_from_list("|en|Input must exceed 8.0 mA (12.0 mA if loop powered local control panel is attached.)", ids,"|en|Adjust Analog Input and continue;Exit");
- }
- }
Please login for more