This adapter for ioBroker can Communicate with a Beckhoff Automation System (Twincat 2 or 3) over the ADS Protocol. The ADS Protocol is implemented in every System of Beckhoff and can be used without any License on ioBroker or Automation System.
This Project is not affilate to Beckhoff in any way
- Beckhoff PLC that has an ethernet connection and is connected to your LAN
- Make your you give the PLC a fixed IP address
- Make sure you can ping the PLC from ioBroker
- TwinCat 2 excluding BC Runtimes or TwinCat 3
-
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. -
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.
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
-
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, LREAL, TIME, TIME_OF_DAY, TOD, DATE, DATE_AND_TIME, DT, STRING
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.
-
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, LREAL, TIME, TIME_OF_DAY, TOD, DATE, DATE_AND_TIME, DT, STRING
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.
- Choose your Runtime Version
- Fill in Target IP-Adress and AMS-Net-ID.
- On TwinCat 2 fill in the Instance Name of Struct.
- On TwinCat 3 fill in the correct Tablename of the before created GlobalVariableTable.
- All other Points u mostly not need to Change.
Upload your *.tpy File from your PLC Project -> Every Time you change something on the Struct u communicate with the ioBroker, you need to Upload it again.
- When some Value is changed in PLC then it will be automatic transferred to ioBroker
- When a Value is changed in ioBroker (Important: ACK need to be FALSE!!) then the Value will be automatic transferred to PLC. After that the Adapter set ACK to TRUE.
- TwinCAT AMS Router doesn't allow multiple TCP connections from the same host. So when you use two instances on the same host to connect to the same TwinCAT router, you will see that TwinCAT will close the first TCP connection and only respond to the newest.
- The Adapter Sync the complete GlobalVariableTable. U have different options to trigger a resync:
- Create a resync Variable in PLC (See here)
- When the PLC are not in Run longer your Resync Intervall -> Then the Sync will triggered after the start of PLC.
- Every Time you Download the Project to your PLC except "OnlineChange"
- Restart the Adapter
- 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.
- (mcm1957) Adapter requires node.js 18 and js-controller >= 5 now
- (mcm1957) Dependencies have been updated
- (mcm1957) Dependencies have been updated
- (mcm1957) Standard test environment has been updated
- (dkleber89) Fix Adapter Checker Issues
- (PLCHome) Add TIME, TIME_OF_DAY, TOD, DATE, DATE_AND_TIME and DT support
- (PLCHome) Support for strings with all char length
- (dkleber89) Process next state in list when register subscriptions not before the previous is finish processed in plc
- (dkleber89) Some little Adapter maintenance
- (dkleber89) Add LREAL Support
- (dkleber89) Set correct type for channels
- (dkleber89) Clear reconnectTimeout on Adapter unload;
- (dkleber89) Add CI over Github Actions; Update Dependencies;
- (dkleber89) Add Support for Strings with fixed length to 80 Chars
- (dkleber89) Add Support for older TwinCat2 Systems with no autosync
- (dkleber89) Add Support for Compact Mode -> JS Controller >= 2.0.0
- (dkleber89) Add check change of Datatype on resync
- (dkleber89) Eslint, Prettier with Airbnb Codestyle, CI adopted, little random changes in Project Structure
The MIT License (MIT)
Copyright (c) 2024 iobroker-community-adapters iobroker-community-adapters@gmx.de Copyright (c) 2018-2023 dkleber89 dkleber89@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.