/** * <summary> * /// Gets the number of decimal places by using the FUTEK * /// DLL Method and check if it's numeric and then parse * /// it into integer then store it into the memory * </summary> * <param name=""></param> * @author 이준호(LEEJOONHO) * @date 2020/03/04 10:40 */ private bool fn_GetDecimalPoint(ref ST_Loadcell loadcell) { m_bRet = false; do { loadcell.m_strTemp = loadcell._Loadcell.Get_Decimal_Point(loadcell.m_ptrHandle); }while (!fn_IsNumeric(loadcell.m_strTemp)); try { loadcell.m_nDecimalPoint = Int32.Parse(loadcell.m_strTemp); m_bRet = true; if (loadcell.m_nDecimalPoint > 3) { loadcell.m_nDecimalPoint = 3; } return(m_bRet); } catch (System.Exception ex) { return(m_bRet); } }
/************************************************************************/ /* 생성자 */ /************************************************************************/ public FutekLoadcell() { //1.5 Data //"841888", null, 8389960, 0, 0, 0, 0, 0, "", 0, false, -9.21936819266264, 0.0, 10.7 //"834592", null, 8373643, 0, 0, 0, 0, 0, "", 0, false, 10.871366211572395, 0.0, 2.34 st_Loadcell = new ST_Loadcell(false); // m_bOn = false; m_dLoadCellValue = 0.0; }
/** * <summary> * /// Gets the unit code to later find unit needed for the device * /// by using the FUTEK DLL Method and check if it's numeric and * /// then parse it into integer and then store it into the memory * </summary> * <param name=""></param> * @author 이준호(LEEJOONHO) * @date 2020/03/04 10:41 */ private bool fn_GetUnitCode(ref ST_Loadcell loadcell) { do { loadcell.m_strTemp = loadcell._Loadcell.Get_Unit_Code(loadcell.m_ptrHandle); }while (!fn_IsNumeric(loadcell.m_strTemp)); try { loadcell.m_nUnitCode = Int32.Parse(loadcell.m_strTemp); return(true); } catch (System.Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message); return(false); } }
//--------------------------------------------------------------------------- /** * <summary> * /// Gets the offset value by using the FUTEK DLL Method and * /// check if it's numeric and then parse it into integer * /// then store it into the memory * </summary> * <param name=""></param> * @author 이준호(LEEJOONHO) * @date 2020/03/04 10:39 */ private bool fn_GetOffsetValue(ref ST_Loadcell loadcell) { do { loadcell.m_strTemp = loadcell._Loadcell.Get_Offset_Value(loadcell.m_ptrHandle); }while (!fn_IsNumeric(loadcell.m_strTemp)); try { //loadcell.m_nOffset = Int32.Parse(loadcell.m_strTemp); loadcell.m_nOffset = Convert.ToInt32(loadcell.m_strTemp); return(true); } catch (System.Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message); return(false); } }
/** * <summary> * /// Gets the unit code to later find unit needed for the device * /// by using the FUTEK DLL Method and check if it's numeric and * /// then parse it into integer and then store it into the memory * </summary> * <param name=""></param> * @author 이준호(LEEJOONHO) * @date 2020/03/04 10:41 */ private bool fn_GetUnitCode(ref ST_Loadcell loadcell) { m_bRet = false; do { loadcell.m_strTemp = loadcell._Loadcell.Get_Unit_Code(loadcell.m_ptrHandle); }while (!fn_IsNumeric(loadcell.m_strTemp)); try { loadcell.m_nUnitCode = Int32.Parse(loadcell.m_strTemp); m_bRet = true; return(m_bRet); } catch (System.Exception ex) { return(m_bRet); } }
/** * <summary> * /// Gets the fullscale load by using the FUTEK DLL Method and * /// check if it's numeric and then parse it into integer * /// then store it into the memory * </summary> * <param name=""></param> * @author 이준호(LEEJOONHO) * @date 2020/03/04 10:40 */ private bool fn_GetFullScaleLoad(ref ST_Loadcell loadcell) { m_bRet = false; do { loadcell.m_strTemp = loadcell._Loadcell.Get_Fullscale_Load(loadcell.m_ptrHandle); }while (!fn_IsNumeric(loadcell.m_strTemp)); try { loadcell.m_nFullScaleLoadValue = Int32.Parse(loadcell.m_strTemp); m_bRet = true; return(m_bRet); } catch (System.Exception ex) { return(m_bRet); } }
/** * <summary> * /// Gets the offset value by using the FUTEK DLL Method and * /// check if it's numeric and then parse it into integer * /// then store it into the memory * </summary> * <param name=""></param> * @author 이준호(LEEJOONHO) * @date 2020/03/04 10:39 */ private bool fn_GetOffsetValue(ref ST_Loadcell loadcell) { m_bRet = false; do { loadcell.m_strTemp = loadcell._Loadcell.Get_Offset_Value(loadcell.m_ptrHandle); }while (!fn_IsNumeric(loadcell.m_strTemp)); try { //loadcell.m_nOffset = Int32.Parse(loadcell.m_strTemp); loadcell.m_nOffset = Convert.ToInt32(loadcell.m_strTemp); m_bRet = true; return(m_bRet); } catch (System.Exception ex) { return(m_bRet); } }
/** * <summary> * /// Gets the number of decimal places by using the FUTEK * /// DLL Method and check if it's numeric and then parse * /// it into integer then store it into the memory * </summary> * <param name=""></param> * @author 이준호(LEEJOONHO) * @date 2020/03/04 10:40 */ private bool fn_GetDecimalPoint(ref ST_Loadcell loadcell) { do { loadcell.m_strTemp = loadcell._Loadcell.Get_Decimal_Point(loadcell.m_ptrHandle); }while (!fn_IsNumeric(loadcell.m_strTemp)); try { loadcell.m_nDecimalPoint = Int32.Parse(loadcell.m_strTemp); if (loadcell.m_nDecimalPoint > 3) { loadcell.m_nDecimalPoint = 3; } return(true); } catch (System.Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message); return(false); } }
private void fn_FindUnits(ref ST_Loadcell loadcell) { switch (loadcell.m_nUnitCode) { case 0: loadcell.m_strUnitCode = "atm"; break; case 1: loadcell.m_strUnitCode = "bar"; break; case 2: loadcell.m_strUnitCode = "dyn"; break; case 3: loadcell.m_strUnitCode = "ft-H2O"; break; case 4: loadcell.m_strUnitCode = "ft-lb"; break; case 5: loadcell.m_strUnitCode = "g"; break; case 6: loadcell.m_strUnitCode = "g-cm"; break; case 7: loadcell.m_strUnitCode = "g-mm"; break; case 8: loadcell.m_strUnitCode = "in-H2O"; break; case 9: loadcell.m_strUnitCode = "in-lb"; break; case 10: loadcell.m_strUnitCode = "in-oz"; break; case 11: loadcell.m_strUnitCode = "kdyn"; break; case 12: loadcell.m_strUnitCode = "kg"; break; case 13: loadcell.m_strUnitCode = "kg-cm"; break; case 14: loadcell.m_strUnitCode = "kg/cm2"; break; case 15: loadcell.m_strUnitCode = "kg-m"; break; case 16: loadcell.m_strUnitCode = "klbs"; break; case 17: loadcell.m_strUnitCode = "kN"; break; case 18: loadcell.m_strUnitCode = "kPa"; break; case 19: loadcell.m_strUnitCode = "kpsi"; break; case 20: loadcell.m_strUnitCode = "lbs"; break; case 21: loadcell.m_strUnitCode = "Mdyn"; break; case 22: loadcell.m_strUnitCode = "mmHG"; break; case 23: loadcell.m_strUnitCode = "mN-m"; break; case 24: loadcell.m_strUnitCode = "MPa"; break; case 25: loadcell.m_strUnitCode = "MT"; break; case 26: loadcell.m_strUnitCode = "N"; break; case 27: loadcell.m_strUnitCode = "N-cm"; break; case 28: loadcell.m_strUnitCode = "N-m"; break; case 29: loadcell.m_strUnitCode = "N-mm"; break; case 30: loadcell.m_strUnitCode = "oz"; break; case 31: loadcell.m_strUnitCode = "psi"; break; case 32: loadcell.m_strUnitCode = "Pa"; break; case 33: loadcell.m_strUnitCode = "T"; break; case 34: loadcell.m_strUnitCode = "mV/V"; break; case 35: loadcell.m_strUnitCode = "µA"; break; case 36: loadcell.m_strUnitCode = "mA"; break; case 37: loadcell.m_strUnitCode = "A"; break; case 38: loadcell.m_strUnitCode = "mm"; break; case 39: loadcell.m_strUnitCode = "cm"; break; case 40: loadcell.m_strUnitCode = "dm"; break; case 41: loadcell.m_strUnitCode = "m"; break; case 42: loadcell.m_strUnitCode = "km"; break; case 43: loadcell.m_strUnitCode = "in"; break; case 44: loadcell.m_strUnitCode = "ft"; break; case 45: loadcell.m_strUnitCode = "yd"; break; case 46: loadcell.m_strUnitCode = "mi"; break; case 47: loadcell.m_strUnitCode = "µg"; break; case 48: loadcell.m_strUnitCode = "mg"; break; case 49: loadcell.m_strUnitCode = "LT"; break; case 50: loadcell.m_strUnitCode = "mbar"; break; case 51: loadcell.m_strUnitCode = "˚C"; break; case 52: loadcell.m_strUnitCode = "˚F"; break; case 53: loadcell.m_strUnitCode = "K"; break; case 54: loadcell.m_strUnitCode = "˚Ra"; break; case 55: loadcell.m_strUnitCode = "kN-m"; break; case 56: loadcell.m_strUnitCode = "g-m"; break; case 57: loadcell.m_strUnitCode = "nV"; break; case 58: loadcell.m_strUnitCode = "µV"; break; case 59: loadcell.m_strUnitCode = "mV"; break; case 60: loadcell.m_strUnitCode = "V"; break; case 61: loadcell.m_strUnitCode = "kV"; break; case 62: loadcell.m_strUnitCode = "NONE"; break; default: loadcell.m_strUnitCode = "Undefined"; break; } }