Newer
Older
SCADA / plc / GRFICS_Workstation_Docs / Documents / attack / plc.xml
root on 8 May 2022 225 KB playing with modbus day #1
  1. <?xml version='1.0' encoding='utf-8'?>
  2. <project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
  3. <fileHeader companyName="Unknown" productName="Unnamed" productVersion="1" creationDateTime="2020-02-03T18:31:26"/>
  4. <contentHeader name="Unnamed" modificationDateTime="2020-02-04T09:21:59">
  5. <coordinateInfo>
  6. <fbd>
  7. <scaling x="10" y="10"/>
  8. </fbd>
  9. <ld>
  10. <scaling x="10" y="10"/>
  11. </ld>
  12. <sfc>
  13. <scaling x="10" y="10"/>
  14. </sfc>
  15. </coordinateInfo>
  16. </contentHeader>
  17. <types>
  18. <dataTypes/>
  19. <pous>
  20. <pou name="main" pouType="program">
  21. <interface>
  22. <localVars>
  23. <variable name="flow_control0">
  24. <type>
  25. <derived name="flow_control"/>
  26. </type>
  27. </variable>
  28. <variable name="first_run">
  29. <type>
  30. <BOOL/>
  31. </type>
  32. <initialValue>
  33. <simpleValue value="True"/>
  34. </initialValue>
  35. </variable>
  36. </localVars>
  37. <localVars>
  38. <variable name="flow_set" address="%MW0">
  39. <type>
  40. <UINT/>
  41. </type>
  42. </variable>
  43. <variable name="a_setpoint" address="%MW1">
  44. <type>
  45. <UINT/>
  46. </type>
  47. </variable>
  48. <variable name="pressure_sp" address="%MW2">
  49. <type>
  50. <UINT/>
  51. </type>
  52. </variable>
  53. <variable name="override_sp" address="%MW3">
  54. <type>
  55. <UINT/>
  56. </type>
  57. </variable>
  58. <variable name="level_sp" address="%MW4">
  59. <type>
  60. <UINT/>
  61. </type>
  62. </variable>
  63. </localVars>
  64. <localVars>
  65. <variable name="composition_control0">
  66. <type>
  67. <derived name="composition_control"/>
  68. </type>
  69. </variable>
  70. <variable name="scale_to_signed0">
  71. <type>
  72. <derived name="scale_to_signed"/>
  73. </type>
  74. </variable>
  75. </localVars>
  76. <localVars>
  77. <variable name="f1_valve_pos" address="%IW0">
  78. <type>
  79. <UINT/>
  80. </type>
  81. </variable>
  82. <variable name="f1_flow" address="%IW1">
  83. <type>
  84. <UINT/>
  85. </type>
  86. </variable>
  87. <variable name="f2_valve_pos" address="%IW2">
  88. <type>
  89. <UINT/>
  90. </type>
  91. </variable>
  92. <variable name="f2_flow" address="%IW3">
  93. <type>
  94. <UINT/>
  95. </type>
  96. </variable>
  97. <variable name="purge_valve_pos" address="%IW4">
  98. <type>
  99. <UINT/>
  100. </type>
  101. </variable>
  102. <variable name="purge_flow" address="%IW5">
  103. <type>
  104. <UINT/>
  105. </type>
  106. </variable>
  107. <variable name="product_valve_pos" address="%IW6">
  108. <type>
  109. <UINT/>
  110. </type>
  111. </variable>
  112. <variable name="product_flow" address="%IW7">
  113. <type>
  114. <UINT/>
  115. </type>
  116. </variable>
  117. <variable name="pressure" address="%IW8">
  118. <type>
  119. <UINT/>
  120. </type>
  121. </variable>
  122. <variable name="level" address="%IW9">
  123. <type>
  124. <UINT/>
  125. </type>
  126. </variable>
  127. <variable name="a_in_purge" address="%IW10">
  128. <type>
  129. <UINT/>
  130. </type>
  131. </variable>
  132. <variable name="b_in_purge" address="%IW11">
  133. <type>
  134. <UINT/>
  135. </type>
  136. </variable>
  137. <variable name="c_in_purge" address="%IW12">
  138. <type>
  139. <UINT/>
  140. </type>
  141. </variable>
  142. <variable name="f1_valve_sp" address="%QW0">
  143. <type>
  144. <UINT/>
  145. </type>
  146. </variable>
  147. <variable name="f2_valve_sp" address="%QW1">
  148. <type>
  149. <UINT/>
  150. </type>
  151. </variable>
  152. <variable name="purge_valve_sp" address="%QW2">
  153. <type>
  154. <UINT/>
  155. </type>
  156. </variable>
  157. <variable name="product_valve_sp" address="%QW3">
  158. <type>
  159. <UINT/>
  160. </type>
  161. </variable>
  162. </localVars>
  163. <localVars>
  164. <variable name="product_valve_safe">
  165. <type>
  166. <UINT/>
  167. </type>
  168. <initialValue>
  169. <simpleValue value="0"/>
  170. </initialValue>
  171. </variable>
  172. <variable name="purge_valve_safe">
  173. <type>
  174. <UINT/>
  175. </type>
  176. <initialValue>
  177. <simpleValue value="65535"/>
  178. </initialValue>
  179. </variable>
  180. <variable name="f1_valve_safe">
  181. <type>
  182. <UINT/>
  183. </type>
  184. </variable>
  185. <variable name="f2_valve_safe">
  186. <type>
  187. <UINT/>
  188. </type>
  189. </variable>
  190. <variable name="pressure_control0">
  191. <type>
  192. <derived name="pressure_control"/>
  193. </type>
  194. </variable>
  195. </localVars>
  196. <localVars>
  197. <variable name="hmi_pressure" address="%MW20">
  198. <type>
  199. <INT/>
  200. </type>
  201. </variable>
  202. <variable name="hmi_level" address="%MW21">
  203. <type>
  204. <INT/>
  205. </type>
  206. </variable>
  207. <variable name="hmi_f1_valve_pos" address="%MW22">
  208. <type>
  209. <INT/>
  210. </type>
  211. </variable>
  212. <variable name="hmi_f1_flow" address="%MW23">
  213. <type>
  214. <INT/>
  215. </type>
  216. </variable>
  217. <variable name="hmi_f2_valve_pos" address="%MW24">
  218. <type>
  219. <INT/>
  220. </type>
  221. </variable>
  222. <variable name="hmi_f2_flow" address="%MW25">
  223. <type>
  224. <INT/>
  225. </type>
  226. </variable>
  227. <variable name="hmi_purge_valve_pos" address="%MW26">
  228. <type>
  229. <INT/>
  230. </type>
  231. </variable>
  232. <variable name="hmi_purge_flow" address="%MW27">
  233. <type>
  234. <INT/>
  235. </type>
  236. </variable>
  237. <variable name="hmi_product_valve_pos" address="%MW28">
  238. <type>
  239. <INT/>
  240. </type>
  241. </variable>
  242. <variable name="hmi_product_flow" address="%MW29">
  243. <type>
  244. <INT/>
  245. </type>
  246. </variable>
  247. <variable name="scan_count" address="%MW30">
  248. <type>
  249. <UINT/>
  250. </type>
  251. </variable>
  252. </localVars>
  253. <localVars>
  254. <variable name="scale_to_signed1">
  255. <type>
  256. <derived name="scale_to_signed"/>
  257. </type>
  258. </variable>
  259. <variable name="scale_to_signed2">
  260. <type>
  261. <derived name="scale_to_signed"/>
  262. </type>
  263. </variable>
  264. <variable name="scale_to_signed3">
  265. <type>
  266. <derived name="scale_to_signed"/>
  267. </type>
  268. </variable>
  269. <variable name="scale_to_signed4">
  270. <type>
  271. <derived name="scale_to_signed"/>
  272. </type>
  273. </variable>
  274. <variable name="scale_to_signed5">
  275. <type>
  276. <derived name="scale_to_signed"/>
  277. </type>
  278. </variable>
  279. <variable name="scale_to_signed6">
  280. <type>
  281. <derived name="scale_to_signed"/>
  282. </type>
  283. </variable>
  284. <variable name="scale_to_signed7">
  285. <type>
  286. <derived name="scale_to_signed"/>
  287. </type>
  288. </variable>
  289. <variable name="scale_to_signed8">
  290. <type>
  291. <derived name="scale_to_signed"/>
  292. </type>
  293. </variable>
  294. <variable name="scale_to_signed9">
  295. <type>
  296. <derived name="scale_to_signed"/>
  297. </type>
  298. </variable>
  299. <variable name="pressure_override0">
  300. <type>
  301. <derived name="pressure_override"/>
  302. </type>
  303. </variable>
  304. <variable name="level_control0">
  305. <type>
  306. <derived name="level_control"/>
  307. </type>
  308. </variable>
  309. </localVars>
  310. <externalVars>
  311. <variable name="run_bit">
  312. <type>
  313. <BOOL/>
  314. </type>
  315. </variable>
  316. </externalVars>
  317. <localVars>
  318. <variable name="run_bit0">
  319. <type>
  320. <BOOL/>
  321. </type>
  322. <initialValue>
  323. <simpleValue value="True"/>
  324. </initialValue>
  325. </variable>
  326. <variable name="initialize_sp0">
  327. <type>
  328. <derived name="initialize_sp"/>
  329. </type>
  330. </variable>
  331. </localVars>
  332. </interface>
  333. <body>
  334. <LD>
  335. <block localId="3" typeName="flow_control" instanceName="flow_control0" height="80" width="219">
  336. <position x="250" y="521"/>
  337. <inputVariables>
  338. <variable formalParameter="product_flow">
  339. <connectionPointIn>
  340. <relPosition x="0" y="29"/>
  341. <connection refLocalId="6">
  342. <position x="250" y="550"/>
  343. <position x="240" y="550"/>
  344. <position x="240" y="510"/>
  345. <position x="108" y="510"/>
  346. </connection>
  347. </connectionPointIn>
  348. </variable>
  349. <variable formalParameter="curr_pos">
  350. <connectionPointIn>
  351. <relPosition x="0" y="49"/>
  352. <connection refLocalId="64">
  353. <position x="250" y="570"/>
  354. <position x="162" y="570"/>
  355. </connection>
  356. </connectionPointIn>
  357. </variable>
  358. <variable formalParameter="flow_set_in">
  359. <connectionPointIn>
  360. <relPosition x="0" y="69"/>
  361. <connection refLocalId="1">
  362. <position x="250" y="590"/>
  363. <position x="237" y="590"/>
  364. <position x="237" y="640"/>
  365. <position x="173" y="640"/>
  366. </connection>
  367. </connectionPointIn>
  368. </variable>
  369. </inputVariables>
  370. <inOutVariables/>
  371. <outputVariables>
  372. <variable formalParameter="new_pos">
  373. <connectionPointOut>
  374. <relPosition x="219" y="29"/>
  375. </connectionPointOut>
  376. </variable>
  377. </outputVariables>
  378. </block>
  379. <inVariable localId="6" height="27" width="106" negated="false">
  380. <position x="2" y="494"/>
  381. <connectionPointOut>
  382. <relPosition x="106" y="16"/>
  383. </connectionPointOut>
  384. <expression>product_flow</expression>
  385. </inVariable>
  386. <inVariable localId="1" height="27" width="103" negated="false" executionOrderId="0">
  387. <position x="70" y="629"/>
  388. <connectionPointOut>
  389. <relPosition x="103" y="11"/>
  390. </connectionPointOut>
  391. <expression>flow_set</expression>
  392. </inVariable>
  393. <rightPowerRail localId="14" height="928" width="3">
  394. <position x="943" y="279"/>
  395. <connectionPointIn>
  396. <relPosition x="0" y="20"/>
  397. </connectionPointIn>
  398. <connectionPointIn>
  399. <relPosition x="0" y="131"/>
  400. </connectionPointIn>
  401. <connectionPointIn>
  402. <relPosition x="0" y="242"/>
  403. </connectionPointIn>
  404. <connectionPointIn>
  405. <relPosition x="0" y="353"/>
  406. </connectionPointIn>
  407. <connectionPointIn>
  408. <relPosition x="0" y="464"/>
  409. </connectionPointIn>
  410. <connectionPointIn>
  411. <relPosition x="0" y="575"/>
  412. </connectionPointIn>
  413. <connectionPointIn>
  414. <relPosition x="0" y="686"/>
  415. </connectionPointIn>
  416. <connectionPointIn>
  417. <relPosition x="0" y="797"/>
  418. </connectionPointIn>
  419. <connectionPointIn>
  420. <relPosition x="0" y="908"/>
  421. </connectionPointIn>
  422. </rightPowerRail>
  423. <inVariable localId="15" height="27" width="103" negated="false" executionOrderId="0">
  424. <position x="28" y="945"/>
  425. <connectionPointOut>
  426. <relPosition x="103" y="15"/>
  427. </connectionPointOut>
  428. <expression>a_setpoint</expression>
  429. </inVariable>
  430. <inVariable localId="18" height="27" width="103" negated="false" executionOrderId="0">
  431. <position x="42" y="895"/>
  432. <connectionPointOut>
  433. <relPosition x="103" y="15"/>
  434. </connectionPointOut>
  435. <expression>a_in_purge</expression>
  436. </inVariable>
  437. <block localId="27" typeName="composition_control" instanceName="composition_control0" height="80" width="162">
  438. <position x="364" y="900"/>
  439. <inputVariables>
  440. <variable formalParameter="a_in_purge">
  441. <connectionPointIn>
  442. <relPosition x="0" y="30"/>
  443. <connection refLocalId="18">
  444. <position x="364" y="930"/>
  445. <position x="261" y="930"/>
  446. <position x="261" y="910"/>
  447. <position x="145" y="910"/>
  448. </connection>
  449. </connectionPointIn>
  450. </variable>
  451. <variable formalParameter="a_setpoint">
  452. <connectionPointIn>
  453. <relPosition x="0" y="50"/>
  454. <connection refLocalId="15">
  455. <position x="364" y="950"/>
  456. <position x="261" y="950"/>
  457. <position x="261" y="960"/>
  458. <position x="131" y="960"/>
  459. </connection>
  460. </connectionPointIn>
  461. </variable>
  462. <variable formalParameter="curr_pos">
  463. <connectionPointIn>
  464. <relPosition x="0" y="70"/>
  465. <connection refLocalId="65">
  466. <position x="364" y="970"/>
  467. <position x="290" y="970"/>
  468. <position x="290" y="1010"/>
  469. <position x="224" y="1010"/>
  470. </connection>
  471. </connectionPointIn>
  472. </variable>
  473. </inputVariables>
  474. <inOutVariables/>
  475. <outputVariables>
  476. <variable formalParameter="new_pos">
  477. <connectionPointOut>
  478. <relPosition x="162" y="30"/>
  479. </connectionPointOut>
  480. </variable>
  481. </outputVariables>
  482. </block>
  483. <comment localId="55" height="140" width="642">
  484. <position x="100" y="0"/>
  485. <content>
  486. <xhtml:p><![CDATA[Main control loops:
  487. 1. Product Flow
  488. 2. Pressure
  489. 3. Composition
  490. 4. Pressure Override
  491. 5. Tank level]]></xhtml:p>
  492. </content>
  493. </comment>
  494. <comment localId="56" height="42" width="557">
  495. <position x="106" y="1683"/>
  496. <content>
  497. <xhtml:p><![CDATA[Scale variables for HMI (it treats everything as signed integers)]]></xhtml:p>
  498. </content>
  499. </comment>
  500. <block localId="57" typeName="scale_to_signed" instanceName="scale_to_signed0" height="40" width="175">
  501. <position x="268" y="1761"/>
  502. <inputVariables>
  503. <variable formalParameter="input_uint">
  504. <connectionPointIn>
  505. <relPosition x="0" y="29"/>
  506. <connection refLocalId="62">
  507. <position x="268" y="1790"/>
  508. <position x="230" y="1790"/>
  509. </connection>
  510. </connectionPointIn>
  511. </variable>
  512. </inputVariables>
  513. <inOutVariables/>
  514. <outputVariables>
  515. <variable formalParameter="output_int">
  516. <connectionPointOut>
  517. <relPosition x="175" y="29"/>
  518. </connectionPointOut>
  519. </variable>
  520. </outputVariables>
  521. </block>
  522. <outVariable localId="58" height="27" width="98" negated="false">
  523. <position x="548" y="542"/>
  524. <connectionPointIn>
  525. <relPosition x="0" y="18"/>
  526. <connection refLocalId="3" formalParameter="new_pos">
  527. <position x="548" y="560"/>
  528. <position x="508" y="560"/>
  529. <position x="508" y="550"/>
  530. <position x="469" y="550"/>
  531. </connection>
  532. </connectionPointIn>
  533. <expression>f1_valve_sp</expression>
  534. </outVariable>
  535. <outVariable localId="59" height="27" width="99" negated="false">
  536. <position x="591" y="910"/>
  537. <connectionPointIn>
  538. <relPosition x="0" y="10"/>
  539. <connection refLocalId="27" formalParameter="new_pos">
  540. <position x="591" y="920"/>
  541. <position x="557" y="920"/>
  542. <position x="557" y="930"/>
  543. <position x="526" y="930"/>
  544. </connection>
  545. </connectionPointIn>
  546. <expression>f2_valve_sp</expression>
  547. </outVariable>
  548. <inVariable localId="22" height="27" width="103" negated="false" executionOrderId="0">
  549. <position x="93" y="765"/>
  550. <connectionPointOut>
  551. <relPosition x="103" y="15"/>
  552. </connectionPointOut>
  553. <expression>pressure_sp</expression>
  554. </inVariable>
  555. <inVariable localId="31" height="27" width="103" negated="false" executionOrderId="0">
  556. <position x="54" y="707"/>
  557. <connectionPointOut>
  558. <relPosition x="103" y="13"/>
  559. </connectionPointOut>
  560. <expression>pressure</expression>
  561. </inVariable>
  562. <block localId="38" typeName="pressure_control" instanceName="pressure_control0" height="80" width="175" executionOrderId="0">
  563. <position x="428" y="711"/>
  564. <inputVariables>
  565. <variable formalParameter="pressure">
  566. <connectionPointIn>
  567. <relPosition x="0" y="29"/>
  568. <connection refLocalId="31">
  569. <position x="428" y="740"/>
  570. <position x="292" y="740"/>
  571. <position x="292" y="720"/>
  572. <position x="157" y="720"/>
  573. </connection>
  574. </connectionPointIn>
  575. </variable>
  576. <variable formalParameter="pressure_sp">
  577. <connectionPointIn>
  578. <relPosition x="0" y="49"/>
  579. <connection refLocalId="22">
  580. <position x="428" y="760"/>
  581. <position x="322" y="760"/>
  582. <position x="322" y="780"/>
  583. <position x="196" y="780"/>
  584. </connection>
  585. </connectionPointIn>
  586. </variable>
  587. <variable formalParameter="curr_pos">
  588. <connectionPointIn>
  589. <relPosition x="0" y="69"/>
  590. <connection refLocalId="66">
  591. <position x="428" y="780"/>
  592. <position x="408" y="780"/>
  593. <position x="408" y="820"/>
  594. <position x="347" y="820"/>
  595. </connection>
  596. </connectionPointIn>
  597. </variable>
  598. </inputVariables>
  599. <inOutVariables/>
  600. <outputVariables>
  601. <variable formalParameter="valve_pos">
  602. <connectionPointOut>
  603. <relPosition x="175" y="29"/>
  604. </connectionPointOut>
  605. </variable>
  606. </outputVariables>
  607. </block>
  608. <inVariable localId="62" height="27" width="74" negated="false">
  609. <position x="156" y="1781"/>
  610. <connectionPointOut>
  611. <relPosition x="74" y="9"/>
  612. </connectionPointOut>
  613. <expression>pressure</expression>
  614. </inVariable>
  615. <outVariable localId="63" height="27" width="106" negated="false">
  616. <position x="496" y="1765"/>
  617. <connectionPointIn>
  618. <relPosition x="0" y="15"/>
  619. <connection refLocalId="57" formalParameter="output_int">
  620. <position x="496" y="1780"/>
  621. <position x="455" y="1780"/>
  622. <position x="455" y="1790"/>
  623. <position x="443" y="1790"/>
  624. </connection>
  625. </connectionPointIn>
  626. <expression>hmi_pressure</expression>
  627. </outVariable>
  628. <block localId="2" typeName="scale_to_signed" instanceName="scale_to_signed1" height="40" width="175" executionOrderId="0">
  629. <position x="251" y="1840"/>
  630. <inputVariables>
  631. <variable formalParameter="input_uint">
  632. <connectionPointIn>
  633. <relPosition x="0" y="30"/>
  634. <connection refLocalId="4">
  635. <position x="251" y="1870"/>
  636. <position x="209" y="1870"/>
  637. </connection>
  638. </connectionPointIn>
  639. </variable>
  640. </inputVariables>
  641. <inOutVariables/>
  642. <outputVariables>
  643. <variable formalParameter="output_int">
  644. <connectionPointOut>
  645. <relPosition x="175" y="30"/>
  646. </connectionPointOut>
  647. </variable>
  648. </outputVariables>
  649. </block>
  650. <inVariable localId="4" height="27" width="70" negated="false" executionOrderId="0">
  651. <position x="139" y="1860"/>
  652. <connectionPointOut>
  653. <relPosition x="70" y="13"/>
  654. </connectionPointOut>
  655. <expression>level</expression>
  656. </inVariable>
  657. <outVariable localId="5" height="27" width="103" negated="false" executionOrderId="0">
  658. <position x="479" y="1844"/>
  659. <connectionPointIn>
  660. <relPosition x="0" y="13"/>
  661. <connection refLocalId="2" formalParameter="output_int">
  662. <position x="479" y="1857"/>
  663. <position x="438" y="1857"/>
  664. <position x="438" y="1870"/>
  665. <position x="412" y="1870"/>
  666. </connection>
  667. </connectionPointIn>
  668. <expression>hmi_level</expression>
  669. </outVariable>
  670. <block localId="7" typeName="scale_to_signed" instanceName="scale_to_signed2" height="40" width="175" executionOrderId="0">
  671. <position x="250" y="1922"/>
  672. <inputVariables>
  673. <variable formalParameter="input_uint">
  674. <connectionPointIn>
  675. <relPosition x="0" y="28"/>
  676. <connection refLocalId="8">
  677. <position x="250" y="1950"/>
  678. <position x="229" y="1950"/>
  679. <position x="229" y="1953"/>
  680. <position x="247" y="1953"/>
  681. <position x="247" y="1950"/>
  682. <position x="226" y="1950"/>
  683. </connection>
  684. </connectionPointIn>
  685. </variable>
  686. </inputVariables>
  687. <inOutVariables/>
  688. <outputVariables>
  689. <variable formalParameter="output_int">
  690. <connectionPointOut>
  691. <relPosition x="175" y="28"/>
  692. </connectionPointOut>
  693. </variable>
  694. </outputVariables>
  695. </block>
  696. <inVariable localId="8" height="27" width="106" negated="false" executionOrderId="0">
  697. <position x="120" y="1936"/>
  698. <connectionPointOut>
  699. <relPosition x="106" y="14"/>
  700. </connectionPointOut>
  701. <expression>f1_valve_pos</expression>
  702. </inVariable>
  703. <outVariable localId="9" height="27" width="138" negated="false" executionOrderId="0">
  704. <position x="478" y="1926"/>
  705. <connectionPointIn>
  706. <relPosition x="0" y="14"/>
  707. <connection refLocalId="7" formalParameter="output_int">
  708. <position x="478" y="1940"/>
  709. <position x="437" y="1940"/>
  710. <position x="437" y="1950"/>
  711. <position x="425" y="1950"/>
  712. </connection>
  713. </connectionPointIn>
  714. <expression>hmi_f1_valve_pos</expression>
  715. </outVariable>
  716. <block localId="10" typeName="scale_to_signed" instanceName="scale_to_signed3" height="40" width="175" executionOrderId="0">
  717. <position x="241" y="2014"/>
  718. <inputVariables>
  719. <variable formalParameter="input_uint">
  720. <connectionPointIn>
  721. <relPosition x="0" y="26"/>
  722. <connection refLocalId="11">
  723. <position x="241" y="2040"/>
  724. <position x="220" y="2040"/>
  725. <position x="220" y="2045"/>
  726. <position x="245" y="2045"/>
  727. <position x="245" y="2050"/>
  728. <position x="235" y="2050"/>
  729. </connection>
  730. </connectionPointIn>
  731. </variable>
  732. </inputVariables>
  733. <inOutVariables/>
  734. <outputVariables>
  735. <variable formalParameter="output_int">
  736. <connectionPointOut>
  737. <relPosition x="175" y="26"/>
  738. </connectionPointOut>
  739. </variable>
  740. </outputVariables>
  741. </block>
  742. <inVariable localId="11" height="27" width="106" negated="false" executionOrderId="0">
  743. <position x="129" y="2034"/>
  744. <connectionPointOut>
  745. <relPosition x="106" y="16"/>
  746. </connectionPointOut>
  747. <expression>f2_valve_pos</expression>
  748. </inVariable>
  749. <outVariable localId="12" height="27" width="138" negated="false" executionOrderId="0">
  750. <position x="469" y="2018"/>
  751. <connectionPointIn>
  752. <relPosition x="0" y="12"/>
  753. <connection refLocalId="10" formalParameter="output_int">
  754. <position x="469" y="2030"/>
  755. <position x="428" y="2030"/>
  756. <position x="428" y="2040"/>
  757. <position x="416" y="2040"/>
  758. </connection>
  759. </connectionPointIn>
  760. <expression>hmi_f2_valve_pos</expression>
  761. </outVariable>
  762. <block localId="13" typeName="scale_to_signed" instanceName="scale_to_signed4" height="40" width="175" executionOrderId="0">
  763. <position x="255" y="2079"/>
  764. <inputVariables>
  765. <variable formalParameter="input_uint">
  766. <connectionPointIn>
  767. <relPosition x="0" y="31"/>
  768. <connection refLocalId="16">
  769. <position x="255" y="2110"/>
  770. <position x="228" y="2110"/>
  771. <position x="228" y="2124"/>
  772. <position x="273" y="2124"/>
  773. <position x="273" y="2130"/>
  774. <position x="206" y="2130"/>
  775. </connection>
  776. </connectionPointIn>
  777. </variable>
  778. </inputVariables>
  779. <inOutVariables/>
  780. <outputVariables>
  781. <variable formalParameter="output_int">
  782. <connectionPointOut>
  783. <relPosition x="175" y="31"/>
  784. </connectionPointOut>
  785. </variable>
  786. </outputVariables>
  787. </block>
  788. <inVariable localId="16" height="27" width="130" negated="false" executionOrderId="0">
  789. <position x="76" y="2116"/>
  790. <connectionPointOut>
  791. <relPosition x="130" y="14"/>
  792. </connectionPointOut>
  793. <expression>purge_valve_pos</expression>
  794. </inVariable>
  795. <outVariable localId="17" height="27" width="162" negated="false" executionOrderId="0">
  796. <position x="477" y="2097"/>
  797. <connectionPointIn>
  798. <relPosition x="0" y="13"/>
  799. <connection refLocalId="13" formalParameter="output_int">
  800. <position x="477" y="2110"/>
  801. <position x="465" y="2110"/>
  802. <position x="465" y="2112"/>
  803. <position x="474" y="2112"/>
  804. <position x="474" y="2110"/>
  805. <position x="430" y="2110"/>
  806. </connection>
  807. </connectionPointIn>
  808. <expression>hmi_purge_valve_pos</expression>
  809. </outVariable>
  810. <block localId="19" typeName="scale_to_signed" instanceName="scale_to_signed5" height="40" width="175" executionOrderId="0">
  811. <position x="244" y="2170"/>
  812. <inputVariables>
  813. <variable formalParameter="input_uint">
  814. <connectionPointIn>
  815. <relPosition x="0" y="30"/>
  816. <connection refLocalId="20">
  817. <position x="244" y="2200"/>
  818. <position x="223" y="2200"/>
  819. <position x="223" y="2201"/>
  820. <position x="282" y="2201"/>
  821. <position x="282" y="2200"/>
  822. <position x="216" y="2200"/>
  823. </connection>
  824. </connectionPointIn>
  825. </variable>
  826. </inputVariables>
  827. <inOutVariables/>
  828. <outputVariables>
  829. <variable formalParameter="output_int">
  830. <connectionPointOut>
  831. <relPosition x="175" y="30"/>
  832. </connectionPointOut>
  833. </variable>
  834. </outputVariables>
  835. </block>
  836. <inVariable localId="20" height="27" width="146" negated="false" executionOrderId="0">
  837. <position x="70" y="2187"/>
  838. <connectionPointOut>
  839. <relPosition x="146" y="13"/>
  840. </connectionPointOut>
  841. <expression>product_valve_pos</expression>
  842. </inVariable>
  843. <outVariable localId="21" height="27" width="178" negated="false" executionOrderId="0">
  844. <position x="472" y="2174"/>
  845. <connectionPointIn>
  846. <relPosition x="0" y="16"/>
  847. <connection refLocalId="19" formalParameter="output_int">
  848. <position x="472" y="2190"/>
  849. <position x="431" y="2190"/>
  850. <position x="431" y="2200"/>
  851. <position x="419" y="2200"/>
  852. </connection>
  853. </connectionPointIn>
  854. <expression>hmi_product_valve_pos</expression>
  855. </outVariable>
  856. <block localId="23" typeName="scale_to_signed" instanceName="scale_to_signed6" height="40" width="175" executionOrderId="0">
  857. <position x="236" y="2248"/>
  858. <inputVariables>
  859. <variable formalParameter="input_uint">
  860. <connectionPointIn>
  861. <relPosition x="0" y="32"/>
  862. <connection refLocalId="24">
  863. <position x="236" y="2280"/>
  864. <position x="194" y="2280"/>
  865. </connection>
  866. </connectionPointIn>
  867. </variable>
  868. </inputVariables>
  869. <inOutVariables/>
  870. <outputVariables>
  871. <variable formalParameter="output_int">
  872. <connectionPointOut>
  873. <relPosition x="175" y="32"/>
  874. </connectionPointOut>
  875. </variable>
  876. </outputVariables>
  877. </block>
  878. <inVariable localId="24" height="27" width="70" negated="false" executionOrderId="0">
  879. <position x="124" y="2268"/>
  880. <connectionPointOut>
  881. <relPosition x="70" y="13"/>
  882. </connectionPointOut>
  883. <expression>f1_flow</expression>
  884. </inVariable>
  885. <outVariable localId="25" height="27" width="103" negated="false" executionOrderId="0">
  886. <position x="464" y="2252"/>
  887. <connectionPointIn>
  888. <relPosition x="0" y="13"/>
  889. <connection refLocalId="23" formalParameter="output_int">
  890. <position x="464" y="2265"/>
  891. <position x="423" y="2265"/>
  892. <position x="423" y="2278"/>
  893. <position x="397" y="2278"/>
  894. </connection>
  895. </connectionPointIn>
  896. <expression>hmi_f1_flow</expression>
  897. </outVariable>
  898. <block localId="26" typeName="scale_to_signed" instanceName="scale_to_signed7" height="40" width="175" executionOrderId="0">
  899. <position x="231" y="2330"/>
  900. <inputVariables>
  901. <variable formalParameter="input_uint">
  902. <connectionPointIn>
  903. <relPosition x="0" y="30"/>
  904. <connection refLocalId="28">
  905. <position x="231" y="2360"/>
  906. <position x="189" y="2360"/>
  907. </connection>
  908. </connectionPointIn>
  909. </variable>
  910. </inputVariables>
  911. <inOutVariables/>
  912. <outputVariables>
  913. <variable formalParameter="output_int">
  914. <connectionPointOut>
  915. <relPosition x="175" y="30"/>
  916. </connectionPointOut>
  917. </variable>
  918. </outputVariables>
  919. </block>
  920. <inVariable localId="28" height="27" width="70" negated="false" executionOrderId="0">
  921. <position x="119" y="2350"/>
  922. <connectionPointOut>
  923. <relPosition x="70" y="13"/>
  924. </connectionPointOut>
  925. <expression>f2_flow</expression>
  926. </inVariable>
  927. <outVariable localId="29" height="27" width="103" negated="false" executionOrderId="0">
  928. <position x="459" y="2334"/>
  929. <connectionPointIn>
  930. <relPosition x="0" y="13"/>
  931. <connection refLocalId="26" formalParameter="output_int">
  932. <position x="459" y="2347"/>
  933. <position x="418" y="2347"/>
  934. <position x="418" y="2360"/>
  935. <position x="392" y="2360"/>
  936. </connection>
  937. </connectionPointIn>
  938. <expression>hmi_f2_flow</expression>
  939. </outVariable>
  940. <block localId="30" typeName="scale_to_signed" instanceName="scale_to_signed8" height="40" width="175" executionOrderId="0">
  941. <position x="228" y="2403"/>
  942. <inputVariables>
  943. <variable formalParameter="input_uint">
  944. <connectionPointIn>
  945. <relPosition x="0" y="27"/>
  946. <connection refLocalId="32">
  947. <position x="228" y="2430"/>
  948. <position x="215" y="2430"/>
  949. <position x="215" y="2440"/>
  950. <position x="185" y="2440"/>
  951. </connection>
  952. </connectionPointIn>
  953. </variable>
  954. </inputVariables>
  955. <inOutVariables/>
  956. <outputVariables>
  957. <variable formalParameter="output_int">
  958. <connectionPointOut>
  959. <relPosition x="175" y="27"/>
  960. </connectionPointOut>
  961. </variable>
  962. </outputVariables>
  963. </block>
  964. <inVariable localId="32" height="27" width="90" negated="false" executionOrderId="0">
  965. <position x="95" y="2424"/>
  966. <connectionPointOut>
  967. <relPosition x="90" y="16"/>
  968. </connectionPointOut>
  969. <expression>purge_flow</expression>
  970. </inVariable>
  971. <outVariable localId="33" height="27" width="122" negated="false" executionOrderId="0">
  972. <position x="456" y="2407"/>
  973. <connectionPointIn>
  974. <relPosition x="0" y="13"/>
  975. <connection refLocalId="30" formalParameter="output_int">
  976. <position x="456" y="2420"/>
  977. <position x="415" y="2420"/>
  978. <position x="415" y="2433"/>
  979. <position x="389" y="2433"/>
  980. </connection>
  981. </connectionPointIn>
  982. <expression>hmi_purge_flow</expression>
  983. </outVariable>
  984. <block localId="34" typeName="scale_to_signed" instanceName="scale_to_signed9" height="40" width="175" executionOrderId="0">
  985. <position x="242" y="2480"/>
  986. <inputVariables>
  987. <variable formalParameter="input_uint">
  988. <connectionPointIn>
  989. <relPosition x="0" y="30"/>
  990. <connection refLocalId="35">
  991. <position x="242" y="2510"/>
  992. <position x="204" y="2510"/>
  993. <position x="204" y="2518"/>
  994. <position x="229" y="2518"/>
  995. <position x="229" y="2520"/>
  996. <position x="219" y="2520"/>
  997. </connection>
  998. </connectionPointIn>
  999. </variable>
  1000. </inputVariables>
  1001. <inOutVariables/>
  1002. <outputVariables>
  1003. <variable formalParameter="output_int">
  1004. <connectionPointOut>
  1005. <relPosition x="175" y="30"/>
  1006. </connectionPointOut>
  1007. </variable>
  1008. </outputVariables>
  1009. </block>
  1010. <inVariable localId="35" height="27" width="106" negated="false" executionOrderId="0">
  1011. <position x="113" y="2507"/>
  1012. <connectionPointOut>
  1013. <relPosition x="106" y="13"/>
  1014. </connectionPointOut>
  1015. <expression>product_flow</expression>
  1016. </inVariable>
  1017. <outVariable localId="36" height="27" width="138" negated="false" executionOrderId="0">
  1018. <position x="463" y="2487"/>
  1019. <connectionPointIn>
  1020. <relPosition x="0" y="13"/>
  1021. <connection refLocalId="34" formalParameter="output_int">
  1022. <position x="463" y="2500"/>
  1023. <position x="427" y="2500"/>
  1024. <position x="427" y="2510"/>
  1025. <position x="417" y="2510"/>
  1026. </connection>
  1027. </connectionPointIn>
  1028. <expression>hmi_product_flow</expression>
  1029. </outVariable>
  1030. <inVariable localId="64" height="27" width="106" negated="false">
  1031. <position x="56" y="555"/>
  1032. <connectionPointOut>
  1033. <relPosition x="106" y="15"/>
  1034. </connectionPointOut>
  1035. <expression>f1_valve_pos</expression>
  1036. </inVariable>
  1037. <inVariable localId="65" height="27" width="106" negated="false">
  1038. <position x="118" y="993"/>
  1039. <connectionPointOut>
  1040. <relPosition x="106" y="17"/>
  1041. </connectionPointOut>
  1042. <expression>f2_valve_pos</expression>
  1043. </inVariable>
  1044. <inVariable localId="66" height="27" width="130" negated="false">
  1045. <position x="217" y="811"/>
  1046. <connectionPointOut>
  1047. <relPosition x="130" y="9"/>
  1048. </connectionPointOut>
  1049. <expression>purge_valve_pos</expression>
  1050. </inVariable>
  1051. <outVariable localId="67" height="27" width="122" negated="false">
  1052. <position x="636" y="710"/>
  1053. <connectionPointIn>
  1054. <relPosition x="0" y="10"/>
  1055. <connection refLocalId="38" formalParameter="valve_pos">
  1056. <position x="636" y="720"/>
  1057. <position x="625" y="720"/>
  1058. <position x="625" y="740"/>
  1059. <position x="603" y="740"/>
  1060. </connection>
  1061. </connectionPointIn>
  1062. <expression>purge_valve_sp</expression>
  1063. </outVariable>
  1064. <block localId="72" typeName="pressure_override" instanceName="pressure_override0" height="80" width="183">
  1065. <position x="322" y="1058"/>
  1066. <inputVariables>
  1067. <variable formalParameter="pressure">
  1068. <connectionPointIn>
  1069. <relPosition x="0" y="32"/>
  1070. <connection refLocalId="73">
  1071. <position x="322" y="1090"/>
  1072. <position x="247" y="1090"/>
  1073. <position x="247" y="1080"/>
  1074. <position x="208" y="1080"/>
  1075. </connection>
  1076. </connectionPointIn>
  1077. </variable>
  1078. <variable formalParameter="curr_sp">
  1079. <connectionPointIn>
  1080. <relPosition x="0" y="52"/>
  1081. <connection refLocalId="74">
  1082. <position x="322" y="1110"/>
  1083. <position x="246" y="1110"/>
  1084. <position x="246" y="1140"/>
  1085. <position x="207" y="1140"/>
  1086. </connection>
  1087. </connectionPointIn>
  1088. </variable>
  1089. <variable formalParameter="override_sp">
  1090. <connectionPointIn>
  1091. <relPosition x="0" y="72"/>
  1092. <connection refLocalId="75">
  1093. <position x="322" y="1130"/>
  1094. <position x="285" y="1130"/>
  1095. <position x="285" y="1200"/>
  1096. <position x="256" y="1200"/>
  1097. </connection>
  1098. </connectionPointIn>
  1099. </variable>
  1100. </inputVariables>
  1101. <inOutVariables/>
  1102. <outputVariables>
  1103. <variable formalParameter="product_sp">
  1104. <connectionPointOut>
  1105. <relPosition x="183" y="32"/>
  1106. </connectionPointOut>
  1107. </variable>
  1108. </outputVariables>
  1109. </block>
  1110. <inVariable localId="73" height="27" width="74" negated="false">
  1111. <position x="134" y="1072"/>
  1112. <connectionPointOut>
  1113. <relPosition x="74" y="8"/>
  1114. </connectionPointOut>
  1115. <expression>pressure</expression>
  1116. </inVariable>
  1117. <inVariable localId="74" height="27" width="74" negated="false">
  1118. <position x="133" y="1130"/>
  1119. <connectionPointOut>
  1120. <relPosition x="74" y="10"/>
  1121. </connectionPointOut>
  1122. <expression>flow_set</expression>
  1123. </inVariable>
  1124. <inVariable localId="75" height="27" width="98" negated="false">
  1125. <position x="158" y="1183"/>
  1126. <connectionPointOut>
  1127. <relPosition x="98" y="17"/>
  1128. </connectionPointOut>
  1129. <expression>override_sp</expression>
  1130. </inVariable>
  1131. <outVariable localId="76" height="27" width="74" negated="false">
  1132. <position x="640" y="1030"/>
  1133. <connectionPointIn>
  1134. <relPosition x="0" y="11"/>
  1135. <connection refLocalId="72" formalParameter="product_sp">
  1136. <position x="640" y="1041"/>
  1137. <position x="585" y="1041"/>
  1138. <position x="585" y="1090"/>
  1139. <position x="505" y="1090"/>
  1140. </connection>
  1141. </connectionPointIn>
  1142. <expression>flow_set</expression>
  1143. </outVariable>
  1144. <block localId="77" typeName="level_control" instanceName="level_control0" height="80" width="167">
  1145. <position x="210" y="1258"/>
  1146. <inputVariables>
  1147. <variable formalParameter="liquid_level">
  1148. <connectionPointIn>
  1149. <relPosition x="0" y="32"/>
  1150. <connection refLocalId="78">
  1151. <position x="210" y="1290"/>
  1152. <position x="145" y="1290"/>
  1153. <position x="145" y="1280"/>
  1154. <position x="88" y="1280"/>
  1155. </connection>
  1156. </connectionPointIn>
  1157. </variable>
  1158. <variable formalParameter="level_sp">
  1159. <connectionPointIn>
  1160. <relPosition x="0" y="52"/>
  1161. <connection refLocalId="79">
  1162. <position x="210" y="1310"/>
  1163. <position x="135" y="1310"/>
  1164. <position x="135" y="1340"/>
  1165. <position x="108" y="1340"/>
  1166. </connection>
  1167. </connectionPointIn>
  1168. </variable>
  1169. <variable formalParameter="curr_pos">
  1170. <connectionPointIn>
  1171. <relPosition x="0" y="72"/>
  1172. <connection refLocalId="80">
  1173. <position x="210" y="1330"/>
  1174. <position x="190" y="1330"/>
  1175. <position x="190" y="1410"/>
  1176. <position x="175" y="1410"/>
  1177. </connection>
  1178. </connectionPointIn>
  1179. </variable>
  1180. </inputVariables>
  1181. <inOutVariables/>
  1182. <outputVariables>
  1183. <variable formalParameter="new_pos">
  1184. <connectionPointOut>
  1185. <relPosition x="167" y="32"/>
  1186. </connectionPointOut>
  1187. </variable>
  1188. </outputVariables>
  1189. </block>
  1190. <inVariable localId="78" height="27" width="50" negated="false">
  1191. <position x="38" y="1270"/>
  1192. <connectionPointOut>
  1193. <relPosition x="50" y="10"/>
  1194. </connectionPointOut>
  1195. <expression>level</expression>
  1196. </inVariable>
  1197. <inVariable localId="79" height="27" width="74" negated="false">
  1198. <position x="34" y="1327"/>
  1199. <connectionPointOut>
  1200. <relPosition x="74" y="13"/>
  1201. </connectionPointOut>
  1202. <expression>level_sp</expression>
  1203. </inVariable>
  1204. <inVariable localId="80" height="27" width="146" negated="false">
  1205. <position x="29" y="1394"/>
  1206. <connectionPointOut>
  1207. <relPosition x="146" y="16"/>
  1208. </connectionPointOut>
  1209. <expression>product_valve_pos</expression>
  1210. </inVariable>
  1211. <outVariable localId="81" height="27" width="138" negated="false">
  1212. <position x="432" y="1269"/>
  1213. <connectionPointIn>
  1214. <relPosition x="0" y="11"/>
  1215. <connection refLocalId="77" formalParameter="new_pos">
  1216. <position x="432" y="1280"/>
  1217. <position x="398" y="1280"/>
  1218. <position x="398" y="1290"/>
  1219. <position x="377" y="1290"/>
  1220. </connection>
  1221. </connectionPointIn>
  1222. <expression>product_valve_sp</expression>
  1223. </outVariable>
  1224. <block localId="87" typeName="ADD" height="60" width="68">
  1225. <position x="239" y="2575"/>
  1226. <inputVariables>
  1227. <variable formalParameter="IN1">
  1228. <connectionPointIn>
  1229. <relPosition x="0" y="30"/>
  1230. <connection refLocalId="88">
  1231. <position x="239" y="2605"/>
  1232. <position x="218" y="2605"/>
  1233. <position x="218" y="2597"/>
  1234. <position x="197" y="2597"/>
  1235. </connection>
  1236. </connectionPointIn>
  1237. </variable>
  1238. <variable formalParameter="IN2">
  1239. <connectionPointIn>
  1240. <relPosition x="0" y="50"/>
  1241. <connection refLocalId="89">
  1242. <position x="239" y="2625"/>
  1243. <position x="220" y="2625"/>
  1244. <position x="220" y="2648"/>
  1245. <position x="179" y="2648"/>
  1246. </connection>
  1247. </connectionPointIn>
  1248. </variable>
  1249. </inputVariables>
  1250. <inOutVariables/>
  1251. <outputVariables>
  1252. <variable formalParameter="OUT">
  1253. <connectionPointOut>
  1254. <relPosition x="68" y="30"/>
  1255. </connectionPointOut>
  1256. </variable>
  1257. </outputVariables>
  1258. </block>
  1259. <inVariable localId="88" height="27" width="90" negated="false">
  1260. <position x="109" y="2584"/>
  1261. <connectionPointOut>
  1262. <relPosition x="90" y="16"/>
  1263. </connectionPointOut>
  1264. <expression>scan_count</expression>
  1265. </inVariable>
  1266. <inVariable localId="89" height="27" width="18" negated="false">
  1267. <position x="161" y="2635"/>
  1268. <connectionPointOut>
  1269. <relPosition x="18" y="13"/>
  1270. </connectionPointOut>
  1271. <expression>1</expression>
  1272. </inVariable>
  1273. <outVariable localId="90" height="27" width="90" negated="false">
  1274. <position x="373" y="2582"/>
  1275. <connectionPointIn>
  1276. <relPosition x="0" y="18"/>
  1277. <connection refLocalId="87" formalParameter="OUT">
  1278. <position x="373" y="2600"/>
  1279. <position x="307" y="2600"/>
  1280. </connection>
  1281. </connectionPointIn>
  1282. <expression>scan_count</expression>
  1283. </outVariable>
  1284. <block localId="91" typeName="GE" height="60" width="68">
  1285. <position x="248" y="2695"/>
  1286. <inputVariables>
  1287. <variable formalParameter="IN1">
  1288. <connectionPointIn>
  1289. <relPosition x="0" y="30"/>
  1290. <connection refLocalId="37">
  1291. <position x="248" y="2725"/>
  1292. <position x="207" y="2725"/>
  1293. <position x="207" y="2716"/>
  1294. <position x="175" y="2716"/>
  1295. </connection>
  1296. </connectionPointIn>
  1297. </variable>
  1298. <variable formalParameter="IN2">
  1299. <connectionPointIn>
  1300. <relPosition x="0" y="50"/>
  1301. <connection refLocalId="39">
  1302. <position x="248" y="2745"/>
  1303. <position x="218" y="2745"/>
  1304. <position x="218" y="2764"/>
  1305. <position x="208" y="2764"/>
  1306. </connection>
  1307. </connectionPointIn>
  1308. </variable>
  1309. </inputVariables>
  1310. <inOutVariables/>
  1311. <outputVariables>
  1312. <variable formalParameter="OUT">
  1313. <connectionPointOut>
  1314. <relPosition x="68" y="30"/>
  1315. </connectionPointOut>
  1316. </variable>
  1317. </outputVariables>
  1318. </block>
  1319. <inVariable localId="37" height="27" width="90" negated="false" executionOrderId="0">
  1320. <position x="87" y="2703"/>
  1321. <connectionPointOut>
  1322. <relPosition x="90" y="17"/>
  1323. </connectionPointOut>
  1324. <expression>scan_count</expression>
  1325. </inVariable>
  1326. <inVariable localId="39" height="27" width="50" negated="false" executionOrderId="0">
  1327. <position x="158" y="2751"/>
  1328. <connectionPointOut>
  1329. <relPosition x="50" y="13"/>
  1330. </connectionPointOut>
  1331. <expression>32000</expression>
  1332. </inVariable>
  1333. <block localId="92" typeName="MOVE" height="60" width="67">
  1334. <position x="390" y="2733"/>
  1335. <inputVariables>
  1336. <variable formalParameter="EN">
  1337. <connectionPointIn>
  1338. <relPosition x="0" y="30"/>
  1339. <connection refLocalId="91" formalParameter="OUT">
  1340. <position x="390" y="2763"/>
  1341. <position x="358" y="2763"/>
  1342. <position x="358" y="2725"/>
  1343. <position x="316" y="2725"/>
  1344. </connection>
  1345. </connectionPointIn>
  1346. </variable>
  1347. <variable formalParameter="IN">
  1348. <connectionPointIn>
  1349. <relPosition x="0" y="50"/>
  1350. <connection refLocalId="40">
  1351. <position x="390" y="2783"/>
  1352. <position x="366" y="2783"/>
  1353. <position x="366" y="2792"/>
  1354. <position x="342" y="2792"/>
  1355. </connection>
  1356. </connectionPointIn>
  1357. </variable>
  1358. </inputVariables>
  1359. <inOutVariables/>
  1360. <outputVariables>
  1361. <variable formalParameter="ENO">
  1362. <connectionPointOut>
  1363. <relPosition x="67" y="30"/>
  1364. </connectionPointOut>
  1365. </variable>
  1366. <variable formalParameter="OUT">
  1367. <connectionPointOut>
  1368. <relPosition x="67" y="50"/>
  1369. </connectionPointOut>
  1370. </variable>
  1371. </outputVariables>
  1372. </block>
  1373. <inVariable localId="40" height="27" width="50" negated="false" executionOrderId="0">
  1374. <position x="292" y="2779"/>
  1375. <connectionPointOut>
  1376. <relPosition x="50" y="13"/>
  1377. </connectionPointOut>
  1378. <expression>0</expression>
  1379. </inVariable>
  1380. <outVariable localId="41" height="27" width="90" negated="false" executionOrderId="0">
  1381. <position x="497" y="2750"/>
  1382. <connectionPointIn>
  1383. <relPosition x="0" y="10"/>
  1384. <connection refLocalId="92" formalParameter="OUT">
  1385. <position x="497" y="2760"/>
  1386. <position x="478" y="2760"/>
  1387. <position x="478" y="2780"/>
  1388. <position x="457" y="2780"/>
  1389. </connection>
  1390. </connectionPointIn>
  1391. <expression>scan_count</expression>
  1392. </outVariable>
  1393. <leftPowerRail localId="93" height="40" width="10">
  1394. <position x="30" y="230"/>
  1395. <connectionPointOut formalParameter="">
  1396. <relPosition x="10" y="20"/>
  1397. </connectionPointOut>
  1398. </leftPowerRail>
  1399. <contact localId="94" height="20" width="21" negated="false">
  1400. <position x="110" y="230"/>
  1401. <connectionPointIn>
  1402. <relPosition x="0" y="10"/>
  1403. <connection refLocalId="93">
  1404. <position x="110" y="240"/>
  1405. <position x="85" y="240"/>
  1406. <position x="85" y="250"/>
  1407. <position x="40" y="250"/>
  1408. </connection>
  1409. </connectionPointIn>
  1410. <connectionPointOut>
  1411. <relPosition x="21" y="10"/>
  1412. </connectionPointOut>
  1413. <variable>first_run</variable>
  1414. </contact>
  1415. <block localId="95" typeName="initialize_sp" instanceName="initialize_sp0" height="140" width="120">
  1416. <position x="200" y="180"/>
  1417. <inputVariables>
  1418. <variable formalParameter="EN">
  1419. <connectionPointIn>
  1420. <relPosition x="0" y="30"/>
  1421. <connection refLocalId="94">
  1422. <position x="200" y="210"/>
  1423. <position x="165" y="210"/>
  1424. <position x="165" y="240"/>
  1425. <position x="131" y="240"/>
  1426. </connection>
  1427. </connectionPointIn>
  1428. </variable>
  1429. </inputVariables>
  1430. <inOutVariables/>
  1431. <outputVariables>
  1432. <variable formalParameter="ENO">
  1433. <connectionPointOut>
  1434. <relPosition x="120" y="30"/>
  1435. </connectionPointOut>
  1436. </variable>
  1437. <variable formalParameter="flow_sp">
  1438. <connectionPointOut>
  1439. <relPosition x="120" y="50"/>
  1440. </connectionPointOut>
  1441. </variable>
  1442. <variable formalParameter="a_sp">
  1443. <connectionPointOut>
  1444. <relPosition x="120" y="70"/>
  1445. </connectionPointOut>
  1446. </variable>
  1447. <variable formalParameter="press_sp">
  1448. <connectionPointOut>
  1449. <relPosition x="120" y="90"/>
  1450. </connectionPointOut>
  1451. </variable>
  1452. <variable formalParameter="over_sp">
  1453. <connectionPointOut>
  1454. <relPosition x="120" y="110"/>
  1455. </connectionPointOut>
  1456. </variable>
  1457. <variable formalParameter="level_sp">
  1458. <connectionPointOut>
  1459. <relPosition x="120" y="130"/>
  1460. </connectionPointOut>
  1461. </variable>
  1462. </outputVariables>
  1463. </block>
  1464. <coil localId="96" height="20" width="21" negated="false" storage="reset">
  1465. <position x="430" y="200"/>
  1466. <connectionPointIn>
  1467. <relPosition x="0" y="10"/>
  1468. <connection refLocalId="95" formalParameter="ENO">
  1469. <position x="430" y="210"/>
  1470. <position x="320" y="210"/>
  1471. </connection>
  1472. </connectionPointIn>
  1473. <connectionPointOut>
  1474. <relPosition x="21" y="10"/>
  1475. </connectionPointOut>
  1476. <variable>first_run</variable>
  1477. </coil>
  1478. <outVariable localId="97" height="30" width="90" negated="false">
  1479. <position x="350" y="230"/>
  1480. <connectionPointIn>
  1481. <relPosition x="0" y="20"/>
  1482. <connection refLocalId="95" formalParameter="a_sp">
  1483. <position x="350" y="250"/>
  1484. <position x="320" y="250"/>
  1485. </connection>
  1486. </connectionPointIn>
  1487. <expression>a_setpoint</expression>
  1488. </outVariable>
  1489. <outVariable localId="42" height="30" width="90" negated="false" executionOrderId="0">
  1490. <position x="500" y="210"/>
  1491. <connectionPointIn>
  1492. <relPosition x="0" y="10"/>
  1493. <connection refLocalId="95" formalParameter="flow_sp">
  1494. <position x="500" y="220"/>
  1495. <position x="410" y="220"/>
  1496. <position x="410" y="230"/>
  1497. <position x="320" y="230"/>
  1498. </connection>
  1499. </connectionPointIn>
  1500. <expression>flow_set</expression>
  1501. </outVariable>
  1502. <outVariable localId="43" height="30" width="100" negated="false" executionOrderId="0">
  1503. <position x="460" y="250"/>
  1504. <connectionPointIn>
  1505. <relPosition x="0" y="10"/>
  1506. <connection refLocalId="95" formalParameter="press_sp">
  1507. <position x="460" y="260"/>
  1508. <position x="390" y="260"/>
  1509. <position x="390" y="270"/>
  1510. <position x="320" y="270"/>
  1511. </connection>
  1512. </connectionPointIn>
  1513. <expression>pressure_sp</expression>
  1514. </outVariable>
  1515. <outVariable localId="44" height="30" width="100" negated="false" executionOrderId="0">
  1516. <position x="350" y="270"/>
  1517. <connectionPointIn>
  1518. <relPosition x="0" y="10"/>
  1519. <connection refLocalId="95" formalParameter="over_sp">
  1520. <position x="350" y="280"/>
  1521. <position x="335" y="280"/>
  1522. <position x="335" y="290"/>
  1523. <position x="320" y="290"/>
  1524. </connection>
  1525. </connectionPointIn>
  1526. <expression>override_sp</expression>
  1527. </outVariable>
  1528. <outVariable localId="45" height="30" width="90" negated="false" executionOrderId="0">
  1529. <position x="450" y="300"/>
  1530. <connectionPointIn>
  1531. <relPosition x="0" y="20"/>
  1532. <connection refLocalId="95" formalParameter="level_sp">
  1533. <position x="450" y="320"/>
  1534. <position x="385" y="320"/>
  1535. <position x="385" y="310"/>
  1536. <position x="320" y="310"/>
  1537. </connection>
  1538. </connectionPointIn>
  1539. <expression>level_sp</expression>
  1540. </outVariable>
  1541. </LD>
  1542. </body>
  1543. </pou>
  1544. <pou name="pressure_control" pouType="functionBlock">
  1545. <interface>
  1546. <localVars>
  1547. <variable name="pressure_real">
  1548. <type>
  1549. <REAL/>
  1550. </type>
  1551. <initialValue>
  1552. <simpleValue value="2700.0"/>
  1553. </initialValue>
  1554. </variable>
  1555. </localVars>
  1556. <inputVars>
  1557. <variable name="pressure">
  1558. <type>
  1559. <UINT/>
  1560. </type>
  1561. <initialValue>
  1562. <simpleValue value="58981"/>
  1563. </initialValue>
  1564. </variable>
  1565. </inputVars>
  1566. <localVars>
  1567. <variable name="pressure_sp_real">
  1568. <type>
  1569. <REAL/>
  1570. </type>
  1571. <initialValue>
  1572. <simpleValue value="2700.0"/>
  1573. </initialValue>
  1574. </variable>
  1575. </localVars>
  1576. <inputVars>
  1577. <variable name="pressure_sp">
  1578. <type>
  1579. <UINT/>
  1580. </type>
  1581. <initialValue>
  1582. <simpleValue value="58981"/>
  1583. </initialValue>
  1584. </variable>
  1585. <variable name="curr_pos">
  1586. <type>
  1587. <UINT/>
  1588. </type>
  1589. <initialValue>
  1590. <simpleValue value="30000"/>
  1591. </initialValue>
  1592. </variable>
  1593. </inputVars>
  1594. <localVars>
  1595. <variable name="valve_pos_real">
  1596. <type>
  1597. <REAL/>
  1598. </type>
  1599. <initialValue>
  1600. <simpleValue value="39.25"/>
  1601. </initialValue>
  1602. </variable>
  1603. <variable name="pos_update_real">
  1604. <type>
  1605. <REAL/>
  1606. </type>
  1607. <initialValue>
  1608. <simpleValue value="0.0"/>
  1609. </initialValue>
  1610. </variable>
  1611. <variable name="valve_pos_nominal">
  1612. <type>
  1613. <REAL/>
  1614. </type>
  1615. <initialValue>
  1616. <simpleValue value="39.25"/>
  1617. </initialValue>
  1618. </variable>
  1619. </localVars>
  1620. <outputVars>
  1621. <variable name="valve_pos">
  1622. <type>
  1623. <UINT/>
  1624. </type>
  1625. <initialValue>
  1626. <simpleValue value="25886"/>
  1627. </initialValue>
  1628. </variable>
  1629. </outputVars>
  1630. <localVars>
  1631. <variable name="pressure_k">
  1632. <type>
  1633. <REAL/>
  1634. </type>
  1635. <initialValue>
  1636. <simpleValue value="20.0"/>
  1637. </initialValue>
  1638. </variable>
  1639. <variable name="pressure_ti">
  1640. <type>
  1641. <REAL/>
  1642. </type>
  1643. <initialValue>
  1644. <simpleValue value="999.0"/>
  1645. </initialValue>
  1646. </variable>
  1647. <variable name="cycle_time">
  1648. <type>
  1649. <TIME/>
  1650. </type>
  1651. <initialValue>
  1652. <simpleValue value="T#50ms"/>
  1653. </initialValue>
  1654. </variable>
  1655. <variable name="scale_to_real5">
  1656. <type>
  1657. <derived name="scale_to_real"/>
  1658. </type>
  1659. </variable>
  1660. <variable name="scale_to_real4">
  1661. <type>
  1662. <derived name="scale_to_real"/>
  1663. </type>
  1664. </variable>
  1665. <variable name="scale_to_uint0">
  1666. <type>
  1667. <derived name="scale_to_uint"/>
  1668. </type>
  1669. </variable>
  1670. <variable name="pressure_max">
  1671. <type>
  1672. <REAL/>
  1673. </type>
  1674. <initialValue>
  1675. <simpleValue value="3200.00"/>
  1676. </initialValue>
  1677. </variable>
  1678. <variable name="pressure_min">
  1679. <type>
  1680. <REAL/>
  1681. </type>
  1682. <initialValue>
  1683. <simpleValue value="0.0"/>
  1684. </initialValue>
  1685. </variable>
  1686. <variable name="pos_min">
  1687. <type>
  1688. <REAL/>
  1689. </type>
  1690. <initialValue>
  1691. <simpleValue value="0.0"/>
  1692. </initialValue>
  1693. </variable>
  1694. <variable name="pos_max">
  1695. <type>
  1696. <REAL/>
  1697. </type>
  1698. <initialValue>
  1699. <simpleValue value="100.0"/>
  1700. </initialValue>
  1701. </variable>
  1702. <variable name="scale_to_real0">
  1703. <type>
  1704. <derived name="scale_to_real"/>
  1705. </type>
  1706. </variable>
  1707. </localVars>
  1708. </interface>
  1709. <body>
  1710. <LD>
  1711. <leftPowerRail localId="2" height="320" width="3">
  1712. <position x="12" y="351"/>
  1713. <connectionPointOut formalParameter="">
  1714. <relPosition x="3" y="20"/>
  1715. </connectionPointOut>
  1716. <connectionPointOut formalParameter="">
  1717. <relPosition x="3" y="60"/>
  1718. </connectionPointOut>
  1719. <connectionPointOut formalParameter="">
  1720. <relPosition x="3" y="100"/>
  1721. </connectionPointOut>
  1722. <connectionPointOut formalParameter="">
  1723. <relPosition x="3" y="140"/>
  1724. </connectionPointOut>
  1725. <connectionPointOut formalParameter="">
  1726. <relPosition x="3" y="180"/>
  1727. </connectionPointOut>
  1728. <connectionPointOut formalParameter="">
  1729. <relPosition x="3" y="220"/>
  1730. </connectionPointOut>
  1731. <connectionPointOut formalParameter="">
  1732. <relPosition x="3" y="260"/>
  1733. </connectionPointOut>
  1734. <connectionPointOut formalParameter="">
  1735. <relPosition x="3" y="300"/>
  1736. </connectionPointOut>
  1737. </leftPowerRail>
  1738. <block localId="37" typeName="scale_to_real" instanceName="scale_to_real5" height="120" width="205" executionOrderId="0">
  1739. <position x="206" y="19"/>
  1740. <inputVariables>
  1741. <variable formalParameter="raw_input_value">
  1742. <connectionPointIn>
  1743. <relPosition x="0" y="36"/>
  1744. <connection refLocalId="41">
  1745. <position x="206" y="55"/>
  1746. <position x="173" y="55"/>
  1747. <position x="173" y="30"/>
  1748. <position x="140" y="30"/>
  1749. </connection>
  1750. </connectionPointIn>
  1751. </variable>
  1752. <variable formalParameter="real_max">
  1753. <connectionPointIn>
  1754. <relPosition x="0" y="69"/>
  1755. <connection refLocalId="39">
  1756. <position x="206" y="88"/>
  1757. <position x="171" y="88"/>
  1758. <position x="171" y="81"/>
  1759. <position x="123" y="81"/>
  1760. </connection>
  1761. </connectionPointIn>
  1762. </variable>
  1763. <variable formalParameter="real_min">
  1764. <connectionPointIn>
  1765. <relPosition x="0" y="102"/>
  1766. <connection refLocalId="40">
  1767. <position x="206" y="121"/>
  1768. <position x="173" y="121"/>
  1769. <position x="173" y="136"/>
  1770. <position x="128" y="136"/>
  1771. </connection>
  1772. </connectionPointIn>
  1773. </variable>
  1774. </inputVariables>
  1775. <inOutVariables/>
  1776. <outputVariables>
  1777. <variable formalParameter="scaled_real">
  1778. <connectionPointOut>
  1779. <relPosition x="205" y="36"/>
  1780. </connectionPointOut>
  1781. </variable>
  1782. </outputVariables>
  1783. </block>
  1784. <inVariable localId="39" height="27" width="106" negated="false" executionOrderId="0">
  1785. <position x="17" y="68"/>
  1786. <connectionPointOut>
  1787. <relPosition x="106" y="13"/>
  1788. </connectionPointOut>
  1789. <expression>pressure_max</expression>
  1790. </inVariable>
  1791. <inVariable localId="40" height="27" width="103" negated="false" executionOrderId="0">
  1792. <position x="25" y="123"/>
  1793. <connectionPointOut>
  1794. <relPosition x="103" y="13"/>
  1795. </connectionPointOut>
  1796. <expression>pressure_min</expression>
  1797. </inVariable>
  1798. <inVariable localId="41" height="27" width="70" negated="false">
  1799. <position x="70" y="17"/>
  1800. <connectionPointOut>
  1801. <relPosition x="70" y="13"/>
  1802. </connectionPointOut>
  1803. <expression>pressure</expression>
  1804. </inVariable>
  1805. <outVariable localId="42" height="27" width="103" negated="false">
  1806. <position x="453" y="28"/>
  1807. <connectionPointIn>
  1808. <relPosition x="0" y="13"/>
  1809. <connection refLocalId="37" formalParameter="scaled_real">
  1810. <position x="453" y="41"/>
  1811. <position x="427" y="41"/>
  1812. <position x="427" y="55"/>
  1813. <position x="411" y="55"/>
  1814. </connection>
  1815. </connectionPointIn>
  1816. <expression>pressure_real</expression>
  1817. </outVariable>
  1818. <block localId="23" typeName="scale_to_real" instanceName="scale_to_real4" height="120" width="205" executionOrderId="0">
  1819. <position x="216" y="160"/>
  1820. <inputVariables>
  1821. <variable formalParameter="raw_input_value">
  1822. <connectionPointIn>
  1823. <relPosition x="0" y="36"/>
  1824. <connection refLocalId="43">
  1825. <position x="216" y="196"/>
  1826. <position x="173" y="196"/>
  1827. <position x="173" y="200"/>
  1828. <position x="131" y="200"/>
  1829. </connection>
  1830. </connectionPointIn>
  1831. </variable>
  1832. <variable formalParameter="real_max">
  1833. <connectionPointIn>
  1834. <relPosition x="0" y="69"/>
  1835. <connection refLocalId="30">
  1836. <position x="216" y="229"/>
  1837. <position x="170" y="229"/>
  1838. <position x="170" y="241"/>
  1839. <position x="125" y="241"/>
  1840. </connection>
  1841. </connectionPointIn>
  1842. </variable>
  1843. <variable formalParameter="real_min">
  1844. <connectionPointIn>
  1845. <relPosition x="0" y="102"/>
  1846. <connection refLocalId="32">
  1847. <position x="216" y="262"/>
  1848. <position x="180" y="262"/>
  1849. <position x="180" y="271"/>
  1850. <position x="145" y="271"/>
  1851. </connection>
  1852. </connectionPointIn>
  1853. </variable>
  1854. </inputVariables>
  1855. <inOutVariables/>
  1856. <outputVariables>
  1857. <variable formalParameter="scaled_real">
  1858. <connectionPointOut>
  1859. <relPosition x="205" y="36"/>
  1860. </connectionPointOut>
  1861. </variable>
  1862. </outputVariables>
  1863. </block>
  1864. <inVariable localId="30" height="27" width="106" negated="false" executionOrderId="0">
  1865. <position x="19" y="228"/>
  1866. <connectionPointOut>
  1867. <relPosition x="106" y="13"/>
  1868. </connectionPointOut>
  1869. <expression>pressure_max</expression>
  1870. </inVariable>
  1871. <inVariable localId="32" height="27" width="103" negated="false" executionOrderId="0">
  1872. <position x="42" y="258"/>
  1873. <connectionPointOut>
  1874. <relPosition x="103" y="13"/>
  1875. </connectionPointOut>
  1876. <expression>pressure_min</expression>
  1877. </inVariable>
  1878. <inVariable localId="43" height="27" width="93" negated="false">
  1879. <position x="38" y="187"/>
  1880. <connectionPointOut>
  1881. <relPosition x="93" y="13"/>
  1882. </connectionPointOut>
  1883. <expression>pressure_sp</expression>
  1884. </inVariable>
  1885. <outVariable localId="44" height="27" width="126" negated="false">
  1886. <position x="467" y="173"/>
  1887. <connectionPointIn>
  1888. <relPosition x="0" y="13"/>
  1889. <connection refLocalId="23" formalParameter="scaled_real">
  1890. <position x="467" y="186"/>
  1891. <position x="450" y="186"/>
  1892. <position x="450" y="196"/>
  1893. <position x="421" y="196"/>
  1894. </connection>
  1895. </connectionPointIn>
  1896. <expression>pressure_sp_real</expression>
  1897. </outVariable>
  1898. <block localId="45" typeName="scale_to_uint" instanceName="scale_to_uint0" height="40" width="120">
  1899. <position x="534" y="820"/>
  1900. <inputVariables>
  1901. <variable formalParameter="real_in">
  1902. <connectionPointIn>
  1903. <relPosition x="0" y="30"/>
  1904. <connection refLocalId="55" formalParameter="OUT">
  1905. <position x="534" y="850"/>
  1906. <position x="485" y="850"/>
  1907. <position x="485" y="840"/>
  1908. <position x="436" y="840"/>
  1909. </connection>
  1910. </connectionPointIn>
  1911. </variable>
  1912. </inputVariables>
  1913. <inOutVariables/>
  1914. <outputVariables>
  1915. <variable formalParameter="uint_out">
  1916. <connectionPointOut>
  1917. <relPosition x="120" y="30"/>
  1918. </connectionPointOut>
  1919. </variable>
  1920. </outputVariables>
  1921. </block>
  1922. <outVariable localId="47" height="27" width="78" negated="false">
  1923. <position x="701" y="813"/>
  1924. <connectionPointIn>
  1925. <relPosition x="0" y="13"/>
  1926. <connection refLocalId="45" formalParameter="uint_out">
  1927. <position x="701" y="826"/>
  1928. <position x="680" y="826"/>
  1929. <position x="680" y="850"/>
  1930. <position x="654" y="850"/>
  1931. </connection>
  1932. </connectionPointIn>
  1933. <expression>valve_pos</expression>
  1934. </outVariable>
  1935. <inVariable localId="49" height="27" width="70" negated="false">
  1936. <position x="147" y="672"/>
  1937. <connectionPointOut>
  1938. <relPosition x="70" y="13"/>
  1939. </connectionPointOut>
  1940. <expression>curr_pos</expression>
  1941. </inVariable>
  1942. <block localId="50" typeName="scale_to_real" instanceName="scale_to_real0" height="80" width="205">
  1943. <position x="346" y="639"/>
  1944. <inputVariables>
  1945. <variable formalParameter="raw_input_value">
  1946. <connectionPointIn>
  1947. <relPosition x="0" y="30"/>
  1948. <connection refLocalId="49">
  1949. <position x="346" y="669"/>
  1950. <position x="322" y="669"/>
  1951. <position x="322" y="685"/>
  1952. <position x="217" y="685"/>
  1953. </connection>
  1954. </connectionPointIn>
  1955. </variable>
  1956. <variable formalParameter="real_max">
  1957. <connectionPointIn>
  1958. <relPosition x="0" y="50"/>
  1959. <connection refLocalId="51">
  1960. <position x="346" y="689"/>
  1961. <position x="284" y="689"/>
  1962. <position x="284" y="717"/>
  1963. <position x="222" y="717"/>
  1964. </connection>
  1965. </connectionPointIn>
  1966. </variable>
  1967. <variable formalParameter="real_min">
  1968. <connectionPointIn>
  1969. <relPosition x="0" y="70"/>
  1970. <connection refLocalId="9">
  1971. <position x="346" y="709"/>
  1972. <position x="287" y="709"/>
  1973. <position x="287" y="747"/>
  1974. <position x="228" y="747"/>
  1975. </connection>
  1976. </connectionPointIn>
  1977. </variable>
  1978. </inputVariables>
  1979. <inOutVariables/>
  1980. <outputVariables>
  1981. <variable formalParameter="scaled_real">
  1982. <connectionPointOut>
  1983. <relPosition x="205" y="30"/>
  1984. </connectionPointOut>
  1985. </variable>
  1986. </outputVariables>
  1987. </block>
  1988. <inVariable localId="51" height="27" width="71" negated="false">
  1989. <position x="151" y="704"/>
  1990. <connectionPointOut>
  1991. <relPosition x="71" y="13"/>
  1992. </connectionPointOut>
  1993. <expression>pos_max</expression>
  1994. </inVariable>
  1995. <inVariable localId="9" height="27" width="71" negated="false" executionOrderId="0">
  1996. <position x="157" y="734"/>
  1997. <connectionPointOut>
  1998. <relPosition x="71" y="13"/>
  1999. </connectionPointOut>
  2000. <expression>pos_min</expression>
  2001. </inVariable>
  2002. <outVariable localId="52" height="27" width="111" negated="false">
  2003. <position x="656" y="625"/>
  2004. <connectionPointIn>
  2005. <relPosition x="0" y="13"/>
  2006. <connection refLocalId="50" formalParameter="scaled_real">
  2007. <position x="656" y="638"/>
  2008. <position x="634" y="638"/>
  2009. <position x="634" y="669"/>
  2010. <position x="551" y="669"/>
  2011. </connection>
  2012. </connectionPointIn>
  2013. <expression>valve_pos_real</expression>
  2014. </outVariable>
  2015. <block localId="53" typeName="SUB" height="60" width="68">
  2016. <position x="191" y="819"/>
  2017. <inputVariables>
  2018. <variable formalParameter="IN1">
  2019. <connectionPointIn>
  2020. <relPosition x="0" y="30"/>
  2021. <connection refLocalId="54">
  2022. <position x="191" y="849"/>
  2023. <position x="158" y="849"/>
  2024. <position x="158" y="834"/>
  2025. <position x="138" y="834"/>
  2026. </connection>
  2027. </connectionPointIn>
  2028. </variable>
  2029. <variable formalParameter="IN2">
  2030. <connectionPointIn>
  2031. <relPosition x="0" y="50"/>
  2032. <connection refLocalId="10">
  2033. <position x="191" y="869"/>
  2034. <position x="165" y="869"/>
  2035. <position x="165" y="881"/>
  2036. <position x="151" y="881"/>
  2037. </connection>
  2038. </connectionPointIn>
  2039. </variable>
  2040. </inputVariables>
  2041. <inOutVariables/>
  2042. <outputVariables>
  2043. <variable formalParameter="OUT">
  2044. <connectionPointOut>
  2045. <relPosition x="68" y="30"/>
  2046. </connectionPointOut>
  2047. </variable>
  2048. </outputVariables>
  2049. </block>
  2050. <inVariable localId="54" height="27" width="111" negated="false">
  2051. <position x="27" y="821"/>
  2052. <connectionPointOut>
  2053. <relPosition x="111" y="13"/>
  2054. </connectionPointOut>
  2055. <expression>valve_pos_real</expression>
  2056. </inVariable>
  2057. <inVariable localId="10" height="27" width="124" negated="false" executionOrderId="0">
  2058. <position x="27" y="868"/>
  2059. <connectionPointOut>
  2060. <relPosition x="124" y="13"/>
  2061. </connectionPointOut>
  2062. <expression>pos_update_real</expression>
  2063. </inVariable>
  2064. <block localId="55" typeName="LIMIT" height="80" width="69">
  2065. <position x="367" y="810"/>
  2066. <inputVariables>
  2067. <variable formalParameter="MN">
  2068. <connectionPointIn>
  2069. <relPosition x="0" y="30"/>
  2070. <connection refLocalId="56">
  2071. <position x="367" y="840"/>
  2072. <position x="348" y="840"/>
  2073. <position x="348" y="811"/>
  2074. <position x="329" y="811"/>
  2075. </connection>
  2076. </connectionPointIn>
  2077. </variable>
  2078. <variable formalParameter="IN">
  2079. <connectionPointIn>
  2080. <relPosition x="0" y="50"/>
  2081. <connection refLocalId="53" formalParameter="OUT">
  2082. <position x="367" y="860"/>
  2083. <position x="311" y="860"/>
  2084. <position x="311" y="849"/>
  2085. <position x="259" y="849"/>
  2086. </connection>
  2087. </connectionPointIn>
  2088. </variable>
  2089. <variable formalParameter="MX">
  2090. <connectionPointIn>
  2091. <relPosition x="0" y="70"/>
  2092. <connection refLocalId="11">
  2093. <position x="367" y="880"/>
  2094. <position x="354" y="880"/>
  2095. <position x="354" y="905"/>
  2096. <position x="341" y="905"/>
  2097. </connection>
  2098. </connectionPointIn>
  2099. </variable>
  2100. </inputVariables>
  2101. <inOutVariables/>
  2102. <outputVariables>
  2103. <variable formalParameter="OUT">
  2104. <connectionPointOut>
  2105. <relPosition x="69" y="30"/>
  2106. </connectionPointOut>
  2107. </variable>
  2108. </outputVariables>
  2109. </block>
  2110. <inVariable localId="56" height="27" width="68" negated="false">
  2111. <position x="261" y="798"/>
  2112. <connectionPointOut>
  2113. <relPosition x="68" y="13"/>
  2114. </connectionPointOut>
  2115. <expression>pos_min</expression>
  2116. </inVariable>
  2117. <inVariable localId="11" height="27" width="71" negated="false" executionOrderId="0">
  2118. <position x="270" y="892"/>
  2119. <connectionPointOut>
  2120. <relPosition x="71" y="13"/>
  2121. </connectionPointOut>
  2122. <expression>pos_max</expression>
  2123. </inVariable>
  2124. <block localId="57" typeName="SUB" height="60" width="68">
  2125. <position x="373" y="423"/>
  2126. <inputVariables>
  2127. <variable formalParameter="IN1">
  2128. <connectionPointIn>
  2129. <relPosition x="0" y="30"/>
  2130. <connection refLocalId="58">
  2131. <position x="373" y="453"/>
  2132. <position x="343" y="453"/>
  2133. <position x="343" y="419"/>
  2134. <position x="314" y="419"/>
  2135. </connection>
  2136. </connectionPointIn>
  2137. </variable>
  2138. <variable formalParameter="IN2">
  2139. <connectionPointIn>
  2140. <relPosition x="0" y="50"/>
  2141. <connection refLocalId="59">
  2142. <position x="373" y="473"/>
  2143. <position x="329" y="473"/>
  2144. <position x="329" y="477"/>
  2145. <position x="285" y="477"/>
  2146. </connection>
  2147. </connectionPointIn>
  2148. </variable>
  2149. </inputVariables>
  2150. <inOutVariables/>
  2151. <outputVariables>
  2152. <variable formalParameter="OUT">
  2153. <connectionPointOut>
  2154. <relPosition x="68" y="30"/>
  2155. </connectionPointOut>
  2156. </variable>
  2157. </outputVariables>
  2158. </block>
  2159. <inVariable localId="58" height="27" width="126" negated="false">
  2160. <position x="188" y="406"/>
  2161. <connectionPointOut>
  2162. <relPosition x="126" y="13"/>
  2163. </connectionPointOut>
  2164. <expression>pressure_sp_real</expression>
  2165. </inVariable>
  2166. <inVariable localId="59" height="27" width="103" negated="false">
  2167. <position x="182" y="464"/>
  2168. <connectionPointOut>
  2169. <relPosition x="103" y="13"/>
  2170. </connectionPointOut>
  2171. <expression>pressure_real</expression>
  2172. </inVariable>
  2173. <block localId="60" typeName="MUL" height="60" width="68">
  2174. <position x="577" y="420"/>
  2175. <inputVariables>
  2176. <variable formalParameter="IN1">
  2177. <connectionPointIn>
  2178. <relPosition x="0" y="30"/>
  2179. <connection refLocalId="57" formalParameter="OUT">
  2180. <position x="577" y="450"/>
  2181. <position x="509" y="450"/>
  2182. <position x="509" y="453"/>
  2183. <position x="441" y="453"/>
  2184. </connection>
  2185. </connectionPointIn>
  2186. </variable>
  2187. <variable formalParameter="IN2">
  2188. <connectionPointIn>
  2189. <relPosition x="0" y="50"/>
  2190. <connection refLocalId="61">
  2191. <position x="577" y="470"/>
  2192. <position x="563" y="470"/>
  2193. <position x="563" y="521"/>
  2194. <position x="550" y="521"/>
  2195. </connection>
  2196. </connectionPointIn>
  2197. </variable>
  2198. </inputVariables>
  2199. <inOutVariables/>
  2200. <outputVariables>
  2201. <variable formalParameter="OUT">
  2202. <connectionPointOut>
  2203. <relPosition x="68" y="30"/>
  2204. </connectionPointOut>
  2205. </variable>
  2206. </outputVariables>
  2207. </block>
  2208. <inVariable localId="61" height="27" width="85" negated="false">
  2209. <position x="465" y="508"/>
  2210. <connectionPointOut>
  2211. <relPosition x="85" y="13"/>
  2212. </connectionPointOut>
  2213. <expression>pressure_k</expression>
  2214. </inVariable>
  2215. <outVariable localId="62" height="27" width="124" negated="false">
  2216. <position x="702" y="459"/>
  2217. <connectionPointIn>
  2218. <relPosition x="0" y="13"/>
  2219. <connection refLocalId="60" formalParameter="OUT">
  2220. <position x="702" y="472"/>
  2221. <position x="673" y="472"/>
  2222. <position x="673" y="450"/>
  2223. <position x="645" y="450"/>
  2224. </connection>
  2225. </connectionPointIn>
  2226. <expression>pos_update_real</expression>
  2227. </outVariable>
  2228. </LD>
  2229. </body>
  2230. </pou>
  2231. <pou name="flow_control" pouType="functionBlock">
  2232. <interface>
  2233. <localVars>
  2234. <variable name="flow_k">
  2235. <type>
  2236. <REAL/>
  2237. </type>
  2238. <initialValue>
  2239. <simpleValue value="1.0"/>
  2240. </initialValue>
  2241. </variable>
  2242. <variable name="flow_ti">
  2243. <type>
  2244. <REAL/>
  2245. </type>
  2246. <initialValue>
  2247. <simpleValue value="999.0"/>
  2248. </initialValue>
  2249. </variable>
  2250. <variable name="flow_td">
  2251. <type>
  2252. <REAL/>
  2253. </type>
  2254. <initialValue>
  2255. <simpleValue value="0.0"/>
  2256. </initialValue>
  2257. </variable>
  2258. </localVars>
  2259. <inputVars>
  2260. <variable name="product_flow">
  2261. <type>
  2262. <UINT/>
  2263. </type>
  2264. <initialValue>
  2265. <simpleValue value="6554"/>
  2266. </initialValue>
  2267. </variable>
  2268. </inputVars>
  2269. <localVars>
  2270. <variable name="product_flow_real">
  2271. <type>
  2272. <REAL/>
  2273. </type>
  2274. <initialValue>
  2275. <simpleValue value="100.0"/>
  2276. </initialValue>
  2277. </variable>
  2278. <variable name="cycle_time">
  2279. <type>
  2280. <TIME/>
  2281. </type>
  2282. <initialValue>
  2283. <simpleValue value="T#50ms"/>
  2284. </initialValue>
  2285. </variable>
  2286. <variable name="pos_update_real">
  2287. <type>
  2288. <REAL/>
  2289. </type>
  2290. <initialValue>
  2291. <simpleValue value="0.0"/>
  2292. </initialValue>
  2293. </variable>
  2294. <variable name="curr_pos_real">
  2295. <type>
  2296. <REAL/>
  2297. </type>
  2298. <initialValue>
  2299. <simpleValue value="60.9"/>
  2300. </initialValue>
  2301. </variable>
  2302. </localVars>
  2303. <outputVars>
  2304. <variable name="new_pos">
  2305. <type>
  2306. <UINT/>
  2307. </type>
  2308. <initialValue>
  2309. <simpleValue value="35000"/>
  2310. </initialValue>
  2311. </variable>
  2312. </outputVars>
  2313. <inputVars>
  2314. <variable name="curr_pos">
  2315. <type>
  2316. <UINT/>
  2317. </type>
  2318. <initialValue>
  2319. <simpleValue value="35000"/>
  2320. </initialValue>
  2321. </variable>
  2322. </inputVars>
  2323. <localVars>
  2324. <variable name="flow_set_real">
  2325. <type>
  2326. <REAL/>
  2327. </type>
  2328. <initialValue>
  2329. <simpleValue value="100.0"/>
  2330. </initialValue>
  2331. </variable>
  2332. </localVars>
  2333. <inputVars>
  2334. <variable name="flow_set_in">
  2335. <type>
  2336. <UINT/>
  2337. </type>
  2338. <initialValue>
  2339. <simpleValue value="6554"/>
  2340. </initialValue>
  2341. </variable>
  2342. </inputVars>
  2343. <localVars>
  2344. <variable name="scale_to_real0">
  2345. <type>
  2346. <derived name="scale_to_real"/>
  2347. </type>
  2348. </variable>
  2349. <variable name="scale_to_real1">
  2350. <type>
  2351. <derived name="scale_to_real"/>
  2352. </type>
  2353. </variable>
  2354. <variable name="flow_max">
  2355. <type>
  2356. <REAL/>
  2357. </type>
  2358. <initialValue>
  2359. <simpleValue value="500.0"/>
  2360. </initialValue>
  2361. </variable>
  2362. <variable name="flow_min">
  2363. <type>
  2364. <REAL/>
  2365. </type>
  2366. <initialValue>
  2367. <simpleValue value="0.0"/>
  2368. </initialValue>
  2369. </variable>
  2370. <variable name="pos_min">
  2371. <type>
  2372. <REAL/>
  2373. </type>
  2374. <initialValue>
  2375. <simpleValue value="0.0"/>
  2376. </initialValue>
  2377. </variable>
  2378. <variable name="pos_max">
  2379. <type>
  2380. <REAL/>
  2381. </type>
  2382. <initialValue>
  2383. <simpleValue value="100.0"/>
  2384. </initialValue>
  2385. </variable>
  2386. <variable name="scale_to_real2">
  2387. <type>
  2388. <derived name="scale_to_real"/>
  2389. </type>
  2390. </variable>
  2391. <variable name="scale_to_uint0">
  2392. <type>
  2393. <derived name="scale_to_uint"/>
  2394. </type>
  2395. </variable>
  2396. </localVars>
  2397. </interface>
  2398. <body>
  2399. <LD>
  2400. <leftPowerRail localId="1" height="715" width="3">
  2401. <position x="29" y="311"/>
  2402. <connectionPointOut formalParameter="">
  2403. <relPosition x="3" y="20"/>
  2404. </connectionPointOut>
  2405. <connectionPointOut formalParameter="">
  2406. <relPosition x="3" y="189"/>
  2407. </connectionPointOut>
  2408. <connectionPointOut formalParameter="">
  2409. <relPosition x="3" y="358"/>
  2410. </connectionPointOut>
  2411. <connectionPointOut formalParameter="">
  2412. <relPosition x="3" y="526"/>
  2413. </connectionPointOut>
  2414. <connectionPointOut formalParameter="">
  2415. <relPosition x="3" y="695"/>
  2416. </connectionPointOut>
  2417. </leftPowerRail>
  2418. <inVariable localId="4" height="27" width="102" negated="false">
  2419. <position x="79" y="390"/>
  2420. <connectionPointOut>
  2421. <relPosition x="102" y="13"/>
  2422. </connectionPointOut>
  2423. <expression>flow_set_real</expression>
  2424. </inVariable>
  2425. <outVariable localId="9" height="27" width="124" negated="false">
  2426. <position x="841" y="368"/>
  2427. <connectionPointIn>
  2428. <relPosition x="0" y="13"/>
  2429. <connection refLocalId="60" formalParameter="OUT">
  2430. <position x="841" y="381"/>
  2431. <position x="737" y="381"/>
  2432. <position x="737" y="406"/>
  2433. <position x="634" y="406"/>
  2434. </connection>
  2435. </connectionPointIn>
  2436. <expression>pos_update_real</expression>
  2437. </outVariable>
  2438. <block localId="11" typeName="scale_to_real" instanceName="scale_to_real0" height="120" width="205" executionOrderId="0">
  2439. <position x="260" y="19"/>
  2440. <inputVariables>
  2441. <variable formalParameter="raw_input_value">
  2442. <connectionPointIn>
  2443. <relPosition x="0" y="30"/>
  2444. <connection refLocalId="5">
  2445. <position x="260" y="49"/>
  2446. <position x="227" y="49"/>
  2447. <position x="227" y="16"/>
  2448. <position x="194" y="16"/>
  2449. </connection>
  2450. </connectionPointIn>
  2451. </variable>
  2452. <variable formalParameter="real_max">
  2453. <connectionPointIn>
  2454. <relPosition x="0" y="50"/>
  2455. <connection refLocalId="12">
  2456. <position x="260" y="69"/>
  2457. <position x="206" y="69"/>
  2458. <position x="206" y="47"/>
  2459. <position x="151" y="47"/>
  2460. </connection>
  2461. </connectionPointIn>
  2462. </variable>
  2463. <variable formalParameter="real_min">
  2464. <connectionPointIn>
  2465. <relPosition x="0" y="70"/>
  2466. <connection refLocalId="10">
  2467. <position x="260" y="89"/>
  2468. <position x="203" y="89"/>
  2469. <position x="203" y="80"/>
  2470. <position x="146" y="80"/>
  2471. </connection>
  2472. </connectionPointIn>
  2473. </variable>
  2474. <variable formalParameter="raw_max">
  2475. <connectionPointIn>
  2476. <relPosition x="0" y="90"/>
  2477. <connection refLocalId="13">
  2478. <position x="260" y="109"/>
  2479. <position x="211" y="109"/>
  2480. <position x="211" y="108"/>
  2481. <position x="162" y="108"/>
  2482. </connection>
  2483. </connectionPointIn>
  2484. </variable>
  2485. <variable formalParameter="raw_min">
  2486. <connectionPointIn>
  2487. <relPosition x="0" y="110"/>
  2488. <connection refLocalId="14">
  2489. <position x="260" y="129"/>
  2490. <position x="213" y="129"/>
  2491. <position x="213" y="146"/>
  2492. <position x="167" y="146"/>
  2493. </connection>
  2494. </connectionPointIn>
  2495. </variable>
  2496. </inputVariables>
  2497. <inOutVariables/>
  2498. <outputVariables>
  2499. <variable formalParameter="scaled_real">
  2500. <connectionPointOut>
  2501. <relPosition x="205" y="30"/>
  2502. </connectionPointOut>
  2503. </variable>
  2504. </outputVariables>
  2505. </block>
  2506. <inVariable localId="12" height="27" width="117" negated="false" executionOrderId="0">
  2507. <position x="34" y="34"/>
  2508. <connectionPointOut>
  2509. <relPosition x="117" y="13"/>
  2510. </connectionPointOut>
  2511. <expression>flow_max</expression>
  2512. </inVariable>
  2513. <inVariable localId="10" height="27" width="74" negated="false" executionOrderId="0">
  2514. <position x="72" y="67"/>
  2515. <connectionPointOut>
  2516. <relPosition x="74" y="13"/>
  2517. </connectionPointOut>
  2518. <expression>flow_min</expression>
  2519. </inVariable>
  2520. <inVariable localId="5" height="27" width="103" negated="false" executionOrderId="0">
  2521. <position x="91" y="3"/>
  2522. <connectionPointOut>
  2523. <relPosition x="103" y="13"/>
  2524. </connectionPointOut>
  2525. <expression>product_flow</expression>
  2526. </inVariable>
  2527. <outVariable localId="15" height="27" width="136" negated="false">
  2528. <position x="501" y="41"/>
  2529. <connectionPointIn>
  2530. <relPosition x="0" y="13"/>
  2531. <connection refLocalId="11" formalParameter="scaled_real">
  2532. <position x="501" y="54"/>
  2533. <position x="491" y="54"/>
  2534. <position x="491" y="49"/>
  2535. <position x="465" y="49"/>
  2536. </connection>
  2537. </connectionPointIn>
  2538. <expression>product_flow_real</expression>
  2539. </outVariable>
  2540. <inVariable localId="16" height="27" width="136" negated="false">
  2541. <position x="57" y="447"/>
  2542. <connectionPointOut>
  2543. <relPosition x="136" y="13"/>
  2544. </connectionPointOut>
  2545. <expression>product_flow_real</expression>
  2546. </inVariable>
  2547. <block localId="2" typeName="scale_to_real" instanceName="scale_to_real1" height="120" width="205" executionOrderId="0">
  2548. <position x="253" y="165"/>
  2549. <inputVariables>
  2550. <variable formalParameter="raw_input_value">
  2551. <connectionPointIn>
  2552. <relPosition x="0" y="36"/>
  2553. <connection refLocalId="25">
  2554. <position x="253" y="201"/>
  2555. <position x="230" y="201"/>
  2556. <position x="230" y="195"/>
  2557. <position x="245" y="195"/>
  2558. <position x="245" y="173"/>
  2559. <position x="144" y="173"/>
  2560. </connection>
  2561. </connectionPointIn>
  2562. </variable>
  2563. <variable formalParameter="real_max">
  2564. <connectionPointIn>
  2565. <relPosition x="0" y="69"/>
  2566. <connection refLocalId="20">
  2567. <position x="253" y="234"/>
  2568. <position x="200" y="234"/>
  2569. <position x="200" y="214"/>
  2570. <position x="147" y="214"/>
  2571. </connection>
  2572. </connectionPointIn>
  2573. </variable>
  2574. <variable formalParameter="real_min">
  2575. <connectionPointIn>
  2576. <relPosition x="0" y="102"/>
  2577. <connection refLocalId="21">
  2578. <position x="253" y="267"/>
  2579. <position x="196" y="267"/>
  2580. <position x="196" y="240"/>
  2581. <position x="140" y="240"/>
  2582. </connection>
  2583. </connectionPointIn>
  2584. </variable>
  2585. </inputVariables>
  2586. <inOutVariables/>
  2587. <outputVariables>
  2588. <variable formalParameter="scaled_real">
  2589. <connectionPointOut>
  2590. <relPosition x="205" y="36"/>
  2591. </connectionPointOut>
  2592. </variable>
  2593. </outputVariables>
  2594. </block>
  2595. <inVariable localId="20" height="27" width="117" negated="false" executionOrderId="0">
  2596. <position x="30" y="201"/>
  2597. <connectionPointOut>
  2598. <relPosition x="117" y="13"/>
  2599. </connectionPointOut>
  2600. <expression>flow_max</expression>
  2601. </inVariable>
  2602. <inVariable localId="21" height="27" width="74" negated="false" executionOrderId="0">
  2603. <position x="66" y="227"/>
  2604. <connectionPointOut>
  2605. <relPosition x="74" y="13"/>
  2606. </connectionPointOut>
  2607. <expression>flow_min</expression>
  2608. </inVariable>
  2609. <inVariable localId="25" height="27" width="89" negated="false">
  2610. <position x="55" y="160"/>
  2611. <connectionPointOut>
  2612. <relPosition x="89" y="13"/>
  2613. </connectionPointOut>
  2614. <expression>flow_set_in</expression>
  2615. </inVariable>
  2616. <outVariable localId="26" height="27" width="102" negated="false">
  2617. <position x="505" y="195"/>
  2618. <connectionPointIn>
  2619. <relPosition x="0" y="13"/>
  2620. <connection refLocalId="2" formalParameter="scaled_real">
  2621. <position x="505" y="208"/>
  2622. <position x="481" y="208"/>
  2623. <position x="481" y="197"/>
  2624. <position x="458" y="197"/>
  2625. </connection>
  2626. </connectionPointIn>
  2627. <expression>flow_set_real</expression>
  2628. </outVariable>
  2629. <block localId="28" typeName="scale_to_real" instanceName="scale_to_real2" height="80" width="205">
  2630. <position x="260" y="628"/>
  2631. <inputVariables>
  2632. <variable formalParameter="raw_input_value">
  2633. <connectionPointIn>
  2634. <relPosition x="0" y="30"/>
  2635. <connection refLocalId="29">
  2636. <position x="260" y="658"/>
  2637. <position x="236" y="658"/>
  2638. <position x="236" y="633"/>
  2639. <position x="161" y="633"/>
  2640. </connection>
  2641. </connectionPointIn>
  2642. </variable>
  2643. <variable formalParameter="real_max">
  2644. <connectionPointIn>
  2645. <relPosition x="0" y="50"/>
  2646. <connection refLocalId="31">
  2647. <position x="260" y="678"/>
  2648. <position x="213" y="678"/>
  2649. <position x="213" y="681"/>
  2650. <position x="166" y="681"/>
  2651. </connection>
  2652. </connectionPointIn>
  2653. </variable>
  2654. <variable formalParameter="real_min">
  2655. <connectionPointIn>
  2656. <relPosition x="0" y="70"/>
  2657. <connection refLocalId="30">
  2658. <position x="260" y="698"/>
  2659. <position x="219" y="698"/>
  2660. <position x="219" y="712"/>
  2661. <position x="178" y="712"/>
  2662. </connection>
  2663. </connectionPointIn>
  2664. </variable>
  2665. </inputVariables>
  2666. <inOutVariables/>
  2667. <outputVariables>
  2668. <variable formalParameter="scaled_real">
  2669. <connectionPointOut>
  2670. <relPosition x="205" y="30"/>
  2671. </connectionPointOut>
  2672. </variable>
  2673. </outputVariables>
  2674. </block>
  2675. <inVariable localId="29" height="27" width="70" negated="false">
  2676. <position x="91" y="620"/>
  2677. <connectionPointOut>
  2678. <relPosition x="70" y="13"/>
  2679. </connectionPointOut>
  2680. <expression>curr_pos</expression>
  2681. </inVariable>
  2682. <inVariable localId="30" height="27" width="68" negated="false">
  2683. <position x="110" y="699"/>
  2684. <connectionPointOut>
  2685. <relPosition x="68" y="13"/>
  2686. </connectionPointOut>
  2687. <expression>pos_min</expression>
  2688. </inVariable>
  2689. <inVariable localId="31" height="27" width="71" negated="false">
  2690. <position x="95" y="668"/>
  2691. <connectionPointOut>
  2692. <relPosition x="71" y="13"/>
  2693. </connectionPointOut>
  2694. <expression>pos_max</expression>
  2695. </inVariable>
  2696. <outVariable localId="32" height="27" width="103" negated="false">
  2697. <position x="506" y="670"/>
  2698. <connectionPointIn>
  2699. <relPosition x="0" y="13"/>
  2700. <connection refLocalId="28" formalParameter="scaled_real">
  2701. <position x="506" y="683"/>
  2702. <position x="482" y="683"/>
  2703. <position x="482" y="658"/>
  2704. <position x="465" y="658"/>
  2705. </connection>
  2706. </connectionPointIn>
  2707. <expression>curr_pos_real</expression>
  2708. </outVariable>
  2709. <inVariable localId="34" height="27" width="103" negated="false">
  2710. <position x="36" y="777"/>
  2711. <connectionPointOut>
  2712. <relPosition x="103" y="13"/>
  2713. </connectionPointOut>
  2714. <expression>curr_pos_real</expression>
  2715. </inVariable>
  2716. <inVariable localId="35" height="27" width="124" negated="false">
  2717. <position x="37" y="853"/>
  2718. <connectionPointOut>
  2719. <relPosition x="124" y="13"/>
  2720. </connectionPointOut>
  2721. <expression>pos_update_real</expression>
  2722. </inVariable>
  2723. <block localId="36" typeName="scale_to_uint" instanceName="scale_to_uint0" height="40" width="120">
  2724. <position x="453" y="787"/>
  2725. <inputVariables>
  2726. <variable formalParameter="real_in">
  2727. <connectionPointIn>
  2728. <relPosition x="0" y="30"/>
  2729. <connection refLocalId="40" formalParameter="OUT">
  2730. <position x="453" y="817"/>
  2731. <position x="433" y="817"/>
  2732. <position x="433" y="786"/>
  2733. <position x="413" y="786"/>
  2734. </connection>
  2735. </connectionPointIn>
  2736. </variable>
  2737. </inputVariables>
  2738. <inOutVariables/>
  2739. <outputVariables>
  2740. <variable formalParameter="uint_out">
  2741. <connectionPointOut>
  2742. <relPosition x="120" y="30"/>
  2743. </connectionPointOut>
  2744. </variable>
  2745. </outputVariables>
  2746. </block>
  2747. <outVariable localId="37" height="27" width="71" negated="false">
  2748. <position x="606" y="818"/>
  2749. <connectionPointIn>
  2750. <relPosition x="0" y="13"/>
  2751. <connection refLocalId="36" formalParameter="uint_out">
  2752. <position x="606" y="831"/>
  2753. <position x="589" y="831"/>
  2754. <position x="589" y="817"/>
  2755. <position x="573" y="817"/>
  2756. </connection>
  2757. </connectionPointIn>
  2758. <expression>new_pos</expression>
  2759. </outVariable>
  2760. <block localId="40" typeName="LIMIT" height="80" width="69">
  2761. <position x="344" y="756"/>
  2762. <inputVariables>
  2763. <variable formalParameter="MN">
  2764. <connectionPointIn>
  2765. <relPosition x="0" y="30"/>
  2766. <connection refLocalId="42">
  2767. <position x="344" y="786"/>
  2768. <position x="330" y="786"/>
  2769. <position x="330" y="753"/>
  2770. <position x="316" y="753"/>
  2771. </connection>
  2772. </connectionPointIn>
  2773. </variable>
  2774. <variable formalParameter="IN">
  2775. <connectionPointIn>
  2776. <relPosition x="0" y="50"/>
  2777. <connection refLocalId="58" formalParameter="OUT">
  2778. <position x="344" y="806"/>
  2779. <position x="284" y="806"/>
  2780. <position x="284" y="799"/>
  2781. <position x="250" y="799"/>
  2782. </connection>
  2783. </connectionPointIn>
  2784. </variable>
  2785. <variable formalParameter="MX">
  2786. <connectionPointIn>
  2787. <relPosition x="0" y="70"/>
  2788. <connection refLocalId="41">
  2789. <position x="344" y="826"/>
  2790. <position x="329" y="826"/>
  2791. <position x="329" y="843"/>
  2792. <position x="314" y="843"/>
  2793. </connection>
  2794. </connectionPointIn>
  2795. </variable>
  2796. </inputVariables>
  2797. <inOutVariables/>
  2798. <outputVariables>
  2799. <variable formalParameter="OUT">
  2800. <connectionPointOut>
  2801. <relPosition x="69" y="30"/>
  2802. </connectionPointOut>
  2803. </variable>
  2804. </outputVariables>
  2805. </block>
  2806. <inVariable localId="41" height="27" width="71" negated="false">
  2807. <position x="243" y="830"/>
  2808. <connectionPointOut>
  2809. <relPosition x="71" y="13"/>
  2810. </connectionPointOut>
  2811. <expression>pos_max</expression>
  2812. </inVariable>
  2813. <inVariable localId="42" height="27" width="68" negated="false">
  2814. <position x="248" y="740"/>
  2815. <connectionPointOut>
  2816. <relPosition x="68" y="13"/>
  2817. </connectionPointOut>
  2818. <expression>pos_min</expression>
  2819. </inVariable>
  2820. <inVariable localId="54" height="27" width="56" negated="false">
  2821. <position x="427" y="453"/>
  2822. <connectionPointOut>
  2823. <relPosition x="56" y="13"/>
  2824. </connectionPointOut>
  2825. <expression>flow_k</expression>
  2826. </inVariable>
  2827. <block localId="58" typeName="ADD" height="60" width="68">
  2828. <position x="182" y="769"/>
  2829. <inputVariables>
  2830. <variable formalParameter="IN1">
  2831. <connectionPointIn>
  2832. <relPosition x="0" y="30"/>
  2833. <connection refLocalId="34">
  2834. <position x="182" y="799"/>
  2835. <position x="146" y="799"/>
  2836. <position x="146" y="795"/>
  2837. <position x="151" y="795"/>
  2838. <position x="151" y="790"/>
  2839. <position x="139" y="790"/>
  2840. </connection>
  2841. </connectionPointIn>
  2842. </variable>
  2843. <variable formalParameter="IN2">
  2844. <connectionPointIn>
  2845. <relPosition x="0" y="50"/>
  2846. <connection refLocalId="35">
  2847. <position x="182" y="819"/>
  2848. <position x="146" y="819"/>
  2849. <position x="146" y="849"/>
  2850. <position x="171" y="849"/>
  2851. <position x="171" y="866"/>
  2852. <position x="161" y="866"/>
  2853. </connection>
  2854. </connectionPointIn>
  2855. </variable>
  2856. </inputVariables>
  2857. <inOutVariables/>
  2858. <outputVariables>
  2859. <variable formalParameter="OUT">
  2860. <connectionPointOut>
  2861. <relPosition x="68" y="30"/>
  2862. </connectionPointOut>
  2863. </variable>
  2864. </outputVariables>
  2865. </block>
  2866. <block localId="59" typeName="SUB" height="60" width="68">
  2867. <position x="277" y="383"/>
  2868. <inputVariables>
  2869. <variable formalParameter="IN1">
  2870. <connectionPointIn>
  2871. <relPosition x="0" y="30"/>
  2872. <connection refLocalId="4">
  2873. <position x="277" y="413"/>
  2874. <position x="229" y="413"/>
  2875. <position x="229" y="403"/>
  2876. <position x="181" y="403"/>
  2877. </connection>
  2878. </connectionPointIn>
  2879. </variable>
  2880. <variable formalParameter="IN2">
  2881. <connectionPointIn>
  2882. <relPosition x="0" y="50"/>
  2883. <connection refLocalId="16">
  2884. <position x="277" y="433"/>
  2885. <position x="235" y="433"/>
  2886. <position x="235" y="460"/>
  2887. <position x="193" y="460"/>
  2888. </connection>
  2889. </connectionPointIn>
  2890. </variable>
  2891. </inputVariables>
  2892. <inOutVariables/>
  2893. <outputVariables>
  2894. <variable formalParameter="OUT">
  2895. <connectionPointOut>
  2896. <relPosition x="68" y="30"/>
  2897. </connectionPointOut>
  2898. </variable>
  2899. </outputVariables>
  2900. </block>
  2901. <block localId="60" typeName="MUL" height="60" width="68">
  2902. <position x="566" y="376"/>
  2903. <inputVariables>
  2904. <variable formalParameter="IN1">
  2905. <connectionPointIn>
  2906. <relPosition x="0" y="30"/>
  2907. <connection refLocalId="59" formalParameter="OUT">
  2908. <position x="566" y="406"/>
  2909. <position x="493" y="406"/>
  2910. <position x="493" y="413"/>
  2911. <position x="345" y="413"/>
  2912. </connection>
  2913. </connectionPointIn>
  2914. </variable>
  2915. <variable formalParameter="IN2">
  2916. <connectionPointIn>
  2917. <relPosition x="0" y="50"/>
  2918. <connection refLocalId="54">
  2919. <position x="566" y="426"/>
  2920. <position x="556" y="426"/>
  2921. <position x="556" y="466"/>
  2922. <position x="483" y="466"/>
  2923. </connection>
  2924. </connectionPointIn>
  2925. </variable>
  2926. </inputVariables>
  2927. <inOutVariables/>
  2928. <outputVariables>
  2929. <variable formalParameter="OUT">
  2930. <connectionPointOut>
  2931. <relPosition x="68" y="30"/>
  2932. </connectionPointOut>
  2933. </variable>
  2934. </outputVariables>
  2935. </block>
  2936. </LD>
  2937. </body>
  2938. </pou>
  2939. <pou name="composition_control" pouType="functionBlock">
  2940. <interface>
  2941. <localVars>
  2942. <variable name="a_in_purge_real">
  2943. <type>
  2944. <REAL/>
  2945. </type>
  2946. <initialValue>
  2947. <simpleValue value="47.00"/>
  2948. </initialValue>
  2949. </variable>
  2950. </localVars>
  2951. <inputVars>
  2952. <variable name="a_in_purge">
  2953. <type>
  2954. <UINT/>
  2955. </type>
  2956. <initialValue>
  2957. <simpleValue value="32000"/>
  2958. </initialValue>
  2959. </variable>
  2960. </inputVars>
  2961. <localVars>
  2962. <variable name="a_setpoint_real">
  2963. <type>
  2964. <REAL/>
  2965. </type>
  2966. <initialValue>
  2967. <simpleValue value="47.00"/>
  2968. </initialValue>
  2969. </variable>
  2970. </localVars>
  2971. <inputVars>
  2972. <variable name="a_setpoint">
  2973. <type>
  2974. <UINT/>
  2975. </type>
  2976. <initialValue>
  2977. <simpleValue value="32000"/>
  2978. </initialValue>
  2979. </variable>
  2980. <variable name="curr_pos">
  2981. <type>
  2982. <UINT/>
  2983. </type>
  2984. <initialValue>
  2985. <simpleValue value="16000"/>
  2986. </initialValue>
  2987. </variable>
  2988. </inputVars>
  2989. <localVars>
  2990. <variable name="valve_pos_real">
  2991. <type>
  2992. <REAL/>
  2993. </type>
  2994. <initialValue>
  2995. <simpleValue value="25.0"/>
  2996. </initialValue>
  2997. </variable>
  2998. <variable name="pos_update_real">
  2999. <type>
  3000. <REAL/>
  3001. </type>
  3002. <initialValue>
  3003. <simpleValue value="0.0"/>
  3004. </initialValue>
  3005. </variable>
  3006. <variable name="valve_pos_nominal">
  3007. <type>
  3008. <REAL/>
  3009. </type>
  3010. <initialValue>
  3011. <simpleValue value="25.0"/>
  3012. </initialValue>
  3013. </variable>
  3014. </localVars>
  3015. <outputVars>
  3016. <variable name="new_pos">
  3017. <type>
  3018. <UINT/>
  3019. </type>
  3020. <initialValue>
  3021. <simpleValue value="16000"/>
  3022. </initialValue>
  3023. </variable>
  3024. </outputVars>
  3025. <localVars>
  3026. <variable name="composition_k">
  3027. <type>
  3028. <REAL/>
  3029. </type>
  3030. <initialValue>
  3031. <simpleValue value="1.0"/>
  3032. </initialValue>
  3033. </variable>
  3034. <variable name="composition_ti">
  3035. <type>
  3036. <REAL/>
  3037. </type>
  3038. <initialValue>
  3039. <simpleValue value="99.0"/>
  3040. </initialValue>
  3041. </variable>
  3042. <variable name="cycle_time">
  3043. <type>
  3044. <TIME/>
  3045. </type>
  3046. <initialValue>
  3047. <simpleValue value="T#50ms"/>
  3048. </initialValue>
  3049. </variable>
  3050. <variable name="scale_to_real3">
  3051. <type>
  3052. <derived name="scale_to_real"/>
  3053. </type>
  3054. </variable>
  3055. <variable name="scale_to_real2">
  3056. <type>
  3057. <derived name="scale_to_real"/>
  3058. </type>
  3059. </variable>
  3060. <variable name="scale_to_uint0">
  3061. <type>
  3062. <derived name="scale_to_uint"/>
  3063. </type>
  3064. </variable>
  3065. <variable name="comp_max">
  3066. <type>
  3067. <REAL/>
  3068. </type>
  3069. <initialValue>
  3070. <simpleValue value="100.0"/>
  3071. </initialValue>
  3072. </variable>
  3073. <variable name="comp_min">
  3074. <type>
  3075. <REAL/>
  3076. </type>
  3077. <initialValue>
  3078. <simpleValue value="0.0"/>
  3079. </initialValue>
  3080. </variable>
  3081. <variable name="pos_max">
  3082. <type>
  3083. <REAL/>
  3084. </type>
  3085. <initialValue>
  3086. <simpleValue value="100.0"/>
  3087. </initialValue>
  3088. </variable>
  3089. <variable name="pos_min">
  3090. <type>
  3091. <REAL/>
  3092. </type>
  3093. <initialValue>
  3094. <simpleValue value="0.0"/>
  3095. </initialValue>
  3096. </variable>
  3097. <variable name="scale_to_real0">
  3098. <type>
  3099. <derived name="scale_to_real"/>
  3100. </type>
  3101. </variable>
  3102. </localVars>
  3103. </interface>
  3104. <body>
  3105. <LD>
  3106. <leftPowerRail localId="2" height="200" width="3">
  3107. <position x="0" y="339"/>
  3108. <connectionPointOut formalParameter="">
  3109. <relPosition x="3" y="20"/>
  3110. </connectionPointOut>
  3111. <connectionPointOut formalParameter="">
  3112. <relPosition x="3" y="60"/>
  3113. </connectionPointOut>
  3114. <connectionPointOut formalParameter="">
  3115. <relPosition x="3" y="100"/>
  3116. </connectionPointOut>
  3117. <connectionPointOut formalParameter="">
  3118. <relPosition x="3" y="140"/>
  3119. </connectionPointOut>
  3120. <connectionPointOut formalParameter="">
  3121. <relPosition x="3" y="180"/>
  3122. </connectionPointOut>
  3123. </leftPowerRail>
  3124. <inVariable localId="3" height="27" width="119" negated="false">
  3125. <position x="96" y="361"/>
  3126. <connectionPointOut>
  3127. <relPosition x="119" y="13"/>
  3128. </connectionPointOut>
  3129. <expression>a_in_purge_real</expression>
  3130. </inVariable>
  3131. <inVariable localId="4" height="27" width="116" negated="false">
  3132. <position x="68" y="317"/>
  3133. <connectionPointOut>
  3134. <relPosition x="116" y="13"/>
  3135. </connectionPointOut>
  3136. <expression>a_setpoint_real</expression>
  3137. </inVariable>
  3138. <inVariable localId="5" height="27" width="111" negated="false">
  3139. <position x="342" y="406"/>
  3140. <connectionPointOut>
  3141. <relPosition x="111" y="13"/>
  3142. </connectionPointOut>
  3143. <expression>composition_k</expression>
  3144. </inVariable>
  3145. <outVariable localId="8" height="27" width="124" negated="false">
  3146. <position x="760" y="349"/>
  3147. <connectionPointIn>
  3148. <relPosition x="0" y="13"/>
  3149. <connection refLocalId="46" formalParameter="OUT">
  3150. <position x="760" y="362"/>
  3151. <position x="666" y="362"/>
  3152. <position x="666" y="376"/>
  3153. <position x="572" y="376"/>
  3154. </connection>
  3155. </connectionPointIn>
  3156. <expression>pos_update_real</expression>
  3157. </outVariable>
  3158. <block localId="26" typeName="scale_to_real" instanceName="scale_to_real3" height="120" width="205" executionOrderId="0">
  3159. <position x="234" y="19"/>
  3160. <inputVariables>
  3161. <variable formalParameter="raw_input_value">
  3162. <connectionPointIn>
  3163. <relPosition x="0" y="36"/>
  3164. <connection refLocalId="30">
  3165. <position x="234" y="55"/>
  3166. <position x="212" y="55"/>
  3167. <position x="212" y="51"/>
  3168. <position x="191" y="51"/>
  3169. </connection>
  3170. </connectionPointIn>
  3171. </variable>
  3172. <variable formalParameter="real_max">
  3173. <connectionPointIn>
  3174. <relPosition x="0" y="69"/>
  3175. <connection refLocalId="28">
  3176. <position x="234" y="88"/>
  3177. <position x="160" y="88"/>
  3178. <position x="160" y="95"/>
  3179. <position x="117" y="95"/>
  3180. </connection>
  3181. </connectionPointIn>
  3182. </variable>
  3183. <variable formalParameter="real_min">
  3184. <connectionPointIn>
  3185. <relPosition x="0" y="102"/>
  3186. <connection refLocalId="29">
  3187. <position x="234" y="121"/>
  3188. <position x="162" y="121"/>
  3189. <position x="162" y="129"/>
  3190. <position x="121" y="129"/>
  3191. </connection>
  3192. </connectionPointIn>
  3193. </variable>
  3194. </inputVariables>
  3195. <inOutVariables/>
  3196. <outputVariables>
  3197. <variable formalParameter="scaled_real">
  3198. <connectionPointOut>
  3199. <relPosition x="205" y="36"/>
  3200. </connectionPointOut>
  3201. </variable>
  3202. </outputVariables>
  3203. </block>
  3204. <inVariable localId="28" height="27" width="84" negated="false" executionOrderId="0">
  3205. <position x="33" y="82"/>
  3206. <connectionPointOut>
  3207. <relPosition x="84" y="13"/>
  3208. </connectionPointOut>
  3209. <expression>comp_max</expression>
  3210. </inVariable>
  3211. <inVariable localId="29" height="27" width="81" negated="false" executionOrderId="0">
  3212. <position x="40" y="116"/>
  3213. <connectionPointOut>
  3214. <relPosition x="81" y="13"/>
  3215. </connectionPointOut>
  3216. <expression>comp_min</expression>
  3217. </inVariable>
  3218. <inVariable localId="30" height="27" width="86" negated="false">
  3219. <position x="105" y="38"/>
  3220. <connectionPointOut>
  3221. <relPosition x="86" y="13"/>
  3222. </connectionPointOut>
  3223. <expression>a_in_purge</expression>
  3224. </inVariable>
  3225. <outVariable localId="31" height="27" width="119" negated="false">
  3226. <position x="486" y="25"/>
  3227. <connectionPointIn>
  3228. <relPosition x="0" y="13"/>
  3229. <connection refLocalId="26" formalParameter="scaled_real">
  3230. <position x="486" y="38"/>
  3231. <position x="463" y="38"/>
  3232. <position x="463" y="55"/>
  3233. <position x="439" y="55"/>
  3234. </connection>
  3235. </connectionPointIn>
  3236. <expression>a_in_purge_real</expression>
  3237. </outVariable>
  3238. <block localId="16" typeName="scale_to_real" instanceName="scale_to_real2" height="120" width="205" executionOrderId="0">
  3239. <position x="239" y="163"/>
  3240. <inputVariables>
  3241. <variable formalParameter="raw_input_value">
  3242. <connectionPointIn>
  3243. <relPosition x="0" y="36"/>
  3244. <connection refLocalId="32">
  3245. <position x="239" y="199"/>
  3246. <position x="216" y="199"/>
  3247. <position x="216" y="193"/>
  3248. <position x="193" y="193"/>
  3249. </connection>
  3250. </connectionPointIn>
  3251. </variable>
  3252. <variable formalParameter="real_max">
  3253. <connectionPointIn>
  3254. <relPosition x="0" y="69"/>
  3255. <connection refLocalId="17">
  3256. <position x="239" y="232"/>
  3257. <position x="184" y="232"/>
  3258. <position x="184" y="224"/>
  3259. <position x="129" y="224"/>
  3260. </connection>
  3261. </connectionPointIn>
  3262. </variable>
  3263. <variable formalParameter="real_min">
  3264. <connectionPointIn>
  3265. <relPosition x="0" y="102"/>
  3266. <connection refLocalId="19">
  3267. <position x="239" y="265"/>
  3268. <position x="192" y="265"/>
  3269. <position x="192" y="258"/>
  3270. <position x="145" y="258"/>
  3271. </connection>
  3272. </connectionPointIn>
  3273. </variable>
  3274. </inputVariables>
  3275. <inOutVariables/>
  3276. <outputVariables>
  3277. <variable formalParameter="scaled_real">
  3278. <connectionPointOut>
  3279. <relPosition x="205" y="36"/>
  3280. </connectionPointOut>
  3281. </variable>
  3282. </outputVariables>
  3283. </block>
  3284. <inVariable localId="17" height="27" width="84" negated="false" executionOrderId="0">
  3285. <position x="45" y="211"/>
  3286. <connectionPointOut>
  3287. <relPosition x="84" y="13"/>
  3288. </connectionPointOut>
  3289. <expression>comp_max</expression>
  3290. </inVariable>
  3291. <inVariable localId="19" height="27" width="81" negated="false" executionOrderId="0">
  3292. <position x="64" y="245"/>
  3293. <connectionPointOut>
  3294. <relPosition x="81" y="13"/>
  3295. </connectionPointOut>
  3296. <expression>comp_min</expression>
  3297. </inVariable>
  3298. <inVariable localId="32" height="27" width="83" negated="false">
  3299. <position x="110" y="180"/>
  3300. <connectionPointOut>
  3301. <relPosition x="83" y="13"/>
  3302. </connectionPointOut>
  3303. <expression>a_setpoint</expression>
  3304. </inVariable>
  3305. <outVariable localId="33" height="27" width="116" negated="false">
  3306. <position x="473" y="170"/>
  3307. <connectionPointIn>
  3308. <relPosition x="0" y="13"/>
  3309. <connection refLocalId="16" formalParameter="scaled_real">
  3310. <position x="473" y="183"/>
  3311. <position x="463" y="183"/>
  3312. <position x="463" y="199"/>
  3313. <position x="444" y="199"/>
  3314. </connection>
  3315. </connectionPointIn>
  3316. <expression>a_setpoint_real</expression>
  3317. </outVariable>
  3318. <block localId="34" typeName="scale_to_uint" instanceName="scale_to_uint0" height="40" width="120">
  3319. <position x="525" y="646"/>
  3320. <inputVariables>
  3321. <variable formalParameter="real_in">
  3322. <connectionPointIn>
  3323. <relPosition x="0" y="30"/>
  3324. <connection refLocalId="44" formalParameter="OUT">
  3325. <position x="525" y="676"/>
  3326. <position x="507" y="676"/>
  3327. <position x="507" y="691"/>
  3328. <position x="490" y="691"/>
  3329. </connection>
  3330. </connectionPointIn>
  3331. </variable>
  3332. </inputVariables>
  3333. <inOutVariables/>
  3334. <outputVariables>
  3335. <variable formalParameter="uint_out">
  3336. <connectionPointOut>
  3337. <relPosition x="120" y="30"/>
  3338. </connectionPointOut>
  3339. </variable>
  3340. </outputVariables>
  3341. </block>
  3342. <outVariable localId="36" height="27" width="78" negated="false">
  3343. <position x="703" y="661"/>
  3344. <connectionPointIn>
  3345. <relPosition x="0" y="13"/>
  3346. <connection refLocalId="34" formalParameter="uint_out">
  3347. <position x="703" y="674"/>
  3348. <position x="674" y="674"/>
  3349. <position x="674" y="676"/>
  3350. <position x="645" y="676"/>
  3351. </connection>
  3352. </connectionPointIn>
  3353. <expression>new_pos</expression>
  3354. </outVariable>
  3355. <block localId="38" typeName="scale_to_real" instanceName="scale_to_real0" height="80" width="205">
  3356. <position x="283" y="547"/>
  3357. <inputVariables>
  3358. <variable formalParameter="raw_input_value">
  3359. <connectionPointIn>
  3360. <relPosition x="0" y="30"/>
  3361. <connection refLocalId="39">
  3362. <position x="283" y="577"/>
  3363. <position x="171" y="577"/>
  3364. </connection>
  3365. </connectionPointIn>
  3366. </variable>
  3367. <variable formalParameter="real_max">
  3368. <connectionPointIn>
  3369. <relPosition x="0" y="50"/>
  3370. <connection refLocalId="40">
  3371. <position x="283" y="597"/>
  3372. <position x="247" y="597"/>
  3373. <position x="247" y="605"/>
  3374. <position x="176" y="605"/>
  3375. </connection>
  3376. </connectionPointIn>
  3377. </variable>
  3378. <variable formalParameter="real_min">
  3379. <connectionPointIn>
  3380. <relPosition x="0" y="70"/>
  3381. <connection refLocalId="9">
  3382. <position x="283" y="617"/>
  3383. <position x="239" y="617"/>
  3384. <position x="239" y="640"/>
  3385. <position x="195" y="640"/>
  3386. </connection>
  3387. </connectionPointIn>
  3388. </variable>
  3389. </inputVariables>
  3390. <inOutVariables/>
  3391. <outputVariables>
  3392. <variable formalParameter="scaled_real">
  3393. <connectionPointOut>
  3394. <relPosition x="205" y="30"/>
  3395. </connectionPointOut>
  3396. </variable>
  3397. </outputVariables>
  3398. </block>
  3399. <inVariable localId="39" height="27" width="70" negated="false">
  3400. <position x="101" y="564"/>
  3401. <connectionPointOut>
  3402. <relPosition x="70" y="13"/>
  3403. </connectionPointOut>
  3404. <expression>curr_pos</expression>
  3405. </inVariable>
  3406. <inVariable localId="40" height="27" width="71" negated="false">
  3407. <position x="105" y="592"/>
  3408. <connectionPointOut>
  3409. <relPosition x="71" y="13"/>
  3410. </connectionPointOut>
  3411. <expression>pos_max</expression>
  3412. </inVariable>
  3413. <inVariable localId="9" height="27" width="71" negated="false" executionOrderId="0">
  3414. <position x="124" y="627"/>
  3415. <connectionPointOut>
  3416. <relPosition x="71" y="13"/>
  3417. </connectionPointOut>
  3418. <expression>pos_min</expression>
  3419. </inVariable>
  3420. <outVariable localId="41" height="27" width="111" negated="false">
  3421. <position x="537" y="571"/>
  3422. <connectionPointIn>
  3423. <relPosition x="0" y="13"/>
  3424. <connection refLocalId="38" formalParameter="scaled_real">
  3425. <position x="537" y="584"/>
  3426. <position x="512" y="584"/>
  3427. <position x="512" y="577"/>
  3428. <position x="488" y="577"/>
  3429. </connection>
  3430. </connectionPointIn>
  3431. <expression>valve_pos_real</expression>
  3432. </outVariable>
  3433. <block localId="42" typeName="ADD" height="60" width="68">
  3434. <position x="257" y="675"/>
  3435. <inputVariables>
  3436. <variable formalParameter="IN1">
  3437. <connectionPointIn>
  3438. <relPosition x="0" y="30"/>
  3439. <connection refLocalId="43">
  3440. <position x="257" y="705"/>
  3441. <position x="233" y="705"/>
  3442. <position x="233" y="707"/>
  3443. <position x="203" y="707"/>
  3444. </connection>
  3445. </connectionPointIn>
  3446. </variable>
  3447. <variable formalParameter="IN2">
  3448. <connectionPointIn>
  3449. <relPosition x="0" y="50"/>
  3450. <connection refLocalId="10">
  3451. <position x="257" y="725"/>
  3452. <position x="231" y="725"/>
  3453. <position x="231" y="748"/>
  3454. <position x="212" y="748"/>
  3455. </connection>
  3456. </connectionPointIn>
  3457. </variable>
  3458. </inputVariables>
  3459. <inOutVariables/>
  3460. <outputVariables>
  3461. <variable formalParameter="OUT">
  3462. <connectionPointOut>
  3463. <relPosition x="68" y="30"/>
  3464. </connectionPointOut>
  3465. </variable>
  3466. </outputVariables>
  3467. </block>
  3468. <inVariable localId="43" height="27" width="111" negated="false">
  3469. <position x="92" y="694"/>
  3470. <connectionPointOut>
  3471. <relPosition x="111" y="13"/>
  3472. </connectionPointOut>
  3473. <expression>valve_pos_real</expression>
  3474. </inVariable>
  3475. <inVariable localId="10" height="27" width="124" negated="false" executionOrderId="0">
  3476. <position x="88" y="735"/>
  3477. <connectionPointOut>
  3478. <relPosition x="124" y="13"/>
  3479. </connectionPointOut>
  3480. <expression>pos_update_real</expression>
  3481. </inVariable>
  3482. <block localId="44" typeName="LIMIT" height="80" width="69">
  3483. <position x="421" y="661"/>
  3484. <inputVariables>
  3485. <variable formalParameter="MN">
  3486. <connectionPointIn>
  3487. <relPosition x="0" y="30"/>
  3488. <connection refLocalId="11">
  3489. <position x="421" y="691"/>
  3490. <position x="403" y="691"/>
  3491. <position x="403" y="655"/>
  3492. <position x="385" y="655"/>
  3493. </connection>
  3494. </connectionPointIn>
  3495. </variable>
  3496. <variable formalParameter="IN">
  3497. <connectionPointIn>
  3498. <relPosition x="0" y="50"/>
  3499. <connection refLocalId="42" formalParameter="OUT">
  3500. <position x="421" y="711"/>
  3501. <position x="373" y="711"/>
  3502. <position x="373" y="705"/>
  3503. <position x="325" y="705"/>
  3504. </connection>
  3505. </connectionPointIn>
  3506. </variable>
  3507. <variable formalParameter="MX">
  3508. <connectionPointIn>
  3509. <relPosition x="0" y="70"/>
  3510. <connection refLocalId="12">
  3511. <position x="421" y="731"/>
  3512. <position x="406" y="731"/>
  3513. <position x="406" y="754"/>
  3514. <position x="392" y="754"/>
  3515. </connection>
  3516. </connectionPointIn>
  3517. </variable>
  3518. </inputVariables>
  3519. <inOutVariables/>
  3520. <outputVariables>
  3521. <variable formalParameter="OUT">
  3522. <connectionPointOut>
  3523. <relPosition x="69" y="30"/>
  3524. </connectionPointOut>
  3525. </variable>
  3526. </outputVariables>
  3527. </block>
  3528. <inVariable localId="11" height="27" width="75" negated="false" executionOrderId="0">
  3529. <position x="310" y="642"/>
  3530. <connectionPointOut>
  3531. <relPosition x="75" y="13"/>
  3532. </connectionPointOut>
  3533. <expression>pos_min</expression>
  3534. </inVariable>
  3535. <inVariable localId="12" height="27" width="75" negated="false" executionOrderId="0">
  3536. <position x="317" y="741"/>
  3537. <connectionPointOut>
  3538. <relPosition x="75" y="13"/>
  3539. </connectionPointOut>
  3540. <expression>pos_max</expression>
  3541. </inVariable>
  3542. <block localId="45" typeName="SUB" height="60" width="68">
  3543. <position x="302" y="332"/>
  3544. <inputVariables>
  3545. <variable formalParameter="IN1">
  3546. <connectionPointIn>
  3547. <relPosition x="0" y="30"/>
  3548. <connection refLocalId="4">
  3549. <position x="302" y="362"/>
  3550. <position x="272" y="362"/>
  3551. <position x="272" y="330"/>
  3552. <position x="184" y="330"/>
  3553. </connection>
  3554. </connectionPointIn>
  3555. </variable>
  3556. <variable formalParameter="IN2">
  3557. <connectionPointIn>
  3558. <relPosition x="0" y="50"/>
  3559. <connection refLocalId="3">
  3560. <position x="302" y="382"/>
  3561. <position x="258" y="382"/>
  3562. <position x="258" y="374"/>
  3563. <position x="215" y="374"/>
  3564. </connection>
  3565. </connectionPointIn>
  3566. </variable>
  3567. </inputVariables>
  3568. <inOutVariables/>
  3569. <outputVariables>
  3570. <variable formalParameter="OUT">
  3571. <connectionPointOut>
  3572. <relPosition x="68" y="30"/>
  3573. </connectionPointOut>
  3574. </variable>
  3575. </outputVariables>
  3576. </block>
  3577. <block localId="46" typeName="MUL" height="60" width="68">
  3578. <position x="504" y="346"/>
  3579. <inputVariables>
  3580. <variable formalParameter="IN1">
  3581. <connectionPointIn>
  3582. <relPosition x="0" y="30"/>
  3583. <connection refLocalId="45" formalParameter="OUT">
  3584. <position x="504" y="376"/>
  3585. <position x="437" y="376"/>
  3586. <position x="437" y="362"/>
  3587. <position x="370" y="362"/>
  3588. </connection>
  3589. </connectionPointIn>
  3590. </variable>
  3591. <variable formalParameter="IN2">
  3592. <connectionPointIn>
  3593. <relPosition x="0" y="50"/>
  3594. <connection refLocalId="5">
  3595. <position x="504" y="396"/>
  3596. <position x="478" y="396"/>
  3597. <position x="478" y="419"/>
  3598. <position x="453" y="419"/>
  3599. </connection>
  3600. </connectionPointIn>
  3601. </variable>
  3602. </inputVariables>
  3603. <inOutVariables/>
  3604. <outputVariables>
  3605. <variable formalParameter="OUT">
  3606. <connectionPointOut>
  3607. <relPosition x="68" y="30"/>
  3608. </connectionPointOut>
  3609. </variable>
  3610. </outputVariables>
  3611. </block>
  3612. </LD>
  3613. </body>
  3614. </pou>
  3615. <pou name="scale_to_real" pouType="functionBlock">
  3616. <interface>
  3617. <inputVars>
  3618. <variable name="raw_input_value">
  3619. <type>
  3620. <UINT/>
  3621. </type>
  3622. </variable>
  3623. </inputVars>
  3624. <outputVars>
  3625. <variable name="scaled_real">
  3626. <type>
  3627. <REAL/>
  3628. </type>
  3629. </variable>
  3630. </outputVars>
  3631. <inputVars>
  3632. <variable name="real_max">
  3633. <type>
  3634. <REAL/>
  3635. </type>
  3636. </variable>
  3637. <variable name="real_min">
  3638. <type>
  3639. <REAL/>
  3640. </type>
  3641. </variable>
  3642. </inputVars>
  3643. <localVars>
  3644. <variable name="raw_max">
  3645. <type>
  3646. <UINT/>
  3647. </type>
  3648. <initialValue>
  3649. <simpleValue value="65535"/>
  3650. </initialValue>
  3651. </variable>
  3652. <variable name="raw_min">
  3653. <type>
  3654. <UINT/>
  3655. </type>
  3656. <initialValue>
  3657. <simpleValue value="0"/>
  3658. </initialValue>
  3659. </variable>
  3660. <variable name="rate">
  3661. <type>
  3662. <REAL/>
  3663. </type>
  3664. </variable>
  3665. <variable name="offset">
  3666. <type>
  3667. <REAL/>
  3668. </type>
  3669. </variable>
  3670. </localVars>
  3671. </interface>
  3672. <body>
  3673. <ST>
  3674. <xhtml:p><![CDATA[rate := (real_max - real_min) / UINT_TO_REAL(raw_max - raw_min);
  3675. offset := real_min - UINT_TO_REAL(raw_min)*rate;
  3676. scaled_real := UINT_TO_REAL(raw_input_value)*rate + offset;]]></xhtml:p>
  3677. </ST>
  3678. </body>
  3679. </pou>
  3680. <pou name="pressure_override" pouType="functionBlock">
  3681. <interface>
  3682. <localVars>
  3683. <variable name="pressure_real">
  3684. <type>
  3685. <REAL/>
  3686. </type>
  3687. <initialValue>
  3688. <simpleValue value="2700.0"/>
  3689. </initialValue>
  3690. </variable>
  3691. </localVars>
  3692. <inputVars>
  3693. <variable name="pressure">
  3694. <type>
  3695. <UINT/>
  3696. </type>
  3697. <initialValue>
  3698. <simpleValue value="58981"/>
  3699. </initialValue>
  3700. </variable>
  3701. <variable name="curr_sp">
  3702. <type>
  3703. <UINT/>
  3704. </type>
  3705. <initialValue>
  3706. <simpleValue value="58981"/>
  3707. </initialValue>
  3708. </variable>
  3709. </inputVars>
  3710. <localVars>
  3711. <variable name="curr_sp_real">
  3712. <type>
  3713. <REAL/>
  3714. </type>
  3715. <initialValue>
  3716. <simpleValue value="2700.0"/>
  3717. </initialValue>
  3718. </variable>
  3719. <variable name="product_sp_real">
  3720. <type>
  3721. <REAL/>
  3722. </type>
  3723. <initialValue>
  3724. <simpleValue value="100.0"/>
  3725. </initialValue>
  3726. </variable>
  3727. <variable name="sp_update">
  3728. <type>
  3729. <REAL/>
  3730. </type>
  3731. <initialValue>
  3732. <simpleValue value="0.0"/>
  3733. </initialValue>
  3734. </variable>
  3735. <variable name="product_sp_nominl">
  3736. <type>
  3737. <REAL/>
  3738. </type>
  3739. <initialValue>
  3740. <simpleValue value="100.0"/>
  3741. </initialValue>
  3742. </variable>
  3743. </localVars>
  3744. <outputVars>
  3745. <variable name="product_sp">
  3746. <type>
  3747. <UINT/>
  3748. </type>
  3749. <initialValue>
  3750. <simpleValue value="13107"/>
  3751. </initialValue>
  3752. </variable>
  3753. </outputVars>
  3754. <localVars>
  3755. <variable name="override_sp_real">
  3756. <type>
  3757. <REAL/>
  3758. </type>
  3759. <initialValue>
  3760. <simpleValue value="2900.0"/>
  3761. </initialValue>
  3762. </variable>
  3763. </localVars>
  3764. <inputVars>
  3765. <variable name="override_sp">
  3766. <type>
  3767. <UINT/>
  3768. </type>
  3769. <initialValue>
  3770. <simpleValue value="63350"/>
  3771. </initialValue>
  3772. </variable>
  3773. </inputVars>
  3774. <localVars>
  3775. <variable name="override_k">
  3776. <type>
  3777. <REAL/>
  3778. </type>
  3779. <initialValue>
  3780. <simpleValue value="1.0"/>
  3781. </initialValue>
  3782. </variable>
  3783. <variable name="override_ti">
  3784. <type>
  3785. <REAL/>
  3786. </type>
  3787. <initialValue>
  3788. <simpleValue value="99999.0"/>
  3789. </initialValue>
  3790. </variable>
  3791. <variable name="cycle_time">
  3792. <type>
  3793. <TIME/>
  3794. </type>
  3795. <initialValue>
  3796. <simpleValue value="T#50ms"/>
  3797. </initialValue>
  3798. </variable>
  3799. <variable name="scale_to_real7">
  3800. <type>
  3801. <derived name="scale_to_real"/>
  3802. </type>
  3803. </variable>
  3804. <variable name="pressure_max">
  3805. <type>
  3806. <REAL/>
  3807. </type>
  3808. <initialValue>
  3809. <simpleValue value="3000.0"/>
  3810. </initialValue>
  3811. </variable>
  3812. <variable name="pressure_min">
  3813. <type>
  3814. <REAL/>
  3815. </type>
  3816. <initialValue>
  3817. <simpleValue value="0.0"/>
  3818. </initialValue>
  3819. </variable>
  3820. <variable name="flow_max">
  3821. <type>
  3822. <REAL/>
  3823. </type>
  3824. <initialValue>
  3825. <simpleValue value="500.0"/>
  3826. </initialValue>
  3827. </variable>
  3828. <variable name="flow_min">
  3829. <type>
  3830. <REAL/>
  3831. </type>
  3832. <initialValue>
  3833. <simpleValue value="0.0"/>
  3834. </initialValue>
  3835. </variable>
  3836. <variable name="scale_to_real0">
  3837. <type>
  3838. <derived name="scale_to_real"/>
  3839. </type>
  3840. </variable>
  3841. </localVars>
  3842. </interface>
  3843. <body>
  3844. <LD>
  3845. <leftPowerRail localId="2" height="400" width="3">
  3846. <position x="73" y="380"/>
  3847. <connectionPointOut formalParameter="">
  3848. <relPosition x="3" y="20"/>
  3849. </connectionPointOut>
  3850. <connectionPointOut formalParameter="">
  3851. <relPosition x="3" y="60"/>
  3852. </connectionPointOut>
  3853. <connectionPointOut formalParameter="">
  3854. <relPosition x="3" y="100"/>
  3855. </connectionPointOut>
  3856. <connectionPointOut formalParameter="">
  3857. <relPosition x="3" y="140"/>
  3858. </connectionPointOut>
  3859. <connectionPointOut formalParameter="">
  3860. <relPosition x="3" y="180"/>
  3861. </connectionPointOut>
  3862. <connectionPointOut formalParameter="">
  3863. <relPosition x="3" y="220"/>
  3864. </connectionPointOut>
  3865. <connectionPointOut formalParameter="">
  3866. <relPosition x="3" y="260"/>
  3867. </connectionPointOut>
  3868. <connectionPointOut formalParameter="">
  3869. <relPosition x="3" y="300"/>
  3870. </connectionPointOut>
  3871. <connectionPointOut formalParameter="">
  3872. <relPosition x="3" y="340"/>
  3873. </connectionPointOut>
  3874. <connectionPointOut formalParameter="">
  3875. <relPosition x="3" y="380"/>
  3876. </connectionPointOut>
  3877. </leftPowerRail>
  3878. <inVariable localId="3" height="27" width="103" negated="false">
  3879. <position x="163" y="459"/>
  3880. <connectionPointOut>
  3881. <relPosition x="103" y="13"/>
  3882. </connectionPointOut>
  3883. <expression>pressure_real</expression>
  3884. </inVariable>
  3885. <inVariable localId="4" height="27" width="124" negated="false">
  3886. <position x="185" y="413"/>
  3887. <connectionPointOut>
  3888. <relPosition x="124" y="13"/>
  3889. </connectionPointOut>
  3890. <expression>override_sp_real</expression>
  3891. </inVariable>
  3892. <inVariable localId="5" height="27" width="83" negated="false">
  3893. <position x="430" y="514"/>
  3894. <connectionPointOut>
  3895. <relPosition x="83" y="13"/>
  3896. </connectionPointOut>
  3897. <expression>override_k</expression>
  3898. </inVariable>
  3899. <outVariable localId="8" height="27" width="121" negated="false">
  3900. <position x="915" y="418"/>
  3901. <connectionPointIn>
  3902. <relPosition x="0" y="13"/>
  3903. <connection refLocalId="84" formalParameter="OUT">
  3904. <position x="915" y="431"/>
  3905. <position x="892" y="431"/>
  3906. </connection>
  3907. </connectionPointIn>
  3908. <expression>sp_update</expression>
  3909. </outVariable>
  3910. <block localId="50" typeName="scale_to_real" instanceName="scale_to_real7" height="120" width="205" executionOrderId="0">
  3911. <position x="315" y="97"/>
  3912. <inputVariables>
  3913. <variable formalParameter="raw_input_value">
  3914. <connectionPointIn>
  3915. <relPosition x="0" y="36"/>
  3916. <connection refLocalId="53">
  3917. <position x="315" y="133"/>
  3918. <position x="251" y="133"/>
  3919. <position x="251" y="114"/>
  3920. <position x="187" y="114"/>
  3921. </connection>
  3922. </connectionPointIn>
  3923. </variable>
  3924. <variable formalParameter="real_max">
  3925. <connectionPointIn>
  3926. <relPosition x="0" y="69"/>
  3927. <connection refLocalId="51">
  3928. <position x="315" y="166"/>
  3929. <position x="264" y="166"/>
  3930. <position x="264" y="177"/>
  3931. <position x="213" y="177"/>
  3932. </connection>
  3933. </connectionPointIn>
  3934. </variable>
  3935. <variable formalParameter="real_min">
  3936. <connectionPointIn>
  3937. <relPosition x="0" y="102"/>
  3938. <connection refLocalId="52">
  3939. <position x="315" y="199"/>
  3940. <position x="275" y="199"/>
  3941. <position x="275" y="227"/>
  3942. <position x="227" y="227"/>
  3943. </connection>
  3944. </connectionPointIn>
  3945. </variable>
  3946. </inputVariables>
  3947. <inOutVariables/>
  3948. <outputVariables>
  3949. <variable formalParameter="scaled_real">
  3950. <connectionPointOut>
  3951. <relPosition x="205" y="36"/>
  3952. </connectionPointOut>
  3953. </variable>
  3954. </outputVariables>
  3955. </block>
  3956. <inVariable localId="51" height="27" width="106" negated="false" executionOrderId="0">
  3957. <position x="107" y="164"/>
  3958. <connectionPointOut>
  3959. <relPosition x="106" y="13"/>
  3960. </connectionPointOut>
  3961. <expression>pressure_max</expression>
  3962. </inVariable>
  3963. <inVariable localId="52" height="27" width="103" negated="false" executionOrderId="0">
  3964. <position x="124" y="214"/>
  3965. <connectionPointOut>
  3966. <relPosition x="103" y="13"/>
  3967. </connectionPointOut>
  3968. <expression>pressure_min</expression>
  3969. </inVariable>
  3970. <inVariable localId="53" height="27" width="70" negated="false">
  3971. <position x="117" y="101"/>
  3972. <connectionPointOut>
  3973. <relPosition x="70" y="13"/>
  3974. </connectionPointOut>
  3975. <expression>pressure</expression>
  3976. </inVariable>
  3977. <outVariable localId="54" height="27" width="103" negated="false">
  3978. <position x="557" y="118"/>
  3979. <connectionPointIn>
  3980. <relPosition x="0" y="13"/>
  3981. <connection refLocalId="50" formalParameter="scaled_real">
  3982. <position x="557" y="131"/>
  3983. <position x="538" y="131"/>
  3984. <position x="538" y="133"/>
  3985. <position x="520" y="133"/>
  3986. </connection>
  3987. </connectionPointIn>
  3988. <expression>pressure_real</expression>
  3989. </outVariable>
  3990. <inVariable localId="59" height="27" width="61" negated="false">
  3991. <position x="323" y="710"/>
  3992. <connectionPointOut>
  3993. <relPosition x="61" y="13"/>
  3994. </connectionPointOut>
  3995. <expression>curr_sp</expression>
  3996. </inVariable>
  3997. <block localId="60" typeName="scale_to_real" instanceName="scale_to_real0" height="80" width="205">
  3998. <position x="478" y="682"/>
  3999. <inputVariables>
  4000. <variable formalParameter="raw_input_value">
  4001. <connectionPointIn>
  4002. <relPosition x="0" y="30"/>
  4003. <connection refLocalId="59">
  4004. <position x="478" y="712"/>
  4005. <position x="416" y="712"/>
  4006. <position x="416" y="723"/>
  4007. <position x="384" y="723"/>
  4008. </connection>
  4009. </connectionPointIn>
  4010. </variable>
  4011. <variable formalParameter="real_max">
  4012. <connectionPointIn>
  4013. <relPosition x="0" y="50"/>
  4014. <connection refLocalId="61">
  4015. <position x="478" y="732"/>
  4016. <position x="445" y="732"/>
  4017. <position x="445" y="756"/>
  4018. <position x="349" y="756"/>
  4019. </connection>
  4020. </connectionPointIn>
  4021. </variable>
  4022. <variable formalParameter="real_min">
  4023. <connectionPointIn>
  4024. <relPosition x="0" y="70"/>
  4025. <connection refLocalId="62">
  4026. <position x="478" y="752"/>
  4027. <position x="456" y="752"/>
  4028. <position x="456" y="797"/>
  4029. <position x="429" y="797"/>
  4030. </connection>
  4031. </connectionPointIn>
  4032. </variable>
  4033. </inputVariables>
  4034. <inOutVariables/>
  4035. <outputVariables>
  4036. <variable formalParameter="scaled_real">
  4037. <connectionPointOut>
  4038. <relPosition x="205" y="30"/>
  4039. </connectionPointOut>
  4040. </variable>
  4041. </outputVariables>
  4042. </block>
  4043. <inVariable localId="61" height="27" width="77" negated="false">
  4044. <position x="272" y="743"/>
  4045. <connectionPointOut>
  4046. <relPosition x="77" y="13"/>
  4047. </connectionPointOut>
  4048. <expression>flow_max</expression>
  4049. </inVariable>
  4050. <inVariable localId="62" height="27" width="74" negated="false">
  4051. <position x="355" y="784"/>
  4052. <connectionPointOut>
  4053. <relPosition x="74" y="13"/>
  4054. </connectionPointOut>
  4055. <expression>flow_min</expression>
  4056. </inVariable>
  4057. <outVariable localId="63" height="27" width="121" negated="false">
  4058. <position x="722" y="687"/>
  4059. <connectionPointIn>
  4060. <relPosition x="0" y="13"/>
  4061. <connection refLocalId="60" formalParameter="scaled_real">
  4062. <position x="722" y="700"/>
  4063. <position x="711" y="700"/>
  4064. <position x="711" y="712"/>
  4065. <position x="683" y="712"/>
  4066. </connection>
  4067. </connectionPointIn>
  4068. <expression>curr_sp_real</expression>
  4069. </outVariable>
  4070. <inVariable localId="66" height="27" width="82" negated="false">
  4071. <position x="122" y="918"/>
  4072. <connectionPointOut>
  4073. <relPosition x="82" y="13"/>
  4074. </connectionPointOut>
  4075. <expression>sp_update</expression>
  4076. </inVariable>
  4077. <block localId="67" typeName="LIMIT" height="80" width="69">
  4078. <position x="459" y="862"/>
  4079. <inputVariables>
  4080. <variable formalParameter="MN">
  4081. <connectionPointIn>
  4082. <relPosition x="0" y="30"/>
  4083. <connection refLocalId="69">
  4084. <position x="459" y="892"/>
  4085. <position x="449" y="892"/>
  4086. <position x="449" y="869"/>
  4087. <position x="454" y="869"/>
  4088. <position x="454" y="854"/>
  4089. <position x="418" y="854"/>
  4090. </connection>
  4091. </connectionPointIn>
  4092. </variable>
  4093. <variable formalParameter="IN">
  4094. <connectionPointIn>
  4095. <relPosition x="0" y="50"/>
  4096. <connection refLocalId="85" formalParameter="OUT">
  4097. <position x="459" y="912"/>
  4098. <position x="385" y="912"/>
  4099. <position x="385" y="886"/>
  4100. <position x="312" y="886"/>
  4101. </connection>
  4102. </connectionPointIn>
  4103. </variable>
  4104. <variable formalParameter="MX">
  4105. <connectionPointIn>
  4106. <relPosition x="0" y="70"/>
  4107. <connection refLocalId="68">
  4108. <position x="459" y="932"/>
  4109. <position x="447" y="932"/>
  4110. <position x="447" y="929"/>
  4111. <position x="453" y="929"/>
  4112. <position x="453" y="938"/>
  4113. <position x="403" y="938"/>
  4114. </connection>
  4115. </connectionPointIn>
  4116. </variable>
  4117. </inputVariables>
  4118. <inOutVariables/>
  4119. <outputVariables>
  4120. <variable formalParameter="OUT">
  4121. <connectionPointOut>
  4122. <relPosition x="69" y="30"/>
  4123. </connectionPointOut>
  4124. </variable>
  4125. </outputVariables>
  4126. </block>
  4127. <inVariable localId="68" height="27" width="77" negated="false">
  4128. <position x="326" y="925"/>
  4129. <connectionPointOut>
  4130. <relPosition x="77" y="13"/>
  4131. </connectionPointOut>
  4132. <expression>150.0</expression>
  4133. </inVariable>
  4134. <inVariable localId="69" height="27" width="74" negated="false">
  4135. <position x="344" y="841"/>
  4136. <connectionPointOut>
  4137. <relPosition x="74" y="13"/>
  4138. </connectionPointOut>
  4139. <expression>50.0</expression>
  4140. </inVariable>
  4141. <inVariable localId="72" height="27" width="30" negated="false">
  4142. <position x="765" y="449"/>
  4143. <connectionPointOut>
  4144. <relPosition x="30" y="13"/>
  4145. </connectionPointOut>
  4146. <expression>0.0</expression>
  4147. </inVariable>
  4148. <block localId="73" typeName="DIV" height="60" width="68">
  4149. <position x="388" y="1005"/>
  4150. <inputVariables>
  4151. <variable formalParameter="IN1">
  4152. <connectionPointIn>
  4153. <relPosition x="0" y="30"/>
  4154. <connection refLocalId="77">
  4155. <position x="388" y="1035"/>
  4156. <position x="349" y="1035"/>
  4157. <position x="349" y="1010"/>
  4158. <position x="266" y="1010"/>
  4159. </connection>
  4160. </connectionPointIn>
  4161. </variable>
  4162. <variable formalParameter="IN2">
  4163. <connectionPointIn>
  4164. <relPosition x="0" y="50"/>
  4165. <connection refLocalId="74">
  4166. <position x="388" y="1055"/>
  4167. <position x="368" y="1055"/>
  4168. <position x="368" y="1094"/>
  4169. <position x="352" y="1094"/>
  4170. <position x="352" y="1112"/>
  4171. <position x="250" y="1112"/>
  4172. </connection>
  4173. </connectionPointIn>
  4174. </variable>
  4175. </inputVariables>
  4176. <inOutVariables/>
  4177. <outputVariables>
  4178. <variable formalParameter="OUT">
  4179. <connectionPointOut>
  4180. <relPosition x="68" y="30"/>
  4181. </connectionPointOut>
  4182. </variable>
  4183. </outputVariables>
  4184. </block>
  4185. <inVariable localId="74" height="27" width="46" negated="false">
  4186. <position x="204" y="1099"/>
  4187. <connectionPointOut>
  4188. <relPosition x="46" y="13"/>
  4189. </connectionPointOut>
  4190. <expression>500.0</expression>
  4191. </inVariable>
  4192. <block localId="75" typeName="MUL" height="60" width="68">
  4193. <position x="530" y="1022"/>
  4194. <inputVariables>
  4195. <variable formalParameter="IN1">
  4196. <connectionPointIn>
  4197. <relPosition x="0" y="30"/>
  4198. <connection refLocalId="73" formalParameter="OUT">
  4199. <position x="530" y="1052"/>
  4200. <position x="505" y="1052"/>
  4201. <position x="505" y="1035"/>
  4202. <position x="456" y="1035"/>
  4203. </connection>
  4204. </connectionPointIn>
  4205. </variable>
  4206. <variable formalParameter="IN2">
  4207. <connectionPointIn>
  4208. <relPosition x="0" y="50"/>
  4209. <connection refLocalId="78">
  4210. <position x="530" y="1072"/>
  4211. <position x="520" y="1072"/>
  4212. <position x="520" y="1107"/>
  4213. <position x="506" y="1107"/>
  4214. </connection>
  4215. </connectionPointIn>
  4216. </variable>
  4217. </inputVariables>
  4218. <inOutVariables/>
  4219. <outputVariables>
  4220. <variable formalParameter="OUT">
  4221. <connectionPointOut>
  4222. <relPosition x="68" y="30"/>
  4223. </connectionPointOut>
  4224. </variable>
  4225. </outputVariables>
  4226. </block>
  4227. <outVariable localId="76" height="27" width="121" negated="false">
  4228. <position x="586" y="837"/>
  4229. <connectionPointIn>
  4230. <relPosition x="0" y="13"/>
  4231. <connection refLocalId="67" formalParameter="OUT">
  4232. <position x="586" y="850"/>
  4233. <position x="544" y="850"/>
  4234. <position x="544" y="892"/>
  4235. <position x="528" y="892"/>
  4236. </connection>
  4237. </connectionPointIn>
  4238. <expression>product_sp_real</expression>
  4239. </outVariable>
  4240. <inVariable localId="77" height="27" width="121" negated="false">
  4241. <position x="145" y="997"/>
  4242. <connectionPointOut>
  4243. <relPosition x="121" y="13"/>
  4244. </connectionPointOut>
  4245. <expression>product_sp_real</expression>
  4246. </inVariable>
  4247. <inVariable localId="78" height="27" width="62" negated="false">
  4248. <position x="444" y="1094"/>
  4249. <connectionPointOut>
  4250. <relPosition x="62" y="13"/>
  4251. </connectionPointOut>
  4252. <expression>65535.0</expression>
  4253. </inVariable>
  4254. <block localId="79" typeName="REAL_TO_UINT" height="40" width="113">
  4255. <position x="627" y="1019"/>
  4256. <inputVariables>
  4257. <variable formalParameter="IN">
  4258. <connectionPointIn>
  4259. <relPosition x="0" y="30"/>
  4260. <connection refLocalId="75" formalParameter="OUT">
  4261. <position x="627" y="1049"/>
  4262. <position x="617" y="1049"/>
  4263. <position x="617" y="1052"/>
  4264. <position x="598" y="1052"/>
  4265. </connection>
  4266. </connectionPointIn>
  4267. </variable>
  4268. </inputVariables>
  4269. <inOutVariables/>
  4270. <outputVariables>
  4271. <variable formalParameter="OUT">
  4272. <connectionPointOut>
  4273. <relPosition x="113" y="30"/>
  4274. </connectionPointOut>
  4275. </variable>
  4276. </outputVariables>
  4277. </block>
  4278. <outVariable localId="80" height="27" width="88" negated="false">
  4279. <position x="787" y="1042"/>
  4280. <connectionPointIn>
  4281. <relPosition x="0" y="13"/>
  4282. <connection refLocalId="79" formalParameter="OUT">
  4283. <position x="787" y="1055"/>
  4284. <position x="770" y="1055"/>
  4285. <position x="770" y="1049"/>
  4286. <position x="740" y="1049"/>
  4287. </connection>
  4288. </connectionPointIn>
  4289. <expression>product_sp</expression>
  4290. </outVariable>
  4291. <inVariable localId="83" height="27" width="94" negated="false">
  4292. <position x="118" y="850"/>
  4293. <connectionPointOut>
  4294. <relPosition x="94" y="13"/>
  4295. </connectionPointOut>
  4296. <expression>curr_sp_real</expression>
  4297. </inVariable>
  4298. <block localId="84" typeName="MAX" height="60" width="68">
  4299. <position x="824" y="401"/>
  4300. <inputVariables>
  4301. <variable formalParameter="IN1">
  4302. <connectionPointIn>
  4303. <relPosition x="0" y="30"/>
  4304. <connection refLocalId="87" formalParameter="OUT">
  4305. <position x="824" y="431"/>
  4306. <position x="752" y="431"/>
  4307. <position x="752" y="468"/>
  4308. <position x="681" y="468"/>
  4309. </connection>
  4310. </connectionPointIn>
  4311. </variable>
  4312. <variable formalParameter="IN2">
  4313. <connectionPointIn>
  4314. <relPosition x="0" y="50"/>
  4315. <connection refLocalId="72">
  4316. <position x="824" y="451"/>
  4317. <position x="809" y="451"/>
  4318. <position x="809" y="462"/>
  4319. <position x="795" y="462"/>
  4320. </connection>
  4321. </connectionPointIn>
  4322. </variable>
  4323. </inputVariables>
  4324. <inOutVariables/>
  4325. <outputVariables>
  4326. <variable formalParameter="OUT">
  4327. <connectionPointOut>
  4328. <relPosition x="68" y="30"/>
  4329. </connectionPointOut>
  4330. </variable>
  4331. </outputVariables>
  4332. </block>
  4333. <block localId="85" typeName="ADD" height="60" width="68">
  4334. <position x="244" y="856"/>
  4335. <inputVariables>
  4336. <variable formalParameter="IN1">
  4337. <connectionPointIn>
  4338. <relPosition x="0" y="30"/>
  4339. <connection refLocalId="83">
  4340. <position x="244" y="886"/>
  4341. <position x="234" y="886"/>
  4342. <position x="234" y="863"/>
  4343. <position x="212" y="863"/>
  4344. </connection>
  4345. </connectionPointIn>
  4346. </variable>
  4347. <variable formalParameter="IN2">
  4348. <connectionPointIn>
  4349. <relPosition x="0" y="50"/>
  4350. <connection refLocalId="66">
  4351. <position x="244" y="906"/>
  4352. <position x="234" y="906"/>
  4353. <position x="234" y="931"/>
  4354. <position x="204" y="931"/>
  4355. </connection>
  4356. </connectionPointIn>
  4357. </variable>
  4358. </inputVariables>
  4359. <inOutVariables/>
  4360. <outputVariables>
  4361. <variable formalParameter="OUT">
  4362. <connectionPointOut>
  4363. <relPosition x="68" y="30"/>
  4364. </connectionPointOut>
  4365. </variable>
  4366. </outputVariables>
  4367. </block>
  4368. <block localId="86" typeName="SUB" height="60" width="68">
  4369. <position x="381" y="426"/>
  4370. <inputVariables>
  4371. <variable formalParameter="IN1">
  4372. <connectionPointIn>
  4373. <relPosition x="0" y="30"/>
  4374. <connection refLocalId="4">
  4375. <position x="381" y="456"/>
  4376. <position x="345" y="456"/>
  4377. <position x="345" y="426"/>
  4378. <position x="309" y="426"/>
  4379. </connection>
  4380. </connectionPointIn>
  4381. </variable>
  4382. <variable formalParameter="IN2">
  4383. <connectionPointIn>
  4384. <relPosition x="0" y="50"/>
  4385. <connection refLocalId="3">
  4386. <position x="381" y="476"/>
  4387. <position x="323" y="476"/>
  4388. <position x="323" y="472"/>
  4389. <position x="266" y="472"/>
  4390. </connection>
  4391. </connectionPointIn>
  4392. </variable>
  4393. </inputVariables>
  4394. <inOutVariables/>
  4395. <outputVariables>
  4396. <variable formalParameter="OUT">
  4397. <connectionPointOut>
  4398. <relPosition x="68" y="30"/>
  4399. </connectionPointOut>
  4400. </variable>
  4401. </outputVariables>
  4402. </block>
  4403. <block localId="87" typeName="MUL" height="60" width="68">
  4404. <position x="613" y="438"/>
  4405. <inputVariables>
  4406. <variable formalParameter="IN1">
  4407. <connectionPointIn>
  4408. <relPosition x="0" y="30"/>
  4409. <connection refLocalId="86" formalParameter="OUT">
  4410. <position x="613" y="468"/>
  4411. <position x="531" y="468"/>
  4412. <position x="531" y="456"/>
  4413. <position x="449" y="456"/>
  4414. </connection>
  4415. </connectionPointIn>
  4416. </variable>
  4417. <variable formalParameter="IN2">
  4418. <connectionPointIn>
  4419. <relPosition x="0" y="50"/>
  4420. <connection refLocalId="5">
  4421. <position x="613" y="488"/>
  4422. <position x="563" y="488"/>
  4423. <position x="563" y="527"/>
  4424. <position x="513" y="527"/>
  4425. </connection>
  4426. </connectionPointIn>
  4427. </variable>
  4428. </inputVariables>
  4429. <inOutVariables/>
  4430. <outputVariables>
  4431. <variable formalParameter="OUT">
  4432. <connectionPointOut>
  4433. <relPosition x="68" y="30"/>
  4434. </connectionPointOut>
  4435. </variable>
  4436. </outputVariables>
  4437. </block>
  4438. </LD>
  4439. </body>
  4440. </pou>
  4441. <pou name="scale_to_signed" pouType="functionBlock">
  4442. <interface>
  4443. <inputVars>
  4444. <variable name="input_uint">
  4445. <type>
  4446. <UINT/>
  4447. </type>
  4448. </variable>
  4449. </inputVars>
  4450. <outputVars>
  4451. <variable name="output_int">
  4452. <type>
  4453. <INT/>
  4454. </type>
  4455. </variable>
  4456. </outputVars>
  4457. </interface>
  4458. <body>
  4459. <LD>
  4460. <block localId="3" typeName="DIV" height="60" width="68">
  4461. <position x="183" y="49"/>
  4462. <inputVariables>
  4463. <variable formalParameter="IN1">
  4464. <connectionPointIn>
  4465. <relPosition x="0" y="30"/>
  4466. <connection refLocalId="4">
  4467. <position x="183" y="79"/>
  4468. <position x="144" y="79"/>
  4469. <position x="144" y="50"/>
  4470. <position x="105" y="50"/>
  4471. </connection>
  4472. </connectionPointIn>
  4473. </variable>
  4474. <variable formalParameter="IN2">
  4475. <connectionPointIn>
  4476. <relPosition x="0" y="50"/>
  4477. <connection refLocalId="5">
  4478. <position x="183" y="99"/>
  4479. <position x="141" y="99"/>
  4480. <position x="141" y="126"/>
  4481. <position x="100" y="126"/>
  4482. </connection>
  4483. </connectionPointIn>
  4484. </variable>
  4485. </inputVariables>
  4486. <inOutVariables/>
  4487. <outputVariables>
  4488. <variable formalParameter="OUT">
  4489. <connectionPointOut>
  4490. <relPosition x="68" y="30"/>
  4491. </connectionPointOut>
  4492. </variable>
  4493. </outputVariables>
  4494. </block>
  4495. <inVariable localId="4" height="27" width="82" negated="false">
  4496. <position x="23" y="37"/>
  4497. <connectionPointOut>
  4498. <relPosition x="82" y="13"/>
  4499. </connectionPointOut>
  4500. <expression>input_uint</expression>
  4501. </inVariable>
  4502. <inVariable localId="5" height="27" width="18" negated="false">
  4503. <position x="82" y="113"/>
  4504. <connectionPointOut>
  4505. <relPosition x="18" y="13"/>
  4506. </connectionPointOut>
  4507. <expression>2</expression>
  4508. </inVariable>
  4509. <outVariable localId="7" height="27" width="84" negated="false">
  4510. <position x="519" y="95"/>
  4511. <connectionPointIn>
  4512. <relPosition x="0" y="13"/>
  4513. <connection refLocalId="9" formalParameter="OUT">
  4514. <position x="519" y="108"/>
  4515. <position x="509" y="108"/>
  4516. <position x="509" y="141"/>
  4517. <position x="524" y="141"/>
  4518. <position x="524" y="166"/>
  4519. <position x="484" y="166"/>
  4520. </connection>
  4521. </connectionPointIn>
  4522. <expression>output_int</expression>
  4523. </outVariable>
  4524. <block localId="8" typeName="ABS" height="40" width="60">
  4525. <position x="311" y="82"/>
  4526. <inputVariables>
  4527. <variable formalParameter="IN">
  4528. <connectionPointIn>
  4529. <relPosition x="0" y="30"/>
  4530. <connection refLocalId="3" formalParameter="OUT">
  4531. <position x="311" y="112"/>
  4532. <position x="287" y="112"/>
  4533. <position x="287" y="79"/>
  4534. <position x="251" y="79"/>
  4535. </connection>
  4536. </connectionPointIn>
  4537. </variable>
  4538. </inputVariables>
  4539. <inOutVariables/>
  4540. <outputVariables>
  4541. <variable formalParameter="OUT">
  4542. <connectionPointOut>
  4543. <relPosition x="60" y="30"/>
  4544. </connectionPointOut>
  4545. </variable>
  4546. </outputVariables>
  4547. </block>
  4548. <block localId="9" typeName="UINT_TO_INT" height="40" width="100">
  4549. <position x="384" y="136"/>
  4550. <inputVariables>
  4551. <variable formalParameter="IN">
  4552. <connectionPointIn>
  4553. <relPosition x="0" y="30"/>
  4554. <connection refLocalId="8" formalParameter="OUT">
  4555. <position x="384" y="166"/>
  4556. <position x="374" y="166"/>
  4557. <position x="374" y="139"/>
  4558. <position x="382" y="139"/>
  4559. <position x="382" y="112"/>
  4560. <position x="371" y="112"/>
  4561. </connection>
  4562. </connectionPointIn>
  4563. </variable>
  4564. </inputVariables>
  4565. <inOutVariables/>
  4566. <outputVariables>
  4567. <variable formalParameter="OUT">
  4568. <connectionPointOut>
  4569. <relPosition x="100" y="30"/>
  4570. </connectionPointOut>
  4571. </variable>
  4572. </outputVariables>
  4573. </block>
  4574. </LD>
  4575. </body>
  4576. </pou>
  4577. <pou name="scale_to_uint" pouType="functionBlock">
  4578. <interface>
  4579. <inputVars>
  4580. <variable name="real_in">
  4581. <type>
  4582. <REAL/>
  4583. </type>
  4584. </variable>
  4585. </inputVars>
  4586. <outputVars>
  4587. <variable name="uint_out">
  4588. <type>
  4589. <UINT/>
  4590. </type>
  4591. </variable>
  4592. </outputVars>
  4593. </interface>
  4594. <body>
  4595. <LD>
  4596. <block localId="1" typeName="DIV" height="60" width="68">
  4597. <position x="259" y="60"/>
  4598. <inputVariables>
  4599. <variable formalParameter="IN1">
  4600. <connectionPointIn>
  4601. <relPosition x="0" y="30"/>
  4602. <connection refLocalId="2">
  4603. <position x="259" y="90"/>
  4604. <position x="214" y="90"/>
  4605. <position x="214" y="78"/>
  4606. <position x="170" y="78"/>
  4607. </connection>
  4608. </connectionPointIn>
  4609. </variable>
  4610. <variable formalParameter="IN2">
  4611. <connectionPointIn>
  4612. <relPosition x="0" y="50"/>
  4613. <connection refLocalId="3">
  4614. <position x="259" y="110"/>
  4615. <position x="230" y="110"/>
  4616. <position x="230" y="131"/>
  4617. <position x="201" y="131"/>
  4618. </connection>
  4619. </connectionPointIn>
  4620. </variable>
  4621. </inputVariables>
  4622. <inOutVariables/>
  4623. <outputVariables>
  4624. <variable formalParameter="OUT">
  4625. <connectionPointOut>
  4626. <relPosition x="68" y="30"/>
  4627. </connectionPointOut>
  4628. </variable>
  4629. </outputVariables>
  4630. </block>
  4631. <inVariable localId="2" height="27" width="56" negated="false">
  4632. <position x="114" y="65"/>
  4633. <connectionPointOut>
  4634. <relPosition x="56" y="13"/>
  4635. </connectionPointOut>
  4636. <expression>real_in</expression>
  4637. </inVariable>
  4638. <inVariable localId="3" height="27" width="46" negated="false">
  4639. <position x="155" y="118"/>
  4640. <connectionPointOut>
  4641. <relPosition x="46" y="13"/>
  4642. </connectionPointOut>
  4643. <expression>100.0</expression>
  4644. </inVariable>
  4645. <block localId="4" typeName="MUL" height="60" width="68">
  4646. <position x="420" y="78"/>
  4647. <inputVariables>
  4648. <variable formalParameter="IN1">
  4649. <connectionPointIn>
  4650. <relPosition x="0" y="30"/>
  4651. <connection refLocalId="1" formalParameter="OUT">
  4652. <position x="420" y="108"/>
  4653. <position x="373" y="108"/>
  4654. <position x="373" y="90"/>
  4655. <position x="327" y="90"/>
  4656. </connection>
  4657. </connectionPointIn>
  4658. </variable>
  4659. <variable formalParameter="IN2">
  4660. <connectionPointIn>
  4661. <relPosition x="0" y="50"/>
  4662. <connection refLocalId="5">
  4663. <position x="420" y="128"/>
  4664. <position x="401" y="128"/>
  4665. <position x="401" y="155"/>
  4666. <position x="350" y="155"/>
  4667. </connection>
  4668. </connectionPointIn>
  4669. </variable>
  4670. </inputVariables>
  4671. <inOutVariables/>
  4672. <outputVariables>
  4673. <variable formalParameter="OUT">
  4674. <connectionPointOut>
  4675. <relPosition x="68" y="30"/>
  4676. </connectionPointOut>
  4677. </variable>
  4678. </outputVariables>
  4679. </block>
  4680. <inVariable localId="5" height="27" width="62" negated="false">
  4681. <position x="300" y="142"/>
  4682. <connectionPointOut>
  4683. <relPosition x="62" y="13"/>
  4684. </connectionPointOut>
  4685. <expression>65535.0</expression>
  4686. </inVariable>
  4687. <block localId="6" typeName="REAL_TO_UINT" height="40" width="113">
  4688. <position x="530" y="76"/>
  4689. <inputVariables>
  4690. <variable formalParameter="IN">
  4691. <connectionPointIn>
  4692. <relPosition x="0" y="30"/>
  4693. <connection refLocalId="4" formalParameter="OUT">
  4694. <position x="530" y="106"/>
  4695. <position x="520" y="106"/>
  4696. <position x="520" y="108"/>
  4697. <position x="488" y="108"/>
  4698. </connection>
  4699. </connectionPointIn>
  4700. </variable>
  4701. </inputVariables>
  4702. <inOutVariables/>
  4703. <outputVariables>
  4704. <variable formalParameter="OUT">
  4705. <connectionPointOut>
  4706. <relPosition x="113" y="30"/>
  4707. </connectionPointOut>
  4708. </variable>
  4709. </outputVariables>
  4710. </block>
  4711. <outVariable localId="7" height="27" width="69" negated="false">
  4712. <position x="679" y="111"/>
  4713. <connectionPointIn>
  4714. <relPosition x="0" y="13"/>
  4715. <connection refLocalId="6" formalParameter="OUT">
  4716. <position x="679" y="124"/>
  4717. <position x="661" y="124"/>
  4718. <position x="661" y="106"/>
  4719. <position x="643" y="106"/>
  4720. </connection>
  4721. </connectionPointIn>
  4722. <expression>uint_out</expression>
  4723. </outVariable>
  4724. </LD>
  4725. </body>
  4726. </pou>
  4727. <pou name="level_control" pouType="functionBlock">
  4728. <interface>
  4729. <inputVars>
  4730. <variable name="liquid_level">
  4731. <type>
  4732. <UINT/>
  4733. </type>
  4734. </variable>
  4735. <variable name="level_sp">
  4736. <type>
  4737. <UINT/>
  4738. </type>
  4739. <initialValue>
  4740. <simpleValue value="30000"/>
  4741. </initialValue>
  4742. </variable>
  4743. <variable name="curr_pos">
  4744. <type>
  4745. <UINT/>
  4746. </type>
  4747. </variable>
  4748. </inputVars>
  4749. <outputVars>
  4750. <variable name="new_pos">
  4751. <type>
  4752. <UINT/>
  4753. </type>
  4754. </variable>
  4755. </outputVars>
  4756. <localVars>
  4757. <variable name="cycle_time">
  4758. <type>
  4759. <TIME/>
  4760. </type>
  4761. <initialValue>
  4762. <simpleValue value="T#50ms"/>
  4763. </initialValue>
  4764. </variable>
  4765. <variable name="level_k">
  4766. <type>
  4767. <REAL/>
  4768. </type>
  4769. <initialValue>
  4770. <simpleValue value="10.0"/>
  4771. </initialValue>
  4772. </variable>
  4773. <variable name="level_ti">
  4774. <type>
  4775. <REAL/>
  4776. </type>
  4777. <initialValue>
  4778. <simpleValue value="99999.0"/>
  4779. </initialValue>
  4780. </variable>
  4781. <variable name="scale_to_real0">
  4782. <type>
  4783. <derived name="scale_to_real"/>
  4784. </type>
  4785. </variable>
  4786. <variable name="level_max">
  4787. <type>
  4788. <REAL/>
  4789. </type>
  4790. <initialValue>
  4791. <simpleValue value="100.0"/>
  4792. </initialValue>
  4793. </variable>
  4794. <variable name="level_min">
  4795. <type>
  4796. <REAL/>
  4797. </type>
  4798. <initialValue>
  4799. <simpleValue value="0.0"/>
  4800. </initialValue>
  4801. </variable>
  4802. <variable name="pos_max">
  4803. <type>
  4804. <REAL/>
  4805. </type>
  4806. <initialValue>
  4807. <simpleValue value="100.0"/>
  4808. </initialValue>
  4809. </variable>
  4810. <variable name="pos_min">
  4811. <type>
  4812. <REAL/>
  4813. </type>
  4814. <initialValue>
  4815. <simpleValue value="0.0"/>
  4816. </initialValue>
  4817. </variable>
  4818. <variable name="level_real">
  4819. <type>
  4820. <REAL/>
  4821. </type>
  4822. <initialValue>
  4823. <simpleValue value="44.18"/>
  4824. </initialValue>
  4825. </variable>
  4826. <variable name="pos_real">
  4827. <type>
  4828. <REAL/>
  4829. </type>
  4830. <initialValue>
  4831. <simpleValue value="47.0"/>
  4832. </initialValue>
  4833. </variable>
  4834. <variable name="pos_update_real">
  4835. <type>
  4836. <REAL/>
  4837. </type>
  4838. <initialValue>
  4839. <simpleValue value="0.0"/>
  4840. </initialValue>
  4841. </variable>
  4842. <variable name="sp_real">
  4843. <type>
  4844. <REAL/>
  4845. </type>
  4846. <initialValue>
  4847. <simpleValue value="44.18"/>
  4848. </initialValue>
  4849. </variable>
  4850. <variable name="scale_to_real1">
  4851. <type>
  4852. <derived name="scale_to_real"/>
  4853. </type>
  4854. </variable>
  4855. <variable name="scale_to_real2">
  4856. <type>
  4857. <derived name="scale_to_real"/>
  4858. </type>
  4859. </variable>
  4860. <variable name="scale_to_uint0">
  4861. <type>
  4862. <derived name="scale_to_uint"/>
  4863. </type>
  4864. </variable>
  4865. </localVars>
  4866. </interface>
  4867. <body>
  4868. <LD>
  4869. <leftPowerRail localId="2" height="40" width="3">
  4870. <position x="71" y="473"/>
  4871. <connectionPointOut formalParameter="">
  4872. <relPosition x="3" y="20"/>
  4873. </connectionPointOut>
  4874. </leftPowerRail>
  4875. <inVariable localId="4" height="27" width="88" negated="false">
  4876. <position x="83" y="42"/>
  4877. <connectionPointOut>
  4878. <relPosition x="88" y="13"/>
  4879. </connectionPointOut>
  4880. <expression>liquid_level</expression>
  4881. </inVariable>
  4882. <block localId="5" typeName="scale_to_real" instanceName="scale_to_real0" height="80" width="205">
  4883. <position x="265" y="34"/>
  4884. <inputVariables>
  4885. <variable formalParameter="raw_input_value">
  4886. <connectionPointIn>
  4887. <relPosition x="0" y="30"/>
  4888. <connection refLocalId="4">
  4889. <position x="265" y="64"/>
  4890. <position x="243" y="64"/>
  4891. <position x="243" y="55"/>
  4892. <position x="171" y="55"/>
  4893. </connection>
  4894. </connectionPointIn>
  4895. </variable>
  4896. <variable formalParameter="real_max">
  4897. <connectionPointIn>
  4898. <relPosition x="0" y="50"/>
  4899. <connection refLocalId="6">
  4900. <position x="265" y="84"/>
  4901. <position x="212" y="84"/>
  4902. <position x="212" y="97"/>
  4903. <position x="155" y="97"/>
  4904. </connection>
  4905. </connectionPointIn>
  4906. </variable>
  4907. <variable formalParameter="real_min">
  4908. <connectionPointIn>
  4909. <relPosition x="0" y="70"/>
  4910. <connection refLocalId="7">
  4911. <position x="265" y="104"/>
  4912. <position x="220" y="104"/>
  4913. <position x="220" y="141"/>
  4914. <position x="142" y="141"/>
  4915. </connection>
  4916. </connectionPointIn>
  4917. </variable>
  4918. </inputVariables>
  4919. <inOutVariables/>
  4920. <outputVariables>
  4921. <variable formalParameter="scaled_real">
  4922. <connectionPointOut>
  4923. <relPosition x="205" y="30"/>
  4924. </connectionPointOut>
  4925. </variable>
  4926. </outputVariables>
  4927. </block>
  4928. <inVariable localId="6" height="27" width="78" negated="false">
  4929. <position x="77" y="84"/>
  4930. <connectionPointOut>
  4931. <relPosition x="78" y="13"/>
  4932. </connectionPointOut>
  4933. <expression>level_max</expression>
  4934. </inVariable>
  4935. <inVariable localId="7" height="27" width="75" negated="false">
  4936. <position x="67" y="128"/>
  4937. <connectionPointOut>
  4938. <relPosition x="75" y="13"/>
  4939. </connectionPointOut>
  4940. <expression>level_min</expression>
  4941. </inVariable>
  4942. <outVariable localId="8" height="27" width="75" negated="false">
  4943. <position x="517" y="47"/>
  4944. <connectionPointIn>
  4945. <relPosition x="0" y="13"/>
  4946. <connection refLocalId="5" formalParameter="scaled_real">
  4947. <position x="517" y="60"/>
  4948. <position x="493" y="60"/>
  4949. <position x="493" y="64"/>
  4950. <position x="470" y="64"/>
  4951. </connection>
  4952. </connectionPointIn>
  4953. <expression>level_real</expression>
  4954. </outVariable>
  4955. <inVariable localId="3" height="27" width="88" negated="false" executionOrderId="0">
  4956. <position x="68" y="185"/>
  4957. <connectionPointOut>
  4958. <relPosition x="88" y="13"/>
  4959. </connectionPointOut>
  4960. <expression>curr_pos</expression>
  4961. </inVariable>
  4962. <block localId="9" typeName="scale_to_real" instanceName="scale_to_real1" height="80" width="205" executionOrderId="0">
  4963. <position x="250" y="177"/>
  4964. <inputVariables>
  4965. <variable formalParameter="raw_input_value">
  4966. <connectionPointIn>
  4967. <relPosition x="0" y="30"/>
  4968. <connection refLocalId="3">
  4969. <position x="250" y="207"/>
  4970. <position x="228" y="207"/>
  4971. <position x="228" y="198"/>
  4972. <position x="156" y="198"/>
  4973. </connection>
  4974. </connectionPointIn>
  4975. </variable>
  4976. <variable formalParameter="real_max">
  4977. <connectionPointIn>
  4978. <relPosition x="0" y="50"/>
  4979. <connection refLocalId="10">
  4980. <position x="250" y="227"/>
  4981. <position x="197" y="227"/>
  4982. <position x="197" y="240"/>
  4983. <position x="140" y="240"/>
  4984. </connection>
  4985. </connectionPointIn>
  4986. </variable>
  4987. <variable formalParameter="real_min">
  4988. <connectionPointIn>
  4989. <relPosition x="0" y="70"/>
  4990. <connection refLocalId="12">
  4991. <position x="250" y="247"/>
  4992. <position x="205" y="247"/>
  4993. <position x="205" y="284"/>
  4994. <position x="127" y="284"/>
  4995. </connection>
  4996. </connectionPointIn>
  4997. </variable>
  4998. </inputVariables>
  4999. <inOutVariables/>
  5000. <outputVariables>
  5001. <variable formalParameter="scaled_real">
  5002. <connectionPointOut>
  5003. <relPosition x="205" y="30"/>
  5004. </connectionPointOut>
  5005. </variable>
  5006. </outputVariables>
  5007. </block>
  5008. <inVariable localId="10" height="27" width="78" negated="false" executionOrderId="0">
  5009. <position x="62" y="227"/>
  5010. <connectionPointOut>
  5011. <relPosition x="78" y="13"/>
  5012. </connectionPointOut>
  5013. <expression>pos_max</expression>
  5014. </inVariable>
  5015. <outVariable localId="11" height="27" width="75" negated="false" executionOrderId="0">
  5016. <position x="502" y="190"/>
  5017. <connectionPointIn>
  5018. <relPosition x="0" y="13"/>
  5019. <connection refLocalId="9" formalParameter="scaled_real">
  5020. <position x="502" y="203"/>
  5021. <position x="478" y="203"/>
  5022. <position x="478" y="207"/>
  5023. <position x="455" y="207"/>
  5024. </connection>
  5025. </connectionPointIn>
  5026. <expression>pos_real</expression>
  5027. </outVariable>
  5028. <inVariable localId="12" height="27" width="75" negated="false" executionOrderId="0">
  5029. <position x="52" y="271"/>
  5030. <connectionPointOut>
  5031. <relPosition x="75" y="13"/>
  5032. </connectionPointOut>
  5033. <expression>pos_min</expression>
  5034. </inVariable>
  5035. <inVariable localId="13" height="27" width="75" negated="false">
  5036. <position x="126" y="509"/>
  5037. <connectionPointOut>
  5038. <relPosition x="75" y="13"/>
  5039. </connectionPointOut>
  5040. <expression>level_real</expression>
  5041. </inVariable>
  5042. <inVariable localId="14" height="27" width="88" negated="false" executionOrderId="0">
  5043. <position x="62" y="306"/>
  5044. <connectionPointOut>
  5045. <relPosition x="88" y="13"/>
  5046. </connectionPointOut>
  5047. <expression>level_sp</expression>
  5048. </inVariable>
  5049. <inVariable localId="15" height="27" width="78" negated="false" executionOrderId="0">
  5050. <position x="56" y="348"/>
  5051. <connectionPointOut>
  5052. <relPosition x="78" y="13"/>
  5053. </connectionPointOut>
  5054. <expression>level_max</expression>
  5055. </inVariable>
  5056. <inVariable localId="16" height="27" width="75" negated="false" executionOrderId="0">
  5057. <position x="46" y="392"/>
  5058. <connectionPointOut>
  5059. <relPosition x="75" y="13"/>
  5060. </connectionPointOut>
  5061. <expression>level_min</expression>
  5062. </inVariable>
  5063. <outVariable localId="17" height="27" width="75" negated="false" executionOrderId="0">
  5064. <position x="496" y="311"/>
  5065. <connectionPointIn>
  5066. <relPosition x="0" y="13"/>
  5067. <connection refLocalId="18" formalParameter="scaled_real">
  5068. <position x="496" y="324"/>
  5069. <position x="472" y="324"/>
  5070. <position x="472" y="328"/>
  5071. <position x="449" y="328"/>
  5072. </connection>
  5073. </connectionPointIn>
  5074. <expression>sp_real</expression>
  5075. </outVariable>
  5076. <block localId="18" typeName="scale_to_real" instanceName="scale_to_real2" height="80" width="205" executionOrderId="0">
  5077. <position x="244" y="298"/>
  5078. <inputVariables>
  5079. <variable formalParameter="raw_input_value">
  5080. <connectionPointIn>
  5081. <relPosition x="0" y="30"/>
  5082. <connection refLocalId="14">
  5083. <position x="244" y="328"/>
  5084. <position x="222" y="328"/>
  5085. <position x="222" y="319"/>
  5086. <position x="150" y="319"/>
  5087. </connection>
  5088. </connectionPointIn>
  5089. </variable>
  5090. <variable formalParameter="real_max">
  5091. <connectionPointIn>
  5092. <relPosition x="0" y="50"/>
  5093. <connection refLocalId="15">
  5094. <position x="244" y="348"/>
  5095. <position x="191" y="348"/>
  5096. <position x="191" y="361"/>
  5097. <position x="134" y="361"/>
  5098. </connection>
  5099. </connectionPointIn>
  5100. </variable>
  5101. <variable formalParameter="real_min">
  5102. <connectionPointIn>
  5103. <relPosition x="0" y="70"/>
  5104. <connection refLocalId="16">
  5105. <position x="244" y="368"/>
  5106. <position x="199" y="368"/>
  5107. <position x="199" y="405"/>
  5108. <position x="121" y="405"/>
  5109. </connection>
  5110. </connectionPointIn>
  5111. </variable>
  5112. </inputVariables>
  5113. <inOutVariables/>
  5114. <outputVariables>
  5115. <variable formalParameter="scaled_real">
  5116. <connectionPointOut>
  5117. <relPosition x="205" y="30"/>
  5118. </connectionPointOut>
  5119. </variable>
  5120. </outputVariables>
  5121. </block>
  5122. <inVariable localId="19" height="27" width="59" negated="false">
  5123. <position x="144" y="454"/>
  5124. <connectionPointOut>
  5125. <relPosition x="59" y="13"/>
  5126. </connectionPointOut>
  5127. <expression>sp_real</expression>
  5128. </inVariable>
  5129. <inVariable localId="20" height="27" width="57" negated="false">
  5130. <position x="460" y="532"/>
  5131. <connectionPointOut>
  5132. <relPosition x="57" y="13"/>
  5133. </connectionPointOut>
  5134. <expression>level_k</expression>
  5135. </inVariable>
  5136. <outVariable localId="21" height="27" width="124" negated="false">
  5137. <position x="781" y="449"/>
  5138. <connectionPointIn>
  5139. <relPosition x="0" y="13"/>
  5140. <connection refLocalId="33" formalParameter="OUT">
  5141. <position x="781" y="462"/>
  5142. <position x="738" y="462"/>
  5143. <position x="738" y="529"/>
  5144. <position x="695" y="529"/>
  5145. </connection>
  5146. </connectionPointIn>
  5147. <expression>pos_update_real</expression>
  5148. </outVariable>
  5149. <inVariable localId="23" height="27" width="68" negated="false">
  5150. <position x="54" y="677"/>
  5151. <connectionPointOut>
  5152. <relPosition x="68" y="13"/>
  5153. </connectionPointOut>
  5154. <expression>pos_real</expression>
  5155. </inVariable>
  5156. <inVariable localId="24" height="27" width="124" negated="false">
  5157. <position x="17" y="729"/>
  5158. <connectionPointOut>
  5159. <relPosition x="124" y="13"/>
  5160. </connectionPointOut>
  5161. <expression>pos_update_real</expression>
  5162. </inVariable>
  5163. <block localId="25" typeName="LIMIT" height="80" width="69">
  5164. <position x="387" y="648"/>
  5165. <inputVariables>
  5166. <variable formalParameter="MN">
  5167. <connectionPointIn>
  5168. <relPosition x="0" y="30"/>
  5169. <connection refLocalId="26">
  5170. <position x="387" y="678"/>
  5171. <position x="348" y="678"/>
  5172. <position x="348" y="666"/>
  5173. <position x="351" y="666"/>
  5174. <position x="351" y="646"/>
  5175. <position x="341" y="646"/>
  5176. </connection>
  5177. </connectionPointIn>
  5178. </variable>
  5179. <variable formalParameter="IN">
  5180. <connectionPointIn>
  5181. <relPosition x="0" y="50"/>
  5182. <connection refLocalId="30" formalParameter="OUT">
  5183. <position x="387" y="698"/>
  5184. <position x="317" y="698"/>
  5185. <position x="317" y="692"/>
  5186. <position x="248" y="692"/>
  5187. </connection>
  5188. </connectionPointIn>
  5189. </variable>
  5190. <variable formalParameter="MX">
  5191. <connectionPointIn>
  5192. <relPosition x="0" y="70"/>
  5193. <connection refLocalId="27">
  5194. <position x="387" y="718"/>
  5195. <position x="359" y="718"/>
  5196. <position x="359" y="732"/>
  5197. <position x="365" y="732"/>
  5198. <position x="365" y="745"/>
  5199. <position x="355" y="745"/>
  5200. </connection>
  5201. </connectionPointIn>
  5202. </variable>
  5203. </inputVariables>
  5204. <inOutVariables/>
  5205. <outputVariables>
  5206. <variable formalParameter="OUT">
  5207. <connectionPointOut>
  5208. <relPosition x="69" y="30"/>
  5209. </connectionPointOut>
  5210. </variable>
  5211. </outputVariables>
  5212. </block>
  5213. <inVariable localId="26" height="27" width="68" negated="false">
  5214. <position x="273" y="633"/>
  5215. <connectionPointOut>
  5216. <relPosition x="68" y="13"/>
  5217. </connectionPointOut>
  5218. <expression>pos_min</expression>
  5219. </inVariable>
  5220. <inVariable localId="27" height="27" width="71" negated="false">
  5221. <position x="284" y="732"/>
  5222. <connectionPointOut>
  5223. <relPosition x="71" y="13"/>
  5224. </connectionPointOut>
  5225. <expression>pos_max</expression>
  5226. </inVariable>
  5227. <block localId="28" typeName="scale_to_uint" instanceName="scale_to_uint0" height="40" width="120">
  5228. <position x="490" y="652"/>
  5229. <inputVariables>
  5230. <variable formalParameter="real_in">
  5231. <connectionPointIn>
  5232. <relPosition x="0" y="30"/>
  5233. <connection refLocalId="25" formalParameter="OUT">
  5234. <position x="490" y="682"/>
  5235. <position x="478" y="682"/>
  5236. <position x="478" y="678"/>
  5237. <position x="456" y="678"/>
  5238. </connection>
  5239. </connectionPointIn>
  5240. </variable>
  5241. </inputVariables>
  5242. <inOutVariables/>
  5243. <outputVariables>
  5244. <variable formalParameter="uint_out">
  5245. <connectionPointOut>
  5246. <relPosition x="120" y="30"/>
  5247. </connectionPointOut>
  5248. </variable>
  5249. </outputVariables>
  5250. </block>
  5251. <outVariable localId="29" height="27" width="71" negated="false">
  5252. <position x="645" y="661"/>
  5253. <connectionPointIn>
  5254. <relPosition x="0" y="13"/>
  5255. <connection refLocalId="28" formalParameter="uint_out">
  5256. <position x="645" y="674"/>
  5257. <position x="627" y="674"/>
  5258. <position x="627" y="682"/>
  5259. <position x="610" y="682"/>
  5260. </connection>
  5261. </connectionPointIn>
  5262. <expression>new_pos</expression>
  5263. </outVariable>
  5264. <block localId="30" typeName="SUB" height="60" width="68">
  5265. <position x="180" y="662"/>
  5266. <inputVariables>
  5267. <variable formalParameter="IN1">
  5268. <connectionPointIn>
  5269. <relPosition x="0" y="30"/>
  5270. <connection refLocalId="23">
  5271. <position x="180" y="692"/>
  5272. <position x="151" y="692"/>
  5273. <position x="151" y="690"/>
  5274. <position x="122" y="690"/>
  5275. </connection>
  5276. </connectionPointIn>
  5277. </variable>
  5278. <variable formalParameter="IN2">
  5279. <connectionPointIn>
  5280. <relPosition x="0" y="50"/>
  5281. <connection refLocalId="24">
  5282. <position x="180" y="712"/>
  5283. <position x="160" y="712"/>
  5284. <position x="160" y="742"/>
  5285. <position x="141" y="742"/>
  5286. </connection>
  5287. </connectionPointIn>
  5288. </variable>
  5289. </inputVariables>
  5290. <inOutVariables/>
  5291. <outputVariables>
  5292. <variable formalParameter="OUT">
  5293. <connectionPointOut>
  5294. <relPosition x="68" y="30"/>
  5295. </connectionPointOut>
  5296. </variable>
  5297. </outputVariables>
  5298. </block>
  5299. <block localId="32" typeName="SUB" height="60" width="68">
  5300. <position x="330" y="458"/>
  5301. <inputVariables>
  5302. <variable formalParameter="IN1">
  5303. <connectionPointIn>
  5304. <relPosition x="0" y="30"/>
  5305. <connection refLocalId="19">
  5306. <position x="330" y="488"/>
  5307. <position x="266" y="488"/>
  5308. <position x="266" y="467"/>
  5309. <position x="203" y="467"/>
  5310. </connection>
  5311. </connectionPointIn>
  5312. </variable>
  5313. <variable formalParameter="IN2">
  5314. <connectionPointIn>
  5315. <relPosition x="0" y="50"/>
  5316. <connection refLocalId="13">
  5317. <position x="330" y="508"/>
  5318. <position x="265" y="508"/>
  5319. <position x="265" y="522"/>
  5320. <position x="201" y="522"/>
  5321. </connection>
  5322. </connectionPointIn>
  5323. </variable>
  5324. </inputVariables>
  5325. <inOutVariables/>
  5326. <outputVariables>
  5327. <variable formalParameter="OUT">
  5328. <connectionPointOut>
  5329. <relPosition x="68" y="30"/>
  5330. </connectionPointOut>
  5331. </variable>
  5332. </outputVariables>
  5333. </block>
  5334. <block localId="33" typeName="MUL" height="60" width="68">
  5335. <position x="627" y="499"/>
  5336. <inputVariables>
  5337. <variable formalParameter="IN1">
  5338. <connectionPointIn>
  5339. <relPosition x="0" y="30"/>
  5340. <connection refLocalId="32" formalParameter="OUT">
  5341. <position x="627" y="529"/>
  5342. <position x="512" y="529"/>
  5343. <position x="512" y="488"/>
  5344. <position x="398" y="488"/>
  5345. </connection>
  5346. </connectionPointIn>
  5347. </variable>
  5348. <variable formalParameter="IN2">
  5349. <connectionPointIn>
  5350. <relPosition x="0" y="50"/>
  5351. <connection refLocalId="20">
  5352. <position x="627" y="549"/>
  5353. <position x="572" y="549"/>
  5354. <position x="572" y="545"/>
  5355. <position x="517" y="545"/>
  5356. </connection>
  5357. </connectionPointIn>
  5358. </variable>
  5359. </inputVariables>
  5360. <inOutVariables/>
  5361. <outputVariables>
  5362. <variable formalParameter="OUT">
  5363. <connectionPointOut>
  5364. <relPosition x="68" y="30"/>
  5365. </connectionPointOut>
  5366. </variable>
  5367. </outputVariables>
  5368. </block>
  5369. </LD>
  5370. </body>
  5371. </pou>
  5372. <pou name="initialize_sp" pouType="functionBlock">
  5373. <interface>
  5374. <localVars constant="true">
  5375. <variable name="flow_sp_c">
  5376. <type>
  5377. <UINT/>
  5378. </type>
  5379. <initialValue>
  5380. <simpleValue value="13107"/>
  5381. </initialValue>
  5382. </variable>
  5383. <variable name="a_sp_c">
  5384. <type>
  5385. <UINT/>
  5386. </type>
  5387. <initialValue>
  5388. <simpleValue value="65535"/>
  5389. </initialValue>
  5390. </variable>
  5391. <variable name="press_sp_c">
  5392. <type>
  5393. <UINT/>
  5394. </type>
  5395. <initialValue>
  5396. <simpleValue value="65535"/>
  5397. </initialValue>
  5398. </variable>
  5399. <variable name="over_sp_c">
  5400. <type>
  5401. <UINT/>
  5402. </type>
  5403. <initialValue>
  5404. <simpleValue value="65535"/>
  5405. </initialValue>
  5406. </variable>
  5407. <variable name="level_sp_c">
  5408. <type>
  5409. <UINT/>
  5410. </type>
  5411. <initialValue>
  5412. <simpleValue value="65535"/>
  5413. </initialValue>
  5414. </variable>
  5415. </localVars>
  5416. <outputVars>
  5417. <variable name="flow_sp">
  5418. <type>
  5419. <UINT/>
  5420. </type>
  5421. </variable>
  5422. <variable name="a_sp">
  5423. <type>
  5424. <UINT/>
  5425. </type>
  5426. </variable>
  5427. <variable name="press_sp">
  5428. <type>
  5429. <UINT/>
  5430. </type>
  5431. </variable>
  5432. <variable name="over_sp">
  5433. <type>
  5434. <UINT/>
  5435. </type>
  5436. </variable>
  5437. <variable name="level_sp">
  5438. <type>
  5439. <UINT/>
  5440. </type>
  5441. </variable>
  5442. </outputVars>
  5443. </interface>
  5444. <body>
  5445. <LD>
  5446. <block localId="3" typeName="MOVE" height="60" width="60">
  5447. <position x="340" y="0"/>
  5448. <inputVariables>
  5449. <variable formalParameter="IN">
  5450. <connectionPointIn>
  5451. <relPosition x="0" y="40"/>
  5452. <connection refLocalId="4">
  5453. <position x="340" y="40"/>
  5454. <position x="325" y="40"/>
  5455. <position x="325" y="60"/>
  5456. <position x="310" y="60"/>
  5457. </connection>
  5458. </connectionPointIn>
  5459. </variable>
  5460. </inputVariables>
  5461. <inOutVariables/>
  5462. <outputVariables>
  5463. <variable formalParameter="OUT">
  5464. <connectionPointOut>
  5465. <relPosition x="60" y="40"/>
  5466. </connectionPointOut>
  5467. </variable>
  5468. </outputVariables>
  5469. </block>
  5470. <inVariable localId="4" height="30" width="60" negated="false">
  5471. <position x="250" y="40"/>
  5472. <connectionPointOut>
  5473. <relPosition x="60" y="10"/>
  5474. </connectionPointOut>
  5475. <expression>a_sp_c</expression>
  5476. </inVariable>
  5477. <outVariable localId="5" height="30" width="50" negated="false">
  5478. <position x="450" y="30"/>
  5479. <connectionPointIn>
  5480. <relPosition x="0" y="10"/>
  5481. <connection refLocalId="3" formalParameter="OUT">
  5482. <position x="450" y="40"/>
  5483. <position x="400" y="40"/>
  5484. </connection>
  5485. </connectionPointIn>
  5486. <expression>a_sp</expression>
  5487. </outVariable>
  5488. <block localId="7" typeName="MOVE" height="60" width="60" executionOrderId="0">
  5489. <position x="260" y="80"/>
  5490. <inputVariables>
  5491. <variable formalParameter="IN">
  5492. <connectionPointIn>
  5493. <relPosition x="0" y="40"/>
  5494. <connection refLocalId="8">
  5495. <position x="260" y="120"/>
  5496. <position x="245" y="120"/>
  5497. <position x="245" y="135"/>
  5498. <position x="270" y="135"/>
  5499. <position x="270" y="140"/>
  5500. <position x="260" y="140"/>
  5501. </connection>
  5502. </connectionPointIn>
  5503. </variable>
  5504. </inputVariables>
  5505. <inOutVariables/>
  5506. <outputVariables>
  5507. <variable formalParameter="OUT">
  5508. <connectionPointOut>
  5509. <relPosition x="60" y="40"/>
  5510. </connectionPointOut>
  5511. </variable>
  5512. </outputVariables>
  5513. </block>
  5514. <inVariable localId="8" height="30" width="90" negated="false" executionOrderId="0">
  5515. <position x="170" y="120"/>
  5516. <connectionPointOut>
  5517. <relPosition x="90" y="20"/>
  5518. </connectionPointOut>
  5519. <expression>flow_sp_c</expression>
  5520. </inVariable>
  5521. <outVariable localId="9" height="30" width="70" negated="false" executionOrderId="0">
  5522. <position x="370" y="100"/>
  5523. <connectionPointIn>
  5524. <relPosition x="0" y="20"/>
  5525. <connection refLocalId="7" formalParameter="OUT">
  5526. <position x="370" y="120"/>
  5527. <position x="320" y="120"/>
  5528. </connection>
  5529. </connectionPointIn>
  5530. <expression>flow_sp</expression>
  5531. </outVariable>
  5532. <block localId="11" typeName="MOVE" height="60" width="60" executionOrderId="0">
  5533. <position x="490" y="130"/>
  5534. <inputVariables>
  5535. <variable formalParameter="IN">
  5536. <connectionPointIn>
  5537. <relPosition x="0" y="40"/>
  5538. <connection refLocalId="12">
  5539. <position x="490" y="170"/>
  5540. <position x="480" y="170"/>
  5541. <position x="480" y="180"/>
  5542. <position x="490" y="180"/>
  5543. </connection>
  5544. </connectionPointIn>
  5545. </variable>
  5546. </inputVariables>
  5547. <inOutVariables/>
  5548. <outputVariables>
  5549. <variable formalParameter="OUT">
  5550. <connectionPointOut>
  5551. <relPosition x="60" y="40"/>
  5552. </connectionPointOut>
  5553. </variable>
  5554. </outputVariables>
  5555. </block>
  5556. <inVariable localId="12" height="30" width="90" negated="false" executionOrderId="0">
  5557. <position x="400" y="170"/>
  5558. <connectionPointOut>
  5559. <relPosition x="90" y="10"/>
  5560. </connectionPointOut>
  5561. <expression>over_sp_c</expression>
  5562. </inVariable>
  5563. <outVariable localId="13" height="30" width="70" negated="false" executionOrderId="0">
  5564. <position x="600" y="160"/>
  5565. <connectionPointIn>
  5566. <relPosition x="0" y="20"/>
  5567. <connection refLocalId="11" formalParameter="OUT">
  5568. <position x="600" y="180"/>
  5569. <position x="575" y="180"/>
  5570. <position x="575" y="170"/>
  5571. <position x="550" y="170"/>
  5572. </connection>
  5573. </connectionPointIn>
  5574. <expression>over_sp</expression>
  5575. </outVariable>
  5576. <block localId="15" typeName="MOVE" height="60" width="60" executionOrderId="0">
  5577. <position x="230" y="170"/>
  5578. <inputVariables>
  5579. <variable formalParameter="IN">
  5580. <connectionPointIn>
  5581. <relPosition x="0" y="40"/>
  5582. <connection refLocalId="16">
  5583. <position x="230" y="210"/>
  5584. <position x="220" y="210"/>
  5585. <position x="220" y="220"/>
  5586. <position x="230" y="220"/>
  5587. </connection>
  5588. </connectionPointIn>
  5589. </variable>
  5590. </inputVariables>
  5591. <inOutVariables/>
  5592. <outputVariables>
  5593. <variable formalParameter="OUT">
  5594. <connectionPointOut>
  5595. <relPosition x="60" y="40"/>
  5596. </connectionPointOut>
  5597. </variable>
  5598. </outputVariables>
  5599. </block>
  5600. <inVariable localId="16" height="30" width="90" negated="false" executionOrderId="0">
  5601. <position x="140" y="210"/>
  5602. <connectionPointOut>
  5603. <relPosition x="90" y="10"/>
  5604. </connectionPointOut>
  5605. <expression>level_sp_c</expression>
  5606. </inVariable>
  5607. <outVariable localId="17" height="30" width="80" negated="false" executionOrderId="0">
  5608. <position x="340" y="190"/>
  5609. <connectionPointIn>
  5610. <relPosition x="0" y="10"/>
  5611. <connection refLocalId="15" formalParameter="OUT">
  5612. <position x="340" y="200"/>
  5613. <position x="305" y="200"/>
  5614. <position x="305" y="210"/>
  5615. <position x="290" y="210"/>
  5616. </connection>
  5617. </connectionPointIn>
  5618. <expression>level_sp</expression>
  5619. </outVariable>
  5620. <block localId="19" typeName="MOVE" height="60" width="60" executionOrderId="0">
  5621. <position x="490" y="230"/>
  5622. <inputVariables>
  5623. <variable formalParameter="IN">
  5624. <connectionPointIn>
  5625. <relPosition x="0" y="40"/>
  5626. <connection refLocalId="20">
  5627. <position x="490" y="270"/>
  5628. <position x="475" y="270"/>
  5629. <position x="475" y="280"/>
  5630. <position x="490" y="280"/>
  5631. </connection>
  5632. </connectionPointIn>
  5633. </variable>
  5634. </inputVariables>
  5635. <inOutVariables/>
  5636. <outputVariables>
  5637. <variable formalParameter="OUT">
  5638. <connectionPointOut>
  5639. <relPosition x="60" y="40"/>
  5640. </connectionPointOut>
  5641. </variable>
  5642. </outputVariables>
  5643. </block>
  5644. <inVariable localId="20" height="30" width="90" negated="false" executionOrderId="0">
  5645. <position x="400" y="270"/>
  5646. <connectionPointOut>
  5647. <relPosition x="90" y="10"/>
  5648. </connectionPointOut>
  5649. <expression>press_sp_c</expression>
  5650. </inVariable>
  5651. <outVariable localId="21" height="30" width="80" negated="false" executionOrderId="0">
  5652. <position x="600" y="250"/>
  5653. <connectionPointIn>
  5654. <relPosition x="0" y="10"/>
  5655. <connection refLocalId="19" formalParameter="OUT">
  5656. <position x="600" y="260"/>
  5657. <position x="565" y="260"/>
  5658. <position x="565" y="270"/>
  5659. <position x="550" y="270"/>
  5660. </connection>
  5661. </connectionPointIn>
  5662. <expression>press_sp</expression>
  5663. </outVariable>
  5664. </LD>
  5665. </body>
  5666. </pou>
  5667. </pous>
  5668. </types>
  5669. <instances>
  5670. <configurations>
  5671. <configuration name="Config0">
  5672. <resource name="Res0">
  5673. <task name="MainTask" priority="0" interval="T#50ms">
  5674. <pouInstance name="instance0" typeName="main"/>
  5675. </task>
  5676. <globalVars>
  5677. <variable name="run_bit" address="%QX0.0">
  5678. <type>
  5679. <BOOL/>
  5680. </type>
  5681. </variable>
  5682. </globalVars>
  5683. </resource>
  5684. </configuration>
  5685. </configurations>
  5686. </instances>
  5687. </project>
Buy Me A Coffee