Enums.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. namespace snap7Enc
  2. {
  3. /// <summary>
  4. /// Types of S7 cpu supported by the library
  5. /// </summary>
  6. public enum CpuType
  7. {
  8. /// <summary>
  9. /// S7 200 cpu type
  10. /// </summary>
  11. S7200 = 0,
  12. /// <summary>
  13. /// S7 300 cpu type
  14. /// </summary>
  15. S7300 = 10,
  16. /// <summary>
  17. /// S7 400 cpu type
  18. /// </summary>
  19. S7400 = 20,
  20. /// <summary>
  21. /// S7 1200 cpu type
  22. /// </summary>
  23. S71200 = 30,
  24. /// <summary>
  25. /// S7 1500 cpu type
  26. /// </summary>
  27. S71500 = 40,
  28. }
  29. /// <summary>
  30. /// Types of error code that can be set after a function is called
  31. /// </summary>
  32. public enum ErrorCode
  33. {
  34. /// <summary>
  35. /// The function has been executed correctly
  36. /// </summary>
  37. NoError = 0,
  38. /// <summary>
  39. /// Wrong type of CPU error
  40. /// </summary>
  41. WrongCPU_Type = 1,
  42. /// <summary>
  43. /// Connection error
  44. /// </summary>
  45. ConnectionError = 2,
  46. /// <summary>
  47. /// Ip address not available
  48. /// </summary>
  49. IPAddressNotAvailable,
  50. /// <summary>
  51. /// Wrong format of the variable
  52. /// </summary>
  53. WrongVarFormat = 10,
  54. /// <summary>
  55. /// Wrong number of received bytes
  56. /// </summary>
  57. WrongNumberReceivedBytes = 11,
  58. /// <summary>
  59. /// Error on send data
  60. /// </summary>
  61. SendData = 20,
  62. /// <summary>
  63. /// Error on read data
  64. /// </summary>
  65. ReadData = 30,
  66. /// <summary>
  67. /// Error on write data
  68. /// </summary>
  69. WriteData = 50
  70. }
  71. /// <summary>
  72. /// Types of memory area that can be read
  73. /// </summary>
  74. public enum DataType
  75. {
  76. /// <summary>
  77. /// Input area memory
  78. /// </summary>
  79. Input = 129,
  80. /// <summary>
  81. /// Output area memory
  82. /// </summary>
  83. Output = 130,
  84. /// <summary>
  85. /// Merkers area memory (M0, M0.0, ...)
  86. /// </summary>
  87. Memory = 131,
  88. /// <summary>
  89. /// DB area memory (DB1, DB2, ...)
  90. /// </summary>
  91. DataBlock = 132,
  92. /// <summary>
  93. /// Timer area memory(T1, T2, ...)
  94. /// </summary>
  95. Timer = 29,
  96. /// <summary>
  97. /// Counter area memory (C1, C2, ...)
  98. /// </summary>
  99. Counter = 28
  100. }
  101. /// <summary>
  102. /// Types
  103. /// </summary>
  104. public enum VarType
  105. {
  106. /// <summary>
  107. /// S7 Bit variable type (bool)
  108. /// </summary>
  109. Bit,
  110. /// <summary>
  111. /// S7 Byte variable type (8 bits)
  112. /// </summary>
  113. Byte,
  114. /// <summary>
  115. /// S7 Word variable type (16 bits, 2 bytes)
  116. /// </summary>
  117. Word,
  118. /// <summary>
  119. /// S7 DWord variable type (32 bits, 4 bytes)
  120. /// </summary>
  121. DWord,
  122. /// <summary>
  123. /// S7 Int variable type (16 bits, 2 bytes)
  124. /// </summary>
  125. Int,
  126. /// <summary>
  127. /// DInt variable type (32 bits, 4 bytes)
  128. /// </summary>
  129. DInt,
  130. /// <summary>
  131. /// Real variable type (32 bits, 4 bytes)
  132. /// </summary>
  133. Real,
  134. /// <summary>
  135. /// String variable type (variable)
  136. /// </summary>
  137. String,
  138. /// <summary>
  139. /// String variable type (variable)
  140. /// </summary>
  141. StringEx,
  142. /// <summary>
  143. /// Timer variable type
  144. /// </summary>
  145. Timer,
  146. /// <summary>
  147. /// Counter variable type
  148. /// </summary>
  149. Counter
  150. }
  151. }