Loading…
Loading…
Method Name: Method_Read_Trend_All_LIGHT
Method ID: 0x4843
Method Label: Read trend curves
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 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_all_resp_code(0);
- _set_device_status(0xFF,0);
- i = 0;
- send_command_trans(143,10);
- nBCT = _ivar_value(17634);
- if (nBCT == 0 || nBCT == 107)
- {
- 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(17634,107);
- send_command_trans(143,0);
- for (i = 0; i < 25; i++)
- {
- compareVal = _ivar_value(resolve_array_ref(17731,i));
- if (compareDW[i] != compareVal)
- {
- break;
- }
- }
- remove_all_abort();
- }
- if (i == 25)
- {
- _iassign(17634,60);
- nTransaction = 70;
- MasterLength = 60;
- }
- else
- {
- _iassign(17634,16);
- nTransaction = 71;
- MasterLength = 16;
- }
- intput_tmp = _lvar_value(17440);
- if (intput_tmp != 33004)
- {
- nb_trend = nb_trend + 1;
- sel_1 = 1;
- save_values();
- }
- intput_tmp = _lvar_value(17441);
- if (intput_tmp != 33004)
- {
- nb_trend = nb_trend + 1;
- sel_2 = 1;
- save_values();
- }
- intput_tmp = _lvar_value(17442);
- if (intput_tmp != 33004)
- {
- nb_trend = nb_trend + 1;
- sel_3 = 1;
- save_values();
- }
- intput_tmp = _lvar_value(17443);
- if (intput_tmp != 33004)
- {
- nb_trend = nb_trend + 1;
- sel_4 = 1;
- save_values();
- }
- if (nb_trend != 0)
- {
- max_trend_entries = _ivar_value(17445);
- _iassign(17456,max_trend_entries);
- send_command_trans(178,1411);
- send_command_trans(173,287);
- _iassign(17750,0);
- _iassign(18718,nb_trend);
- _iassign(17732,132);
- _iassign(17748,1);
- i = _ivar_value(17457);
- _iassign(17439,5);
- send_command_trans(178,1410);
- send_command_trans(146,2);
- count_retries = 1;
- while (count_retries <= 15 && nState != 100)
- {
- DELAY(2,literal_string(2833));
- count_retries = count_retries + 1;
- send_command_trans(147,2);
- tabnState[0] = 17451;
- nState = _ivar_value(17451);
- }
- if (nState != 100)
- {
- ACKNOWLEDGE(literal_string(2834));
- 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(18719,-HB_TrendInterval_1 * nb_points);
- _iassign(17732,132);
- _iassign(17748,1);
- send_command_trans(211,0);
- while (nDataReadCount <= max_trend_entries - 1 - reduce_points)
- {
- if (MasterLength == 60)
- {
- if (max_trend_entries - nDataReadCount >= 15)
- {
- _iassign(17794,(nDataReadCount + MasterLength / 4) * 100 / max_trend_entries);
- }
- else
Please login for more