예제 #1
0
 public void Write(TagBoolean Tag, Boolean Value)
 {
     if (Tag.Address.Table == Table.Coils)
     {
         WriteCoils(Tag.Address.Index, BitConverter.GetBytes(Value));
     }
 }
예제 #2
0
파일: TagMaster.cs 프로젝트: dncep/Woofer
        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);
            }
        }
예제 #3
0
        private void Update(TagBoolean Tag)
        {
            int     index = Tag.Address.Index - this.Address.Index;
            Boolean value = BitConverter.ToBoolean(Buffer, index);

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