public static HomeParams Parse(string str) { string[] strValue = str.Split(','); var homeparams = new HomeParams(); homeparams.Dir = int.Parse(strValue[0]); homeparams.EZ = int.Parse(strValue[1]); homeparams.MaxVel = int.Parse(strValue[2]); homeparams.Mode = int.Parse(strValue[3]); homeparams.OrgVel = int.Parse(strValue[4]); homeparams.ZeroOffset = int.Parse(strValue[5]); homeparams.Timeout = int.Parse(strValue[6]); return(homeparams); }
#pragma warning disable CS1591 // 缺少对公共可见类型或成员“HomeParams.Parse(string)”的 XML 注释 public static HomeParams Parse(string str) #pragma warning restore CS1591 // 缺少对公共可见类型或成员“HomeParams.Parse(string)”的 XML 注释 { string[] strValue = str.Split(','); var homeparams = new HomeParams(); homeparams.Dir = int.Parse(strValue[0]); homeparams.EZ = int.Parse(strValue[1]); homeparams.MaxVel = int.Parse(strValue[2]); homeparams.Mode = int.Parse(strValue[3]); homeparams.OrgVel = int.Parse(strValue[4]); homeparams.ZeroOffset = int.Parse(strValue[5]); homeparams.Timeout = int.Parse(strValue[6]); return(homeparams); }
/// <summary> /// 回零配置 /// </summary> /// <param name="axisNo"></param> /// <param name="homeConfigParams"></param> public void SetAxisHomeConfig(int axisNo, HomeParams homeConfigParams) { APS168.APS_set_axis_param(axisNo, (int)APS_Define.PRA_HOME_MODE, homeConfigParams.Mode); // home mode 0:ORG 1:EL 2:EZ APS168.APS_set_axis_param(axisNo, (int)APS_Define.PRA_HOME_DIR, homeConfigParams.Dir); // Set home direction 0:p-dir 1:n-dir APS168.APS_set_axis_param(axisNo, (int)APS_Define.PRA_HOME_EZA, homeConfigParams.EZ); // EZ alignment enable 0-no 1-yes APS168.APS_set_axis_param_f(axisNo, (int)APS_Define.PRA_HOME_CURVE, 0.5); // homing curve parten(T or s curve) 0-T 0~1.0-S APS168.APS_set_axis_param_f(axisNo, (int)APS_Define.PRA_HOME_ACC, homeConfigParams.MaxVel * 5); // Acceleration deceleration rate APS168.APS_set_axis_param_f(axisNo, (int)APS_Define.PRA_HOME_VS, 0); // homing start velocity APS168.APS_set_axis_param_f(axisNo, (int)APS_Define.PRA_HOME_VM, homeConfigParams.MaxVel); // homing max velocity APS168.APS_set_axis_param_f(axisNo, (int)APS_Define.PRA_HOME_VO, homeConfigParams.OrgVel); // Homing leave ORG velocity APS168.APS_set_axis_param_f(axisNo, (int)APS_Define.PRA_HOME_SHIFT, homeConfigParams.ZeroOffset); // The shift from ORG }
public void SetAxisHomeParam(HomeParams homeParam) => ApsController.SetAxisHomeConfig(NoId, homeParam);