Loading…
Loading…
Method Name: stroke_valve_method
Method ID: 0x4323
Method Label: Stroke Valve
Method Help: Select the desired method to stroke the valve. The ramp rate is set to 1.0% per second. Valid entries for the target are 0 to 100%.
- {
- int q;
- int q0;
- int q1;
- int q2;
- int q3;
- float qa;
- float qb;
- float qc;
- float qd;
- char S[3];
- int i;
- int c;
- int t;
- int s;
- int z;
- int i0;
- int i1;
- int wt;
- long ids[2];
- float tvl;
- float r;
- _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(literal_string(2124));
- return;
- }
- ;
- send_trans(129,0,S);
- _vassign(16452,16427);
- save_values();
- if (1 == _ivar_value(167))
- {
- ACKNOWLEDGE(literal_string(2512));
- process_abort();
- }
- if (_ivar_value(16427))
- {
- if ((_ivar_value(16465) & 0x01C0) == 0x0100)
- {
- _get_dev_var_value(literal_string(2513),0,16452);
- }
- else
- {
- _get_dev_var_value(literal_string(2514),0,16452);
- }
- save_values();
- if (_ivar_value(16452) > 0)
- {
- ACKNOWLEDGE(literal_string(2515));
- 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(literal_string(2494));
- }
- else
- {
- ACKNOWLEDGE(literal_string(2495));
- }
- process_abort();
- }
- _add_abort_method(17169);
- DELAY(1,literal_string(2461));
- if (!!(inst_level & 0x0008))
- {
- i = 0;
- send(138,S);
- if ((_ivar_value(16789) & 0x02) > 0)
- {
- q = _ivar_value(16539);
- var_103u = 0x07;
- send_trans(130,134,S);
- send_trans(129,30,S);
- if (0x7FA00000 == _lvar_value(16940))
- i = 0x01;
- if (0x7FA00000 == _lvar_value(16938))
- i = i | 0x02;
- if (0x7FA00000 == _lvar_value(16939))
- i = i | 0x04;
- var_103u = q;
- send_trans(130,134,S);
- if ((i & 0x01) > 0 && (_ivar_value(16465) & 0x0200) == 0x0200)
- {
- ACKNOWLEDGE(literal_string(2601));
- }
- if ((i & 0x02) > 0)
- {
- ACKNOWLEDGE(literal_string(2602));
- }
- if ((i & 0x04) > 0)
- {
- ACKNOWLEDGE(literal_string(2603));
- }
- }
- switch (_ivar_value(16434))
- {
- case 7:
- if ((_ivar_value(16532) & 0x18) > 0)
- qb = 2.41;
- else
- qb = 0.689;
- qd = 0.1;
- break;
- case 12:
- if ((_ivar_value(16532) & 0x18) > 0)
- qb = 241.3;
- else
- qb = 68.9;
- qd = 10.0;
- break;
- case 10:
- if ((_ivar_value(16532) & 0x18) > 0)
- qb = 2.46;
- else
- qb = 0.703;
- qd = 0.1;
- break;
- default:
- if ((_ivar_value(16532) & 0x18) > 0)
- qb = 35.0;
- else
- qb = 10.0;
- qd = 5.0;
- break;
- }
- if (!(i & 0x01))
- {
- qa = _fvar_value(16947);
- _fassign(16947,qb * 15.0);
- send_trans(130,91,S);
- send(42,S);
- send_trans(129,29,S);
- q = 0;
- while (_fvar_value(16439) < qb && !q)
- {
- send_trans(129,29,S);
- q = SELECT_FROM_LIST(literal_string(2604),literal_string(2605));
- }
- qc = _fvar_value(16439);
- if (qc > qa)
- {
- qa = qc + qb / 2.0;
- q0 = qa / qd;
- qa = q0 * qd;
- }
Please login for more