Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add guidance on how to connect from TwinCAT XAE #2

Open
RodneyRichardson opened this issue Feb 11, 2021 · 6 comments
Open

Please add guidance on how to connect from TwinCAT XAE #2

RodneyRichardson opened this issue Feb 11, 2021 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@RodneyRichardson
Copy link

I have started the docker container, and can connect to the swagger API using a web browser, but I don't know how to add a route to the softBeckhoff PLC.

Please add some guidance on what value to put into the routing, and/or if routes need to be set up on the softBeckhoff via the API.

@fbarresi fbarresi self-assigned this Feb 11, 2021
@fbarresi fbarresi added the documentation Improvements or additions to documentation label Feb 11, 2021
@fbarresi
Copy link
Owner

Hi!

Can you please explain me your use case? Do you want to connect the software to the twincat engineering?

@RodneyRichardson
Copy link
Author

RodneyRichardson commented Feb 12, 2021

I have TwinCAT Engineering (XAE) installed on Windows 10, and am using it to write my PLC code. I would like to run that PLC code on the softBeckhoff PLC running in docker on the same machine.

The "Broadcast Search" option in the Add Route Dialog in XAE does not find the softBeckhoff. I don't know what route to add manually to my TwinCAT Engineering environment, nor how to add the route from the softBeckhoff back.

If I manually enter route information (e.g. IP Address=127.0.0.1, AmsNetId=192.168.1.20.1.1, Transport=TCP_IP), it asks for Remote credentials (Username/Password) which I don't know.

@fbarresi
Copy link
Owner

Hi!
Thank you for your explanation.

Basically you just have to setup a route on your machine (unidirectional).
Then you can setup the other direction of the route for your docker container over the API [/routes].

image

Otherwise the SoftBeckhoff is will not be able to run your code or act like a PLC you can program 😢 .
The software was designed for testing ADS Communication for example for testing software that communicates with a PLC or for CI/CD Agents that have to run automated tests.
Since a fully PLC simulation is still possible out of the box over the installed runtime inside the engineering environment I don't plan to integrate such a function in the software.

@RodneyRichardson
Copy link
Author

RodneyRichardson commented Feb 15, 2021

Thanks, but I'm having a few problems with this.
Looking at the start-up log in the docker container, I see the following:

Local System: SoftBeckhoff, 192.168.1.20.1.1, 172.17.0.2
Configured routes:
        RemoteSystem1, 10.30.2.124.1.1, RemoteSystem1
  1. In XAE, what value do I put in the AmsNetId and IP Address? I assume 192.168.1.20.1.1 and 127.0.0.1, and the Remove Route set to None..
  2. What's the IP address I use for the "PUT routes" call? I'm assuming 172.17.0.2, with the AmsNetId from my "TwinCAT Info" and an arbitrary name.
  3. When I call "GET routes" (using the swagger "Try it out"), it always returns 204 (no content). Looking at the code, I see this is not implemented (nor can I see a way to easily implement this, as listing doesn't look to be supported by TwinCAT.Ads.TcpRouter.AmsTcpIpRouter).

@fbarresi
Copy link
Owner

Hi!

  1. There is a route already configured, that you see in docker log. I put it as default in appsettings.json So everybody can see the default structure if starting from source.
  2. Basing on what I see in you log snippet you need to setup an unidirectional route with 192.168.1.20.1.1 and 172.17.0.2 (Ip of your running container)
  3. In the API you have to setup a route with AMSNetId and Ip Address of your machine and an arbitrary name.
  4. This is still a todo, because the amsTcpIpRouter doesn't expose the list of routes. I wanted to reach the list via reflection, but I'm still working on it.

In you case I would try to start the software from source, so you can use your local router server an all you local routes.
Just start with this flag --add-router=false

@RodneyRichardson
Copy link
Author

Hi, Thank you for your advice, but I'm afraid I still can't get this to work on my setup. For now I'm going to use the Beckhoff XAR on a VMWare VM, but I may come back to this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants