Skip to content

Commit

Permalink
Version 1.14.4
Browse files Browse the repository at this point in the history
- Bug fix: Changed RPC method flags from 16-bit to 32-bit
- Bug fix: Fix RPC method parsing in TwinCAT 4026
  • Loading branch information
jisotalo committed Oct 3, 2024
1 parent cbb85fb commit 01a538c
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 69 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.14.4] - 03.10.2023
### Changed
- Bug fix: Changed RPC method flags from 16-bit to 32-bit
- Bug fix: Fix RPC method parsing in TwinCAT 4026

See [PR #127](https://github.com/jisotalo/ads-client/pull/127) for details.

Thank you [icon-bobk](https://github.com/icon-bobk) for contribution!

## [1.14.3] - 23.09.2023
### Changed
- Bug fix: Some TwinCAT 2 devices (such as BK9050) do not send data length if answering with error code
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


[![npm version](https://img.shields.io/npm/v/ads-client)](https://www.npmjs.org/package/ads-client)
[![Donate](https://img.shields.io/badge/Support-PayPal-yellow)](https://www.paypal.com/donate/?business=KUWBXXCVGZZME&no_recurring=0&currency_code=EUR)
[![GitHub](https://img.shields.io/badge/View%20on-GitHub-brightgreen)](https://github.com/jisotalo/ads-client)
[![License](https://img.shields.io/github/license/jisotalo/ads-client)](https://choosealicense.com/licenses/mit/)

Expand All @@ -12,30 +11,33 @@ Coded from scratch using [TwinCAT ADS specification](https://infosys.beckhoff.co

There is automatically created documentation available at https://jisotalo.fi/ads-client/

# Project status
# Version 2 will be released soon

This project is currently "ready". It's maintained actively and used in projects by the author and others (also lot's of commercial projects)
The 1.4.4 is the the last version for v1, unless some bugs need fixing.

Bugs are fixed if found and new features can be added. Please let me know if you have any ideas!
<span style="color:red; font-weight:bold;">It might be a good idea to use the version 2 beta for new projects. It will no longer have breaking changes and it's basically ready!</span>

If you want to support my work, you can do it using PayPal. I can provide you support in exchange.
See [`v2-dev`](https://github.com/jisotalo/ads-client/tree/v2-dev) branch for more info. It's a full rewrite in in TypeScript and it can be installed from npm (`npm i ads-client@beta`).

[![Donate](https://img.shields.io/badge/Support%20my%20work!-PayPal-yellow)](https://www.paypal.com/donate/?business=KUWBXXCVGZZME&no_recurring=0&currency_code=EUR)
# Supporting

## Version 2
If you want to support my work, you can buy me a coffee!

Version 2 is now released as beta!
<a href="https://www.buymeacoffee.com/jisotalo" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

[![Donate](https://img.shields.io/badge/Donate-PayPal-yellow)](https://www.paypal.com/donate/?business=KUWBXXCVGZZME&no_recurring=0&currency_code=EUR)

If you need help with integrating the ads-client, I'm available for coding work with invoicing. Please send me email!

See [`v2-dev`](https://github.com/jisotalo/ads-client/tree/v2-dev) branch for more info. It's a full rewrite in in TypeScript and it can be installed from npm.

# Using Node-RED?
Check out the [node-red-contrib-ads-client](https://www.npmjs.com/package/node-red-contrib-ads-client) package. It's an `ads-client` wrapper for Node-RED to get the same functionality.


# Table of contents
- [ads-client](#ads-client)
- [Project status](#project-status)
- [Version 2](#version-2)
- [Version 2 will be released soon](#version-2-will-be-released-soon)
- [Supporting](#supporting)
- [Using Node-RED?](#using-node-red)
- [Table of contents](#table-of-contents)
- [Installation](#installation)
Expand Down
54 changes: 27 additions & 27 deletions docs/-_LibraryInternals.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h4 class="name" id="._amsNetIdStrToByteArray"><span class="type-signature">(sta

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6875">line 6875</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6877">line 6877</a>
</li></ul></dd>


Expand Down Expand Up @@ -305,7 +305,7 @@ <h4 class="name" id="._byteArrayToAmsNetIdStr"><span class="type-signature">(sta

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6859">line 6859</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6861">line 6861</a>
</li></ul></dd>


Expand Down Expand Up @@ -466,7 +466,7 @@ <h4 class="name" id="._checkReceivedData"><span class="type-signature">(static)

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5819">line 5819</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5821">line 5821</a>
</li></ul></dd>


Expand Down Expand Up @@ -873,7 +873,7 @@ <h4 class="name" id="._console"><span class="type-signature">(static) </span>_co

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6711">line 6711</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6713">line 6713</a>
</li></ul></dd>


Expand Down Expand Up @@ -1009,7 +1009,7 @@ <h4 class="name" id="._createAmsHeader"><span class="type-signature">(static) </

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6608">line 6608</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6610">line 6610</a>
</li></ul></dd>


Expand Down Expand Up @@ -1167,7 +1167,7 @@ <h4 class="name" id="._createAmsTcpHeader"><span class="type-signature">(static)

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6676">line 6676</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6678">line 6678</a>
</li></ul></dd>


Expand Down Expand Up @@ -1348,7 +1348,7 @@ <h4 class="name" id="._createAmsTcpRequest"><span class="type-signature">(static

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6572">line 6572</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6574">line 6574</a>
</li></ul></dd>


Expand Down Expand Up @@ -1506,7 +1506,7 @@ <h4 class="name" id="._deepMergeObjects"><span class="type-signature">(static) <

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6745">line 6745</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6747">line 6747</a>
</li></ul></dd>


Expand Down Expand Up @@ -1963,7 +1963,7 @@ <h4 class="name" id="._getDataTypeInfo"><span class="type-signature">(static) </

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5773">line 5773</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5775">line 5775</a>
</li></ul></dd>


Expand Down Expand Up @@ -2127,7 +2127,7 @@ <h4 class="name" id="._getDataTypeRecursive"><span class="type-signature">(stati

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5588">line 5588</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5590">line 5590</a>
</li></ul></dd>


Expand Down Expand Up @@ -2383,7 +2383,7 @@ <h4 class="name" id="._onAdsCommandReceived"><span class="type-signature">(async

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6312">line 6312</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6314">line 6314</a>
</li></ul></dd>


Expand Down Expand Up @@ -2520,7 +2520,7 @@ <h4 class="name" id="._onAmsTcpPacketReceived"><span class="type-signature">(asy

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6215">line 6215</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6217">line 6217</a>
</li></ul></dd>


Expand Down Expand Up @@ -3238,7 +3238,7 @@ <h4 class="name" id="._parseAdsData"><span class="type-signature">(static) </spa

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6025">line 6025</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6027">line 6027</a>
</li></ul></dd>


Expand Down Expand Up @@ -3396,7 +3396,7 @@ <h4 class="name" id="._parseAdsNotification"><span class="type-signature">(stati

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6394">line 6394</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6396">line 6396</a>
</li></ul></dd>


Expand Down Expand Up @@ -3554,7 +3554,7 @@ <h4 class="name" id="._parseAmsHeader"><span class="type-signature">(static) </s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5943">line 5943</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5945">line 5945</a>
</li></ul></dd>


Expand Down Expand Up @@ -3712,7 +3712,7 @@ <h4 class="name" id="._parseAmsTcpHeader"><span class="type-signature">(static)

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5899">line 5899</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5901">line 5901</a>
</li></ul></dd>


Expand Down Expand Up @@ -3870,7 +3870,7 @@ <h4 class="name" id="._parseAmsTcpPacket"><span class="type-signature">(async, s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5862">line 5862</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5864">line 5864</a>
</li></ul></dd>


Expand Down Expand Up @@ -4164,7 +4164,7 @@ <h4 class="name" id="._parseJsObjectToBuffer"><span class="type-signature">(stat

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5240">line 5240</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5242">line 5242</a>
</li></ul></dd>


Expand Down Expand Up @@ -4449,7 +4449,7 @@ <h4 class="name" id="._parseJsVariableToPlc"><span class="type-signature">(stati

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5361">line 5361</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5363">line 5363</a>
</li></ul></dd>


Expand Down Expand Up @@ -4631,7 +4631,7 @@ <h4 class="name" id="._parsePlcDataToObject"><span class="type-signature">(stati

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5406">line 5406</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5408">line 5408</a>
</li></ul></dd>


Expand Down Expand Up @@ -4879,7 +4879,7 @@ <h4 class="name" id="._parsePlcVariableToJs"><span class="type-signature">(stati

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5489">line 5489</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5491">line 5491</a>
</li></ul></dd>


Expand Down Expand Up @@ -5060,7 +5060,7 @@ <h4 class="name" id="._parseSymbolInfo"><span class="type-signature">(static) </

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5044">line 5044</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5046">line 5046</a>
</li></ul></dd>


Expand Down Expand Up @@ -5218,7 +5218,7 @@ <h4 class="name" id="._readDataTypeInfo"><span class="type-signature">(static) <

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5527">line 5527</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5529">line 5529</a>
</li></ul></dd>


Expand Down Expand Up @@ -5380,7 +5380,7 @@ <h4 class="name" id="._readSymbolInfo"><span class="type-signature">(static) </s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5179">line 5179</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line5181">line 5181</a>
</li></ul></dd>


Expand Down Expand Up @@ -6110,7 +6110,7 @@ <h4 class="name" id="._sendAdsCommand"><span class="type-signature">(static) </s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6469">line 6469</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6471">line 6471</a>
</li></ul></dd>


Expand Down Expand Up @@ -7095,7 +7095,7 @@ <h4 class="name" id="._trimPlcString"><span class="type-signature">(static) </sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6833">line 6833</a>
<a href="ads-client.js.html">ads-client.js</a>, <a href="ads-client.js.html#line6835">line 6835</a>
</li></ul></dd>


Expand Down Expand Up @@ -7725,7 +7725,7 @@ <h5 class="subsection-title">Properties:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sat Sep 23 2023 08:34:17 GMT+0300 (Itä-Euroopan kesäaika) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Oct 03 2024 20:50:46 GMT+0300 (Itä-Euroopan kesäaika) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Client.html
Original file line number Diff line number Diff line change
Expand Up @@ -9027,7 +9027,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sat Sep 23 2023 08:34:17 GMT+0300 (Itä-Euroopan kesäaika) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Oct 03 2024 20:50:46 GMT+0300 (Itä-Euroopan kesäaika) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/ClientException.html
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ <h5>Type:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sat Sep 23 2023 08:34:17 GMT+0300 (Itä-Euroopan kesäaika) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Oct 03 2024 20:50:46 GMT+0300 (Itä-Euroopan kesäaika) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
20 changes: 11 additions & 9 deletions docs/ads-client.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -4866,6 +4866,7 @@ <h1 class="page-title">ads-client.js</h1>

//Get method length
let len = data.readUInt32LE(pos)
const methodFinalPos = pos + len;
pos += 4

//4..7 Version
Expand All @@ -4888,33 +4889,33 @@ <h1 class="page-title">ads-client.js</h1>
method.reserved = data.readUInt32LE(pos)
pos += 4

//24..27 Return type GUID
//24..39 Return type GUID
method.returnTypeGuid = data.slice(pos, pos + 16).toString('hex')
pos += 16

//28..31 Return data type
//40..43 Return data type
method.retunAdsDataType = data.readUInt32LE(pos)
method.retunAdsDataTypeStr = ADS.ADS_DATA_TYPES.toString(method.retunAdsDataType)
pos += 4

//27..30 Flags (AdsDataTypeFlags)
method.flags = data.readUInt16LE(pos)
//44..47 Flags
method.flags = data.readUInt32LE(pos)
method.flagsStr = ADS.ADS_DATA_TYPE_FLAGS.toStringArray(method.flags)
pos += 4

//31..32 Name length
//48..49 Name length
method.nameLength = data.readUInt16LE(pos)
pos += 2

//33..34 Return type length
//50..51 Return type length
method.returnTypeLength = data.readUInt16LE(pos)
pos += 2

//35..36 Comment length
//52..53 Comment length
method.commentLength = data.readUInt16LE(pos)
pos += 2

//37..38 Parameter count
//54..55 Parameter count
method.parameterCount = data.readUInt16LE(pos)
pos += 2

Expand Down Expand Up @@ -5002,6 +5003,7 @@ <h1 class="page-title">ads-client.js</h1>
method.parameters.push(param)
}

pos = methodFinalPos;
dataType.rpcMethods.push(method)
}
}
Expand Down Expand Up @@ -6942,7 +6944,7 @@ <h1 class="page-title">ads-client.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sat Sep 23 2023 08:34:17 GMT+0300 (Itä-Euroopan kesäaika) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Oct 03 2024 20:50:46 GMT+0300 (Itä-Euroopan kesäaika) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
Loading

0 comments on commit 01a538c

Please sign in to comment.