/// <summary> /// 设置开关量“输出值” /// 如果是开关量1=True,0=False /// </summary> public void SetNewOutput(bool value, OUTPUT_MODE outMode) { Output = new ValueStruct(value); _OutputMode = outMode; _UpdateTime = DateTime.Now; _Changed = !_OutputMode.Equals(CurrValue); }
/// <summary> /// 设置开关量“输出值”根据当前值翻转 /// 如果当前值是 Null、False,则输出为 True,否则输出 False /// </summary> public void SetNewOutputRollingOver(OUTPUT_MODE outMode) { if (CurrValue.IsNull || CurrValue.B == false) { Output = new ValueStruct(true); } else { Output = new ValueStruct(false); } _OutputMode = outMode; _UpdateTime = DateTime.Now; _Changed = true; }
/// <summary> /// /// </summary> /// <param name="id">IO点/软单元/采集点全局唯一索引号</param> public AcquireValue(int id) { _Id = id; CurrValue = new ValueStruct(); PreviousValue = new ValueStruct(); Output = new ValueStruct(); DefaultValue = ValueStruct.NullDefault; _OutputMode = OUTPUT_MODE.omAuto; _ZeroOffset = 0; _Gain = 0; _CalibrateValue = 0; _UpdateTime = DateTime.MinValue; _LastChangedTime = DateTime.MinValue; _Changed = false; }
/// <summary> /// 将输出值复位 /// 准备进入逻辑判断、运算环节前复位输出 /// </summary> public void ResetOutput() { Output = ValueStruct.NullDefault; _OutputMode = OUTPUT_MODE.omAuto; _UpdateTime = DateTime.Now; }