Loading…

Method Name: meth_CalWizard

Method ID: 0x4455

Method Label: Quick Start Wizard

Method Help:


  • {
  • int l_iCoeffToEnter;
  • int l_iCoeffCounter;
  • int l_iCalPointsToEnter;
  • int l_iChoice;
  • int l_iChoiceTemp;
  • int l_iState;
  • int l_iAutomatic;
  • int l_iCalPointManuell;
  • int l_iNumberRate;
  • int l_iNumberValue;
  • int l_iCustomCalMethod;
  • int l_iCustomMeasMode;
  • int l_iCoeffSetByUser;
  • int l_iCalPointsCounter;
  • int l_iLoop;
  • int i;
  • int offset;
  • float l_fRate;
  • float l_fValue;
  • float l_fRateNext;
  • float l_fValueNext;
  • float l_afValue[12];
  • float l_afCps[12];
  • float l_afCoeff[4];
  • float l_fRhoLiquid;
  • float l_fRhoSolid;
  • float l_fAbsCoeff;
  • float l_fCustomPath;
  • float l_fReadinTime;
  • float l_fReadinTimeBackup;
  • float l_fReadinCps;
  • float l_fBackground;
  • float l_fBackgroundBackup;
  • float l_fUpperRange;
  • float l_fLowerRange;
  • float l_fDampingValue;
  • int l_iBackUpUnitCode;
  • int l_iYear;
  • int l_iMonth;
  • int l_iDay;
  • int l_iChangeDateTime;
  • int l_iCalibrated;
  • long ids[4];
  • char status[3];
  • SET_NUMBER_OF_RETRIES(5);
  • _set_no_device(2);
  • _set_all_resp_code(0);
  • _set_device_status(0xFF,0);
  • _set_xmtr_all_resp_code(0);
  • _set_xmtr_device_status(0xFF,0);
  • ;
  • if (!(write_protect == 1 || lock_device_status_code == 0x04) && 1)
  • {
  • ACKNOWLEDGE(literal_string(1538));
  • PUT_MESSAGE(literal_string(1539));
  • send(210,status);
  • if (status[0] != 0)
  • {
  • display_response_status(210,status[0]);
  • process_abort();
  • }
  • ;
  • l_iCalPointsCounter = 0;
  • l_iCoeffCounter = 0;
  • l_iCoeffToEnter = 0;
  • l_iCalPointsToEnter = 0;
  • l_iCoeffSetByUser = 0;
  • l_iAutomatic = 0;
  • l_iCalibrated = 0;
  • l_iCalPointManuell = 0;
  • send(208,status);
  • if (status[0] != 0)
  • {
  • display_response_status(208,status[0]);
  • process_abort();
  • }
  • ;
  • _vassign(16452,17179);
  • _vassign(16453,17180);
  • _vassign(16454,17181);
  • send(180,status);
  • if (status[0] != 0)
  • {
  • display_response_status(180,status[0]);
  • process_abort();
  • }
  • ;
  • send(234,status);
  • if (status[0] != 0)
  • {
  • display_response_status(234,status[0]);
  • process_abort();
  • }
  • ;
  • send(236,status);
  • if (status[0] != 0)
  • {
  • display_response_status(236,status[0]);
  • process_abort();
  • }
  • ;
  • send(238,status);
  • if (status[0] != 0)
  • {
  • display_response_status(238,status[0]);
  • process_abort();
  • }
  • ;
  • send(138,status);
  • if (status[0] != 0)
  • {
  • display_response_status(138,status[0]);
  • process_abort();
  • }
  • ;
  • send(163,status);
  • if (status[0] != 0)
  • {
  • display_response_status(163,status[0]);
  • process_abort();
  • }
  • ;
  • send(218,status);
  • if (status[0] != 0)
  • {
  • display_response_status(218,status[0]);
  • process_abort();
  • }
  • ;
  • _vassign(17282,17281);
  • _vassign(17252,17251);
  • _vassign(16457,16414);
  • _vassign(17279,17278);
  • _vassign(17114,17097);
  • _vassign(17116,17098);
  • _vassign(17276,17275);
  • save_values();
  • l_iYear = Date_to_Year(_lvar_value(16457));
  • l_iMonth = Date_to_Month(_lvar_value(16457));
  • l_iDay = Date_to_DayOfMonth(_lvar_value(16457));
  • if (_ivar_value(17113) == 0)
  • {
  • l_iCalibrated = 0;
  • l_iState = 22;
  • }
  • else
  • {
  • l_iCalibrated = 1;
  • l_iState = 1;
  • }
  • while (l_iState > 0)
  • {
  • if (l_iState == 1)
  • {
  • DELAY(1,literal_string(1540));
  • }
  • else
  • {
  • DELAY(1,literal_string(1540));
  • }
  • switch (l_iState)
  • {
  • case 1:
  • l_iChoice = SELECT_FROM_LIST(literal_string(1541),literal_string(1542));
  • switch (l_iChoice)
  • {
  • case 0:
  • l_iState = 22;
  • break;
  • case 1:
  • l_iState = 12;
  • break;
  • case 2:
  • default:
  • l_iState = 1 * -1;
  • break;
  • }
  • break;
  • case 22:
  • _vassign(16457,16414);
  • l_iYear = Date_to_Year(_lvar_value(16457));
  • l_iMonth = Date_to_Month(_lvar_value(16457));
  • l_iDay = Date_to_DayOfMonth(_lvar_value(16457));
  • if (l_iCalibrated == 0)
  • {
  • l_iChangeDateTime = 1;
  • l_iState = 23;
  • }
  • else
  • {
  • ids[0] = 16457;
  • l_iChoice = select_from_list(literal_string(1543),ids,literal_string(1544));
  • switch (l_iChoice)
  • {
  • case 0:
  • l_iChangeDateTime = 0;
  • l_iState = 23;
  • break;
  • case 1:
  • l_iChangeDateTime = 1;
  • l_iState = 23;
  • break;
  • case 2:
  • l_iChangeDateTime = 0;
  • if (_ivar_value(17113) == 0)
  • {
  • l_iState = 23;
  • }
  • else
  • {
  • l_iState = 1;
  • }
  • break;
  • default:
  • l_iChangeDateTime = 0;
  • l_iState = 22 * -1;
  • break;
  • }
  • }
  • if (l_iChangeDateTime == 1)
  • {
  • do {
  • ids[0] = 16457;
  • if (l_iCalibrated == 0)
  • {
  • l_iChoice = _get_local_var_value(literal_string(1545),0,literal_string(1546));
  • }
  • else
  • {
  • l_iChoice = _get_local_var_value(literal_string(1547),ids,literal_string(1546));
  • }
  • var_ls_dtActiveDate = To_Date(l_iYear,l_iMonth,l_iDay);
  • }
  • while (l_iDay < 1 && l_iDay > 31);
  • do {
  • ids[0] = 16457;
  • if (l_iCalibrated == 0)
  • {
  • l_iChoice = _get_local_var_value(literal_string(1548),0,literal_string(1549));
  • }
  • else
  • {
  • l_iChoice = _get_local_var_value(literal_string(1550),ids,literal_string(1549));
  • }
  • var_ls_dtActiveDate = To_Date(l_iYear,l_iMonth,l_iDay);
  • }
  • while (l_iMonth < 1 && l_iMonth > 12);
  • do {
  • ids[0] = 16457;
  • if (l_iCalibrated == 0)
  • {
  • l_iChoice = _get_local_var_value(literal_string(1551),0,literal_string(1552));
  • }
  • else
  • {
  • l_iChoice = _get_local_var_value(literal_string(1553),ids,literal_string(1552));
  • }
  • var_ls_dtActiveDate = To_Date(l_iYear,l_iMonth,l_iDay);
  • }
  • while (l_iYear < 2001);
  • _vassign(16414,16457);
  • send(139,status);
  • if (status[0] != 0)
  • {
  • display_response_status(139,status[0]);
  • l_iState = 22;
  • }
  • else
  • {
  • l_iState = 23;
  • }
  • }
  • break;
  • case 23:
  • send(138,status);
  • if (status[0] != 0)
  • {
  • display_response_status(138,status[0]);
  • process_abort();
  • }
  • ;
  • if (l_iCalibrated == 0)
  • {
  • l_iChangeDateTime = 1;
  • l_iState = 23;
  • }
  • else
  • {
  • ids[0] = 16415;
  • l_iChoice = select_from_list(literal_string(1554),ids,literal_string(1544));
  • switch (l_iChoice)
  • {
  • case 0:
  • l_iChangeDateTime = 0;
  • l_iState = 21;
  • break;
  • case 1:
  • l_iChangeDateTime = 1;
  • l_iState = 21;
  • break;
  • case 2:
  • l_iChangeDateTime = 0;
  • l_iState = 22;
  • break;
  • default:
  • l_iChangeDateTime = 0;
  • l_iState = 23 * -1;
  • break;
  • }
  • }
  • if (l_iChangeDateTime == 1)
  • {
  • send(138,status);
  • if (status[0] != 0)
  • {
  • display_response_status(138,status[0]);
  • process_abort();
  • }
  • ;
  • if (l_iCalibrated == 0)
  • {
  • ids[0] = 16415;
  • l_iChoice = _get_dev_var_value(literal_string(1555),ids,16415);
  • }
  • else
  • {
  • ids[0] = 16415;
  • l_iChoice = _get_dev_var_value(literal_string(1554),ids,16415);
  • }
  • save_values();
  • send(140,status);
  • if (status[0] != 0)
  • {
  • display_response_status(140,status[0]);
  • l_iState = 23;
  • }
  • else
  • {
  • l_iState = 21;
  • }
  • }
  • break;
  • case 21:
  • _add_abort_method(17490);
  • send(163,status);
  • if (status[0] != 0)
  • {
  • display_response_status(163,status[0]);
  • process_abort();
  • }
  • ;
  • _vassign(17252,17251);
  • save_values();
  • ids[0] = 17251;
  • l_iChoice = select_from_list(literal_string(1556),ids,literal_string(1544));
  • switch (l_iChoice)
  • {
  • case 0:
  • l_iState = 25;
  • break;
  • case 1:
  • l_iChoice = _get_dev_var_value(literal_string(1557),ids,17251);
  • save_values();
  • send(164,status);
  • if (status[0] != 0)
  • {
  • display_response_status(164,status[0]);
  • process_abort();
  • }
  • ;
  • l_iState = 25;
  • break;
  • case 2:
  • l_iState = 23;
  • break;
  • case 3:
  • default:
  • l_iState = 21 * -1;
  • break;
  • }
  • break;
  • case 25:
  • send(236,status);
  • if (status[0] != 0)
  • {
  • display_response_status(236,status[0]);
  • process_abort();
  • }
  • ;
  • _vassign(17279,17278);
  • save_values();
  • ids[0] = 17278;
  • l_iChoice = select_from_list(literal_string(1558),ids,literal_string(1544));
  • switch (l_iChoice)
  • {
  • case 0:
  • l_iState = 2;
  • break;
  • case 1:
  • l_iChoice = _get_dev_var_value(literal_string(1559),ids,17278);
  • save_values();
  • send(237,status);
  • if (status[0] != 0)
  • {
  • display_response_status(237,status[0]);
  • process_abort();
  • }
  • ;
  • l_iState = 2;
  • break;
  • case 2:
  • l_iState = 21;
  • break;
  • case 3:
  • default:
  • l_iState = 25 * -1;
  • break;
  • }
  • break;
  • case 2:
  • send(234,status);
  • if (status[0] != 0)
  • {
  • display_response_status(234,status[0]);
  • process_abort();
  • }
  • ;
  • l_fCustomPath = _fvar_value(17184);
  • send(236,status);
  • if (status[0] != 0)
  • {
  • display_response_status(236,status[0]);
  • process_abort();
  • }
  • ;
  • _vassign(17114,17097);
  • save_values();
  • l_iCustomMeasMode = _ivar_value(17097);
  • ids[0] = 17097;
  • l_iChoice = select_from_list(literal_string(1560),ids,literal_string(1561));
  • switch (l_iChoice)
  • {
  • case 0:
  • l_iCustomMeasMode = _ivar_value(17097);
  • l_iState = 3;
  • break;
  • case 1:
  • l_iCustomMeasMode = 0;
  • l_iState = 3;
  • break;
  • case 2:
  • l_iCustomMeasMode = 1;
  • l_iState = 3;
  • break;
  • case 3:
  • l_iCustomMeasMode = 2;
  • l_iState = 3;
  • break;
  • case 4:
  • l_iState = 25;
  • break;
  • case 5:
  • default:
  • l_iState = 2 * -1;
  • break;
  • }
  • break;
  • case 3:
  • _iassign(16455,l_iCustomMeasMode);
  • if (l_iCustomMeasMode == 0)
  • {
  • ids[0] = 17179;
  • l_iChoice = select_from_list(literal_string(1562),ids,literal_string(1563));
  • switch (l_iChoice)
  • {
  • case 0:
  • l_iState = 4;
  • break;
  • case 1:
  • _iassign(17179,0x5B);
  • send(209,status);
  • if (status[0] != 0)
  • {
  • display_response_status(209,status[0]);
  • process_abort();
  • }
  • ;
  • l_iState = 4;
  • break;
  • case 2:
  • _iassign(17179,0x5C);
  • send(209,status);
  • if (status[0] != 0)
  • {
  • display_response_status(209,status[0]);
  • process_abort();
  • }
  • ;
  • l_iState = 4;
  • break;
  • case 3:
  • _iassign(17179,0x5D);
  • send(209,status);
  • if (status[0] != 0)
  • {
  • display_response_status(209,status[0]);
  • process_abort();
  • }
  • ;
  • l_iState = 4;
  • break;
  • case 4:
  • _iassign(17179,0x5E);
  • send(209,status);
  • if (status[0] != 0)
  • {
  • display_response_status(209,status[0]);


Please login for more