Loading…

方法名称: th_calib

方法ID: 0x4017

方法标签: Calibrate Sensor

方法描述: Calibrate Zero and Span.(Zero first)


  • {
  • long idc[5];
  • char status[3];
  • int use_abort_method;
  • char disp_string1[60];
  • char disp_string2[60];
  • int slen1;
  • int slen2;
  • int ret;
  • int cal_art;
  • char xmtr_status[25];
  • int cmd;
  • int gasi;
  • int uniti;
  • int maxGas;
  • int maxUnit;
  • int altgas;
  • SET_NUMBER_OF_RETRIES(10);
  • _set_all_resp_code(0);
  • _set_xmtr_all_resp_code(0);
  • _set_device_status(0xFF,0);
  • _set_xmtr_device_status(0xFF,0);
  • slen1 = 60;
  • slen2 = 60;
  • _add_abort_method(16765);
  • ret = SELECT_FROM_LIST(literal_string(314),literal_string(315));
  • cal_art = ret;
  • if (cal_art == 0)
  • {
  • PUT_MESSAGE(literal_string(316));
  • _iassign(5202,0);
  • }
  • else
  • {
  • send_command(140);
  • idc[0] = 16484;
  • idc[1] = 16540;
  • idc[2] = 16573;
  • _get_dictionary_string(1193083224,disp_string2,slen2);
  • ret = select_from_list(literal_string(317),idc,disp_string2);
  • if (ret == 0)
  • {
  • altgas = gasi = _ivar_value(16538);
  • maxGas = 24;
  • do {
  • _iassign(16537,gasi);
  • send_command(157);
  • idc[0] = resolve_array_ref(16536,gasi);
  • _get_dictionary_string(1193083222,disp_string1,slen1);
  • _get_dictionary_string(1193083190,disp_string2,slen2);
  • ret = select_from_list(disp_string1,idc,disp_string2);
  • if (ret == 0)
  • {
  • break;
  • }
  • switch (ret)
  • {
  • case 1:
  • gasi--;
  • if (gasi < 0)
  • {
  • gasi = maxGas;
  • }
  • break;
  • case 2:
  • gasi++;
  • if (gasi > maxGas)
  • {
  • gasi = 0;
  • }
  • break;
  • }
  • }
  • while (1);
  • if (gasi == altgas)
  • {
  • uniti = _ivar_value(16569);
  • }
  • else
  • {
  • uniti = 0;
  • }
  • maxUnit = 22;


请登录以获得完整内容