Skip to content

Commit

Permalink
Add LREAL support (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkleber89 committed Jan 25, 2021
1 parent 12ed99b commit 15b8fac
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 41 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ This Project is not affilate to Beckhoff in any way

3. On TwinCat 2 Create a Struct and fill in your needed Symbols. Then add this Struct to a GlobalVariableTable.

##### Currently Supported Types: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, STRING(80)
##### Currently Supported Types: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, LREAL, STRING(80)

OPTIONAL: You can create a Variable in root of Struct with the exact name -> ioBrokerResync (Not Casesensitiv and not matter which Type) -> Every time this Variable changes his value the Table get resynced in ioBroker.

4. On TwinCat 3 Create a GlobalVariableTable and fill in your needed Symbols.

##### Currently Supported Types: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, STRING(80)
##### Currently Supported Types: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, LREAL, STRING(80)

OPTIONAL: You can create a Variable in root of Variable Table with the exact name -> ioBrokerResync (Not Casesensitiv and not matter which Type) -> Every time this Variable changes his value the Table get resynced in ioBroker.

Expand Down Expand Up @@ -65,6 +65,10 @@ Upload your *.tpy File from your PLC Project -> Every Time you change something
3. Sync never meant the Dataexchange of the Symbols. Sync is the create or delete the States in ioBroker dependent on the GlobalVariableTable in the PLC.

## Changelog
### 1.4.0 (2021-01-25)

- (dkleber89) Add LREAL Support

### 1.3.0 (2021-01-25)

- (dkleber89) Set correct type for channels
Expand Down Expand Up @@ -109,10 +113,6 @@ Upload your *.tpy File from your PLC Project -> Every Time you change something

- (dkleber89) Random Bugfixes, Add some monitoring that States get correct Ack

### 1.0.0 (2019-03-23)

- (dkleber 89) Stable Release, Update Gulp, add new Translations

## License

The MIT License (MIT)
Expand Down
20 changes: 10 additions & 10 deletions docs/de/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ Dieses Projekt hat keine Verbindung mit der Firma Beckhoff
1. Im Projekt muss ADS aktiviert sein. Dazu im Steuerungsproject in die Taskkonfiguration gehen und die Checkbox `Symbole erzeugen` aktivieren. Dann die Konfiguration auf die Steuerung laden und diese neu starten. Ein Neustart ist nur nötig wenn TwinCat 2 verwendet wird.

![createSymbols](img/createSymbols.png)

2. In der Steuerung muss eine Statische Route angelegt werden. Die Route muss mit dem ioBroker zusammenpassen (IP-Adresse und AMS-Net-ID).

Hier ein Beispiel wie das aussehen kann wenn die Route direkt auf der Steuerung hinzugefügt wird. Die Route kann auch über den Engineerien Rechner hinzugefügt werden.

![createSymbols](img/addRoute.png)

Weitere Informationen über den TwinCat Router und die Steuerung allgemein kann im [Beckhoff Information System](https://infosys.beckhoff.com/ "Beckhoff Information System") nachgelesen werden.

3. Bei TwinCat 2 muss in der Steuerung noch eine Struktur angelegt werden. Die Struktur danach zu einer globalen Variablentabelle hinzufügen. Hier können dann alle benötigten Variablen angelegt werden. Der Datenaustausch wird dann von ADS und dem Adapter selbstständig ausgeführt.
##### Derzeit unterstützte Datentypen: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, STRING(80)

##### Derzeit unterstützte Datentypen: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, LREAL, STRING(80)

OPTIONAL: Es kann eine Variable direkt in der Variablentabelle ohne Verschachtelung mit einem exakten Namen angelegt werden -> ioBrokerResync (Groß-/Kleinschreibung und Datentyp ist egal) -> Jedes mal wenn sich dieser Wert ändert wird die Variablentabelle im ioBroker neu eingelesen.

3. Bei TwinCat 3 muss in der Steuerung noch eine globale Variablentabelle angelegt werden. Hier können dann alle benötigten Variablen angelegt werden. Der Datenaustausch wird dann von ADS und dem Adapter selbstständig ausgeführt.

##### Derzeit unterstützte Datentypen: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, STRING(80)
##### Derzeit unterstützte Datentypen: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, LREAL, STRING(80)

OPTIONAL: Es kann eine Variable direkt in der Variablentabelle ohne Verschachtelung mit einem exakten Namen angelegt werden -> ioBrokerResync (Groß-/Kleinschreibung und Datentyp ist egal) -> Jedes mal wenn sich dieser Wert ändert wird die Variablentabelle im ioBroker neu eingelesen.

### Adapter Einstellungen
Expand All @@ -59,7 +59,7 @@ Die *.tpy Datei aus dem SPS Projekt muss hochgeladen werden. -> Immer wenn am St
### Wichtiges
1. Der TwinCAT AMS Router lässt keine mehrfachen TCP Verbindungen vom gleichen Host zu. Wenn zwei Instanzen vom selben Host zum selben TwinCat Router aufgebaut werden so wird vom Router automatisch die erste Verbindung geschlossen und nur der neusten geantwortet.
2. Der Adapter syncronisiert automatisch alle Variablen im ioBroker. Es gibt mehrere Möglichkeiten wie ein resync getriggert werden kann:
- Wenn sich der Wert der Resyc Variable ändert (Siehe [hier](#Konfiguration-der-Steuerung))
- Wenn sich der Wert der Resyc Variable ändert (Siehe [hier](#Konfiguration-der-Steuerung))
- Wenn die Steuerung länger nicht im RUN Modus ist als der Reconnect Interval -> Dann wird beim übergang der Steuerung in den RUN Modus die Variablentabelle resynchronisiert.
- Wenn das Project auf die Steuerung geladen wird. Ausnahme -> OnlineChange
- Wenn der Adapter neu gestartet wird.
Expand Down
16 changes: 8 additions & 8 deletions docs/en/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ This Project is not affilate to Beckhoff in any way
1. Enable ADS on your PLC project. To do this click on your task and then enable the checkbox before `Create symbols`. Download the new configuration and make sure you reboot your PLC. The reboot is only needed when you are using TwinCat 2.

![createSymbols](img/createSymbols.png)

2. Now add a static route to our Beckhoff PLC. The route should point to your server that will run the proxy application.

Here an example to add a Static Route directly on PLC u can add this Route also from your EngineeringPC to the PLC.

![createSymbols](img/addRoute.png)

Important is that the AmsNetId and the AdressInfo (IP-Adress) matches with the Adapter Settings. For further Information about TwinCat Router and Security read Documentation on Synchronisierung [Beckhoff Information System](https://infosys.beckhoff.com/ 'Beckhoff Information System')

3. On TwinCat 2 Create a Struct and fill in your needed Symbols. Then add this Struct to a GlobalVariableTable.

##### Currently Supported Types: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, STRING(80)
##### Currently Supported Types: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, LREAL, STRING(80)

OPTIONAL: You can create a Variable in root of Struct with the exact name -> ioBrokerResync (Not Casesensitiv and not matter which Type) -> Every time this Variable changes his value the Table get resynced in ioBroker.

4. On TwinCat 3 Create a GlobalVariableTable and fill in your needed Symbols.

##### Currently Supported Types: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, STRING(80)
##### Currently Supported Types: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, LREAL, STRING(80)

OPTIONAL: You can create a Variable in root of Variable Table with the exact name -> ioBrokerResync (Not Casesensitiv and not matter which Type) -> Every time this Variable changes his value the Table get resynced in ioBroker.

### Adapter Configuration
Expand Down
28 changes: 14 additions & 14 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
{
"common": {
"name": "beckhoff",
"version": "1.3.0",
"version": "1.4.0",
"news": {
"1.0.0": {
"en": "Stable Release, Update Gulp, add new Translations",
"de": "Stable-Release, Update Gulp, hinzufügen neuer Übersetzungen",
"ru": "Стабильный релиз, обновление залпом, добавить новые переводы",
"pt": "Versão estável, Atualização Gole, adicionar novas Traduções",
"nl": "Een stabiele versie, Update Gulp, het toevoegen van nieuwe Vertalingen",
"fr": "Publication de la Version Stable, mise à Jour de Gulp, ajouter de nouvelles Traductions",
"it": "Stabile di Rilascio, l'Aggiornamento Gulp, aggiungere nuove Traduzioni",
"es": "La Versión estable, la Actualización de Gulp, añadir nuevas Traducciones",
"pl": "Wersja stabilna, aktualizacja duszkiem, dodać nowe tłumaczenia",
"zh-cn": "稳定释放、更新口,添加新的翻译"
},
"1.0.1": {
"en": "Random Bugfixes",
"de": "Verschieden Bugfixes",
Expand Down Expand Up @@ -146,6 +134,18 @@
"es": "Establecer el tipo correcto de canales",
"pl": "Ustaw prawidłowy typ kanałów",
"zh-cn": "为频道设置正确的类型"
},
"1.4.0": {
"en": "Add LREAL support",
"de": "LREAL Unterstützung hinzugefügt",
"ru": "Добавить поддержку LREAL",
"pt": "Adicionar suporte LREAL",
"nl": "Voeg LREAL-ondersteuning toe",
"fr": "Ajouter le support LREAL",
"it": "Aggiungi il supporto LREAL",
"es": "Agregar soporte LREAL",
"pl": "Dodaj obsługę LREAL",
"zh-cn": "添加LREAL支持"
}
},
"title": "Beckhoff TwinCat ADS",
Expand Down Expand Up @@ -250,4 +250,4 @@
"native": {}
}
]
}
}
2 changes: 1 addition & 1 deletion lib/plcVarSyncronizing.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = function plcVarSync(adsC, adapter, emitter) {
* @returns {array} SymbolList for creating States in ioBroker and subscibe the Handles
*/
function createSymbolObjectList(datatypList, symbolList, datatypeIndex, prefix) {
const knownDatatypes = ['BOOL', 'BYTE', 'WORD', 'DWORD', 'SINT', 'USINT', 'INT', 'UINT', 'DINT', 'UDINT', 'REAL', 'STRING(80)'];
const knownDatatypes = ['BOOL', 'BYTE', 'WORD', 'DWORD', 'SINT', 'USINT', 'INT', 'UINT', 'DINT', 'UDINT', 'REAL', 'LREAL', 'STRING(80)'];

const tempObject = {
symname: '',
Expand Down
2 changes: 1 addition & 1 deletion lib/tpyParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = (adapter, emitter) => {
* @returns {array} SymbolList for creating States in ioBroker and subscibe the Handles
*/
function createSymbolObjectList(datatyps, symbols, datatypeIndex, prefix) {
const knownDatatypes = ['BOOL', 'BYTE', 'WORD', 'DWORD', 'SINT', 'USINT', 'INT', 'UINT', 'DINT', 'UDINT', 'REAL', 'STRING(80)'];
const knownDatatypes = ['BOOL', 'BYTE', 'WORD', 'DWORD', 'SINT', 'USINT', 'INT', 'UINT', 'DINT', 'UDINT', 'REAL', 'LREAL', 'STRING(80)'];

const tempObject = {
symname: '',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "iobroker.beckhoff",
"description": "ioBroker Beckoff Adapter to communicate with a Beckhoff PLC",
"version": "1.3.0",
"version": "1.4.0",
"private": false,
"license": "MIT",
"keywords": [
Expand Down

0 comments on commit 15b8fac

Please sign in to comment.