Example #1
0
 public ReadEventArchiveRequest(ushort unitId, MODBUSAddress eventArchiveAddress, ushort index, bool isExtendedUnitId)
     : base(unitId, Device.ReadHoldingRegisters)
 {
     this.EventArchiveAddress = new MODBUSAddress(eventArchiveAddress.RelativeAddress, eventArchiveAddress.IsZeroBased);
     this.Index            = index;
     this.IsExtendedUnitId = isExtendedUnitId;
 }
Example #2
0
        public List <EventArchiveRecord> ReadEventArchiveRecord(ushort?unitId, MODBUSAddress eventArchiveAddress, ushort index, bool?isExtendedUnitId)
        {
            var request  = new ReadEventArchiveRequest(unitId.HasValue ? unitId.Value : UnitId, eventArchiveAddress, index, isExtendedUnitId.HasValue ? isExtendedUnitId.Value : UseExtendedAddressing);
            var response = Transport.UnicastMessage <ReadEventArchiveResponse>(request);

            return(response.EventArchiveRecords);
        }
Example #3
0
        public HistoryArchiveRecord ReadHistoryArchiveRecord(ushort?unitId, MODBUSAddress historyArchiveAddress, ushort index, byte recordSize, bool?isExtendedUnitId)
        {
            var request  = new ReadHistoryArchiveRequest(unitId.HasValue ? unitId.Value : UnitId, historyArchiveAddress, index, recordSize, isExtendedUnitId.HasValue ? isExtendedUnitId.Value : UseExtendedAddressing);
            var response = Transport.UnicastMessage <ReadHistoryArchiveResponse>(request);

            return(response.HistoryArchiveRecord);
        }
Example #4
0
 public ReadHistoryArchiveRequest(ushort unitId, MODBUSAddress historyArchiveAddress, ushort index, byte recordSize, bool isExtendedUnitId)
     : base(unitId, Device.ReadHoldingRegisters)
 {
     this.HistoryArchiveAddress = new MODBUSAddress(historyArchiveAddress.RelativeAddress, historyArchiveAddress.IsZeroBased);
     this.Index            = index;
     this.RecordSize       = recordSize;
     this.IsExtendedUnitId = isExtendedUnitId;
 }