public void BoolTag_AddAddress() { BoolTag myTag = new BoolTag(StatusFunction.InputStatus); myTag.AddAddress(5); myTag.AddAddress(12); myTag.SetData(GetModbusBoolValues()); }
public void BoolTag_OrMerge3() { BoolTag myTag = new BoolTag(StatusFunction.InputStatus); myTag.AddAddress(8); // false myTag.AddAddress(9); // false myTag.MergeType = TagAddressMergeType.OrMerge; myTag.SetData(GetModbusBoolValues()); Assert.AreEqual(false, myTag.Value); }
public void BoolTag_AndMerge2() { BoolTag myTag = new BoolTag(StatusFunction.InputStatus); myTag.AddAddress(3); // true myTag.AddAddress(4); // true myTag.MergeType = TagAddressMergeType.AndMerge; myTag.SetData(GetModbusBoolValues()); Assert.AreEqual(true, myTag.Value); }
public void BoolTag_OrMask5() { BoolTag myTag = new BoolTag(StatusFunction.InputStatus); myTag.AddAddress(5); // false myTag.MaskType = TagAddressMaskType.None; myTag.Mask = true; myTag.SetData(GetModbusBoolValues()); Assert.AreEqual(false, myTag.Value); }
public void BoolTag_OrMask2() { BoolTag myTag = new BoolTag(StatusFunction.InputStatus); myTag.AddAddress(3); // true myTag.MaskType = TagAddressMaskType.OrMask; myTag.Mask = false; myTag.SetData(GetModbusBoolValues()); Assert.AreEqual(true, myTag.Value); }
public void RefreshValues(ReadMap map, bool[] modbusvalues) { //TODO : May performance better for (int i = 0; i < modbusvalues.Length; i++) { ushort address = (ushort)(i + map.StartAddress); if (!CoilValues.ContainsKey(address)) { CoilValues.Add(address, modbusvalues[i]); } else { CoilValues[address] = modbusvalues[i]; } } foreach (var item in Values) { BoolTag tag = item as BoolTag; tag.SetData(CoilValues); } }