Example #1
0
 public void Write(TagBoolean Tag, Boolean Value)
 {
     if (Tag.Address.Table == Table.Coils)
     {
         WriteCoils(Tag.Address.Index, BitConverter.GetBytes(Value));
     }
 }
Example #2
0
        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);
            }
        }
Example #3
0
        private void Update(TagBoolean Tag)
        {
            int     index = Tag.Address.Index - this.Address.Index;
            Boolean value = BitConverter.ToBoolean(Buffer, index);

            Tag.ValueSetter(value);
        }
Example #4
0
 public void Add(TagBoolean Tag, UInt16 Index)
 {
     Tag.PLC     = this;
     Tag.Address = new Address {
         Table = Table.Coils, Index = Index
     };
     Add(Tag);
 }
Example #5
0
 public void Write(TagBoolean Tag, Boolean Value)
 {
     if (Tag.Address.Table == Table.Coils)
     {
         WriteCoils(Tag.Address.Index, BitConverter.GetBytes(Value));
     }
 }
Example #6
0
 public void Add(TagBoolean Tag, UInt16 Index)
 {
     Tag.PLC = this;
     Tag.Address = new Address { Table = Table.Coils, Index = Index };
     Add(Tag);
 }
Example #7
0
 private void Update(TagBoolean Tag)
 {
     int index = Tag.Address.Index - this.Address.Index;
     Boolean value = BitConverter.ToBoolean(Buffer, index);
     Tag.ValueSetter(value);
 }