runtime.fun 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. {REDUND_OK} FUNCTION_BLOCK r_trig (*for internal use only - do not use this function in user programs*)
  2. VAR_INPUT
  3. CLK :BOOL;
  4. END_VAR
  5. VAR_OUTPUT
  6. Q :BOOL;
  7. END_VAR
  8. VAR
  9. M :BOOL;
  10. END_VAR
  11. END_FUNCTION_BLOCK
  12. {REDUND_OK} FUNCTION_BLOCK f_trig (*for internal use only - do not use this function in user programs*)
  13. VAR_INPUT
  14. CLK :BOOL;
  15. END_VAR
  16. VAR_OUTPUT
  17. Q :BOOL;
  18. END_VAR
  19. VAR
  20. M :BOOL;
  21. END_VAR
  22. END_FUNCTION_BLOCK
  23. {REDUND_OK} FUNCTION_BLOCK rf_trig (*for internal use only - do not use this function in user programs*)
  24. VAR_INPUT
  25. CLK :BOOL;
  26. END_VAR
  27. VAR_OUTPUT
  28. Q :BOOL;
  29. END_VAR
  30. VAR
  31. M :BOOL;
  32. END_VAR
  33. END_FUNCTION_BLOCK
  34. FUNCTION GetTime : TIME (*for internal use only - do not use this function in user programs*)
  35. END_FUNCTION
  36. {REDUND_OK} FUNCTION_BLOCK SFCActionControl (*for internal use only - do not use this function in user programs*)
  37. VAR_INPUT
  38. N :BOOL;
  39. R0 :BOOL;
  40. S0 :BOOL;
  41. L :BOOL;
  42. D :BOOL;
  43. P :BOOL;
  44. SD :BOOL;
  45. DS :BOOL;
  46. SL :BOOL;
  47. T :TIME;
  48. END_VAR
  49. VAR_OUTPUT
  50. Q :BOOL;
  51. END_VAR
  52. VAR
  53. S_FF_SET :USINT;
  54. S_FF_R1 :USINT;
  55. S_FF_Q :USINT;
  56. dummy1 :USINT;
  57. L_TMR_PT :TIME;
  58. L_TMR_ET :TIME;
  59. L_TMR_STAR :TIME;
  60. L_TMR_IN :USINT;
  61. L_TMR_Q :USINT;
  62. L_TMR_M :USINT;
  63. dummy2 :USINT;
  64. D_TMR_PT :TIME;
  65. D_TMR_ET :TIME;
  66. D_TMR_STAR :TIME;
  67. D_TMR_IN :USINT;
  68. D_TMR_Q :USINT;
  69. D_TMR_M :USINT;
  70. dummy3 :USINT;
  71. P_TRIG_CLK :USINT;
  72. P_TRIG_Q :USINT;
  73. P_TRIG_M :USINT;
  74. dummy4 :USINT;
  75. SD_TMR_PT :TIME;
  76. SD_TMR_ET :TIME;
  77. SD_TMR_STA :TIME;
  78. SD_TMR_IN :USINT;
  79. SD_TMR_Q :USINT;
  80. SD_TMR_M :USINT;
  81. dummy5 :USINT;
  82. SD_FF_SET :USINT;
  83. SD_FF_R1 :USINT;
  84. SD_FF_Q :USINT;
  85. DS_FF_SET :USINT;
  86. DS_FF_R1 :USINT;
  87. DS_FF_Q :USINT;
  88. DS_TMR_PT :TIME;
  89. DS_TMR_ET :TIME;
  90. DS_TMR_STA :TIME;
  91. DS_TMR_IN :USINT;
  92. DS_TMR_Q :USINT;
  93. DS_TMR_M :USINT;
  94. dummy6 :USINT;
  95. SL_FF_SET :USINT;
  96. SL_FF_R1 :USINT;
  97. SL_FF_Q :USINT;
  98. dummy7 :USINT;
  99. SL_TMR_PT :TIME;
  100. SL_TMR_ET :TIME;
  101. SL_TMR_STA :TIME;
  102. SL_TMR_IN :USINT;
  103. SL_TMR_Q :USINT;
  104. SL_TMR_M :USINT;
  105. dummy8 :USINT;
  106. END_VAR
  107. END_FUNCTION_BLOCK
  108. {REDUND_OK} FUNCTION_BLOCK SFCAC2 (*for internal use only - do not use this function in user programs*)
  109. VAR_INPUT
  110. N : {REDUND_UNREPLICABLE} BOOL;
  111. R0 : {REDUND_UNREPLICABLE} BOOL;
  112. S0 : {REDUND_UNREPLICABLE} BOOL;
  113. L : {REDUND_UNREPLICABLE} BOOL;
  114. D : {REDUND_UNREPLICABLE} BOOL;
  115. P : {REDUND_UNREPLICABLE} BOOL;
  116. P1 : {REDUND_UNREPLICABLE} BOOL;
  117. P0 : {REDUND_UNREPLICABLE} BOOL;
  118. SD : {REDUND_UNREPLICABLE} BOOL;
  119. DS : {REDUND_UNREPLICABLE} BOOL;
  120. SL : {REDUND_UNREPLICABLE} BOOL;
  121. T :TIME;
  122. END_VAR
  123. VAR_OUTPUT
  124. Q :BOOL;
  125. A :BOOL;
  126. END_VAR
  127. VAR
  128. S_FF_SET :USINT;
  129. S_FF_R1 :USINT;
  130. S_FF_Q :USINT;
  131. L_TMR_PT :TIME;
  132. L_TMR_ET :TIME;
  133. L_TMR_STAR :TIME;
  134. L_TMR_IN :USINT;
  135. L_TMR_Q :USINT;
  136. L_TMR_M :USINT;
  137. D_TMR_PT :TIME;
  138. D_TMR_ET :TIME;
  139. D_TMR_STAR :TIME;
  140. D_TMR_IN :USINT;
  141. D_TMR_Q :USINT;
  142. D_TMR_M :USINT;
  143. SD_TMR_PT :TIME;
  144. SD_TMR_ET :TIME;
  145. SD_TMR_STA :TIME;
  146. SD_TMR_IN :USINT;
  147. SD_TMR_Q :USINT;
  148. SD_TMR_M :USINT;
  149. SD_FF_SET :USINT;
  150. SD_FF_R1 :USINT;
  151. SD_FF_Q1 :USINT;
  152. DS_FF_SET :USINT;
  153. DS_FF_R1 :USINT;
  154. DS_FF_Q1 :USINT;
  155. DS_TMR_PT :TIME;
  156. DS_TMR_ET :TIME;
  157. DS_TMR_STA :TIME;
  158. DS_TMR_IN :USINT;
  159. DS_TMR_Q :USINT;
  160. DS_TMR_M :USINT;
  161. SL_FF_SET :USINT;
  162. SL_FF_R1 :USINT;
  163. SL_FF_Q :USINT;
  164. SL_TMR_PT :TIME;
  165. SL_TMR_ET :TIME;
  166. SL_TMR_STA :TIME;
  167. SL_TMR_IN :USINT;
  168. SL_TMR_Q :USINT;
  169. SL_TMR_M :USINT;
  170. P_TRIG_Q :USINT;
  171. P_TRIG_M :USINT;
  172. Q_TRIG_Q :USINT;
  173. Q_TRIG_M :USINT;
  174. P1_TRIG_Q :USINT;
  175. P1_TRIG_M :USINT;
  176. P0_TRIG_Q :USINT;
  177. P0_TRIG_M :USINT;
  178. END_VAR
  179. END_FUNCTION_BLOCK
  180. {REDUND_OK} FUNCTION RealTan : LREAL
  181. VAR_INPUT
  182. x :LREAL;
  183. END_VAR
  184. END_FUNCTION
  185. {REDUND_OK} FUNCTION RealAtan : LREAL
  186. VAR_INPUT
  187. x :LREAL;
  188. END_VAR
  189. END_FUNCTION
  190. {REDUND_OK} FUNCTION RealAsin : LREAL
  191. VAR_INPUT
  192. x :LREAL;
  193. END_VAR
  194. END_FUNCTION
  195. {REDUND_OK} FUNCTION RealAcos : LREAL
  196. VAR_INPUT
  197. x :LREAL;
  198. END_VAR
  199. END_FUNCTION
  200. {REDUND_OK} FUNCTION RealExp : LREAL
  201. VAR_INPUT
  202. x :LREAL;
  203. END_VAR
  204. END_FUNCTION
  205. {REDUND_OK} FUNCTION RealLn : LREAL
  206. VAR_INPUT
  207. x :LREAL;
  208. END_VAR
  209. END_FUNCTION
  210. {REDUND_OK} FUNCTION RealLog : LREAL
  211. VAR_INPUT
  212. x :LREAL;
  213. END_VAR
  214. END_FUNCTION
  215. {REDUND_OK} FUNCTION RealExpt : LREAL
  216. VAR_INPUT
  217. x :LREAL;
  218. y :LREAL;
  219. END_VAR
  220. END_FUNCTION
  221. {REDUND_OK} FUNCTION RealAbs : LREAL
  222. VAR_INPUT
  223. x :LREAL;
  224. END_VAR
  225. END_FUNCTION
  226. {REDUND_OK} FUNCTION RealSin : LREAL
  227. VAR_INPUT
  228. x :LREAL;
  229. END_VAR
  230. END_FUNCTION
  231. {REDUND_OK} FUNCTION RealCos : LREAL
  232. VAR_INPUT
  233. x :LREAL;
  234. END_VAR
  235. END_FUNCTION
  236. {REDUND_OK} FUNCTION RealSqrt : LREAL
  237. VAR_INPUT
  238. x :LREAL;
  239. END_VAR
  240. END_FUNCTION
  241. {REDUND_OK} FUNCTION_BLOCK SFCAC3 (*for internal use only - do not use this function in user programs*)
  242. VAR_INPUT
  243. N : {REDUND_UNREPLICABLE} BOOL;
  244. R0 : {REDUND_UNREPLICABLE} BOOL;
  245. S0 : {REDUND_UNREPLICABLE} BOOL;
  246. L : {REDUND_UNREPLICABLE} BOOL;
  247. D : {REDUND_UNREPLICABLE} BOOL;
  248. P : {REDUND_UNREPLICABLE} BOOL;
  249. P1 : {REDUND_UNREPLICABLE} BOOL;
  250. P0 : {REDUND_UNREPLICABLE} BOOL;
  251. SD : {REDUND_UNREPLICABLE} BOOL;
  252. DS : {REDUND_UNREPLICABLE} BOOL;
  253. SL : {REDUND_UNREPLICABLE} BOOL;
  254. T :LREAL;
  255. T_ACT : {REDUND_UNREPLICABLE} LREAL;
  256. PAUSE : {REDUND_UNREPLICABLE} BOOL;
  257. END_VAR
  258. VAR_OUTPUT
  259. Q : {REDUND_UNREPLICABLE} BOOL;
  260. A :BOOL;
  261. END_VAR
  262. VAR
  263. L_TMR :TimerType;
  264. D_TMR :TimerType;
  265. SD_TMR :TimerType;
  266. DS_TMR :TimerType;
  267. SL_TMR :TimerType;
  268. S_FF_Q1 :USINT;
  269. SD_FF_Q1 :USINT;
  270. DS_FF_Q1 :USINT;
  271. SL_FF_Q1 :USINT;
  272. P_R_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
  273. P_R_TRIG_M :USINT;
  274. Q_F_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
  275. Q_F_TRIG_M :USINT;
  276. P1_R_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
  277. P1_R_TRIG_M :USINT;
  278. P0_F_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
  279. P0_F_TRIG_M :USINT;
  280. END_VAR
  281. END_FUNCTION_BLOCK