public override bool InitController() { if (!Connected) { connecter.DevIndex = DevIndex; connecter.ConnectDriver(); } if (Connected && !enabled) { bool flag = true; foreach (var item in param.InitCmd) { flag &= connecter.SendCommand(item); } foreach (var item in param.OutPutByte) { flag &= SetValueMapAddress(item); } foreach (var item in param.InPutByte) { flag &= SetValueMapAddress(item); } enabled = flag; return(flag); } else { return(enabled); } }
/// <summary> /// 初始化驱动器 /// </summary> /// <returns></returns> public override bool InitAmpC() { if (!Connected) { connecter.DevIndex = devIndex; connecter.ConnectDriver(); } if (Connected) { bool flag = connecter.SendCommand(string.Format("#{0}J/", AmpCIndex));//设置为闭环控制 return(flag); } else { return(false); } }