Loading…
Loading…
Method Name: Method_Read_Trend_All_LIGHT
Method ID: 0x461A
Method Label: Read trend curv.
Method Help:
- {
- int nDataReadCount;
- int select;
- int count_retries;
- int tabnState[2];
- int nState;
- int x1;
- int nb_trend;
- int position;
- int nb_points;
- int sel_1;
- int sel_2;
- int sel_3;
- int sel_4;
- int MasterLength;
- int nTransaction;
- int reduce_points;
- long intput_tmp;
- long i;
- long varid[2];
- long nMaxBCT;
- long nBCT;
- unsigned int compareDW[29];
- unsigned int compareVal;
- long max_trend_entries;
- float max_y;
- float min_y;
- float max_y_2;
- float min_y_2;
- float max_y_3;
- float min_y_3;
- float max_y_4;
- float min_y_4;
- float flt_y;
- float max_1;
- float max_2;
- float max_3;
- float max_4;
- float min_1;
- float min_2;
- float min_3;
- float min_4;
- nb_trend = 0;
- position = 0;
- reduce_points = 0;
- x1 = 0;
- sel_1 = 0;
- sel_2 = 0;
- sel_3 = 0;
- sel_4 = 0;
- max_y = -1000000;
- min_y = 100000;
- max_y_2 = -1000000;
- min_y_2 = 100000;
- max_y_3 = -1000000;
- min_y_3 = 100000;
- max_y_4 = -1000000;
- min_y_4 = 100000;
- max_1 = 100000;
- max_2 = 100000;
- max_3 = 100000;
- max_4 = 100000;
- min_1 = 100000;
- min_2 = 100000;
- min_3 = 100000;
- min_4 = 100000;
- _set_comm_status(0x7F,1);
- _set_no_device(1);
- _set_all_resp_code(0);
- _set_device_status(0xFF,0);
- i = 0;
- send_command_trans(143,10);
- nBCT = _ivar_value(17360);
- nMaxBCT = _ivar_value(17361);
- if (nMaxBCT == 0 || nMaxBCT == 107 && nBCT == 0)
- {
- _add_abort_method(17388);
- compareDW[0] = 0x3a7d6d3d;
- compareDW[1] = 0x513e2d2d;
- compareDW[2] = 0x717a2f6a;
- compareDW[3] = 0x43755f46;
- compareDW[4] = 0x41247658;
- compareDW[5] = 0x6b3d3734;
- compareDW[6] = 0x76737076;
- compareDW[7] = 0x6137416f;
- compareDW[8] = 0x435b515d;
- compareDW[9] = 0x2b50534a;
- compareDW[10] = 0x26766a33;
- compareDW[11] = 0x626f235e;
- compareDW[12] = 0x61aa7347;
- compareDW[13] = 0x6e735477;
- compareDW[14] = 0x264c4c34;
- compareDW[15] = 0x3462787d;
- compareDW[16] = 0x3a7d6d3d;
- compareDW[17] = 0x513e2d2d;
- compareDW[18] = 0x717a2f6a;
- compareDW[19] = 0x43755f46;
- compareDW[20] = 0x41247658;
- compareDW[21] = 0x6b3d3734;
- compareDW[22] = 0x76737076;
- compareDW[23] = 0x6137416f;
- compareDW[24] = 0x435b515d;
- compareDW[25] = 0x2b50534a;
- compareDW[26] = 0x26766a33;
- _iassign(17360,110);
- send_command_trans(143,0);
- _iassign(17360,107);
- send_command_trans(143,0);
- for (i = 0; i < 25; i++)
- {
- compareVal = _ivar_value(resolve_array_ref(17389,i));
- if (compareDW[i] != compareVal)
- {
- break;
- }
- }
- remove_all_abort();
- }
- if (i == 0 && nMaxBCT != 110 || i == 25)
- {
- _iassign(17360,60);
- nTransaction = 70;
- MasterLength = 60;
- }
- else
- {
- _iassign(17360,16);
- nTransaction = 71;
- MasterLength = 16;
- }
- intput_tmp = _lvar_value(16859);
- if (intput_tmp != 33004)
- {
- nb_trend = nb_trend + 1;
- sel_1 = 1;
- save_values();
- }
- intput_tmp = _lvar_value(16864);
- if (intput_tmp != 33004)
- {
- nb_trend = nb_trend + 1;
- sel_2 = 1;
- save_values();
- }
- intput_tmp = _lvar_value(16869);
- if (intput_tmp != 33004)
- {
- nb_trend = nb_trend + 1;
- sel_3 = 1;
- save_values();
- }
- intput_tmp = _lvar_value(16874);
- if (intput_tmp != 33004)
- {
- nb_trend = nb_trend + 1;
- sel_4 = 1;
- save_values();
- }
- if (nb_trend != 0)
- {
- max_trend_entries = _ivar_value(16876);
- _iassign(16885,max_trend_entries);
- send_command_trans(178,1788);
- send_command_trans(173,111);
- _iassign(17408,0);
- _iassign(18205,nb_trend);
- _iassign(17390,132);
- _iassign(17406,1);
- i = _ivar_value(16886);
- _iassign(16875,5);
- send_command_trans(178,1787);
- send_command_trans(146,2);
- count_retries = 1;
- while (count_retries <= 15 && nState != 100)
- {
- DELAY(2,literal_string(2234));
- count_retries = count_retries + 1;
- send_command_trans(147,2);
- tabnState[0] = 16880;
- nState = _ivar_value(16880);
- }
- if (nState != 100)
- {
- ACKNOWLEDGE(literal_string(2209));
- abort();
- }
- nDataReadCount = 0;
- if (nb_trend == 1)
- {
- nb_points = max_trend_entries;
- reduce_points = max_trend_entries - nb_points * 1;
- }
- if (nb_trend == 2)
- {
- nb_points = max_trend_entries / 2;
- reduce_points = max_trend_entries - nb_points * 2;
- }
- if (nb_trend == 3)
- {
- nb_points = max_trend_entries / 3;
- reduce_points = max_trend_entries - nb_points * 3;
- }
- if (nb_trend == 4)
- {
- nb_points = max_trend_entries / 4;
- reduce_points = max_trend_entries - nb_points * 4;
- }
- _iassign(18206,-HB_TrendInterval_1 * nb_points);
- _iassign(17390,132);
- _iassign(17406,1);
- send_command_trans(211,0);
- while (nDataReadCount <= max_trend_entries - 1 - reduce_points)
- {
- if (MasterLength == 60)
- {
- if (max_trend_entries - nDataReadCount >= 15)
- {
- _iassign(17452,(nDataReadCount + MasterLength / 4) * 100 / max_trend_entries);
- }
- else
- {
- _iassign(17452,(nDataReadCount + 1) * 100 / max_trend_entries);
- }
Please login for more