Comments (7)
Hi Hans!
Thanks! Great that it has been working so far, glad to hear!
As you OSX doesn't have a TwinCAT router installed, it has no idea where that machine with AmsNetId 5.85.243.162 is (as AmsNetId is not IP address).
As default, the ads-client tries to connect to local router (localhost), which is usually OK when you have TwinCAT installed. However, now you won't have any.
Instead, you need to tell the client to connect to router of another machine, as with Raspberry Pi example. You also need to provide AmsNetId of your own. So follow the https://github.com/jisotalo/ads-client#setup-3---connecting-from-any-nodejs-supported-system-to-the-plc
Change the PLC_IP_ADDRESS to your PLC IP. And the port 48898 needs to be open from firewall.
const client = new ads.Client({
localAmsNetId: '192.168.1.10.1.1', //Can be anything but needs to be in PLC StaticRoutes.xml file
localAdsPort: 32750, //Can be anything that is not used
targetAmsNetId: '5.85.243.162.1.1',
targetAdsPort: 851,
routerAddress: 'PLC_IP_ADDRESS', //PLC ip address
routerTcpPort: 48898 //PLC needs to have this port opened. Test disabling all firewalls if problems
})
Please let me know how it's going! I haven't heard any comments from OSX yet.
from ads-client.
Hi there,
thank you for your explanation! Just figured out that I actually never connected with OSX before... I thought I did, but that was when I was running bootcamped Windows (with TwinCAT installed.)
I'll try to get it running following your guide and keep you updated
Thanks for you help!
Hans
from ads-client.
Got it working!
It's actually quite easy if using the Beckhoff Web Configuration. http://<PLC_IP>/config/
(in my case PLC IP = 192.168.99.208) asks for username and password. Then navigate to config/#TwinCAT&Connectivity
and add my device. (Under the hood this seems to add to TwinCAT\3.1\Target\StaticRoutes.xml)
- AMS Net ID: 192.168.99.106.1.1 (made this one up, using the IP + .1.1)
- Transport Type: TCP_IP
- Address: 192.168.99.106
- Connection Timeout (ms): 60000
- Flags: Static, IP Address
Now I can connect from OSX with the following credentials:
{
localAmsNetId: '192.168.99.106.1.1',
localAdsPort: 32750,
targetAmsNetId: '5.85.243.162.1.1',
targetAdsPort: 851,
routerAddress: '192.168.99.208', // plc ip
routerTcpPort: 48898
}
Works! Thank you so much
from ads-client.
Awesome! Thanks for detailed info. I'll link to this issue later from the FAQ if that helps somebody!
I have been thinking about a node.js based AMS router, that would work in any machine (similar to the .NET Core version by Beckhoff). That would be another solution too.
from ads-client.
hi can you tell me what platform you are using to connect, i use react-native and it gives error:
TypeError: undefined is not a constructor (evaluating 'new (_$$_REQUIRE(_dependencyMap[13], "net").Socket)()')
Pls help me and thank you very much
from ads-client.
Hi Hans!
Thanks! Great that it has been working so far, glad to hear!
As you OSX doesn't have a TwinCAT router installed, it has no idea where that machine with AmsNetId 5.85.243.162 is (as AmsNetId is not IP address).
As default, the ads-client tries to connect to local router (localhost), which is usually OK when you have TwinCAT installed. However, now you won't have any.
Instead, you need to tell the client to connect to router of another machine, as with Raspberry Pi example. You also need to provide AmsNetId of your own. So follow the https://github.com/jisotalo/ads-client#setup-3---connecting-from-any-nodejs-supported-system-to-the-plc
Change the PLC_IP_ADDRESS to your PLC IP. And the port 48898 needs to be open from firewall.
const client = new ads.Client({ localAmsNetId: '192.168.1.10.1.1', //Can be anything but needs to be in PLC StaticRoutes.xml file localAdsPort: 32750, //Can be anything that is not used targetAmsNetId: '5.85.243.162.1.1', targetAdsPort: 851, routerAddress: 'PLC_IP_ADDRESS', //PLC ip address routerTcpPort: 48898 //PLC needs to have this port opened. Test disabling all firewalls if problems })
Please let me know how it's going! I haven't heard any comments from OSX yet.
sorry for the trouble, i got the same issue, i don't know where i can perform the code block begins with const client = new ads...,
could you make some screen shot for me, appreciate your great support.
from ads-client.
Got it working!
It's actually quite easy if using the Beckhoff Web Configuration.
http://<PLC_IP>/config/
(in my case PLC IP = 192.168.99.208) asks for username and password. Then navigate toconfig/#TwinCAT&Connectivity
and add my device. (Under the hood this seems to add to TwinCAT\3.1\Target\StaticRoutes.xml)
- AMS Net ID: 192.168.99.106.1.1 (made this one up, using the IP + .1.1)
- Transport Type: TCP_IP
- Address: 192.168.99.106
- Connection Timeout (ms): 60000
- Flags: Static, IP Address
Now I can connect from OSX with the following credentials:
{ localAmsNetId: '192.168.99.106.1.1', localAdsPort: 32750, targetAmsNetId: '5.85.243.162.1.1', targetAdsPort: 851, routerAddress: '192.168.99.208', // plc ip routerTcpPort: 48898 }
Works! Thank you so much
Hi Hans,
glad to find the topic here, could you share me how to use the Beckhoff Web Configuration, if we need to install a certain software?, i have installed the windows in VM, and installed the twincat3 4024.50+ in VM windows, i can't open the (http://<PLC_IP>/config/
) website in browser, could you make some screen shot for it? i follow the setup3 as the website. https://github.com/jisotalo/ads-client#setup-3---connecting-from-any-nodejs-supported-system-to-the-plc
sorry for the trouble.
from ads-client.
Related Issues (20)
- Read symbol value on BC9050 HOT 2
- MBUS card through ADS HOT 1
- BK9050 HOT 11
- idea: ads-client with Blockly, organization: VisualPLC, problem port 301 without address, HOT 11
- CX9020 HOT 1
- Get events/alarms/messages from TcEventLogger HOT 3
- write variable type BOOL HOT 1
- ads-client+vite+vanillajs it's possible? HOT 5
- Subcribe to variable without PLC port 301 HOT 1
- Version 2 - Missing features from v1 HOT 9
- Version 2 - Adding support for SymbolInfo and DataType extended flags
- Version 2 - Making sure 1.4.2 and 1.4.3 updates are merged HOT 2
- Version 2 - Pull requests
- Version 2 - README
- Version 2 - MIGRATION HOT 1
- Version 2 - Documentation
- Version 2 - Finalizing types HOT 1
- Version 2 - Finalizing testing
- Version 2 - Reconnecting and handling subscriptions during reconnection and symbol version change HOT 1
- Time datatype HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ads-client.