Beispiel #1
0
        public int WriteBit(DeviceAddress address, bool value)
        {
            int rs = _plcReader.WriteBit(address, value);

            if (rs >= 0)
            {
                if (DataChange != null)
                {
                    ITag tag = GetTagByAddress(address);
                    if (tag != null)
                    {
                        DataChange(this,
                                   new DataChangeEventArgs(1,
                                                           new HistoryData[1] {
                            new HistoryData(tag.ID, QUALITIES.QUALITY_GOOD, new Storage {
                                Boolean = value
                            },
                                            DateTime.Now)
                        }));
                    }
                }
            }

            return(rs);
        }
Beispiel #2
0
 public int WriteBit(DeviceAddress address, bool value)
 {
     return(_reader.WriteBit(address, value));
 }