FileIO.fun 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileCreate (*creates a file; asynchronous execution*)
  2. VAR_INPUT
  3. enable : BOOL; (*enables execution*)
  4. pDevice : UDINT; (*device name given as a pointer*)
  5. pFile : UDINT; (*pointer to the file name*)
  6. END_VAR
  7. VAR
  8. i_state : UINT; (*internal variable*)
  9. i_result : UINT; (*internal variable*)
  10. i_tmp : UDINT; (*internal variable*)
  11. END_VAR
  12. VAR_OUTPUT
  13. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  14. ident : UDINT; (*identifier of the created file*)
  15. END_VAR
  16. END_FUNCTION_BLOCK
  17. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileOpen (*opens a file; asynchronous execution*)
  18. VAR_INPUT
  19. enable : BOOL; (*enables execution*)
  20. pDevice : UDINT; (*device name given as a pointer*)
  21. pFile : UDINT; (*pointer to the file name*)
  22. mode : USINT; (*access mode (FILE_R, FILE_W, FILE_RW)*)
  23. END_VAR
  24. VAR
  25. i_state : UINT; (*internal variable*)
  26. i_result : UINT; (*internal variable*)
  27. i_tmp : UDINT; (*internal variable*)
  28. END_VAR
  29. VAR_OUTPUT
  30. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  31. ident : UDINT; (*identifier of the created file*)
  32. filelen : UDINT; (*file length*)
  33. END_VAR
  34. END_FUNCTION_BLOCK
  35. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileClose (*closes an open file; asynchronous execution*)
  36. VAR_INPUT
  37. enable : BOOL; (*enables execution*)
  38. ident : UDINT; (*identifier of the created file*)
  39. END_VAR
  40. VAR
  41. i_state : UINT; (*internal variable*)
  42. i_result : UINT; (*internal variable*)
  43. i_tmp : UDINT; (*internal variable*)
  44. END_VAR
  45. VAR_OUTPUT
  46. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  47. END_VAR
  48. END_FUNCTION_BLOCK
  49. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileRead (*reads from an open file; asynchronous execution*)
  50. VAR_INPUT
  51. enable : BOOL; (*enables execution*)
  52. ident : UDINT; (*identifier of the created file*)
  53. offset : UDINT; (*offset*)
  54. pDest : UDINT; (*pointer to the read buffer*)
  55. len : UDINT; (*length of bytes to read*)
  56. END_VAR
  57. VAR
  58. i_state : UINT; (*internal variable*)
  59. i_result : UINT; (*internal variable*)
  60. i_tmp : UDINT; (*internal variable*)
  61. END_VAR
  62. VAR_OUTPUT
  63. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  64. END_VAR
  65. END_FUNCTION_BLOCK
  66. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileReadEx (*reads from an open file and returns the number of actually read bytes; asynchronous execution*)
  67. VAR_INPUT
  68. enable : BOOL; (*enables execution*)
  69. ident : UDINT; (*identifier of the created file*)
  70. offset : UDINT; (*offset*)
  71. pDest : UDINT; (*pointer to the read buffer*)
  72. len : UDINT; (*number of bytes to read*)
  73. END_VAR
  74. VAR
  75. i_state : UINT; (*internal variable*)
  76. i_result : UINT; (*internal variable*)
  77. i_tmp : UDINT; (*internal variable*)
  78. END_VAR
  79. VAR_OUTPUT
  80. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  81. bytesread : UDINT; (*number of bytes read*)
  82. END_VAR
  83. END_FUNCTION_BLOCK
  84. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileWrite (*writes to a file; asynchronous execution*)
  85. VAR_INPUT
  86. enable : BOOL; (*enables execution*)
  87. ident : UDINT; (*identifier of the created file*)
  88. offset : UDINT; (*offset*)
  89. pSrc : UDINT; (*pointer to the write buffer*)
  90. len : UDINT; (*number of bytes to write*)
  91. END_VAR
  92. VAR
  93. i_state : UINT; (*internal variable*)
  94. i_result : UINT; (*internal variable*)
  95. i_tmp : UDINT; (*internal variable*)
  96. END_VAR
  97. VAR_OUTPUT
  98. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  99. END_VAR
  100. END_FUNCTION_BLOCK
  101. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileWriteEx (*writes to a file; asynchronous execution*)
  102. VAR_INPUT
  103. enable : BOOL; (*enables execution*)
  104. ident : UDINT; (*identifier of the created file*)
  105. offset : UDINT; (*offset*)
  106. pSrc : UDINT; (*pointer to the write buffer*)
  107. len : UDINT; (*number of bytes to write*)
  108. option : UDINT; (*options*)
  109. END_VAR
  110. VAR
  111. i_state : UINT; (*internal variable*)
  112. i_result : UINT; (*internal variable*)
  113. i_tmp : UDINT; (*internal variable*)
  114. END_VAR
  115. VAR_OUTPUT
  116. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  117. END_VAR
  118. END_FUNCTION_BLOCK
  119. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileRename (*renames files; asynchronous execution*)
  120. VAR_INPUT
  121. enable : BOOL; (*enables execution*)
  122. pDevice : UDINT; (*device name given as a pointer*)
  123. pName : UDINT; (*pointer to the file name*)
  124. pNewName : UDINT; (*pointer to the new file name*)
  125. END_VAR
  126. VAR
  127. i_state : UINT; (*internal variable*)
  128. i_result : UINT; (*internal variable*)
  129. i_tmp : UDINT; (*internal variable*)
  130. END_VAR
  131. VAR_OUTPUT
  132. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  133. END_VAR
  134. END_FUNCTION_BLOCK
  135. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileCopy (*copies a file; asynchronous execution*)
  136. VAR_INPUT
  137. enable : BOOL; (*enables execution*)
  138. pSrcDev : UDINT; (*pointer to the source file device name*)
  139. pSrc : UDINT; (*pointer to the existing file name*)
  140. pDestDev : UDINT; (*pointer to the destination file device name*)
  141. pDest : UDINT; (*pointer to the copy file name*)
  142. option : USINT; (*copy option*)
  143. END_VAR
  144. VAR
  145. i_state : UINT; (*internal variable*)
  146. i_result : UINT; (*internal variable*)
  147. i_tmp : UDINT; (*internal variable*)
  148. END_VAR
  149. VAR_OUTPUT
  150. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  151. END_VAR
  152. END_FUNCTION_BLOCK
  153. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileDelete (*deletes a file; asynchronous execution*)
  154. VAR_INPUT
  155. enable : BOOL; (*enables execution*)
  156. pDevice : UDINT; (*device name given as a pointer*)
  157. pName : UDINT; (*pointer to the file name*)
  158. END_VAR
  159. VAR
  160. i_state : UINT; (*internal variable*)
  161. i_result : UINT; (*internal variable*)
  162. i_tmp : UDINT; (*internal variable*)
  163. END_VAR
  164. VAR_OUTPUT
  165. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  166. END_VAR
  167. END_FUNCTION_BLOCK
  168. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileInfo (*gets information about a file; asynchronous execution*)
  169. VAR_INPUT
  170. enable : BOOL; (*enables execution*)
  171. pDevice : UDINT; (*device name given as a pointer*)
  172. pName : UDINT; (*file name given as pointer*)
  173. pInfo : UDINT; (*file information (fiFILE_INFO) structure given as pointer*)
  174. END_VAR
  175. VAR
  176. i_state : UINT; (*internal variable*)
  177. i_result : UINT; (*internal variable*)
  178. i_tmp : UDINT; (*internal variable*)
  179. END_VAR
  180. VAR_OUTPUT
  181. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  182. END_VAR
  183. END_FUNCTION_BLOCK
  184. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileTruncate (*truncates a file's length; asynchronous execution*)
  185. VAR_INPUT
  186. enable : BOOL; (*enables execution*)
  187. pDevice : UDINT; (*device name given as a pointer*)
  188. pName : UDINT; (*file name given as pointer*)
  189. newLength : UDINT; (*new length*)
  190. END_VAR
  191. VAR
  192. i_state : UINT; (*internal variable*)
  193. i_result : UINT; (*internal variable*)
  194. i_tmp : UDINT; (*internal variable*)
  195. END_VAR
  196. VAR_OUTPUT
  197. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  198. END_VAR
  199. END_FUNCTION_BLOCK
  200. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirCreate (*creates a directory; asynchronous execution*)
  201. VAR_INPUT
  202. enable : BOOL; (*enables execution*)
  203. pDevice : UDINT; (*device name given as a pointer*)
  204. pName : UDINT; (*pointer to the directory name*)
  205. END_VAR
  206. VAR
  207. i_state : UINT; (*internal variable*)
  208. i_result : UINT; (*internal variable*)
  209. i_tmp : UDINT; (*internal variable*)
  210. END_VAR
  211. VAR_OUTPUT
  212. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  213. END_VAR
  214. END_FUNCTION_BLOCK
  215. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirOpen (*opens a directory; asynchronous execution*)
  216. VAR_INPUT
  217. enable : BOOL; (*enables execution*)
  218. pDevice : UDINT; (*device name given as a pointer*)
  219. pName : UDINT; (*pointer to the directory name*)
  220. END_VAR
  221. VAR
  222. i_state : UINT; (*internal variable*)
  223. i_result : UINT; (*internal variable*)
  224. i_tmp : UDINT; (*internal variable*)
  225. END_VAR
  226. VAR_OUTPUT
  227. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  228. ident : UDINT; (*identifier of the directory*)
  229. END_VAR
  230. END_FUNCTION_BLOCK
  231. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirClose (*closes a directory; asynchronous execution*)
  232. VAR_INPUT
  233. enable : BOOL; (*enables execution*)
  234. ident : UDINT; (*identifier of the directory*)
  235. END_VAR
  236. VAR
  237. i_state : UINT; (*internal variable*)
  238. i_result : UINT; (*internal variable*)
  239. i_tmp : UDINT; (*internal variable*)
  240. END_VAR
  241. VAR_OUTPUT
  242. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  243. END_VAR
  244. END_FUNCTION_BLOCK
  245. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirRead (*reads the individual file names in a directory; asynchronous execution*)
  246. VAR_INPUT
  247. enable : BOOL; (*enables execution*)
  248. pDevice : UDINT; (*device name given as a pointer*)
  249. pPath : UDINT; (*pointer to the path string*)
  250. entry : UDINT; (*specifies which entry should be read*)
  251. option : USINT; (*specifies whether directory names or filenames should be read*)
  252. pData : UDINT; (*pointer to the memory area where the information is copied*)
  253. data_len : UDINT; (*length of the provided data area*)
  254. END_VAR
  255. VAR
  256. i_state : UINT; (*internal variable*)
  257. i_result : UINT; (*internal variable*)
  258. i_tmp : UDINT; (*internal variable*)
  259. END_VAR
  260. VAR_OUTPUT
  261. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  262. END_VAR
  263. END_FUNCTION_BLOCK
  264. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirReadEx (*reads the individual file or directory names in a directory; asynchronous execution*)
  265. VAR_INPUT
  266. enable : BOOL; (*enables execution*)
  267. ident : UDINT; (*identifier of the directory*)
  268. pData : UDINT; (*pointer to the memory area where the information is copied*)
  269. data_len : UDINT; (*length of the available data area*)
  270. END_VAR
  271. VAR
  272. i_state : UINT; (*internal variable*)
  273. i_result : UINT; (*internal variable*)
  274. i_tmp : UDINT; (*internal variable*)
  275. END_VAR
  276. VAR_OUTPUT
  277. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  278. END_VAR
  279. END_FUNCTION_BLOCK
  280. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirInfo (*gets information about a directory; asynchronous execution*)
  281. VAR_INPUT
  282. enable : BOOL; (*enables execution*)
  283. pDevice : UDINT; (*device name given as a pointer*)
  284. pPath : UDINT; (*pointer to the path (directory name)*)
  285. END_VAR
  286. VAR
  287. i_state : UINT; (*internal variable*)
  288. i_result : UINT; (*internal variable*)
  289. i_tmp : UDINT; (*internal variable*)
  290. END_VAR
  291. VAR_OUTPUT
  292. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  293. dirnum : UDINT; (*number of subdirectories in this directory*)
  294. filenum : UDINT; (*number of files in this directory*)
  295. END_VAR
  296. END_FUNCTION_BLOCK
  297. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirRename (*renames directories; asynchronous execution*)
  298. VAR_INPUT
  299. enable : BOOL; (*enables execution*)
  300. pDevice : UDINT; (*device name given as a pointer*)
  301. pName : UDINT; (*pointer to the directory name*)
  302. pNewName : UDINT; (*pointer to the new directory name*)
  303. END_VAR
  304. VAR
  305. i_state : UINT; (*internal variable*)
  306. i_result : UINT; (*internal variable*)
  307. i_tmp : UDINT; (*internal variable*)
  308. END_VAR
  309. VAR_OUTPUT
  310. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  311. END_VAR
  312. END_FUNCTION_BLOCK
  313. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirCopy (*copies a directory*)
  314. VAR_INPUT
  315. enable : BOOL; (*enables execution*)
  316. pSrcDev : UDINT; (*pointer to the source file device name*)
  317. pSrcDir : UDINT; (*pointer to the source directory name*)
  318. pDestDev : UDINT; (*pointer to the destination file device name*)
  319. pDestDir : UDINT; (*pointer to the destination directory name*)
  320. option : USINT; (*copy option*)
  321. END_VAR
  322. VAR
  323. i_state : UINT; (*internal variable*)
  324. i_result : UINT; (*internal variable*)
  325. i_tmp : UDINT; (*internal variable*)
  326. END_VAR
  327. VAR_OUTPUT
  328. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  329. END_VAR
  330. END_FUNCTION_BLOCK
  331. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirDelete (*deletes a directory; asynchronous execution*)
  332. VAR_INPUT
  333. enable : BOOL; (*enables execution*)
  334. pDevice : UDINT; (*device name given as a pointer*)
  335. pName : UDINT; (*pointer to the directory name*)
  336. END_VAR
  337. VAR
  338. i_state : UINT; (*internal variable*)
  339. i_result : UINT; (*internal variable*)
  340. i_tmp : UDINT; (*internal variable*)
  341. END_VAR
  342. VAR_OUTPUT
  343. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  344. END_VAR
  345. END_FUNCTION_BLOCK
  346. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirDeleteEx (*deletes a directory (all files and subdirectories); asynchronous execution*)
  347. VAR_INPUT
  348. enable : BOOL; (*enables execution*)
  349. pDevice : UDINT; (*device name given as a pointer*)
  350. pName : UDINT; (*pointer to the directory name*)
  351. END_VAR
  352. VAR
  353. i_state : UINT; (*internal variable*)
  354. i_result : UINT; (*internal variable*)
  355. i_tmp : UDINT; (*internal variable*)
  356. END_VAR
  357. VAR_OUTPUT
  358. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  359. END_VAR
  360. END_FUNCTION_BLOCK
  361. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK SetAttributes (*sets attributes; asynchronous execution*)
  362. VAR_INPUT
  363. enable : BOOL; (*enables execution*)
  364. pDevice : UDINT; (*device name given as a pointer*)
  365. pPath : UDINT; (*pointer to the path name (file or directory)*)
  366. attributes : USINT; (*attributes*)
  367. option : USINT; (*set options*)
  368. END_VAR
  369. VAR
  370. i_state : UINT; (*internal variable*)
  371. i_result : UINT; (*internal variable*)
  372. i_tmp : UDINT; (*internal variable*)
  373. END_VAR
  374. VAR_OUTPUT
  375. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  376. END_VAR
  377. END_FUNCTION_BLOCK
  378. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK GetAttributes (*reads attributes; asynchronous execution*)
  379. VAR_INPUT
  380. enable : BOOL; (*enables execution*)
  381. pDevice : UDINT; (*device name given as a pointer*)
  382. pPath : UDINT; (*pointer to the path name (file or directory)*)
  383. END_VAR
  384. VAR
  385. i_state : UINT; (*internal variable*)
  386. i_result : UINT; (*internal variable*)
  387. i_tmp : UDINT; (*internal variable*)
  388. END_VAR
  389. VAR_OUTPUT
  390. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  391. attributes : USINT; (*attributes*)
  392. END_VAR
  393. END_FUNCTION_BLOCK
  394. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DevMemInfo (*determines a file device's memory information; asynchronous execution*)
  395. VAR_INPUT
  396. enable : BOOL; (*enables execution*)
  397. pDevice : UDINT; (*device name given as a pointer*)
  398. END_VAR
  399. VAR
  400. i_state : UINT; (*internal variable*)
  401. i_result : UINT; (*internal variable*)
  402. i_tmp : UDINT; (*internal variable*)
  403. END_VAR
  404. VAR_OUTPUT
  405. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  406. freemem : UDINT; (*available disk space*)
  407. memsize : UDINT; (*total disk space*)
  408. END_VAR
  409. END_FUNCTION_BLOCK
  410. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DevLink (*creates the file device; asynchronous execution*)
  411. VAR_INPUT
  412. enable : BOOL; (*enables execution*)
  413. pDevice : UDINT; (*new device name given as a pointer*)
  414. pParam : UDINT; (*pointer to the link parameter*)
  415. END_VAR
  416. VAR
  417. i_state : UINT; (*internal variable*)
  418. i_result : UINT; (*internal variable*)
  419. i_tmp : UDINT; (*internal variable*)
  420. END_VAR
  421. VAR_OUTPUT
  422. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  423. handle : UDINT; (*file device handle*)
  424. END_VAR
  425. END_FUNCTION_BLOCK
  426. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DevUnlink (*unlinks the device; asynchronous execution*)
  427. VAR_INPUT
  428. enable : BOOL; (*enables execution*)
  429. handle : UDINT; (*file device handle*)
  430. END_VAR
  431. VAR
  432. i_state : UINT; (*internal variable*)
  433. i_result : UINT; (*internal variable*)
  434. i_tmp : UDINT; (*internal variable*)
  435. END_VAR
  436. VAR_OUTPUT
  437. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  438. END_VAR
  439. END_FUNCTION_BLOCK
  440. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK GetVolumeLabel (*reads volume label; asynchronous execution*)
  441. VAR_INPUT
  442. enable : BOOL; (*enables execution*)
  443. pDevice : UDINT; (*device name given as a pointer*)
  444. pLabel : UDINT; (*buffer for volume label given as pointer*)
  445. labelMax : UDINT; (*size of buffer for volume label*)
  446. END_VAR
  447. VAR
  448. i_state : UINT; (*internal variable*)
  449. i_result : UINT; (*internal variable*)
  450. i_tmp : UDINT; (*internal variable*)
  451. END_VAR
  452. VAR_OUTPUT
  453. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  454. labelLen : UDINT; (*length of volume label*)
  455. END_VAR
  456. END_FUNCTION_BLOCK
  457. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK GetVolumeSerialNo (*reads volume serial nummer; asynchronous execution*)
  458. VAR_INPUT
  459. enable : BOOL; (*enables execution*)
  460. pDevice : UDINT; (*device name given as a pointer*)
  461. END_VAR
  462. VAR
  463. i_state : UINT; (*internal variable*)
  464. i_result : UINT; (*internal variable*)
  465. i_tmp : UDINT; (*internal variable*)
  466. END_VAR
  467. VAR_OUTPUT
  468. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
  469. serialNo : UDINT; (*volume serialNo*)
  470. END_VAR
  471. END_FUNCTION_BLOCK
  472. FUNCTION FileIoGetSysError : UINT (*reads system errors*)
  473. END_FUNCTION