예제 #1
0
        public int WriteInt16(DeviceAddress address, short value)
        {
            int rs = _plcReader.WriteInt16(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 {
                                Int16 = value
                            },
                                            DateTime.Now)
                        }));
                    }
                }
            }

            return(rs);
        }
예제 #2
0
 public int WriteInt16(DeviceAddress address, short value)
 {
     return(_reader.WriteInt16(address, value));
 }