DataObj.fun 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjCreate (*creates a data object*)
  2. VAR_INPUT
  3. enable :BOOL; (*enables execution*)
  4. grp :USINT; (*group ID for the data object (default 0x00), must be set to zero*)
  5. pName :UDINT; (*pointer to name of the data object to be created*)
  6. len :UDINT; (*length of the data area of the data object to be created*)
  7. MemType :USINT; (*type of target memory: doTEMP, doUSRRAM, doUSRROM, doSYSROM, doFIXRAM, doMEMCARD*)
  8. Option :UDINT; (*options: doNO_CS*)
  9. pCpyData :UDINT; (*pointer to data written to the data object during generation*)
  10. END_VAR
  11. VAR_OUTPUT
  12. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  13. ident :UDINT; (*ID of the created data object*)
  14. pDatObjMem :UDINT; (*pointer to the data in the data object*)
  15. END_VAR
  16. VAR
  17. i_state :UDINT; (*internal variable*)
  18. i_result :UDINT; (*internal variable*)
  19. i_spare :ARRAY[0..104] OF USINT; (*internal variable*)
  20. i_spare_1 :UDINT; (*internal variable*)
  21. i_spare_2 :UINT; (*internal variable*)
  22. i_spare_3 :UDINT; (*internal variable*)
  23. i_spare_4 :USINT; (*internal variable*)
  24. END_VAR
  25. END_FUNCTION_BLOCK
  26. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjWrite (*writes to a data object*)
  27. VAR_INPUT
  28. enable :BOOL; (*enables execution*)
  29. ident :UDINT; (*ID of the data object*)
  30. Offset :UDINT; (*offset in the data area of the data object*)
  31. pSource :UDINT; (*pointer to the data copied to the data object*)
  32. len :UDINT; (*length of the data to be copied*)
  33. END_VAR
  34. VAR_OUTPUT
  35. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  36. END_VAR
  37. END_FUNCTION_BLOCK
  38. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjRead (*reads from a data object*)
  39. VAR_INPUT
  40. enable :BOOL; (*enables execution*)
  41. ident :UDINT; (*ID of the data object*)
  42. Offset :UDINT; (*offset in the data area of the data object*)
  43. pDestination:UDINT; (*memory to which the data to be read is copied*)
  44. len :UDINT; (*length of the data to be copied*)
  45. END_VAR
  46. VAR_OUTPUT
  47. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  48. END_VAR
  49. END_FUNCTION_BLOCK
  50. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjDelete (*deletes data objects*)
  51. VAR_INPUT
  52. enable :BOOL; (*enables execution*)
  53. ident :UDINT; (*ID of the data object*)
  54. END_VAR
  55. VAR_OUTPUT
  56. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  57. END_VAR
  58. VAR
  59. i_state :UDINT; (*internal variable*)
  60. i_result :UDINT; (*internal variable*)
  61. i_spare :USINT; (*internal variable*)
  62. END_VAR
  63. END_FUNCTION_BLOCK
  64. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjMove (*moves the storage space of a data object to a new target memory*)
  65. VAR_INPUT
  66. enable :BOOL; (*enables execution*)
  67. ident :UDINT; (*ID of the data object*)
  68. MemType :USINT; (*target memory in which the data object is to be saved, e.g. doTEMP, doUSRRAM, doUSRROM, ...*)
  69. Option :UDINT; (*options for the object to be saved (doNO_CS = no checksum)*)
  70. END_VAR
  71. VAR_OUTPUT
  72. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  73. identNew :UDINT; (*ID of the new data object*)
  74. pDatObjMem :UDINT; (*pointer to the data in the newly created data object*)
  75. END_VAR
  76. VAR
  77. i_state :UDINT; (*internal variable*)
  78. i_result :UDINT; (*internal variable*)
  79. i_spare :ARRAY[0..40] OF USINT; (*internal variable*)
  80. i_spare_1 :UDINT; (*internal variable*)
  81. i_spare_2 :USINT; (*internal variable*)
  82. END_VAR
  83. END_FUNCTION_BLOCK
  84. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjCopy (*copies a data object*)
  85. VAR_INPUT
  86. enable :BOOL; (*enables execution*)
  87. ident :UDINT; (*ID of the data object to be copied*)
  88. pNameTarget :UDINT; (*pointer to name of the new data object*)
  89. MemTypeTarget :USINT; (*target memory in which the new object is to be generated, e.g. doTEMP, doUSRRAM, ...*)
  90. OptionTarget :UDINT; (*options for the copied object (doNO_CS = no checksum)*)
  91. END_VAR
  92. VAR_OUTPUT
  93. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  94. identNew :UDINT; (*ID of the copied data object*)
  95. pDatObjMemNew :UDINT; (*pointer to the data in the newly created data object*)
  96. END_VAR
  97. VAR
  98. i_state :UDINT; (*internal variable*)
  99. i_result :UDINT; (*internal variable*)
  100. i_spare :ARRAY[0..40] OF USINT; (*internal variable*)
  101. i_spare_1 :UDINT; (*internal variable*)
  102. i_spare_2 :USINT; (*internal variable*)
  103. END_VAR
  104. END_FUNCTION_BLOCK
  105. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjInfo (*gives information about a data object*)
  106. VAR_INPUT
  107. enable :BOOL; (*enables execution*)
  108. pName :UDINT; (*name of data object*)
  109. END_VAR
  110. VAR_OUTPUT
  111. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  112. ident :UDINT; (*ID of the data object*)
  113. pDatObjMem :UDINT; (*pointer to the data in the data object*)
  114. len :UDINT; (*length of the data area in the data object*)
  115. MemType :USINT; (*memory type in which the data object is located, e.g. doTEMP, doUSRRAM, doUSRROM, ...*)
  116. Option :UDINT; (*information about data object options*)
  117. ChangeDate :DATE_AND_TIME; (*modification date of the data object*)
  118. END_VAR
  119. END_FUNCTION_BLOCK
  120. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjChangeDate (*changes the modification date of a data object*)
  121. VAR_INPUT
  122. enable :BOOL; (*enables execution*)
  123. pName :UDINT; (*pointer to name of data object*)
  124. SetDate :DATE_AND_TIME; (*date and time; if the value 0 is transferred, the current PLC system time is used*)
  125. END_VAR
  126. VAR_OUTPUT
  127. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  128. END_VAR
  129. END_FUNCTION_BLOCK
  130. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjAttach (*attaches a data object to prevent deletion*)
  131. VAR_INPUT
  132. enable :BOOL; (*enables execution*)
  133. ident :UDINT; (*ID of the data object*)
  134. END_VAR
  135. VAR_OUTPUT
  136. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  137. END_VAR
  138. END_FUNCTION_BLOCK
  139. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjDetach (*detaches a data object*)
  140. VAR_INPUT
  141. enable :BOOL; (*enables execution*)
  142. ident :UDINT; (*ID of the data object*)
  143. END_VAR
  144. VAR_OUTPUT
  145. status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  146. END_VAR
  147. END_FUNCTION_BLOCK