DataItemAddress.cs 984 B

12345678910111213141516171819202122232425262728293031323334353637
  1. namespace S7.Net.Protocol.S7
  2. {
  3. /// <summary>
  4. /// Represents an area of memory in the PLC
  5. /// </summary>
  6. internal class DataItemAddress
  7. {
  8. public DataItemAddress(DataType dataType, int db, int startByteAddress, int byteLength)
  9. {
  10. DataType = dataType;
  11. DB = db;
  12. StartByteAddress = startByteAddress;
  13. ByteLength = byteLength;
  14. }
  15. /// <summary>
  16. /// Memory area to read
  17. /// </summary>
  18. public DataType DataType { get; }
  19. /// <summary>
  20. /// Address of memory area to read (example: for DB1 this value is 1, for T45 this value is 45)
  21. /// </summary>
  22. public int DB { get; }
  23. /// <summary>
  24. /// Address of the first byte to read
  25. /// </summary>
  26. public int StartByteAddress { get; }
  27. /// <summary>
  28. /// Length of data to read
  29. /// </summary>
  30. public int ByteLength { get; }
  31. }
  32. }