AsSafety.fun 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. {REDUND_ERROR} FUNCTION_BLOCK safeRemoteControl (*Remote Control Function Block*)
  2. VAR_INPUT
  3. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  4. Execute : BOOL; (*execution*)
  5. pCommandData : UDINT; (*pointer to command data*)
  6. END_VAR
  7. VAR_OUTPUT
  8. Done : BOOL; (*execution done*)
  9. Busy : BOOL; (*execution busy*)
  10. Error : BOOL; (*execution error*)
  11. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  12. SafeLOGICStatus : RemoteControlStatusTypeV1; (*SafeLOGIC status*)
  13. END_VAR
  14. VAR
  15. i_state : UINT; (*internal variable*)
  16. i_result : UINT; (*internal variable*)
  17. i_tmp : UDINT; (*internal variable*)
  18. i_handle : UDINT; (*internal variable*)
  19. END_VAR
  20. END_FUNCTION_BLOCK
  21. {REDUND_ERROR} FUNCTION_BLOCK safeRemoteControl_V2 (*Remote Control Function Block*)
  22. VAR_INPUT
  23. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  24. Execute : BOOL; (*execution*)
  25. pCommandData : UDINT; (*pointer to command data*)
  26. END_VAR
  27. VAR_OUTPUT
  28. Done : BOOL; (*execution done*)
  29. Busy : BOOL; (*execution busy*)
  30. Error : BOOL; (*execution error*)
  31. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  32. SafeLOGICStatus : RemoteControlStatusTypeV2; (*SafeLOGIC status*)
  33. END_VAR
  34. VAR
  35. Internal : AsSafetyInternalType; (*internal variable*)
  36. END_VAR
  37. END_FUNCTION_BLOCK
  38. {REDUND_ERROR} FUNCTION_BLOCK safeDownloadApplication (*Download Application Function Block*)
  39. VAR_INPUT
  40. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  41. Execute : BOOL; (*execution*)
  42. pCommandData : UDINT; (*pointer to command data*)
  43. END_VAR
  44. VAR_OUTPUT
  45. Done : BOOL; (*execution done*)
  46. Busy : BOOL; (*execution busy*)
  47. Error : BOOL; (*execution error*)
  48. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  49. UnlockRequired : BOOL; (*unlock required*)
  50. ApplicationCRC : UDINT; (*application CRC*)
  51. END_VAR
  52. VAR
  53. i_state : UINT; (*internal variable*)
  54. i_result : UINT; (*internal variable*)
  55. i_tmp : UDINT; (*internal variable*)
  56. i_handle : UDINT; (*internal variable*)
  57. END_VAR
  58. END_FUNCTION_BLOCK
  59. {REDUND_ERROR} FUNCTION_BLOCK safeDownloadApplication_V2 (*Download Application Function Block*)
  60. VAR_INPUT
  61. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  62. Execute : BOOL; (*execution*)
  63. pCommandData : UDINT; (*pointer to command data*)
  64. END_VAR
  65. VAR_OUTPUT
  66. Done : BOOL; (*execution done*)
  67. Busy : BOOL; (*execution busy*)
  68. Error : BOOL; (*execution error*)
  69. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  70. UnlockRequired : BOOL; (*unlock required*)
  71. ApplicationCRC : UDINT; (*application CRC*)
  72. END_VAR
  73. VAR
  74. Internal : AsSafetyInternalType; (*internal variable*)
  75. END_VAR
  76. END_FUNCTION_BLOCK
  77. {REDUND_ERROR} FUNCTION_BLOCK safeDownloadData (*Download Data Function Block*)
  78. VAR_INPUT
  79. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  80. Execute : BOOL; (*execution*)
  81. Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,... *)
  82. pCommandData : UDINT; (*pointer to command data*)
  83. END_VAR
  84. VAR_OUTPUT
  85. Done : BOOL; (*execution done*)
  86. Busy : BOOL; (*execution busy*)
  87. Error : BOOL; (*execution error*)
  88. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  89. UnlockRequired : BOOL; (*unlock required*)
  90. Timestamp : UDINT; (*timestamp from data*)
  91. END_VAR
  92. VAR
  93. i_state : UINT; (*internal variable*)
  94. i_result : UINT; (*internal variable*)
  95. i_tmp : UDINT; (*internal variable*)
  96. i_handle : UDINT; (*internal variable*)
  97. END_VAR
  98. END_FUNCTION_BLOCK
  99. {REDUND_ERROR} FUNCTION_BLOCK safeDownloadData_V2 (*Download Data Function Block*)
  100. VAR_INPUT
  101. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  102. Execute : BOOL; (*execution*)
  103. Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,... *)
  104. pCommandData : UDINT; (*pointer to command data*)
  105. END_VAR
  106. VAR_OUTPUT
  107. Done : BOOL; (*execution done*)
  108. Busy : BOOL; (*execution busy*)
  109. Error : BOOL; (*execution error*)
  110. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  111. UnlockRequired : BOOL; (*unlock required*)
  112. Timestamp : UDINT; (*timestamp from data*)
  113. END_VAR
  114. VAR
  115. Internal : AsSafetyInternalType; (*internal variable*)
  116. END_VAR
  117. END_FUNCTION_BLOCK
  118. {REDUND_ERROR} FUNCTION_BLOCK safeConfigurationOnTarget (*Configuration On Target Function Block*)
  119. VAR_INPUT
  120. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  121. Execute : BOOL; (*execution*)
  122. Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,...*)
  123. pCommandData : UDINT; (*pointer to command data*)
  124. END_VAR
  125. VAR_OUTPUT
  126. Done : BOOL; (*execution done*)
  127. Busy : BOOL; (*execution busy*)
  128. Error : BOOL; (*execution error*)
  129. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  130. Timestamp : UDINT; (*timestamp of data*)
  131. END_VAR
  132. VAR
  133. i_state : UINT; (*internal variable*)
  134. i_result : UINT; (*internal variable*)
  135. i_tmp : UDINT; (*internal variable*)
  136. i_handle : UDINT; (*internal variable*)
  137. END_VAR
  138. END_FUNCTION_BLOCK
  139. {REDUND_ERROR} FUNCTION_BLOCK safeConfigurationOnTarget_V2 (*Configuration On Target Function Block*)
  140. VAR_INPUT
  141. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  142. Execute : BOOL; (*execution*)
  143. Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,...*)
  144. pCommandData : UDINT; (*pointer to command data*)
  145. END_VAR
  146. VAR_OUTPUT
  147. Done : BOOL; (*execution done*)
  148. Busy : BOOL; (*execution busy*)
  149. Error : BOOL; (*execution error*)
  150. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  151. Timestamp : UDINT; (*timestamp of data*)
  152. END_VAR
  153. VAR
  154. Internal : AsSafetyInternalType; (*internal variable*)
  155. END_VAR
  156. END_FUNCTION_BLOCK
  157. {REDUND_ERROR} FUNCTION safeLibraryVersion : UINT (*returns the actual library version*)
  158. END_FUNCTION
  159. {REDUND_ERROR} FUNCTION_BLOCK safeDownloadFile (*Download File Function Block*)
  160. VAR_INPUT
  161. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  162. Execute : BOOL; (*execution*)
  163. pCommandData : UDINT; (*pointer to command data*)
  164. END_VAR
  165. VAR_OUTPUT
  166. Done : BOOL; (*execution done*)
  167. Busy : BOOL; (*execution busy*)
  168. Error : BOOL; (*execution error*)
  169. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  170. UnlockRequired : BOOL; (*unlock required*)
  171. Timestamp : UDINT; (*timestamp from data*)
  172. END_VAR
  173. VAR
  174. Internal : AsSafetyInternalType; (*internal variable*)
  175. END_VAR
  176. END_FUNCTION_BLOCK
  177. {REDUND_ERROR} FUNCTION_BLOCK safeCheckTable (*Check Table Function Block*)
  178. VAR_INPUT
  179. Execute : BOOL; (*execution*)
  180. InstNr : USINT; (*instance number*)
  181. pUser : UDINT; (*user name*)
  182. Timestamp : UDINT; (*timestamp*)
  183. TableType : USINT; (*table type*)
  184. EntryCnt : UDINT; (*number of entries*)
  185. pTableHeader : UDINT; (*table header input*)
  186. pTableData : UDINT; (*table data input*)
  187. pTableHeaderOut : UDINT; (*table header output buffer*)
  188. pTableDataOut : UDINT; (*table data output buffer*)
  189. pFileDataOut : UDINT; (*file data output buffer*)
  190. AckData : USINT; (*1 .. acknowledge table data, 2 .. NOT acknowledge table data, abort FUB*)
  191. END_VAR
  192. VAR_OUTPUT
  193. Done : BOOL; (*execution done*)
  194. Busy : BOOL; (*execution busy*)
  195. Error : BOOL; (*execution error*)
  196. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  197. CheckErrorCode : UDINT; (*table check error code*)
  198. CheckErrorLine : UDINT; (*table check error line*)
  199. CheckErrorColumn : UDINT; (*table check error column*)
  200. pCrcOut : UDINT; (*returns pointer to CRC data*)
  201. CrcCntOut : UDINT; (*returns number of CRCs*)
  202. END_VAR
  203. VAR
  204. i_step : UINT; (*internal*)
  205. i_tmp : UDINT; (*internal*)
  206. i_clean : BOOL; (*internal*)
  207. END_VAR
  208. END_FUNCTION_BLOCK
  209. {REDUND_ERROR} FUNCTION_BLOCK safeFileInfo (*File Info Function Block*)
  210. VAR_INPUT
  211. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  212. Execute : BOOL; (*execution*)
  213. Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,...*)
  214. pCommandData : UDINT; (*pointer to command data*)
  215. END_VAR
  216. VAR_OUTPUT
  217. Done : BOOL; (*execution done*)
  218. Busy : BOOL; (*execution busy*)
  219. Error : BOOL; (*execution error*)
  220. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  221. END_VAR
  222. VAR
  223. Internal : AsSafetyInternalType; (*internal variable*)
  224. END_VAR
  225. END_FUNCTION_BLOCK
  226. {REDUND_ERROR} FUNCTION safeGetTableLength : UDINT (*Function returns size of table data*)
  227. VAR_INPUT
  228. TableType : USINT; (*table type*)
  229. EntryCnt : UDINT; (*number of entries*)
  230. pTableHeader : UDINT; (*pointer to table header*)
  231. END_VAR
  232. END_FUNCTION
  233. {REDUND_ERROR} FUNCTION_BLOCK safeGetDataLength (*Function Block returns size of download file*)
  234. VAR_INPUT
  235. Execute : BOOL; (*execution*)
  236. Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,... *)
  237. pCommandData : UDINT; (*pointer to command data*)
  238. END_VAR
  239. VAR_OUTPUT
  240. Done : BOOL; (*execution done*)
  241. Busy : BOOL; (*execution busy*)
  242. Error : BOOL; (*execution error*)
  243. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  244. Length : UDINT; (*calculated length of download file*)
  245. END_VAR
  246. VAR
  247. Internal : AsSafetyInternalType; (*internal variable*)
  248. END_VAR
  249. END_FUNCTION_BLOCK
  250. {REDUND_ERROR} FUNCTION_BLOCK safeCreateData (*Create Data Function Block*)
  251. VAR_INPUT
  252. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  253. Execute : BOOL; (*execution*)
  254. Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,... *)
  255. pCommandData : UDINT; (*pointer to command data*)
  256. FileDataOutLen : UDINT; (*size of buffer for file data*)
  257. pFileDataOut : UDINT; (*pointer to memory buffer for file data*)
  258. END_VAR
  259. VAR_OUTPUT
  260. Done : BOOL; (*execution done*)
  261. Busy : BOOL; (*execution busy*)
  262. Error : BOOL; (*execution error*)
  263. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  264. UnlockRequired : BOOL; (*unlock required*)
  265. Timestamp : UDINT; (*timestamp from data*)
  266. END_VAR
  267. VAR
  268. Internal : AsSafetyInternalType; (*internal variable*)
  269. END_VAR
  270. END_FUNCTION_BLOCK
  271. {REDUND_ERROR} FUNCTION_BLOCK safeLogicInfo (*Remote Control Function Block*)
  272. VAR_INPUT
  273. SafeLOGICID : UINT; (*SafeLOGIC ID*)
  274. Execute : BOOL; (*execution*)
  275. Type : UINT; (*type of data: safeINFO_TYPE_PWD_INFO, safeINFO_TYPE_PWD_CHK, safeINFO_TYPE_UDID_INFO*)
  276. pCommandData : UDINT; (*pointer to command data*)
  277. END_VAR
  278. VAR_OUTPUT
  279. Done : BOOL; (*execution done*)
  280. Busy : BOOL; (*execution busy*)
  281. Error : BOOL; (*execution error*)
  282. StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
  283. END_VAR
  284. VAR
  285. Internal : AsSafetyInternalType; (*internal variable*)
  286. END_VAR
  287. END_FUNCTION_BLOCK