/// <summary> /// 获取单个输入点状态 /// ArgumentOutofRange /// </summary> /// <param name="index">输入点序号,从0开始</param> /// <returns></returns> public int GetAI(int index, out double volt) { if (index < 0 || index >= AICount) { throw new Exception(string.Format("GetAI(index = {0}, volt) index is out of range:0~{1}", index, AICount - 1)); } volt = 0; if (!IsOpen) { return((int)ErrorDef.NotOpen); } int opt = HTM.ReadAI(aiIndex[index], out volt); if (opt != 0) { return((int)ErrorDef.InvokeFailed); } return((int)ErrorDef.Success); }