|
8 | 8 | <a id="md:project-status" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Project status<a href="#md:project-status" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>14.12.2024 - version 2 released!</p> |
9 | 9 | <ul> |
10 | 10 | <li>Rewritten in Typescript</li> |
11 | | -<li>See <a href="https://github.com/jisotalo/ads-client/blob/v2-dev/CHANGELOG.md" target="_blank" class="external">CHANGELOG.md</a> for details.</li> |
12 | | -<li>See <a href="https://github.com/jisotalo/ads-client/blob/v2-dev/MIGRATION.md" target="_blank" class="external">MIGRATION.md</a> for guide of migrating v1 -> v2 (<strong>breaking changes!</strong>)</li> |
| 11 | +<li>See <a href="https://github.com/jisotalo/ads-client/blob/master/CHANGELOG.md" target="_blank" class="external">CHANGELOG.md</a> for details.</li> |
| 12 | +<li>See <a href="https://github.com/jisotalo/ads-client/blob/master/MIGRATION.md" target="_blank" class="external">MIGRATION.md</a> for guide of migrating v1 -> v2 (<strong>breaking changes!</strong>)</li> |
13 | 13 | <li>See the new <a href="https://jisotalo.fi/ads-client/classes/Client.html" target="_blank" class="external">documentation</a></li> |
14 | 14 | </ul> |
15 | 15 | <p>See <a href="https://github.com/jisotalo/ads-client/tree/legacy-v1" target="_blank" class="external"><code>legacy-v1</code> branch</a> for previous/legacy version 1.4.4.</p> |
|
759 | 759 | <li>The feature isn't well documented by Beckhoff, so there might be some things that aren't taken into account</li> |
760 | 760 | </ul> |
761 | 761 | <a id="md:about-examples" class="tsd-anchor"></a><h3 class="tsd-anchor-link">About examples<a href="#md:about-examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>These examples use <code>FB_RPC</code> from the test PLC project at <a href="https://github.com/jisotalo/ads-client-test-plc-project" target="_blank" class="external">https://github.com/jisotalo/ads-client-test-plc-project</a>.</p> |
762 | | -<p><img src="https://raw.githubusercontent.com/jisotalo/ads-client/refs/heads/v2-dev/img/fb_rpc.png" alt=""></p> |
| 762 | +<p><img src="https://github.com/jisotalo/ads-client/blob/master/img/fb_rpc.png?raw=true" alt=""></p> |
763 | 763 | <p>There is an instance of the function block at <code>GVL_RPC.RpcBlock</code>.</p> |
764 | | -<a id="md:rpc-method-with-standard-data-types" class="tsd-anchor"></a><h3 class="tsd-anchor-link">RPC method with standard data types<a href="#md:rpc-method-with-standard-data-types" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>Calculator()</code> method calculates sum, product and division of the input values. The method returns <code>true</code>, if all calculations were successful.</p> |
| 764 | +<a id="md:rpc-method-with-standard-data-types" class="tsd-anchor"></a><h3 class="tsd-anchor-link">RPC method with standard data types<a href="#md:rpc-method-with-standard-data-types" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>conn |
| 765 | +The <code>Calculator()</code> method calculates sum, product and division of the input values. The method returns <code>true</code>, if all calculations were successful.</p> |
765 | 766 | <pre><code><span class="hl-1">{</span><span class="hl-0">attribute</span><span class="hl-1"> </span><span class="hl-6">'TcRpcEnable'</span><span class="hl-1">}</span><br/><span class="hl-4">METHOD</span><span class="hl-1"> </span><span class="hl-10">Calculator</span><span class="hl-1"> : </span><span class="hl-4">BOOL</span><br/><span class="hl-4">VAR_INPUT</span><br/><span class="hl-1"> </span><span class="hl-10">Value1</span><span class="hl-1"> : </span><span class="hl-4">REAL</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-10">Value2</span><span class="hl-1"> : </span><span class="hl-4">REAL</span><span class="hl-1">;</span><br/><span class="hl-4">END_VAR</span><br/><span class="hl-4">VAR_OUTPUT</span><br/><span class="hl-1"> </span><span class="hl-10">Sum</span><span class="hl-1"> : </span><span class="hl-4">REAL</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-10">Product</span><span class="hl-1"> : </span><span class="hl-4">REAL</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-10">Division</span><span class="hl-1"> : </span><span class="hl-4">REAL</span><span class="hl-1">;</span><br/><span class="hl-4">END_VAR</span><br/><br/><span class="hl-2">//--- Code starts ---</span><br/><br/><span class="hl-2">//Return TRUE if all success</span><br/><span class="hl-10">Calculator</span><span class="hl-1"> := </span><span class="hl-4">TRUE</span><span class="hl-1">;</span><br/><br/><span class="hl-10">Sum</span><span class="hl-1"> := </span><span class="hl-0">Value1</span><span class="hl-1"> + </span><span class="hl-0">Value2</span><span class="hl-1">;</span><br/><span class="hl-10">Product</span><span class="hl-1"> := </span><span class="hl-0">Value1</span><span class="hl-1"> * </span><span class="hl-0">Value2</span><span class="hl-1">;</span><br/><br/><span class="hl-4">IF</span><span class="hl-1"> </span><span class="hl-0">Value2</span><span class="hl-1"> <> </span><span class="hl-8">0</span><span class="hl-1"> </span><span class="hl-4">THEN</span><br/><span class="hl-1"> </span><span class="hl-10">Division</span><span class="hl-1"> := </span><span class="hl-0">Value1</span><span class="hl-1"> / </span><span class="hl-0">Value2</span><span class="hl-1">;</span><br/><span class="hl-4">ELSE</span><br/><span class="hl-1"> </span><span class="hl-10">Division</span><span class="hl-1"> := </span><span class="hl-8">0</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-10">Calculator</span><span class="hl-1"> := </span><span class="hl-4">FALSE</span><span class="hl-1">;</span><br/><span class="hl-4">END_IF</span> |
766 | 767 | </code><button>Copy</button></pre> |
767 | 768 |
|
|
945 | 946 | This prevents regression, thus updating the ads-client should be always safe.</p> |
946 | 947 | <p>There are separate tests for TwinCAT 2 and TwinCAT 3.</p> |
947 | 948 | <p>PLC projects for running test suites are located in the following repository: |
948 | | -<a href="https://github.com/jisotalo/ads-client-test-plc-project/tree/v2-dev" target="_blank" class="external">https://github.com/jisotalo/ads-client-test-plc-project/tree/v2-dev</a>.</p> |
| 949 | +<a href="https://github.com/jisotalo/ads-client-test-plc-project" target="_blank" class="external">https://github.com/jisotalo/ads-client-test-plc-project</a>.</p> |
949 | 950 | <a id="md:twincat-3-tests" class="tsd-anchor"></a><h3 class="tsd-anchor-link">TwinCAT 3 tests<a href="#md:twincat-3-tests" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Tests are run with command <code>npm run test-tc3</code>. TwinCAT 3 test PLC projects needs to be running in the target system.</p> |
950 | 951 | <a id="md:twincat-2-tests" class="tsd-anchor"></a><h3 class="tsd-anchor-link">TwinCAT 2 tests<a href="#md:twincat-2-tests" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Tests are run with command <code>npm run test-tc2</code>. TwinCAT 2 test PLC projects needs to be running in the target system.</p> |
951 | 952 | <a id="md:license" class="tsd-anchor"></a><h1 class="tsd-anchor-link">License<a href="#md:license" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Licensed under <a href="http://www.opensource.org/licenses/MIT" target="_blank" class="external">MIT License</a>.</p> |
|
0 commit comments