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

Can't read/write virtual plc when running it from Docker #9

Open
emmanuelbertho opened this issue May 24, 2023 · 0 comments
Open

Can't read/write virtual plc when running it from Docker #9

emmanuelbertho opened this issue May 24, 2023 · 0 comments

Comments

@emmanuelbertho
Copy link

Hello, I am trying your virtual-plc and I have an issue.
When I start the program on my machine everything works fine and I can read and write values in ADS.
But when I am starting it in Docker, I can't read and write values in my plc. I have an exception : TwinCAT.Ads.AdsErrorException : 'Target port could not be found. (AdsErrorCode: 6, 0x6)'

image

Here is the log of my container :

dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Application Directories
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
=======================
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
ApplicationPath: /app/SoftBeckhoff.dll
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
BaseDirectory: /app/
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
CurrentDirectory: /app
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Configuration
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
=============
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
ASPNETCORE_ENVIRONMENT: Production
Provider: ChainedConfigurationProvider
Provider: JsonConfigurationProvider
Provider: JsonConfigurationProvider
Provider: EnvironmentVariablesConfigurationProvider
Provider: CommandLineConfigurationProvider
Provider: JsonConfigurationProvider
Local System: SoftBeckhoff, 192.168.1.20.1.1, 172.17.0.5

Configured routes:
RemoteSystem1, 10.30.2.124.1.1, RemoteSystem1

dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Starting remote listeners ...
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Starting listening on 172.17.0.5:48898
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Waiting for Request to AmsTcpIpRouter (192.168.1.20.1.1)
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
[AmsTcpIpRouter] Start Listener
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Opening Loopback listener '127.0.0.1:48898'
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
[AmsTcpIpRouter] Start Listener
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://[::]:80
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /app
info: SoftBeckhoff.Services.BeckhoffService[0]
Initializing Beckhoff server...
info: SoftBeckhoff.Services.BeckhoffService[0]
Beckhoff server created
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Opening Loopback listener '127.0.0.1:48898'
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
[AmsTcpIpRouter] Start Listener
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
[AmsTcpIpRouter] TCP Connect Endpoint: 127.0.0.1:37776
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Port '852' occupied!
info: TwinCAT.Ads.AdsRouterService.RouterService[0]
AdsServer with AmsPort '192.168.1.20.1.1:65535' registered!
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Starting Receive AdsServer '192.168.1.20.1.1:65535 (Endpoint: 127.0.0.1:37776)' registered!
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
--> Sending Frame: TcpFrame Flags: PortConnect, DataSize: 8 (TcpFrameSize: 14)
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
--> Send TcpFrame: TcpFrame Flags: PortConnect, DataSize: 8 (TcpFrameSize: 14)
info: TwinCAT.Ads.AdsRouterService.RouterService[0]
AdsServer '192.168.1.20.1.1:852' connected! (2 loopback connections active)
info: SoftBeckhoff.Services.BeckhoffService[0]
Beckhoff server connected = True with result = 852
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down...
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
A task was canceled.
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
[AmsTcpIpRouter] TCP Disconnect Endpoint: 127.0.0.1:37776
dbug: TwinCAT.Ads.AdsRouterService.RouterService[0]
Loopback listener '127.0.0.1:48898' closed!

Do you know what could cause that ?

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

No branches or pull requests

1 participant