Giter VIP home page Giter VIP logo

Comments (7)

jisotalo avatar jisotalo commented on September 25, 2024

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.

hansipete avatar hansipete commented on September 25, 2024

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.

hansipete avatar hansipete commented on September 25, 2024

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.

jisotalo avatar jisotalo commented on September 25, 2024

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.

Vinhtu avatar Vinhtu commented on September 25, 2024

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.

Dominic-Liu avatar Dominic-Liu commented on September 25, 2024

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.

Dominic-Liu avatar Dominic-Liu commented on September 25, 2024

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

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.