private string ReadWorkpartNumHandle(ref ushort flib, string para) { string message = null; var res = new ReadWorkpartNumResultModel(); var ret = new WorkpartNumHelper().ReadWorkpartNum(flib, ref res); if (ret.Item1 == -16) { var ret_conn = ConnectHelper.BuildConnect(ref flib, m_ip, m_port, m_timeout); if (ret_conn == 0) { ret = new WorkpartNumHelper().ReadWorkpartNum(flib, ref res); } } if (ret.Item1 != 0) { message = ret.Item2; } GetResultEvent?.Invoke(new BaseCNCResultModel <ReadWorkpartNumResultModel>() { Value = new List <ReadWorkpartNumResultModel>() { res }, Id = para }); return(message); }
public Tuple <short, string> ReadWorkpartNum(ushort flib, ref ReadWorkpartNumResultModel data) { Focas1.IODBPSD param3 = new Focas1.IODBPSD(); var ret = Focas1.cnc_rdparam(flib, 6711, 0, 8, param3); if (ret == 0) { data.Value = param3.u.ldata; return(new Tuple <short, string>(0, null)); } else { return(new Tuple <short, string>(ret, $"读取加工工件信息错误,返回:{ret}")); } }