public void Write(TagBoolean Tag, Boolean Value) { if (Tag.Address.Table == Table.Coils) { WriteCoils(Tag.Address.Index, BitConverter.GetBytes(Value)); } }
internal static ITag ParseValue(BinaryReader reader, byte id) { switch (id) { case TagBoolean.TypeId: return(TagBoolean.Parse(reader)); case TagByte.TypeId: return(TagByte.Parse(reader)); case TagShort.TypeId: return(TagShort.Parse(reader)); case TagInt.TypeId: return(TagInt.Parse(reader)); case TagFloat.TypeId: return(TagFloat.Parse(reader)); case TagLong.TypeId: return(TagLong.Parse(reader)); case TagDouble.TypeId: return(TagDouble.Parse(reader)); case TagString.TypeId: return(TagString.Parse(reader)); case TagCompound.TypeId: return(TagCompound.Parse(reader)); case TagList.TypeId: return(TagList.Parse(reader)); default: throw new FormatException("Invalid type ID: " + id + ". At file position " + reader.BaseStream.Position); } }
private void Update(TagBoolean Tag) { int index = Tag.Address.Index - this.Address.Index; Boolean value = BitConverter.ToBoolean(Buffer, index); Tag.ValueSetter(value); }
public void Add(TagBoolean Tag, UInt16 Index) { Tag.PLC = this; Tag.Address = new Address { Table = Table.Coils, Index = Index }; Add(Tag); }