Loading…
Loading…
Method Name: read_hk_data
Method ID: 0x47D9
Method Label: Read curve
Method Help:
- {
- int HKSelectionValue;
- int nPointRead;
- int select;
- long x_eng_unit_tmp;
- int x;
- int y1;
- int x1;
- int count_retries;
- int nNumBytesRead;
- int nDataReadCount;
- float flt_y;
- float xmin;
- float xmax;
- float ymax;
- float ymin;
- float nDecimation;
- float corr_x_min_tmp;
- float fltDigitsPerm;
- float fltDigitsAt0;
- float empty;
- float full;
- float fulltmp;
- float CustomOffset;
- float mrkBlockingDistance_var;
- float mrkFull_var;
- float mrkEmpty_var;
- float mrkLn_var;
- float mrkElectricProbeLength_var;
- int nDataPos;
- int nDataPos1;
- int nStartPos;
- int nState;
- int nNumberOfPoints;
- int nHKres;
- int nNumberOfPointsPerTransaction;
- long varid[1];
- int i;
- int nTransaction;
- int nBCT;
- int nMaxBCT;
- unsigned int compareDW[29];
- unsigned int compareVal;
- _set_device_status(0xFF,0);
- _set_all_resp_code(0);
- _set_comm_status(0x7F,0);
- _set_xmtr_device_status(0xFF,0);
- _set_xmtr_all_resp_code(0);
- varid[0] = 17653;
- nState = 0;
- save_values();
- _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(17558);
- nMaxBCT = _ivar_value(17559);
- if (nMaxBCT == 0 || nMaxBCT == 107 && nBCT == 0)
- {
- _add_abort_method(17587);
- 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(17558,110);
- send_command_trans(143,0);
- _iassign(17558,107);
- send_command_trans(143,0);
- for (i = 0; i < 25; i++)
- {
- compareVal = _ivar_value(resolve_array_ref(17586,i));
- if (compareDW[i] != compareVal)
- {
- break;
- }
- }
- remove_all_abort();
- }
- if (i == 0 && nMaxBCT != 110 || i == 25)
- {
- nTransaction = 32;
- nNumberOfPointsPerTransaction = 40;
- _iassign(17558,80);
- }
- else
- {
- nTransaction = 31;
- nNumberOfPointsPerTransaction = 8;
- _iassign(17558,16);
- }
- x_max_value = _fvar_value(16404);
- save_values();
- x_max_value = 2 * x_max_value;
- save_values();
- save_values();
- x_min_value = 0.0;
- save_values();
- x_eng_unit_tmp = _ivar_value(16403);
- _iassign(17595,x_eng_unit_tmp);
- save_values();
- _fassign(18382,x_min_value);
- save_values();
- _fassign(18383,x_max_value);
- save_values();
- _MenuDisplay(19748,literal_string(1630),literal_string(1629));
- save_values();
- HKSelectionValue = _ivar_value(18350);
- save_values();
- for (x1 = 0; x1 <= 4; x1++)
- {
- for (y1 = 0; y1 <= 99; y1++)
- {
- _fassign(resolve_array_ref(resolve_array_ref(18360,x1),y1),0);
- }
- }
- fltDigitsPerm = _fvar_value(16627);
- save_values();
- fltDigitsAt0 = _fvar_value(16626);
- save_values();
- empty = _fvar_value(16413);
- save_values();
- _fassign(19712,empty);
- save_values();
- fulltmp = _fvar_value(16517);
- save_values();
- full = empty - fulltmp;
- save_values();
- _fassign(19710,full);
- save_values();
- mrkBlockingDistance_var = _fvar_value(16665);
- save_values();
- _fassign(19708,mrkBlockingDistance_var);
- mrkLn_var = _fvar_value(16404);
- save_values();
- _fassign(19714,mrkLn_var);
- mrkElectricProbeLength_var = _fvar_value(16642);
- save_values();
- _fassign(19716,mrkElectricProbeLength_var);
- save_values();
- _fassign(17591,MinXBoundHK);
- save_values();
- _fassign(17592,MaxXBoundHK);
- save_values();
- _add_abort_method(18392);
- if (HKselection == 296)
- {
- nDataPos = 0;
- save_values();
- nDataPos1 = 0;
- save_values();
- DELAY(1,literal_string(1624));
- _iassign(17588,128);
- _iassign(17589,0);
- _iassign(17590,3);
- _fassign(17593,(x_max_value - x_min_value) / 500);
- save_values();
- send_command_trans(146,0);
- save_values();
- nState = _ivar_value(17594);
- ymax = 0.0;
- ymin = 0.0;
- count_retries = 0;
- nState = _ivar_value(17594);
- while (count_retries < 10 && nState != 100)
- {
- varid[0] = 17594;
- DELAY(1,literal_string(1624));
- send_command_trans(147,0);
- count_retries = count_retries + 1;
- nState = _ivar_value(17594);
- }
- varid[0] = 17653;
- nState = _ivar_value(17594);
- if (nState != 100)
- {
- ACKNOWLEDGE(literal_string(1559));
- abort();
- }
- nNumberOfPoints = _ivar_value(17601);
- NumberOfPointsHK = _ivar_value(17601);
- nHKres = number_data_points;
- nDataReadCount = 0;
- _iassign(17588,128);
- _iassign(17606,1);
- _iassign(17607,0);
- _iassign(17608,0);
- send_command_trans(211,0);
- x = 0;
- _iassign(17606,0);
- _iassign(17607,0);
- _iassign(17608,0);
- nDataReadCount = 0;
- nDecimation = _fvar_value(17593);
- corr_x_min_tmp = _fvar_value(17603);
- _fassign(19722,nDecimation);
- _fassign(19721,corr_x_min_tmp);
- nNumBytesRead = 0;
- DELAY(1,literal_string(1631));
- while (nDataReadCount <= nNumberOfPoints)
- {
- _iassign(17653,(nDataReadCount + nNumberOfPointsPerTransaction) * 100 / nNumberOfPoints);
- varid[0] = 17653;
- if (progress < 100)
- {
- put_message(literal_string(1560),varid);
- }
- _iassign(17606,0);
- send_command_trans(212,nTransaction);
- if (number_bytes_message == 0)
- {
- abort();
Please login for more