AsIecCon.fun 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730
  1. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapDT : DATE_AND_TIME (*swaps the byte order of a DATE_AND_TIME value*)
  2. VAR_INPUT
  3. IN :DATE_AND_TIME; (*input value*)
  4. END_VAR
  5. END_FUNCTION
  6. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapTIME : TIME (*swaps the byte order of a TIME value*)
  7. VAR_INPUT
  8. IN :TIME; (*input value*)
  9. END_VAR
  10. END_FUNCTION
  11. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapDATE : DATE (*swaps the byte order of a DATE value*)
  12. VAR_INPUT
  13. IN :DATE; (*input value*)
  14. END_VAR
  15. END_FUNCTION
  16. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapTOD : TOD (*swaps the byte order of a TOD value*)
  17. VAR_INPUT
  18. IN :TOD; (*input value*)
  19. END_VAR
  20. END_FUNCTION
  21. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapREAL : REAL (*swaps the byte order of a REAL value*)
  22. VAR_INPUT
  23. IN :REAL; (*input value*)
  24. END_VAR
  25. END_FUNCTION
  26. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapLREAL : LREAL (*swaps the byte order of a LREAL value*)
  27. VAR_INPUT
  28. IN :LREAL; (*input value*)
  29. END_VAR
  30. END_FUNCTION
  31. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapUDINT : UDINT (*swaps the byte order of an UDINT value*)
  32. VAR_INPUT
  33. IN :UDINT; (*input value*)
  34. END_VAR
  35. END_FUNCTION
  36. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapDINT : DINT (*swaps the byte order of a DINT value*)
  37. VAR_INPUT
  38. IN :DINT; (*input value*)
  39. END_VAR
  40. END_FUNCTION
  41. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapUINT : UINT (*swaps the byte order of an UINT value*)
  42. VAR_INPUT
  43. IN :UINT; (*input value*)
  44. END_VAR
  45. END_FUNCTION
  46. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapINT : INT (*swaps the byte order of an INT value*)
  47. VAR_INPUT
  48. IN :INT; (*input value*)
  49. END_VAR
  50. END_FUNCTION
  51. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapWORD : WORD (*swaps the byte order of a WORD value*)
  52. VAR_INPUT
  53. IN :WORD; (*input value*)
  54. END_VAR
  55. END_FUNCTION
  56. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION swapDWORD : DWORD (*swaps the byte order of a DWORD value*)
  57. VAR_INPUT
  58. IN :DWORD; (*input value*)
  59. END_VAR
  60. END_FUNCTION
  61. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HDT : DATE_AND_TIME (*converts a DATE_AND_TIME value from network (big endian) to host byte order*)
  62. VAR_INPUT
  63. IN :DATE_AND_TIME; (*input value*)
  64. END_VAR
  65. END_FUNCTION
  66. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HTIME : TIME (*converts a TIME value from network (big endian) to host byte order*)
  67. VAR_INPUT
  68. IN :TIME; (*input value*)
  69. END_VAR
  70. END_FUNCTION
  71. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HDATE : DATE (*converts a DATE value from network (big endian) to host byte order*)
  72. VAR_INPUT
  73. IN :DATE; (*input value*)
  74. END_VAR
  75. END_FUNCTION
  76. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HTOD : TOD (*converts a TOD value from network (big endian) to host byte order*)
  77. VAR_INPUT
  78. IN :TOD; (*input value*)
  79. END_VAR
  80. END_FUNCTION
  81. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HREAL : REAL (*converts a REAL value from network (big endian) to host byte order*)
  82. VAR_INPUT
  83. IN :REAL; (*input value*)
  84. END_VAR
  85. END_FUNCTION
  86. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HLREAL : LREAL (*converts a LREAL value from network (big endian) to host byte order*)
  87. VAR_INPUT
  88. IN :LREAL; (*input value*)
  89. END_VAR
  90. END_FUNCTION
  91. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HUDINT : UDINT (*converts a UDINT value from network (big endian) to host byte order*)
  92. VAR_INPUT
  93. IN :UDINT; (*input value*)
  94. END_VAR
  95. END_FUNCTION
  96. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HDINT : DINT (*converts a DINT value from network (big endian) to host byte order*)
  97. VAR_INPUT
  98. IN :DINT; (*input value*)
  99. END_VAR
  100. END_FUNCTION
  101. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HUINT : UINT (*converts a UINT value from network (big endian) to host byte order*)
  102. VAR_INPUT
  103. IN :UINT; (*input value*)
  104. END_VAR
  105. END_FUNCTION
  106. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION N_TO_HINT : INT (*converts an INT value from network (big endian) to host byte order*)
  107. VAR_INPUT
  108. IN :INT; (*input value*)
  109. END_VAR
  110. END_FUNCTION
  111. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NDT : DATE_AND_TIME (*converts a DATE_AND_TIME value from host to network byte order (big endian)*)
  112. VAR_INPUT
  113. IN :DATE_AND_TIME; (*input value*)
  114. END_VAR
  115. END_FUNCTION
  116. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NTIME : TIME (*converts a TIME value from host to network byte order (big endian)*)
  117. VAR_INPUT
  118. IN :TIME; (*input value*)
  119. END_VAR
  120. END_FUNCTION
  121. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NDATE : DATE (*converts a DATE value from host to network byte order (big endian)*)
  122. VAR_INPUT
  123. IN :DATE; (*input value*)
  124. END_VAR
  125. END_FUNCTION
  126. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NTOD : TOD (*converts a TOD value from host to network byte order (big endian)*)
  127. VAR_INPUT
  128. IN :TOD; (*input value*)
  129. END_VAR
  130. END_FUNCTION
  131. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NREAL : REAL (*converts a REAL value from host to network byte order (big endian)*)
  132. VAR_INPUT
  133. IN :REAL; (*input value*)
  134. END_VAR
  135. END_FUNCTION
  136. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NLREAL : LREAL (*converts a LREAL value from host to network byte order (big endian)*)
  137. VAR_INPUT
  138. IN :LREAL; (*input value*)
  139. END_VAR
  140. END_FUNCTION
  141. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NUDINT : UDINT (*converts a UDINT value from host to network byte order (big endian)*)
  142. VAR_INPUT
  143. IN :UDINT; (*input value*)
  144. END_VAR
  145. END_FUNCTION
  146. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NDINT : DINT (*converts a DINT value from host to network byte order (big endian)*)
  147. VAR_INPUT
  148. IN :DINT; (*input value*)
  149. END_VAR
  150. END_FUNCTION
  151. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NUINT : UINT (*converts a UINT value from host to network byte order (big endian)*)
  152. VAR_INPUT
  153. IN :UINT; (*input value*)
  154. END_VAR
  155. END_FUNCTION
  156. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION H_TO_NINT : INT (*converts an INT value from host to network byte order (big endian)*)
  157. VAR_INPUT
  158. IN :INT; (*input value*)
  159. END_VAR
  160. END_FUNCTION
  161. (*BOOL_TO_ functions*)
  162. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_BYTE : BYTE (*converts a BOOL value (1 bit) to a BYTE value (8 bits unsigned)*)
  163. VAR_INPUT
  164. IN :BOOL; (*input value*)
  165. END_VAR
  166. END_FUNCTION
  167. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_WORD : WORD (*converts a BOOL value (1 bit) to a WORD value (16 bits unsigned)*)
  168. VAR_INPUT
  169. IN :BOOL; (*input value*)
  170. END_VAR
  171. END_FUNCTION
  172. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_DWORD : DWORD (*converts a BOOL value (1 bit) to a DWORD value (32 bits unsigned)*)
  173. VAR_INPUT
  174. IN :BOOL; (*input value*)
  175. END_VAR
  176. END_FUNCTION
  177. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_SINT : SINT (*converts a BOOL value (1 bit) to a SINT value (8 bits signed)*)
  178. VAR_INPUT
  179. IN :BOOL; (*input value*)
  180. END_VAR
  181. END_FUNCTION
  182. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_INT : INT (*converts a BOOL value (1 bit) to an INT value (16 bits signed)*)
  183. VAR_INPUT
  184. IN :BOOL; (*input value*)
  185. END_VAR
  186. END_FUNCTION
  187. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_DINT : DINT (*converts a BOOL value (1 bit) to a DINT value (32 bits signed)*)
  188. VAR_INPUT
  189. IN :BOOL; (*input value*)
  190. END_VAR
  191. END_FUNCTION
  192. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_USINT : USINT (*converts a BOOL value (1 bit) to a USINT value (8 bits unsigned)*)
  193. VAR_INPUT
  194. IN :BOOL; (*input value*)
  195. END_VAR
  196. END_FUNCTION
  197. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_UINT : UINT (*converts a BOOL value (1 bit) to a UINT value (16 bits unsigned)*)
  198. VAR_INPUT
  199. IN :BOOL; (*input value*)
  200. END_VAR
  201. END_FUNCTION
  202. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_UDINT : UDINT (*converts a BOOL value (1 bit) to a UDINT value (32 bits unsigned)*)
  203. VAR_INPUT
  204. IN :BOOL; (*input value*)
  205. END_VAR
  206. END_FUNCTION
  207. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_TIME : TIME (*converts a BOOL value (1 bit) to a TIME value (32 bits time in milliseconds)*)
  208. VAR_INPUT
  209. IN :BOOL; (*input value*)
  210. END_VAR
  211. END_FUNCTION
  212. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_DT : DATE_AND_TIME (*converts a BOOL value (1 bit) to a DATE_AND_TIME value (32 bits date in seconds)*)
  213. VAR_INPUT
  214. IN :BOOL; (*input value*)
  215. END_VAR
  216. END_FUNCTION
  217. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_DATE : DATE (*converts a BOOL value (1 bit) to a DATE value (32 bits date in seconds)*)
  218. VAR_INPUT
  219. IN :BOOL; (*input value*)
  220. END_VAR
  221. END_FUNCTION
  222. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_TOD : TOD (*converts a BOOL value (1 bit) to a TOD value (32 bits time of day in milliseconds)*)
  223. VAR_INPUT
  224. IN :BOOL; (*input value*)
  225. END_VAR
  226. END_FUNCTION
  227. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_REAL : REAL (*converts a BOOL value (1 bit) to a REAL value (32 bits floating point number)*)
  228. VAR_INPUT
  229. IN :BOOL; (*input value*)
  230. END_VAR
  231. END_FUNCTION
  232. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_LREAL : LREAL (*converts a BOOL value (1 bit) to a LREAL value (64 bits floating point number)*)
  233. VAR_INPUT
  234. IN :BOOL; (*input value*)
  235. END_VAR
  236. END_FUNCTION
  237. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_STRING : STRING[80] (*converts a BOOL value (1 bit) to a STRING value with variable length*)
  238. VAR_INPUT
  239. IN :BOOL; (*input value*)
  240. END_VAR
  241. END_FUNCTION
  242. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BOOL_TO_WSTRING : WSTRING[80] (*converts a BOOL value (1 bit) to a WSTRING value with variable length*)
  243. VAR_INPUT
  244. IN :BOOL; (*input value*)
  245. END_VAR
  246. END_FUNCTION
  247. (*BYTE_TO_ functions*)
  248. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_BOOL : BOOL (*converts a BYTE value (8 bits unsigned) to a BOOL value (1 bit)*)
  249. VAR_INPUT
  250. IN :BYTE; (*input value*)
  251. END_VAR
  252. END_FUNCTION
  253. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_WORD : WORD (*converts a BYTE value (8 bits unsigned) to a WORD value (16 bits unsigned)*)
  254. VAR_INPUT
  255. IN :BYTE; (*input value*)
  256. END_VAR
  257. END_FUNCTION
  258. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_DWORD : DWORD (*converts a BYTE value (8 bits unsigned) to a DWORD value (32 bits unsigned)*)
  259. VAR_INPUT
  260. IN :BYTE; (*input value*)
  261. END_VAR
  262. END_FUNCTION
  263. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_SINT : SINT (*converts a BYTE value (8 bits unsigned) to a SINT value (8 bits signed)*)
  264. VAR_INPUT
  265. IN :BYTE; (*input value*)
  266. END_VAR
  267. END_FUNCTION
  268. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_INT : INT (*converts a BYTE value (8 bits unsigned) to an INT value (16 bits signed)*)
  269. VAR_INPUT
  270. IN :BYTE; (*input value*)
  271. END_VAR
  272. END_FUNCTION
  273. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_DINT : DINT (*converts a BYTE value (8 bits unsigned) to a DINT value (32 bits signed)*)
  274. VAR_INPUT
  275. IN :BYTE; (*input value*)
  276. END_VAR
  277. END_FUNCTION
  278. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_USINT : USINT (*converts a BYTE value (8 bits unsigned) to a USINT value (8 bits unsigned)*)
  279. VAR_INPUT
  280. IN :BYTE; (*input value*)
  281. END_VAR
  282. END_FUNCTION
  283. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_UINT : UINT (*converts a BYTE value (8 bits unsigned) to a UINT value (16 bits unsigned)*)
  284. VAR_INPUT
  285. IN :BYTE; (*input value*)
  286. END_VAR
  287. END_FUNCTION
  288. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_UDINT : UDINT (*converts a BYTE value (8 bits unsigned) to a UDINT value (32 bits unsigned)*)
  289. VAR_INPUT
  290. IN :BYTE; (*input value*)
  291. END_VAR
  292. END_FUNCTION
  293. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_TIME : TIME (*converts a BYTE value (8 bits unsigned) to a TIME value (32 bits time in milliseconds)*)
  294. VAR_INPUT
  295. IN :BYTE; (*input value*)
  296. END_VAR
  297. END_FUNCTION
  298. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_DT : DT (*converts a BYTE value (8 bits unsigned) to a DATE_AND_TIME value (32 bits date in seconds)*)
  299. VAR_INPUT
  300. IN :BYTE; (*input value*)
  301. END_VAR
  302. END_FUNCTION
  303. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_DATE : DATE (*converts a BYTE value (8 bits unsigned) to a DATE value (32 bits date in seconds)*)
  304. VAR_INPUT
  305. IN :BYTE; (*input value*)
  306. END_VAR
  307. END_FUNCTION
  308. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_TOD : TOD (*converts a BYTE value (8 bits unsigned) to a TOD value (32 bits time of day in milliseconds)*)
  309. VAR_INPUT
  310. IN :BYTE; (*input value*)
  311. END_VAR
  312. END_FUNCTION
  313. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_REAL : REAL (*converts a BYTE value (8 bits unsigned) to a REAL value (32 bits floating point number)*)
  314. VAR_INPUT
  315. IN :BYTE; (*input value*)
  316. END_VAR
  317. END_FUNCTION
  318. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_LREAL : LREAL (*converts a BYTE value (8 bits unsigned) to a LREAL value (64 bits floating point number)*)
  319. VAR_INPUT
  320. IN :BYTE; (*input value*)
  321. END_VAR
  322. END_FUNCTION
  323. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_STRING : STRING[80] (*converts a BYTE value (8 bits unsigned) to a STRING value with variable length*)
  324. VAR_INPUT
  325. IN :BYTE; (*input value*)
  326. END_VAR
  327. END_FUNCTION
  328. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION BYTE_TO_WSTRING : WSTRING[80] (*converts a BYTE value (8 bits unsigned) to a WSTRING value with variable length*)
  329. VAR_INPUT
  330. IN :BYTE; (*input value*)
  331. END_VAR
  332. END_FUNCTION
  333. (*WORD_TO_ functions*)
  334. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_BOOL : BOOL (*converts a WORD value (16 bits unsigned) to a BOOL value (1 bit)*)
  335. VAR_INPUT
  336. IN :WORD; (*input value*)
  337. END_VAR
  338. END_FUNCTION
  339. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_BYTE : BYTE (*converts a WORD value (16 bits unsigned) to a BYTE value (8 bits unsigned)*)
  340. VAR_INPUT
  341. IN :WORD; (*input value*)
  342. END_VAR
  343. END_FUNCTION
  344. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_DWORD : DWORD (*converts a WORD value (16 bits unsigned) to a DWORD value (32 bits unsigned)*)
  345. VAR_INPUT
  346. IN :WORD; (*input value*)
  347. END_VAR
  348. END_FUNCTION
  349. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_SINT : SINT (*converts a WORD value (16 bits unsigned) to a SINT value (8 bits signed)*)
  350. VAR_INPUT
  351. IN :WORD; (*input value*)
  352. END_VAR
  353. END_FUNCTION
  354. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_INT : INT (*converts a WORD value (16 bits unsigned) to an INT value (16 bits signed)*)
  355. VAR_INPUT
  356. IN :WORD; (*input value*)
  357. END_VAR
  358. END_FUNCTION
  359. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_DINT : DINT (*converts a WORD value (16 bits unsigned) to a DINT value (32 bits signed)*)
  360. VAR_INPUT
  361. IN :WORD; (*input value*)
  362. END_VAR
  363. END_FUNCTION
  364. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_USINT : USINT (*converts a WORD value (16 bits unsigned) to a USINT value (8 bits unsigned)*)
  365. VAR_INPUT
  366. IN :WORD; (*input value*)
  367. END_VAR
  368. END_FUNCTION
  369. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_UINT : UINT (*converts a WORD value (16 bits unsigned) to a UINT value (16 bits unsigned)*)
  370. VAR_INPUT
  371. IN :WORD; (*input value*)
  372. END_VAR
  373. END_FUNCTION
  374. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_UDINT : UDINT (*converts a WORD value (16 bits unsigned) to a UDINT value (32 bits unsigned)*)
  375. VAR_INPUT
  376. IN :WORD; (*input value*)
  377. END_VAR
  378. END_FUNCTION
  379. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_TIME : TIME (*converts a WORD value (16 bits unsigned) to a TIME value (32 bits time in milliseconds)*)
  380. VAR_INPUT
  381. IN :WORD; (*input value*)
  382. END_VAR
  383. END_FUNCTION
  384. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_DT : DT (*converts a WORD value (16 bits unsigned) to a DATE_AND_TIME value (32 bits date in seconds)*)
  385. VAR_INPUT
  386. IN :WORD; (*input value*)
  387. END_VAR
  388. END_FUNCTION
  389. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_DATE : DATE (*converts a WORD value (16 bits unsigned) to a DATE value (32 bits date in seconds)*)
  390. VAR_INPUT
  391. IN :WORD; (*input value*)
  392. END_VAR
  393. END_FUNCTION
  394. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_TOD : TOD (*converts a WORD value (16 bits unsigned) to a TOD value (32 bits time of day in milliseconds)*)
  395. VAR_INPUT
  396. IN :WORD; (*input value*)
  397. END_VAR
  398. END_FUNCTION
  399. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_REAL : REAL (*converts a WORD value (16 bits unsigned) to a REAL value (32 bits floating point number)*)
  400. VAR_INPUT
  401. IN :WORD; (*input value*)
  402. END_VAR
  403. END_FUNCTION
  404. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_LREAL : LREAL (*converts a WORD value (16 bits unsigned) to a LREAL value (64 bits floating point number)*)
  405. VAR_INPUT
  406. IN :WORD; (*input value*)
  407. END_VAR
  408. END_FUNCTION
  409. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_STRING : STRING[80] (*converts a WORD value (16 bits unsigned) to a STRING value with variable length*)
  410. VAR_INPUT
  411. IN :WORD; (*input value*)
  412. END_VAR
  413. END_FUNCTION
  414. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WORD_TO_WSTRING : WSTRING[80] (*converts a WORD value (16 bits unsigned) to a WSTRING value with variable length*)
  415. VAR_INPUT
  416. IN :WORD; (*input value*)
  417. END_VAR
  418. END_FUNCTION
  419. (*DWORD_TO_ functions*)
  420. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_BOOL : BOOL (*converts a DWORD value (32 bits unsigned) to a BOOL value (1 bit)*)
  421. VAR_INPUT
  422. IN :DWORD; (*input value*)
  423. END_VAR
  424. END_FUNCTION
  425. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_BYTE : BYTE (*converts a DWORD value (32 bits unsigned) to a BYTE value (8 bits unsigned)*)
  426. VAR_INPUT
  427. IN :DWORD; (*input value*)
  428. END_VAR
  429. END_FUNCTION
  430. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_WORD : WORD (*converts a DWORD value (32 bits unsigned) to a WORD value (16 bits unsigned)*)
  431. VAR_INPUT
  432. IN :DWORD; (*input value*)
  433. END_VAR
  434. END_FUNCTION
  435. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_SINT : SINT (*converts a DWORD value (32 bits unsigned) to a SINT value (8 bits signed)*)
  436. VAR_INPUT
  437. IN :DWORD; (*input value*)
  438. END_VAR
  439. END_FUNCTION
  440. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_INT : INT (*converts a DWORD value (32 bits unsigned) to an INT value (16 bits signed)*)
  441. VAR_INPUT
  442. IN :DWORD; (*input value*)
  443. END_VAR
  444. END_FUNCTION
  445. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_DINT : DINT (*converts a DWORD value (32 bits unsigned) to a DINT value (32 bits signed)*)
  446. VAR_INPUT
  447. IN :DWORD; (*input value*)
  448. END_VAR
  449. END_FUNCTION
  450. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_USINT : USINT (*converts a DWORD value (32 bits unsigned) to a USINT value (8 bits unsigned)*)
  451. VAR_INPUT
  452. IN :DWORD; (*input value*)
  453. END_VAR
  454. END_FUNCTION
  455. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_UINT : UINT (*converts a DWORD value (32 bits unsigned) to a UINT value (16 bits unsigned)*)
  456. VAR_INPUT
  457. IN :DWORD; (*input value*)
  458. END_VAR
  459. END_FUNCTION
  460. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_UDINT : UDINT (*converts a DWORD value (32 bits unsigned) to a UDINT value (32 bits unsigned)*)
  461. VAR_INPUT
  462. IN :DWORD; (*input value*)
  463. END_VAR
  464. END_FUNCTION
  465. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_TIME : TIME (*converts a DWORD value (32 bits unsigned) to a TIME value (32 bits time in milliseconds)*)
  466. VAR_INPUT
  467. IN :DWORD; (*input value*)
  468. END_VAR
  469. END_FUNCTION
  470. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_DT : DT (*converts a DWORD value (32 bits unsigned) to a DATE_AND_TIME value (32 bits date in seconds)*)
  471. VAR_INPUT
  472. IN :DWORD; (*input value*)
  473. END_VAR
  474. END_FUNCTION
  475. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_DATE : DATE (*converts a DWORD value (32 bits unsigned) to a DATE value (32 bits date in seconds)*)
  476. VAR_INPUT
  477. IN :DWORD; (*input value*)
  478. END_VAR
  479. END_FUNCTION
  480. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_TOD : TOD (*converts a DWORD value (32 bits unsigned) to a TOD value (32 bits time of day in milliseconds)*)
  481. VAR_INPUT
  482. IN :DWORD; (*input value*)
  483. END_VAR
  484. END_FUNCTION
  485. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_REAL : REAL (*converts a DWORD value (32 bits unsigned) to a REAL value (32 bits floating point number)*)
  486. VAR_INPUT
  487. IN :DWORD; (*input value*)
  488. END_VAR
  489. END_FUNCTION
  490. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_LREAL : LREAL (*converts a DWORD value (32 bits unsigned) to a LREAL value (64 bits floating point number)*)
  491. VAR_INPUT
  492. IN :DWORD; (*input value*)
  493. END_VAR
  494. END_FUNCTION
  495. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_STRING : STRING[80] (*converts a DWORD value (32 bits unsigned) to a STRING value with variable length*)
  496. VAR_INPUT
  497. IN :DWORD; (*input value*)
  498. END_VAR
  499. END_FUNCTION
  500. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DWORD_TO_WSTRING : WSTRING[80] (*converts a DWORD value (32 bits unsigned) to a WSTRING value with variable length*)
  501. VAR_INPUT
  502. IN :DWORD; (*input value*)
  503. END_VAR
  504. END_FUNCTION
  505. (*SINT_TO_ functions*)
  506. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_BOOL : BOOL (*converts a SINT value (8 bits signed) to a BOOL value (1 bit)*)
  507. VAR_INPUT
  508. IN :SINT; (*input value*)
  509. END_VAR
  510. END_FUNCTION
  511. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_BYTE : BYTE (*converts a SINT value (8 bits signed) to a BYTE value (8 bits unsigned)*)
  512. VAR_INPUT
  513. IN :SINT; (*input value*)
  514. END_VAR
  515. END_FUNCTION
  516. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_WORD : WORD (*converts a SINT value (8 bits signed) to a WORD value (16 bits unsigned)*)
  517. VAR_INPUT
  518. IN :SINT; (*input value*)
  519. END_VAR
  520. END_FUNCTION
  521. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_DWORD : DWORD (*converts a SINT value (8 bits signed) to a DWORD value (32 bits unsigned)*)
  522. VAR_INPUT
  523. IN :SINT; (*input value*)
  524. END_VAR
  525. END_FUNCTION
  526. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_INT : INT (*converts a SINT value (8 bits signed) to an INT value (16 bits signed)*)
  527. VAR_INPUT
  528. IN :SINT; (*input value*)
  529. END_VAR
  530. END_FUNCTION
  531. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_DINT : DINT (*converts a SINT value (8 bits signed) to a DINT value (32 bits signed)*)
  532. VAR_INPUT
  533. IN :SINT; (*input value*)
  534. END_VAR
  535. END_FUNCTION
  536. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_USINT : USINT (*converts a SINT value (8 bits signed) to a USINT value (8 bits unsigned)*)
  537. VAR_INPUT
  538. IN :SINT; (*input value*)
  539. END_VAR
  540. END_FUNCTION
  541. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_UINT : UINT (*converts a SINT value (8 bits signed) to a UINT value (16 bits unsigned)*)
  542. VAR_INPUT
  543. IN :SINT; (*input value*)
  544. END_VAR
  545. END_FUNCTION
  546. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_UDINT : UDINT (*converts a SINT value (8 bits signed) to a UDINT value (32 bits unsigned)*)
  547. VAR_INPUT
  548. IN :SINT; (*input value*)
  549. END_VAR
  550. END_FUNCTION
  551. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_TIME : TIME (*converts a SINT value (8 bits signed) to a TIME value (32 bits time in milliseconds)*)
  552. VAR_INPUT
  553. IN :SINT; (*input value*)
  554. END_VAR
  555. END_FUNCTION
  556. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_DT : DT (*converts a SINT value (8 bits signed) to a DATE_AND_TIME value (32 bits date in seconds)*)
  557. VAR_INPUT
  558. IN :SINT; (*input value*)
  559. END_VAR
  560. END_FUNCTION
  561. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_DATE : DATE (*converts a SINT value (8 bits signed) to a DATE value (32 bits date in seconds)*)
  562. VAR_INPUT
  563. IN :SINT; (*input value*)
  564. END_VAR
  565. END_FUNCTION
  566. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_TOD : TOD (*converts a SINT value (8 bits signed) to a TOD value (32 bits time of day in milliseconds)*)
  567. VAR_INPUT
  568. IN :SINT; (*input value*)
  569. END_VAR
  570. END_FUNCTION
  571. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_REAL : REAL (*converts a SINT value (8 bits signed) to a REAL value (32 bits floating point number)*)
  572. VAR_INPUT
  573. IN :SINT; (*input value*)
  574. END_VAR
  575. END_FUNCTION
  576. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_LREAL : LREAL (*converts a SINT value (8 bits signed) to a LREAL value (64 bits floating point number)*)
  577. VAR_INPUT
  578. IN :SINT; (*input value*)
  579. END_VAR
  580. END_FUNCTION
  581. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_STRING : STRING[80] (*converts a SINT value (8 bits signed) to a STRING value with variable length*)
  582. VAR_INPUT
  583. IN :SINT; (*input value*)
  584. END_VAR
  585. END_FUNCTION
  586. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION SINT_TO_WSTRING : WSTRING[80] (*converts a SINT value (8 bits signed) to a WSTRING value with variable length*)
  587. VAR_INPUT
  588. IN :SINT; (*input value*)
  589. END_VAR
  590. END_FUNCTION
  591. (*INT_TO_ functions*)
  592. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_BOOL : BOOL (*converts an INT value (16 bits signed) to a BOOL value (1 bit)*)
  593. VAR_INPUT
  594. IN :INT; (*input value*)
  595. END_VAR
  596. END_FUNCTION
  597. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_BYTE : BYTE (*converts an INT value (16 bits signed) to a BYTE value (8 bits unsigned)*)
  598. VAR_INPUT
  599. IN :INT; (*input value*)
  600. END_VAR
  601. END_FUNCTION
  602. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_WORD : WORD (*converts an INT value (16 bits signed) to a WORD value (16 bits unsigned)*)
  603. VAR_INPUT
  604. IN :INT; (*input value*)
  605. END_VAR
  606. END_FUNCTION
  607. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_DWORD : DWORD (*converts an INT value (16 bits signed) to a DWORD value (32 bits unsigned)*)
  608. VAR_INPUT
  609. IN :INT; (*input value*)
  610. END_VAR
  611. END_FUNCTION
  612. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_SINT : SINT (*converts an INT value (16 bits signed) to a SINT value (8 bits signed)*)
  613. VAR_INPUT
  614. IN :INT; (*input value*)
  615. END_VAR
  616. END_FUNCTION
  617. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_DINT : DINT (*converts an INT value (16 bits signed) to a DINT value (32 bits signed)*)
  618. VAR_INPUT
  619. IN :INT; (*input value*)
  620. END_VAR
  621. END_FUNCTION
  622. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_USINT : USINT (*converts an INT value (16 bits signed) to a USINT value (8 bits unsigned)*)
  623. VAR_INPUT
  624. IN :INT; (*input value*)
  625. END_VAR
  626. END_FUNCTION
  627. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_UINT : UINT (*converts an INT value (16 bits signed) to a UINT value (16 bits unsigned)*)
  628. VAR_INPUT
  629. IN :INT; (*input value*)
  630. END_VAR
  631. END_FUNCTION
  632. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_UDINT : UDINT (*converts an INT value (16 bits signed) to a UDINT value (32 bits unsigned)*)
  633. VAR_INPUT
  634. IN :INT; (*input value*)
  635. END_VAR
  636. END_FUNCTION
  637. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_TIME : TIME (*converts an INT value (16 bits signed) to a TIME value (32 bits time in milliseconds)*)
  638. VAR_INPUT
  639. IN :INT; (*input value*)
  640. END_VAR
  641. END_FUNCTION
  642. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_DT : DT (*converts an INT value (16 bits signed) to a DATE_AND_TIME value (32 bits date in seconds)*)
  643. VAR_INPUT
  644. IN :INT; (*input value*)
  645. END_VAR
  646. END_FUNCTION
  647. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_DATE : DATE (*converts an INT value (16 bits signed) to a DATE value (32 bits date in seconds)*)
  648. VAR_INPUT
  649. IN :INT; (*input value*)
  650. END_VAR
  651. END_FUNCTION
  652. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_TOD : TOD (*converts an INT value (16 bits signed) to a TOD value (32 bits time of day in milliseconds)*)
  653. VAR_INPUT
  654. IN :INT; (*input value*)
  655. END_VAR
  656. END_FUNCTION
  657. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_REAL : REAL (*converts an INT value (16 bits signed) to a REAL value (32 bits floating point number)*)
  658. VAR_INPUT
  659. IN :INT; (*input value*)
  660. END_VAR
  661. END_FUNCTION
  662. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_LREAL : LREAL (*converts an INT value (16 bits signed) to a LREAL value (64 bits floating point number)*)
  663. VAR_INPUT
  664. IN :INT; (*input value*)
  665. END_VAR
  666. END_FUNCTION
  667. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_STRING : STRING[80] (*converts an INT value (16 bits signed) to a STRING value with variable length*)
  668. VAR_INPUT
  669. IN :INT; (*input value*)
  670. END_VAR
  671. END_FUNCTION
  672. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INT_TO_WSTRING : WSTRING[80] (*converts an INT value (16 bits signed) to a WSTRING value with variable length*)
  673. VAR_INPUT
  674. IN :INT; (*input value*)
  675. END_VAR
  676. END_FUNCTION
  677. (*DINT_TO_ functions*)
  678. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_BOOL : BOOL (*converts a DINT value (32 bits signed) to a BOOL value (1 bit)*)
  679. VAR_INPUT
  680. IN :DINT; (*input value*)
  681. END_VAR
  682. END_FUNCTION
  683. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_BYTE : BYTE (*converts a DINT value (32 bits signed) to a BYTE value (8 bits unsigned)*)
  684. VAR_INPUT
  685. IN :DINT; (*input value*)
  686. END_VAR
  687. END_FUNCTION
  688. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_WORD : WORD (*converts a DINT value (32 bits signed) to a WORD value (16 bits unsigned)*)
  689. VAR_INPUT
  690. IN :DINT; (*input value*)
  691. END_VAR
  692. END_FUNCTION
  693. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_DWORD : DWORD (*converts a DINT value (32 bits signed) to a DWORD value (32 bits unsigned)*)
  694. VAR_INPUT
  695. IN :DINT; (*input value*)
  696. END_VAR
  697. END_FUNCTION
  698. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_SINT : SINT (*converts a DINT value (32 bits signed) to a SINT value (8 bits signed)*)
  699. VAR_INPUT
  700. IN :DINT; (*input value*)
  701. END_VAR
  702. END_FUNCTION
  703. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_INT : INT (*converts a DINT value (32 bits signed) to an INT value (16 bits signed)*)
  704. VAR_INPUT
  705. IN :DINT; (*input value*)
  706. END_VAR
  707. END_FUNCTION
  708. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_USINT : USINT (*converts a DINT value (32 bits signed) to a USINT value (8 bits unsigned)*)
  709. VAR_INPUT
  710. IN :DINT; (*input value*)
  711. END_VAR
  712. END_FUNCTION
  713. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_UINT : UINT (*converts a DINT value (32 bits signed) to a UINT value (16 bits unsigned)*)
  714. VAR_INPUT
  715. IN :DINT; (*input value*)
  716. END_VAR
  717. END_FUNCTION
  718. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_UDINT : UDINT (*converts a DINT value (32 bits signed) to a UDINT value (32 bits unsigned)*)
  719. VAR_INPUT
  720. IN :DINT; (*input value*)
  721. END_VAR
  722. END_FUNCTION
  723. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_TIME : TIME (*converts a DINT value (32 bits signed) to a TIME value (32 bits time in milliseconds)*)
  724. VAR_INPUT
  725. IN :DINT; (*input value*)
  726. END_VAR
  727. END_FUNCTION
  728. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_DT : DT (*converts a DINT value (32 bits signed) to a DATE_AND_TIME value (32 bits date in seconds)*)
  729. VAR_INPUT
  730. IN :DINT; (*input value*)
  731. END_VAR
  732. END_FUNCTION
  733. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_DATE : DATE (*converts a DINT value (32 bits signed) to a DATE value (32 bits date in seconds)*)
  734. VAR_INPUT
  735. IN :DINT; (*input value*)
  736. END_VAR
  737. END_FUNCTION
  738. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_TOD : TOD (*converts a DINT value (32 bits signed) to a TOD value (32 bits time of day in milliseconds)*)
  739. VAR_INPUT
  740. IN :DINT; (*input value*)
  741. END_VAR
  742. END_FUNCTION
  743. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_REAL : REAL (*converts a DINT value (32 bits signed) to a REAL value (32 bits floating point number)*)
  744. VAR_INPUT
  745. IN :DINT; (*input value*)
  746. END_VAR
  747. END_FUNCTION
  748. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_LREAL : LREAL (*converts a DINT value (32 bits signed) to a LREAL value (64 bits floating point number)*)
  749. VAR_INPUT
  750. IN :DINT; (*input value*)
  751. END_VAR
  752. END_FUNCTION
  753. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_STRING : STRING[80] (*converts a DINT value (32 bits signed) to a STRING value with variable length*)
  754. VAR_INPUT
  755. IN :DINT; (*input value*)
  756. END_VAR
  757. END_FUNCTION
  758. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DINT_TO_WSTRING : WSTRING[80] (*converts a DINT value (32 bits signed) to a WSTRING value with variable length*)
  759. VAR_INPUT
  760. IN :DINT; (*input value*)
  761. END_VAR
  762. END_FUNCTION
  763. (*USINT_TO_ functions*)
  764. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_BOOL : BOOL (*converts a USINT value (8 bits unsigned) to a BOOL value (1 bit)*)
  765. VAR_INPUT
  766. IN :USINT; (*input value*)
  767. END_VAR
  768. END_FUNCTION
  769. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_BYTE : BYTE (*converts a USINT value (8 bits unsigned) to a BYTE value (8 bits unsigned)*)
  770. VAR_INPUT
  771. IN :USINT; (*input value*)
  772. END_VAR
  773. END_FUNCTION
  774. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_WORD : WORD (*converts a USINT value (8 bits unsigned) to a WORD value (16 bits unsigned)*)
  775. VAR_INPUT
  776. IN :USINT; (*input value*)
  777. END_VAR
  778. END_FUNCTION
  779. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_DWORD : DWORD (*converts a USINT value (8 bits unsigned) to a DWORD value (32 bits unsigned)*)
  780. VAR_INPUT
  781. IN :USINT; (*input value*)
  782. END_VAR
  783. END_FUNCTION
  784. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_SINT : SINT (*converts a USINT value (8 bits unsigned) to a SINT value (8 bits signed)*)
  785. VAR_INPUT
  786. IN :USINT; (*input value*)
  787. END_VAR
  788. END_FUNCTION
  789. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_INT : INT (*converts a USINT value (8 bits unsigned) to an INT value (16 bits signed)*)
  790. VAR_INPUT
  791. IN :USINT; (*input value*)
  792. END_VAR
  793. END_FUNCTION
  794. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_DINT : DINT (*converts a USINT value (8 bits unsigned) to a DINT value (32 bits signed)*)
  795. VAR_INPUT
  796. IN :USINT; (*input value*)
  797. END_VAR
  798. END_FUNCTION
  799. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_UINT : UINT (*converts a USINT value (8 bits unsigned) to a UINT value (16 bits unsigned)*)
  800. VAR_INPUT
  801. IN :USINT; (*input value*)
  802. END_VAR
  803. END_FUNCTION
  804. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_UDINT : UDINT (*converts a USINT value (8 bits unsigned) to a UDINT value (32 bits unsigned)*)
  805. VAR_INPUT
  806. IN :USINT; (*input value*)
  807. END_VAR
  808. END_FUNCTION
  809. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_TIME : TIME (*converts a USINT value (8 bits unsigned) to a TIME value (32 bits time in milliseconds)*)
  810. VAR_INPUT
  811. IN :USINT; (*input value*)
  812. END_VAR
  813. END_FUNCTION
  814. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_DT : DT (*converts a USINT value (8 bits unsigned) to a DATE_AND_TIME value (32 bits date in seconds)*)
  815. VAR_INPUT
  816. IN :USINT; (*input value*)
  817. END_VAR
  818. END_FUNCTION
  819. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_DATE : DATE (*converts a USINT value (8 bits unsigned) to a DATE value (32 bits date in seconds)*)
  820. VAR_INPUT
  821. IN :USINT; (*input value*)
  822. END_VAR
  823. END_FUNCTION
  824. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_TOD : TOD (*converts a USINT value (8 bits unsigned) to a TOD value (32 bits time of day in milliseconds)*)
  825. VAR_INPUT
  826. IN :USINT; (*input value*)
  827. END_VAR
  828. END_FUNCTION
  829. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_REAL : REAL (*converts a USINT value (8 bits unsigned) to a REAL value (32 bits floating point number)*)
  830. VAR_INPUT
  831. IN :USINT; (*input value*)
  832. END_VAR
  833. END_FUNCTION
  834. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_LREAL : LREAL (*converts a USINT value (8 bits unsigned) to a LREAL value (64 bits floating point number)*)
  835. VAR_INPUT
  836. IN :USINT; (*input value*)
  837. END_VAR
  838. END_FUNCTION
  839. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_STRING : STRING[80] (*converts a USINT value (8 bits unsigned) to a STRING value with variable length*)
  840. VAR_INPUT
  841. IN :USINT; (*input value*)
  842. END_VAR
  843. END_FUNCTION
  844. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION USINT_TO_WSTRING : WSTRING[80] (*converts a USINT value (8 bits unsigned) to a WSTRING value with variable length*)
  845. VAR_INPUT
  846. IN :USINT; (*input value*)
  847. END_VAR
  848. END_FUNCTION
  849. (*UINT_TO_ functions*)
  850. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_BOOL : BOOL (*converts a UINT value (16 bits unsigned) to a BOOL value (1 bit)*)
  851. VAR_INPUT
  852. IN :UINT; (*input value*)
  853. END_VAR
  854. END_FUNCTION
  855. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_BYTE : BYTE (*converts a UINT value (16 bits unsigned) to a BYTE value (8 bits unsigned)*)
  856. VAR_INPUT
  857. IN :UINT; (*input value*)
  858. END_VAR
  859. END_FUNCTION
  860. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_WORD : WORD (*converts a UINT value (16 bits unsigned) to a WORD value (16 bits unsigned)*)
  861. VAR_INPUT
  862. IN :UINT; (*input value*)
  863. END_VAR
  864. END_FUNCTION
  865. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_DWORD : DWORD (*converts a UINT value (16 bits unsigned) to a DWORD value (32 bits unsigned)*)
  866. VAR_INPUT
  867. IN :UINT; (*input value*)
  868. END_VAR
  869. END_FUNCTION
  870. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_SINT : SINT (*converts a UINT value (16 bits unsigned) to a SINT value (8 bits signed)*)
  871. VAR_INPUT
  872. IN :UINT; (*input value*)
  873. END_VAR
  874. END_FUNCTION
  875. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_INT : INT (*converts a UINT value (16 bits unsigned) to an INT value (16 bits signed)*)
  876. VAR_INPUT
  877. IN :UINT; (*input value*)
  878. END_VAR
  879. END_FUNCTION
  880. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_DINT : DINT (*converts a UINT value (16 bits unsigned) to a DINT value (32 bits signed)*)
  881. VAR_INPUT
  882. IN :UINT; (*input value*)
  883. END_VAR
  884. END_FUNCTION
  885. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_USINT : USINT (*converts a UINT value (16 bits unsigned) to a USINT value (8 bits unsigned)*)
  886. VAR_INPUT
  887. IN :UINT; (*input value*)
  888. END_VAR
  889. END_FUNCTION
  890. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_UDINT : UDINT (*converts a UINT value (16 bits unsigned) to a UDINT value (32 bits unsigned)*)
  891. VAR_INPUT
  892. IN :UINT; (*input value*)
  893. END_VAR
  894. END_FUNCTION
  895. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_TIME : TIME (*converts a UINT value (16 bits unsigned) to a TIME value (32 bits time in milliseconds)*)
  896. VAR_INPUT
  897. IN :UINT; (*input value*)
  898. END_VAR
  899. END_FUNCTION
  900. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_DT : DT (*converts a UINT value (16 bits unsigned) to a DATE_AND_TIME value (32 bits date in seconds)*)
  901. VAR_INPUT
  902. IN :UINT; (*input value*)
  903. END_VAR
  904. END_FUNCTION
  905. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_DATE : DATE (*converts a UINT value (16 bits unsigned) to a DATE value (32 bits date in seconds)*)
  906. VAR_INPUT
  907. IN :UINT; (*input value*)
  908. END_VAR
  909. END_FUNCTION
  910. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_TOD : TOD (*converts a UINT value (16 bits unsigned) to a TOD value (32 bits time of day in milliseconds)*)
  911. VAR_INPUT
  912. IN :UINT; (*input value*)
  913. END_VAR
  914. END_FUNCTION
  915. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_REAL : REAL (*converts a UINT value (16 bits unsigned) to a REAL value (32 bits floating point number)*)
  916. VAR_INPUT
  917. IN :UINT; (*input value*)
  918. END_VAR
  919. END_FUNCTION
  920. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_LREAL : LREAL (*converts a UINT value (16 bits unsigned) to a LREAL value (64 bits floating point number)*)
  921. VAR_INPUT
  922. IN :UINT; (*input value*)
  923. END_VAR
  924. END_FUNCTION
  925. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_STRING : STRING[80] (*converts a UINT value (16 bits unsigned) to a STRING value with variable length*)
  926. VAR_INPUT
  927. IN :UINT; (*input value*)
  928. END_VAR
  929. END_FUNCTION
  930. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UINT_TO_WSTRING : WSTRING[80] (*converts a UINT value (16 bits unsigned) to a WSTRING value with variable length*)
  931. VAR_INPUT
  932. IN :UINT; (*input value*)
  933. END_VAR
  934. END_FUNCTION
  935. (*UDINT_TO_ functions*)
  936. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_BOOL : BOOL (*converts a UDINT value (32 bits unsigned) to a BOOL value (1 bit)*)
  937. VAR_INPUT
  938. IN :UDINT; (*input value*)
  939. END_VAR
  940. END_FUNCTION
  941. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_BYTE : BYTE (*converts a UDINT value (32 bits unsigned) to a BYTE value (8 bits unsigned)*)
  942. VAR_INPUT
  943. IN :UDINT; (*input value*)
  944. END_VAR
  945. END_FUNCTION
  946. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_WORD : WORD (*converts a UDINT value (32 bits unsigned) to a WORD value (16 bits unsigned)*)
  947. VAR_INPUT
  948. IN :UDINT; (*input value*)
  949. END_VAR
  950. END_FUNCTION
  951. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_DWORD : DWORD (*converts a UDINT value (32 bits unsigned) to a DWORD value (32 bits unsigned)*)
  952. VAR_INPUT
  953. IN :UDINT; (*input value*)
  954. END_VAR
  955. END_FUNCTION
  956. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_SINT : SINT (*converts a UDINT value (32 bits unsigned) to a SINT value (8 bits signed)*)
  957. VAR_INPUT
  958. IN :UDINT; (*input value*)
  959. END_VAR
  960. END_FUNCTION
  961. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_INT : INT (*converts a UDINT value (32 bits unsigned) to an INT value (16 bits signed)*)
  962. VAR_INPUT
  963. IN :UDINT; (*input value*)
  964. END_VAR
  965. END_FUNCTION
  966. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_DINT : DINT (*converts a UDINT value (32 bits unsigned) to a DINT value (32 bits signed)*)
  967. VAR_INPUT
  968. IN :UDINT; (*input value*)
  969. END_VAR
  970. END_FUNCTION
  971. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_USINT : USINT (*converts a UDINT value (32 bits unsigned) to a USINT value (8 bits unsigned)*)
  972. VAR_INPUT
  973. IN :UDINT; (*input value*)
  974. END_VAR
  975. END_FUNCTION
  976. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_UINT : UINT (*converts a UDINT value (32 bits unsigned) to a UINT value (16 bits unsigned)*)
  977. VAR_INPUT
  978. IN :UDINT; (*input value*)
  979. END_VAR
  980. END_FUNCTION
  981. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_TIME : TIME (*converts a UDINT value (32 bits unsigned) to a TIME value (32 bits time in milliseconds)*)
  982. VAR_INPUT
  983. IN :UDINT; (*input value*)
  984. END_VAR
  985. END_FUNCTION
  986. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_DT : DT (*converts a UDINT value (32 bits unsigned) to a DATE_AND_TIME value (32 bits date in seconds)*)
  987. VAR_INPUT
  988. IN :UDINT; (*input value*)
  989. END_VAR
  990. END_FUNCTION
  991. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_DATE : DATE (*converts a UDINT value (32 bits unsigned) to a DATE value (32 bits date in seconds)*)
  992. VAR_INPUT
  993. IN :UDINT; (*input value*)
  994. END_VAR
  995. END_FUNCTION
  996. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_TOD : TOD (*converts a UDINT value (32 bits unsigned) to a TOD value (32 bits time of day in milliseconds)*)
  997. VAR_INPUT
  998. IN :UDINT; (*input value*)
  999. END_VAR
  1000. END_FUNCTION
  1001. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_REAL : REAL (*converts a UDINT value (32 bits unsigned) to a REAL value (32 bits floating point number)*)
  1002. VAR_INPUT
  1003. IN :UDINT; (*input value*)
  1004. END_VAR
  1005. END_FUNCTION
  1006. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_LREAL : LREAL (*converts a UDINT value (32 bits unsigned) to a LREAL value (64 bits floating point number)*)
  1007. VAR_INPUT
  1008. IN :UDINT; (*input value*)
  1009. END_VAR
  1010. END_FUNCTION
  1011. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_STRING : STRING[80] (*converts a UDINT value (32 bits unsigned) to a STRING value with variable length*)
  1012. VAR_INPUT
  1013. IN :UDINT; (*input value*)
  1014. END_VAR
  1015. END_FUNCTION
  1016. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION UDINT_TO_WSTRING : WSTRING[80] (*converts a UDINT value (32 bits unsigned) to a WSTRING value with variable length*)
  1017. VAR_INPUT
  1018. IN :UDINT; (*input value*)
  1019. END_VAR
  1020. END_FUNCTION
  1021. (*TIME_TO_ functions*)
  1022. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_BOOL : BOOL (*converts a TIME value (32 bits time in milliseconds) to a BOOL value (1 bit)*)
  1023. VAR_INPUT
  1024. IN :TIME; (*input value*)
  1025. END_VAR
  1026. END_FUNCTION
  1027. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_BYTE : BYTE (*converts a TIME value (32 bits time in milliseconds) to a BYTE value (8 bits unsigned)*)
  1028. VAR_INPUT
  1029. IN :TIME; (*input value*)
  1030. END_VAR
  1031. END_FUNCTION
  1032. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_WORD : WORD (*converts a TIME value (32 bits time in milliseconds) to a WORD value (16 bits unsigned)*)
  1033. VAR_INPUT
  1034. IN :TIME; (*input value*)
  1035. END_VAR
  1036. END_FUNCTION
  1037. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_DWORD : DWORD (*converts a TIME value (32 bits time in milliseconds) to a DWORD value (32 bits unsigned)*)
  1038. VAR_INPUT
  1039. IN :TIME; (*input value*)
  1040. END_VAR
  1041. END_FUNCTION
  1042. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_SINT : SINT (*converts a TIME value (32 bits time in milliseconds) to a SINT value (8 bits signed)*)
  1043. VAR_INPUT
  1044. IN :TIME; (*input value*)
  1045. END_VAR
  1046. END_FUNCTION
  1047. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_INT : INT (*converts a TIME value (32 bits time in milliseconds) to an INT value (16 bits signed)*)
  1048. VAR_INPUT
  1049. IN :TIME; (*input value*)
  1050. END_VAR
  1051. END_FUNCTION
  1052. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_DINT : DINT (*converts a TIME value (32 bits time in milliseconds) to a DINT value (32 bits signed)*)
  1053. VAR_INPUT
  1054. IN :TIME; (*input value*)
  1055. END_VAR
  1056. END_FUNCTION
  1057. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_USINT : USINT (*converts a TIME value (32 bits time in milliseconds) to a USINT value (8 bits unsigned)*)
  1058. VAR_INPUT
  1059. IN :TIME; (*input value*)
  1060. END_VAR
  1061. END_FUNCTION
  1062. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_UINT : UINT (*converts a TIME value (32 bits time in milliseconds) to a UINT value (16 bits unsigned)*)
  1063. VAR_INPUT
  1064. IN :TIME; (*input value*)
  1065. END_VAR
  1066. END_FUNCTION
  1067. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_UDINT : UDINT (*converts a TIME value (32 bits time in milliseconds) to a UDINT value (32 bits unsigned)*)
  1068. VAR_INPUT
  1069. IN :TIME; (*input value*)
  1070. END_VAR
  1071. END_FUNCTION
  1072. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_DT : DT (*converts a TIME value (32 bits time in milliseconds) to a DATE_AND_TIME value (32 bits date in seconds)*)
  1073. VAR_INPUT
  1074. IN :TIME; (*input value*)
  1075. END_VAR
  1076. END_FUNCTION
  1077. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_DATE : DATE (*converts a TIME value (32 bits time in milliseconds) to a DATE value (32 bits date in seconds)*)
  1078. VAR_INPUT
  1079. IN :TIME; (*input value*)
  1080. END_VAR
  1081. END_FUNCTION
  1082. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_TOD : TOD (*converts a TIME value (32 bits time in milliseconds) to a TOD value (32 bits time of day in milliseconds)*)
  1083. VAR_INPUT
  1084. IN :TIME; (*input value*)
  1085. END_VAR
  1086. END_FUNCTION
  1087. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_REAL : REAL (*converts a TIME value (32 bits time in milliseconds) to a REAL value (32 bits floating point number)*)
  1088. VAR_INPUT
  1089. IN :TIME; (*input value*)
  1090. END_VAR
  1091. END_FUNCTION
  1092. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_LREAL : LREAL (*converts a TIME value (32 bits time in milliseconds) to a LREAL value (64 bits floating point number)*)
  1093. VAR_INPUT
  1094. IN :TIME; (*input value*)
  1095. END_VAR
  1096. END_FUNCTION
  1097. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_STRING : STRING[80] (*converts a TIME value (32 bits time in milliseconds) to a STRING value with variable length*)
  1098. VAR_INPUT
  1099. IN :TIME; (*input value*)
  1100. END_VAR
  1101. END_FUNCTION
  1102. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_WSTRING : WSTRING[80] (*converts a TIME value (32 bits time in milliseconds) to a WSTRING value with variable length*)
  1103. VAR_INPUT
  1104. IN :TIME; (*input value*)
  1105. END_VAR
  1106. END_FUNCTION
  1107. (*DT_TO_ functions*)
  1108. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_BOOL : BOOL (*converts a DATE_AND_TIME value (32 bits date in seconds) to a BOOL value (1 bit)*)
  1109. VAR_INPUT
  1110. IN :DT; (*input value*)
  1111. END_VAR
  1112. END_FUNCTION
  1113. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_BYTE : BYTE (*converts a DATE_AND_TIME value (32 bits date in seconds) to a BYTE value (8 bits unsigned)*)
  1114. VAR_INPUT
  1115. IN :DT; (*input value*)
  1116. END_VAR
  1117. END_FUNCTION
  1118. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_WORD : WORD (*converts a DATE_AND_TIME value (32 bits date in seconds) to a WORD value (16 bits unsigned)*)
  1119. VAR_INPUT
  1120. IN :DT; (*input value*)
  1121. END_VAR
  1122. END_FUNCTION
  1123. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_DWORD : DWORD (*converts a DATE_AND_TIME value (32 bits date in seconds) to a DWORD value (32 bits unsigned)*)
  1124. VAR_INPUT
  1125. IN :DT; (*input value*)
  1126. END_VAR
  1127. END_FUNCTION
  1128. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_SINT : SINT (*converts a DATE_AND_TIME value (32 bits date in seconds) to a SINT value (8 bits signed)*)
  1129. VAR_INPUT
  1130. IN :DT; (*input value*)
  1131. END_VAR
  1132. END_FUNCTION
  1133. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_INT : INT (*converts a DATE_AND_TIME value (32 bits date in seconds) to an INT value (16 bits signed)*)
  1134. VAR_INPUT
  1135. IN :DT; (*input value*)
  1136. END_VAR
  1137. END_FUNCTION
  1138. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_DINT : DINT (*converts a DATE_AND_TIME value (32 bits date in seconds) to a DINT value (32 bits signed)*)
  1139. VAR_INPUT
  1140. IN :DT; (*input value*)
  1141. END_VAR
  1142. END_FUNCTION
  1143. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_USINT : USINT (*converts a DATE_AND_TIME value (32 bits date in seconds) to a USINT value (8 bits unsigned)*)
  1144. VAR_INPUT
  1145. IN :DT; (*input value*)
  1146. END_VAR
  1147. END_FUNCTION
  1148. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_UINT : UINT (*converts a DATE_AND_TIME value (32 bits date in seconds) to a UINT value (16 bits unsigned)*)
  1149. VAR_INPUT
  1150. IN :DT; (*input value*)
  1151. END_VAR
  1152. END_FUNCTION
  1153. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_UDINT : UDINT (*converts a DATE_AND_TIME value (32 bits date in seconds) to a UDINT value (32 bits unsigned)*)
  1154. VAR_INPUT
  1155. IN :DT; (*input value*)
  1156. END_VAR
  1157. END_FUNCTION
  1158. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_TIME : TIME (*converts a DATE_AND_TIME value (32 bits date in seconds) to a TIME value (32 bits time in milliseconds)*)
  1159. VAR_INPUT
  1160. IN :DT; (*input value*)
  1161. END_VAR
  1162. END_FUNCTION
  1163. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_DATE : DATE (*converts a DATE_AND_TIME value (32 bits date in seconds) to a DATE value (32 bits date in seconds)*)
  1164. VAR_INPUT
  1165. IN :DT; (*input value*)
  1166. END_VAR
  1167. END_FUNCTION
  1168. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_TOD : TOD (*converts a DATE_AND_TIME value (32 bits date in seconds) to a TOD value (32 bits time of day in milliseconds)*)
  1169. VAR_INPUT
  1170. IN :DT; (*input value*)
  1171. END_VAR
  1172. END_FUNCTION
  1173. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_REAL : REAL (*converts a DATE_AND_TIME value (32 bits date in seconds) to a REAL value (32 bits floating point number)*)
  1174. VAR_INPUT
  1175. IN :DT; (*input value*)
  1176. END_VAR
  1177. END_FUNCTION
  1178. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_LREAL : LREAL (*converts a DATE_AND_TIME value (32 bits date in seconds) to a LREAL value (64 bits floating point number)*)
  1179. VAR_INPUT
  1180. IN :DT; (*input value*)
  1181. END_VAR
  1182. END_FUNCTION
  1183. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_STRING : STRING[80] (*converts a DATE_AND_TIME value (32 bits date in seconds) to a STRING value with variable length*)
  1184. VAR_INPUT
  1185. IN :DT; (*input value*)
  1186. END_VAR
  1187. END_FUNCTION
  1188. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DT_TO_WSTRING : WSTRING[80] (*converts a DATE_AND_TIME value (32 bits date in seconds) to a WSTRING value with variable length*)
  1189. VAR_INPUT
  1190. IN :DT; (*input value*)
  1191. END_VAR
  1192. END_FUNCTION
  1193. (*DATE_TO_ functions*)
  1194. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_BOOL : BOOL (*converts a DATE value (32 bits date in seconds) to a BOOL value (1 bit)*)
  1195. VAR_INPUT
  1196. IN :DATE; (*input value*)
  1197. END_VAR
  1198. END_FUNCTION
  1199. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_BYTE : BYTE (*converts a DATE value (32 bits date in seconds) to a BYTE value (8 bits unsigned)*)
  1200. VAR_INPUT
  1201. IN :DATE; (*input value*)
  1202. END_VAR
  1203. END_FUNCTION
  1204. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_WORD : WORD (*converts a DATE value (32 bits date in seconds) to a WORD value (16 bits unsigned)*)
  1205. VAR_INPUT
  1206. IN :DATE; (*input value*)
  1207. END_VAR
  1208. END_FUNCTION
  1209. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_DWORD : DWORD (*converts a DATE value (32 bits date in seconds) to a DWORD value (32 bits unsigned)*)
  1210. VAR_INPUT
  1211. IN :DATE; (*input value*)
  1212. END_VAR
  1213. END_FUNCTION
  1214. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_SINT : SINT (*converts a DATE value (32 bits date in seconds) to a SINT value (8 bits signed)*)
  1215. VAR_INPUT
  1216. IN :DATE; (*input value*)
  1217. END_VAR
  1218. END_FUNCTION
  1219. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_INT : INT (*converts a DATE value (32 bits date in seconds) to an INT value (16 bits signed)*)
  1220. VAR_INPUT
  1221. IN :DATE; (*input value*)
  1222. END_VAR
  1223. END_FUNCTION
  1224. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_DINT : DINT (*converts a DATE value (32 bits date in seconds) to a DINT value (32 bits signed)*)
  1225. VAR_INPUT
  1226. IN :DATE; (*input value*)
  1227. END_VAR
  1228. END_FUNCTION
  1229. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_USINT : USINT (*converts a DATE value (32 bits date in seconds) to a USINT value (8 bits unsigned)*)
  1230. VAR_INPUT
  1231. IN :DATE; (*input value*)
  1232. END_VAR
  1233. END_FUNCTION
  1234. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_UINT : UINT (*converts a DATE value (32 bits date in seconds) to a UINT value (16 bits unsigned)*)
  1235. VAR_INPUT
  1236. IN :DATE; (*input value*)
  1237. END_VAR
  1238. END_FUNCTION
  1239. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_UDINT : UDINT (*converts a DATE value (32 bits date in seconds) to a UDINT value (32 bits unsigned)*)
  1240. VAR_INPUT
  1241. IN :DATE; (*input value*)
  1242. END_VAR
  1243. END_FUNCTION
  1244. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_TIME : TIME (*converts a DATE value (32 bits date in seconds) to a TIME value (32 bits time in milliseconds)*)
  1245. VAR_INPUT
  1246. IN :DATE; (*input value*)
  1247. END_VAR
  1248. END_FUNCTION
  1249. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_DT : DT (*converts a DATE value (32 bits date in seconds) to a DATE_AND_TIME value (32 bits date in seconds)*)
  1250. VAR_INPUT
  1251. IN :DATE; (*input value*)
  1252. END_VAR
  1253. END_FUNCTION
  1254. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_TOD : TOD (*converts a DATE value (32 bits date in seconds) to a TOD value (32 bits time of day in milliseconds)*)
  1255. VAR_INPUT
  1256. IN :DATE; (*input value*)
  1257. END_VAR
  1258. END_FUNCTION
  1259. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_REAL : REAL (*converts a DATE value (32 bits date in seconds) to a REAL value (32 bits floating point number)*)
  1260. VAR_INPUT
  1261. IN :DATE; (*input value*)
  1262. END_VAR
  1263. END_FUNCTION
  1264. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_LREAL : LREAL (*converts a DATE value (32 bits date in seconds) to a LREAL value (64 bits floating point number)*)
  1265. VAR_INPUT
  1266. IN :DATE; (*input value*)
  1267. END_VAR
  1268. END_FUNCTION
  1269. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_STRING : STRING[80] (*converts a DATE value (32 bits date in seconds) to a STRING value with variable length*)
  1270. VAR_INPUT
  1271. IN :DATE; (*input value*)
  1272. END_VAR
  1273. END_FUNCTION
  1274. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DATE_TO_WSTRING : WSTRING[80] (*converts a DATE value (32 bits date in seconds) to a WSTRING value with variable length*)
  1275. VAR_INPUT
  1276. IN :DATE; (*input value*)
  1277. END_VAR
  1278. END_FUNCTION
  1279. (*TOD_TO_ functions*)
  1280. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_BOOL : BOOL (*converts a TOD value (32 bits time of day in milliseconds) to a BOOL value (1 bit)*)
  1281. VAR_INPUT
  1282. IN :TOD; (*input value*)
  1283. END_VAR
  1284. END_FUNCTION
  1285. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_BYTE : BYTE (*converts a TOD value (32 bits time of day in milliseconds) to a BYTE value (8 bits unsigned)*)
  1286. VAR_INPUT
  1287. IN :TOD; (*input value*)
  1288. END_VAR
  1289. END_FUNCTION
  1290. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_WORD : WORD (*converts a TOD value (32 bits time of day in milliseconds) to a WORD value (16 bits unsigned)*)
  1291. VAR_INPUT
  1292. IN :TOD; (*input value*)
  1293. END_VAR
  1294. END_FUNCTION
  1295. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_DWORD : DWORD (*converts a TOD value (32 bits time of day in milliseconds) to a DWORD value (32 bits unsigned)*)
  1296. VAR_INPUT
  1297. IN :TOD; (*input value*)
  1298. END_VAR
  1299. END_FUNCTION
  1300. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_SINT : SINT (*converts a TOD value (32 bits time of day in milliseconds) to a SINT value (8 bits signed)*)
  1301. VAR_INPUT
  1302. IN :TOD; (*input value*)
  1303. END_VAR
  1304. END_FUNCTION
  1305. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_INT : INT (*converts a TOD value (32 bits time of day in milliseconds) to an INT value (16 bits signed)*)
  1306. VAR_INPUT
  1307. IN :TOD; (*input value*)
  1308. END_VAR
  1309. END_FUNCTION
  1310. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_DINT : DINT (*converts a TOD value (32 bits time of day in milliseconds) to a DINT value (32 bits signed)*)
  1311. VAR_INPUT
  1312. IN :TOD; (*input value*)
  1313. END_VAR
  1314. END_FUNCTION
  1315. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_USINT : USINT (*converts a TOD value (32 bits time of day in milliseconds) to a USINT value (8 bits unsigned)*)
  1316. VAR_INPUT
  1317. IN :TOD; (*input value*)
  1318. END_VAR
  1319. END_FUNCTION
  1320. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_UINT : UINT (*converts a TOD value (32 bits time of day in milliseconds) to a UINT value (16 bits unsigned)*)
  1321. VAR_INPUT
  1322. IN :TOD; (*input value*)
  1323. END_VAR
  1324. END_FUNCTION
  1325. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_UDINT : UDINT (*converts a TOD value (32 bits time of day in milliseconds) to a UDINT value (32 bits unsigned)*)
  1326. VAR_INPUT
  1327. IN :TOD; (*input value*)
  1328. END_VAR
  1329. END_FUNCTION
  1330. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_TIME : TIME (*converts a TOD value (32 bits time of day in milliseconds) to a TIME value (32 bits time in milliseconds)*)
  1331. VAR_INPUT
  1332. IN :TOD; (*input value*)
  1333. END_VAR
  1334. END_FUNCTION
  1335. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_DT : DT (*converts a TOD value (32 bits time of day in milliseconds) to a DATE_AND_TIME value (32 bits date in seconds)*)
  1336. VAR_INPUT
  1337. IN :TOD; (*input value*)
  1338. END_VAR
  1339. END_FUNCTION
  1340. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_DATE : DATE (*converts a TOD value (32 bits time of day in milliseconds) to a DATE value (32 bits date in seconds)*)
  1341. VAR_INPUT
  1342. IN :TOD; (*input value*)
  1343. END_VAR
  1344. END_FUNCTION
  1345. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_REAL : REAL (*converts a TOD value (32 bits time of day in milliseconds) to a REAL value (32 bits floating point number)*)
  1346. VAR_INPUT
  1347. IN :TOD; (*input value*)
  1348. END_VAR
  1349. END_FUNCTION
  1350. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_LREAL : LREAL (*converts a TOD value (32 bits time of day in milliseconds) to a LREAL value (64 bits floating point number)*)
  1351. VAR_INPUT
  1352. IN :TOD; (*input value*)
  1353. END_VAR
  1354. END_FUNCTION
  1355. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_STRING : STRING[80] (*converts a TOD value (32 bits time of day in milliseconds) to a STRING value with variable length*)
  1356. VAR_INPUT
  1357. IN :TOD; (*input value*)
  1358. END_VAR
  1359. END_FUNCTION
  1360. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION TOD_TO_WSTRING : WSTRING[80] (*converts a TOD value (32 bits time of day in milliseconds) to a WSTRING value with variable length*)
  1361. VAR_INPUT
  1362. IN :TOD; (*input value*)
  1363. END_VAR
  1364. END_FUNCTION
  1365. (*REAL_TO_ functions*)
  1366. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_BOOL : BOOL (*converts a REAL value (32 bits floating point number) to a BOOL value (1 bit)*)
  1367. VAR_INPUT
  1368. IN :REAL; (*input value*)
  1369. END_VAR
  1370. END_FUNCTION
  1371. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_BYTE : BYTE (*converts a REAL value (32 bits floating point number) to a BYTE value (8 bits unsigned)*)
  1372. VAR_INPUT
  1373. IN :REAL; (*input value*)
  1374. END_VAR
  1375. END_FUNCTION
  1376. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_WORD : WORD (*converts a REAL value (32 bits floating point number) to a WORD value (16 bits unsigned)*)
  1377. VAR_INPUT
  1378. IN :REAL; (*input value*)
  1379. END_VAR
  1380. END_FUNCTION
  1381. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_DWORD : DWORD (*converts a REAL value (32 bits floating point number) to a DWORD value (32 bits unsigned)*)
  1382. VAR_INPUT
  1383. IN :REAL; (*input value*)
  1384. END_VAR
  1385. END_FUNCTION
  1386. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_SINT : SINT (*converts a REAL value (32 bits floating point number) to a SINT value (8 bits signed)*)
  1387. VAR_INPUT
  1388. IN :REAL; (*input value*)
  1389. END_VAR
  1390. END_FUNCTION
  1391. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_INT : INT (*converts a REAL value (32 bits floating point number) to an INT value (16 bits signed)*)
  1392. VAR_INPUT
  1393. IN :REAL; (*input value*)
  1394. END_VAR
  1395. END_FUNCTION
  1396. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_DINT : DINT (*converts a REAL value (32 bits floating point number) to a DINT value (32 bits signed)*)
  1397. VAR_INPUT
  1398. IN :REAL; (*input value*)
  1399. END_VAR
  1400. END_FUNCTION
  1401. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_USINT : USINT (*converts a REAL value (32 bits floating point number) to a USINT value (8 bits unsigned)*)
  1402. VAR_INPUT
  1403. IN :REAL; (*input value*)
  1404. END_VAR
  1405. END_FUNCTION
  1406. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_UINT : UINT (*converts a REAL value (32 bits floating point number) to a UINT value (16 bits unsigned)*)
  1407. VAR_INPUT
  1408. IN :REAL; (*input value*)
  1409. END_VAR
  1410. END_FUNCTION
  1411. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_UDINT : UDINT (*converts a REAL value (32 bits floating point number) to a UDINT value (32 bits unsigned)*)
  1412. VAR_INPUT
  1413. IN :REAL; (*input value*)
  1414. END_VAR
  1415. END_FUNCTION
  1416. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_TIME : TIME (*converts a REAL value (32 bits floating point number) to a TIME value (32 bits time in milliseconds)*)
  1417. VAR_INPUT
  1418. IN :REAL; (*input value*)
  1419. END_VAR
  1420. END_FUNCTION
  1421. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_DT : DT (*converts a REAL value (32 bits floating point number) to a DATE_AND_TIME value (32 bits date in seconds)*)
  1422. VAR_INPUT
  1423. IN :REAL; (*input value*)
  1424. END_VAR
  1425. END_FUNCTION
  1426. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_DATE : DATE (*converts a REAL value (32 bits floating point number) to a DATE value (32 bits date in seconds)*)
  1427. VAR_INPUT
  1428. IN :REAL; (*input value*)
  1429. END_VAR
  1430. END_FUNCTION
  1431. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_TOD : TOD (*converts a REAL value (32 bits floating point number) to a TOD value (32 bits time of day in milliseconds)*)
  1432. VAR_INPUT
  1433. IN :REAL; (*input value*)
  1434. END_VAR
  1435. END_FUNCTION
  1436. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_LREAL : LREAL (*converts a REAL value (32 bits floating point number) to a LREAL value (64 bits floating point number)*)
  1437. VAR_INPUT
  1438. IN :REAL; (*input value*)
  1439. END_VAR
  1440. END_FUNCTION
  1441. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_STRING : STRING[80] (*converts a REAL value (32 bits floating point number) to a STRING value with variable length*)
  1442. VAR_INPUT
  1443. IN :REAL; (*input value*)
  1444. END_VAR
  1445. END_FUNCTION
  1446. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REAL_TO_WSTRING : WSTRING[80] (*converts a REAL value (32 bits floating point number) to a WSTRING value with variable length*)
  1447. VAR_INPUT
  1448. IN :REAL; (*input value*)
  1449. END_VAR
  1450. END_FUNCTION
  1451. (*LREAL_TO_ functions*)
  1452. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_BOOL : BOOL (*converts a LREAL value (64 bits floating point number) to a BOOL value (1 bit)*)
  1453. VAR_INPUT
  1454. IN :LREAL; (*input value*)
  1455. END_VAR
  1456. END_FUNCTION
  1457. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_BYTE : BYTE (*converts a LREAL value (64 bits floating point number) to a BYTE value (8 bits unsigned)*)
  1458. VAR_INPUT
  1459. IN :LREAL; (*input value*)
  1460. END_VAR
  1461. END_FUNCTION
  1462. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_WORD : WORD (*converts a LREAL value (64 bits floating point number) to a WORD value (16 bits unsigned)*)
  1463. VAR_INPUT
  1464. IN :LREAL; (*input value*)
  1465. END_VAR
  1466. END_FUNCTION
  1467. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_DWORD : DWORD (*converts a LREAL value (64 bits floating point number) to a DWORD value (32 bits unsigned)*)
  1468. VAR_INPUT
  1469. IN :LREAL; (*input value*)
  1470. END_VAR
  1471. END_FUNCTION
  1472. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_SINT : SINT (*converts a LREAL value (64 bits floating point number) to a SINT value (8 bits signed)*)
  1473. VAR_INPUT
  1474. IN :LREAL; (*input value*)
  1475. END_VAR
  1476. END_FUNCTION
  1477. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_INT : INT (*converts a LREAL value (64 bits floating point number) to an INT value (16 bits signed)*)
  1478. VAR_INPUT
  1479. IN :LREAL; (*input value*)
  1480. END_VAR
  1481. END_FUNCTION
  1482. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_DINT : DINT (*converts a LREAL value (64 bits floating point number) to a DINT value (32 bits signed)*)
  1483. VAR_INPUT
  1484. IN :LREAL; (*input value*)
  1485. END_VAR
  1486. END_FUNCTION
  1487. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_USINT : USINT (*converts a LREAL value (64 bits floating point number) to a USINT value (8 bits unsigned)*)
  1488. VAR_INPUT
  1489. IN :LREAL; (*input value*)
  1490. END_VAR
  1491. END_FUNCTION
  1492. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_UINT : UINT (*converts a LREAL value (64 bits floating point number) to a UINT value (16 bits unsigned)*)
  1493. VAR_INPUT
  1494. IN :LREAL; (*input value*)
  1495. END_VAR
  1496. END_FUNCTION
  1497. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_UDINT : UDINT (*converts a LREAL value (64 bits floating point number) to a UDINT value (32 bits unsigned)*)
  1498. VAR_INPUT
  1499. IN :LREAL; (*input value*)
  1500. END_VAR
  1501. END_FUNCTION
  1502. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_TIME : TIME (*converts a LREAL value (64 bits floating point number) to a TIME value (32 bits time in milliseconds)*)
  1503. VAR_INPUT
  1504. IN :LREAL; (*input value*)
  1505. END_VAR
  1506. END_FUNCTION
  1507. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_DT : DT (*converts a LREAL value (64 bits floating point number) to a DATE_AND_TIME value (32 bits date in seconds)*)
  1508. VAR_INPUT
  1509. IN :LREAL; (*input value*)
  1510. END_VAR
  1511. END_FUNCTION
  1512. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_DATE : DATE (*converts a LREAL value (64 bits floating point number) to a DATE value (32 bits date in seconds)*)
  1513. VAR_INPUT
  1514. IN :LREAL; (*input value*)
  1515. END_VAR
  1516. END_FUNCTION
  1517. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_TOD : TOD (*converts a LREAL value (64 bits floating point number) to a TOD value (32 bits time of day in milliseconds)*)
  1518. VAR_INPUT
  1519. IN :LREAL; (*input value*)
  1520. END_VAR
  1521. END_FUNCTION
  1522. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_REAL : REAL (*converts a LREAL value (64 bits floating point number) to a REAL value (32 bits floating point number)*)
  1523. VAR_INPUT
  1524. IN :LREAL; (*input value*)
  1525. END_VAR
  1526. END_FUNCTION
  1527. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_STRING : STRING[80] (*converts a LREAL value (64 bits floating point number) to a STRING value with variable length*)
  1528. VAR_INPUT
  1529. IN :LREAL; (*input value*)
  1530. END_VAR
  1531. END_FUNCTION
  1532. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LREAL_TO_WSTRING : WSTRING[80] (*converts a LREAL value (64 bits floating point number) to a WSTRING value with variable length*)
  1533. VAR_INPUT
  1534. IN :LREAL; (*input value*)
  1535. END_VAR
  1536. END_FUNCTION
  1537. (*STRING_TO_ functions*)
  1538. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_BOOL : BOOL (*converts a STRING value with variable length to a BOOL value (1 bit)*)
  1539. VAR_INPUT
  1540. IN :STRING[80]; (*input value*)
  1541. END_VAR
  1542. END_FUNCTION
  1543. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_BYTE : BYTE (*converts a STRING value with variable length to a BYTE value (8 bits unsigned)*)
  1544. VAR_INPUT
  1545. IN :STRING[80]; (*input value*)
  1546. END_VAR
  1547. END_FUNCTION
  1548. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_WORD : WORD (*converts a STRING value with variable length to a WORD value (16 bits unsigned)*)
  1549. VAR_INPUT
  1550. IN :STRING[80]; (*input value*)
  1551. END_VAR
  1552. END_FUNCTION
  1553. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_DWORD : DWORD (*converts a STRING value with variable length to a DWORD value (32 bits unsigned)*)
  1554. VAR_INPUT
  1555. IN :STRING[80]; (*input value*)
  1556. END_VAR
  1557. END_FUNCTION
  1558. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_SINT : SINT (*converts a STRING value with variable length to a SINT value (8 bits signed)*)
  1559. VAR_INPUT
  1560. IN :STRING[80]; (*input value*)
  1561. END_VAR
  1562. END_FUNCTION
  1563. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_INT : INT (*converts a STRING value with variable length to an INT value (16 bits signed)*)
  1564. VAR_INPUT
  1565. IN :STRING[80]; (*input value*)
  1566. END_VAR
  1567. END_FUNCTION
  1568. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_DINT : DINT (*converts a STRING value with variable length to a DINT value (32 bits signed)*)
  1569. VAR_INPUT
  1570. IN :STRING[80]; (*input value*)
  1571. END_VAR
  1572. END_FUNCTION
  1573. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_USINT : USINT (*converts a STRING value with variable length to a USINT value (8 bits unsigned)*)
  1574. VAR_INPUT
  1575. IN :STRING[80]; (*input value*)
  1576. END_VAR
  1577. END_FUNCTION
  1578. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_UINT : UINT (*converts a STRING value with variable length to a UINT value (16 bits unsigned)*)
  1579. VAR_INPUT
  1580. IN :STRING[80]; (*input value*)
  1581. END_VAR
  1582. END_FUNCTION
  1583. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_UDINT : UDINT (*converts a STRING value with variable length to a UDINT value (32 bits unsigned)*)
  1584. VAR_INPUT
  1585. IN :STRING[80]; (*input value*)
  1586. END_VAR
  1587. END_FUNCTION
  1588. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_TIME : TIME (*converts a STRING value with variable length to a TIME value (32 bits time in milliseconds)*)
  1589. VAR_INPUT
  1590. IN :STRING[80]; (*input value*)
  1591. END_VAR
  1592. END_FUNCTION
  1593. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_DT : DT (*converts a STRING value with variable length to a DATE_AND_TIME value (32 bits date in seconds)*)
  1594. VAR_INPUT
  1595. IN :STRING[80]; (*input value*)
  1596. END_VAR
  1597. END_FUNCTION
  1598. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_DATE : DATE (*converts a STRING value with variable length to a DATE value (32 bits date in seconds)*)
  1599. VAR_INPUT
  1600. IN :STRING[80]; (*input value*)
  1601. END_VAR
  1602. END_FUNCTION
  1603. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_TOD : TOD (*converts a STRING value with variable length to a TOD value (32 bits time of day in milliseconds)*)
  1604. VAR_INPUT
  1605. IN :STRING[80]; (*input value*)
  1606. END_VAR
  1607. END_FUNCTION
  1608. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_REAL : REAL (*converts a STRING value with variable length to a REAL value (32 bits floating point number)*)
  1609. VAR_INPUT
  1610. IN :STRING[80]; (*input value*)
  1611. END_VAR
  1612. END_FUNCTION
  1613. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_LREAL : LREAL (*converts a STRING value with variable length to a LREAL value (64 bits floating point number)*)
  1614. VAR_INPUT
  1615. IN :STRING[80]; (*input value*)
  1616. END_VAR
  1617. END_FUNCTION
  1618. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION STRING_TO_WSTRING : WSTRING (*converts a STRING value with variable length to a WSTRING value with variable length*)
  1619. VAR_INPUT
  1620. IN :STRING[80]; (*input value*)
  1621. END_VAR
  1622. END_FUNCTION
  1623. (*WSTRING_TO_ functions*)
  1624. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_BOOL : BOOL (*converts a WSTRING value with variable length to a BOOL value (1 bit)*)
  1625. VAR_INPUT
  1626. IN :WSTRING[80]; (*input value*)
  1627. END_VAR
  1628. END_FUNCTION
  1629. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_BYTE : BYTE (*converts a WSTRING value with variable length to a BYTE value (8 bits unsigned)*)
  1630. VAR_INPUT
  1631. IN :WSTRING[80]; (*input value*)
  1632. END_VAR
  1633. END_FUNCTION
  1634. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_WORD : WORD (*converts a WSTRING value with variable length to a WORD value (16 bits unsigned)*)
  1635. VAR_INPUT
  1636. IN :WSTRING[80]; (*input value*)
  1637. END_VAR
  1638. END_FUNCTION
  1639. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_DWORD : DWORD (*converts a WSTRING value with variable length to a DWORD value (32 bits unsigned)*)
  1640. VAR_INPUT
  1641. IN :WSTRING[80]; (*input value*)
  1642. END_VAR
  1643. END_FUNCTION
  1644. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_SINT : SINT (*converts a WSTRING value with variable length to a SINT value (8 bits signed)*)
  1645. VAR_INPUT
  1646. IN :WSTRING[80]; (*input value*)
  1647. END_VAR
  1648. END_FUNCTION
  1649. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_INT : INT (*converts a WSTRING value with variable length to an INT value (16 bits signed)*)
  1650. VAR_INPUT
  1651. IN :WSTRING[80]; (*input value*)
  1652. END_VAR
  1653. END_FUNCTION
  1654. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_DINT : DINT (*converts a WSTRING value with variable length to a DINT value (32 bits signed)*)
  1655. VAR_INPUT
  1656. IN :WSTRING[80]; (*input value*)
  1657. END_VAR
  1658. END_FUNCTION
  1659. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_USINT : USINT (*converts a WSTRING value with variable length to a USINT value (8 bits unsigned)*)
  1660. VAR_INPUT
  1661. IN :WSTRING[80]; (*input value*)
  1662. END_VAR
  1663. END_FUNCTION
  1664. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_UINT : UINT (*converts a WSTRING value with variable length to a UINT value (16 bits unsigned)*)
  1665. VAR_INPUT
  1666. IN :WSTRING[80]; (*input value*)
  1667. END_VAR
  1668. END_FUNCTION
  1669. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_UDINT : UDINT (*converts a WSTRING value with variable length to a UDINT value (32 bits unsigned)*)
  1670. VAR_INPUT
  1671. IN :WSTRING[80]; (*input value*)
  1672. END_VAR
  1673. END_FUNCTION
  1674. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_TIME : TIME (*converts a WSTRING value with variable length to a TIME value (32 bits time in milliseconds)*)
  1675. VAR_INPUT
  1676. IN :WSTRING[80]; (*input value*)
  1677. END_VAR
  1678. END_FUNCTION
  1679. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_DT : DT (*converts a WSTRING value with variable length to a DATE_AND_TIME value (32 bits date in seconds)*)
  1680. VAR_INPUT
  1681. IN :WSTRING[80]; (*input value*)
  1682. END_VAR
  1683. END_FUNCTION
  1684. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_DATE : DATE (*converts a WSTRING value with variable length to a DATE value (32 bits date in seconds)*)
  1685. VAR_INPUT
  1686. IN :WSTRING[80]; (*input value*)
  1687. END_VAR
  1688. END_FUNCTION
  1689. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_TOD : TOD (*converts a WSTRING value with variable length to a TOD value (32 bits time of day in milliseconds)*)
  1690. VAR_INPUT
  1691. IN :WSTRING[80]; (*input value*)
  1692. END_VAR
  1693. END_FUNCTION
  1694. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_REAL : REAL (*converts a WSTRING value with variable length to a REAL value (32 bits floating point number)*)
  1695. VAR_INPUT
  1696. IN :WSTRING[80]; (*input value*)
  1697. END_VAR
  1698. END_FUNCTION
  1699. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_LREAL : LREAL (*converts a WSTRING value with variable length to a LREAL value (64 bits floating point number)*)
  1700. VAR_INPUT
  1701. IN :WSTRING[80]; (*input value*)
  1702. END_VAR
  1703. END_FUNCTION
  1704. {REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION WSTRING_TO_STRING : STRING[80] (*converts a WSTRING value with variable length to a STRING value with variable length*)
  1705. VAR_INPUT
  1706. IN :WSTRING[80]; (*input value*)
  1707. END_VAR
  1708. END_FUNCTION