brsystem.fun 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK MEMInfo (*returns information about the memory areas available on the system*)
  2. VAR_INPUT
  3. enable :BOOL; (*enables execution*)
  4. END_VAR
  5. VAR_OUTPUT
  6. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  7. FreeUSR_Ram :UDINT; (*SG3: free memory in USER RAM SG4: free memory in SRAM (Userram)*)
  8. FreeSYSTEM :UDINT; (*SG3: free system memory SG4: not used, always 0*)
  9. FreeUSR_Prom :UDINT; (*SG3: free memory in USER PROM SG4: free memory of HD where RPSHD is located*)
  10. FreeSYS_Prom :UDINT; (*SG3: free memory in system PROM SG4: free memory of HD where RPSHD is located*)
  11. FreeFIX_Ram :UDINT; (*SG3: free memory in FIX RAM SG4: not used, always 0*)
  12. FreeTMP_Ram :UDINT; (*SG3: free temporary memory in RAM SG4: free memory in DRAM*)
  13. FreeMEMCARD :UDINT; (*SG3: free memory on MEMCARD SG4: not used, always 0*)
  14. END_VAR
  15. END_FUNCTION_BLOCK
  16. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK MEMxInfo (*returns information about the memory areas available in the system; asynchronous execution*)
  17. VAR_INPUT
  18. enable :BOOL; (*enables execution*)
  19. mem_typ :UDINT; (*memory type: brDRAM, brUSRRAM, brSYSROM, brUSRROM*)
  20. END_VAR
  21. VAR_OUTPUT
  22. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  23. MemSize :UDINT; (*total memory size in bytes*)
  24. FreeMemSize :UDINT; (*size of available memory in bytes*)
  25. BiggestFreeBlockSize :UDINT; (*size of the largest available block in memory in bytes*)
  26. END_VAR
  27. VAR
  28. i_state :UINT; (*internal variable*)
  29. i_result :UINT; (*internal variable*)
  30. i_tmp :UDINT; (*internal variable*)
  31. END_VAR
  32. END_FUNCTION_BLOCK
  33. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK SysInfo (*returns information about the target system*)
  34. VAR_INPUT
  35. enable :BOOL; (*enables execution*)
  36. END_VAR
  37. VAR_OUTPUT
  38. init_reason :USINT; (*reason for initialization*)
  39. init_count :USINT; (*SG3: the value is increased by every INIT (warm restart) SG4: not used, always 0*)
  40. tick_count :UDINT; (*tick count*)
  41. version :UDINT; (*operating system version of the target system*)
  42. END_VAR
  43. END_FUNCTION_BLOCK
  44. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK RTInfo (*returns runtime information about the software object*)
  45. VAR_INPUT
  46. enable :BOOL; (*enables execution*)
  47. END_VAR
  48. VAR_OUTPUT
  49. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  50. cycle_time :UDINT; (*cycle time in microsec*)
  51. init_reason :SINT; (*reason for initialization*)
  52. task_class :SINT; (*task class (SG3: #1 - #4 SG4: #1 - #8)*)
  53. END_VAR
  54. END_FUNCTION_BLOCK
  55. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK TARGETInfo (*returns information about the target system used*)
  56. VAR_INPUT
  57. enable :BOOL; (*enables execution*)
  58. pOSVersion :UDINT; (*string given as a pointer (min. 7 char), where the os version is written*)
  59. END_VAR
  60. VAR_OUTPUT
  61. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  62. DataFormat :USINT; (*wether "big endian" or "little endian" ("TARGET_BIG_ENDIAN"/"TARGET_LITTLE_ENDIAN")*)
  63. END_VAR
  64. END_FUNCTION_BLOCK
  65. {REDUND_ERROR} FUNCTION_BLOCK HWInfo (*returns information about the hardware configuration*)
  66. VAR_INPUT
  67. enable :BOOL; (*enables execution*)
  68. first :BOOL; (*determines the hardware module on which the FUB is used 0/1 next/first*)
  69. pName :UDINT; (*string given as a pointer, where the name of the module is written*)
  70. END_VAR
  71. VAR_OUTPUT
  72. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  73. family :USINT; (*family designation*)
  74. usetype :USINT; (*hardware type*)
  75. module_typ :UDINT; (*module type*)
  76. master_no :USINT; (*logical number of the IO master, RIO master, CAN bus with CANIO*)
  77. slave_no :USINT; (*slave number*)
  78. module_adr :USINT; (*hardware module address (decimal)*)
  79. slot_no :USINT; (*slot of the first submodule found (decimal)*)
  80. END_VAR
  81. VAR
  82. next_vw_p :UDINT; (*internal variable*)
  83. last_modul_p :UDINT; (*internal variable*)
  84. next_entry_p :UDINT; (*internal variable*)
  85. next_entry_ix :USINT; (*internal variable*)
  86. next_slot_ix :USINT; (*internal variable*)
  87. last_rio_master :USINT; (*internal variable*)
  88. END_VAR
  89. END_FUNCTION_BLOCK
  90. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK SysconfInfo (*returns the parameters for a sysconf entry*)
  91. VAR_INPUT
  92. enable :BOOL; (*enables execution*)
  93. pEntry :UDINT; (*string given as a pointer, where the name of the entry is written*)
  94. pValue :UDINT; (*string given as a pointer, where the value of the entry is copied*)
  95. value_len :UDINT; (*length of the "value-string"*)
  96. END_VAR
  97. VAR_OUTPUT
  98. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  99. END_VAR
  100. END_FUNCTION_BLOCK
  101. {REDUND_ERROR} FUNCTION_BLOCK SysconfSet (*sets the parameters for a sysconf entry*)
  102. VAR_INPUT
  103. enable :BOOL; (*enables execution*)
  104. pEntry :UDINT; (*string given as a pointer, where the name of the entry is written*)
  105. pNewValue :UDINT; (*string given as a pointer, where the new value of the entry is written*)
  106. option :USINT; (*sets the parameter volatile/permanent ("brSYSCONF_SET_VOLATILE"/"brSYSCONF_SET_NON_VOLATILE")*)
  107. END_VAR
  108. VAR_OUTPUT
  109. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  110. END_VAR
  111. END_FUNCTION_BLOCK
  112. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK BatteryInfo (*returns the state of the battery*)
  113. VAR_INPUT
  114. enable :BOOL; (*enables execution*)
  115. pDevice :UDINT; (*device name given as a pointer*)
  116. END_VAR
  117. VAR_OUTPUT
  118. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  119. state :USINT; (*state of the battery*)
  120. END_VAR
  121. END_FUNCTION_BLOCK
  122. {REDUND_ERROR} FUNCTION_BLOCK EXCInfo (*returns information about the software object that triggered the exception*)
  123. VAR_INPUT
  124. enable :BOOL; (*enables execution*)
  125. END_VAR
  126. VAR_OUTPUT
  127. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  128. task_class :UDINT; (*task class in which the exception was triggered*)
  129. task_ident :UDINT; (*ID number of the software object that triggered the exception*)
  130. END_VAR
  131. END_FUNCTION_BLOCK
  132. {REDUND_ERROR} FUNCTION_BLOCK ZYKVLenable (*enables/disables the cycle time monitoring of software objects*)
  133. VAR_INPUT
  134. enable :BOOL; (*enables execution*)
  135. mode :BOOL; (*0/1 monitoring off/on*)
  136. END_VAR
  137. VAR_OUTPUT
  138. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  139. END_VAR
  140. END_FUNCTION_BLOCK
  141. {REDUND_ERROR} FUNCTION_BLOCK PMemGet (*reads data of len byte from the permanent memeory area beginning at offset*)
  142. VAR_INPUT
  143. enable :BOOL; (*enables execution*)
  144. offset :UDINT; (*offset within the permanent memory area*)
  145. len :UDINT; (*length of data area to be read*)
  146. adress :UDINT; (*address where the read data is copied*)
  147. END_VAR
  148. VAR_OUTPUT
  149. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  150. END_VAR
  151. END_FUNCTION_BLOCK
  152. {REDUND_ERROR} FUNCTION_BLOCK PMemPut (*writes len bytes to the permanent memory area beginning at offset*)
  153. VAR_INPUT
  154. enable :BOOL; (*enables execution*)
  155. offset :UDINT; (*offset within the permanent memory area*)
  156. len :UDINT; (*length of data area to be written*)
  157. adress :UDINT; (*address of the data to be written to the permanent memory area*)
  158. END_VAR
  159. VAR_OUTPUT
  160. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  161. END_VAR
  162. END_FUNCTION_BLOCK
  163. {REDUND_ERROR} FUNCTION_BLOCK PMemSize (*determines the size of permanent memory area in its existing configuration*)
  164. VAR_INPUT
  165. enable :BOOL; (*enables execution*)
  166. END_VAR
  167. VAR_OUTPUT
  168. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  169. size :UDINT; (*size of permanent memory area*)
  170. END_VAR
  171. END_FUNCTION_BLOCK
  172. {REDUND_ERROR} FUNCTION_BLOCK ARwinWindowsInfo (*get status of windows system*)
  173. VAR_INPUT
  174. enable :BOOL; (*enables execution*)
  175. END_VAR
  176. VAR_OUTPUT
  177. status :UINT; (*execution status: ERR_OK, 0xXXXX = see help*)
  178. windowsStatus :UDINT; (*windows system status: brWINDOWS_BLUESCREEN, brWINDOWS_OK*)
  179. END_VAR
  180. END_FUNCTION_BLOCK
  181. {REDUND_ERROR} FUNCTION_BLOCK ARwinEthWinInfo (*get ETH info windows interface*)
  182. VAR_INPUT
  183. enable :BOOL; (*enables execution*)
  184. END_VAR
  185. VAR_OUTPUT
  186. status :UINT; (*execution status: ERR_OK, 0xXXXX = see help*)
  187. IPAddr :STRING[15]; (*IP-address of virtual windows IF*)
  188. SubnetMask :STRING[15]; (*netmask of virtual windows IF*)
  189. MacAddr :ARRAY[0..5] OF BYTE; (*MAC-address of virtual windows IF*)
  190. END_VAR
  191. END_FUNCTION_BLOCK