Beckhoff ADS - Target port not found

derickloo

Member
Join Date
Mar 2015
Location
Malaysia
Posts
36
I has an industrial pc connect to the controller. And write the PLC program to control the machine On and off in the industrial PC. It is work well.
I has add another normal RJ45 cable and connect the industrial pc to the Wifi router to make the industrial pc available to the LAN.
From there, I has a web server which also in the same LAN. I has a web services in the server which use to control Start and Stop function for the PLC program. But every time i run the web service i get the error "Target Port not found".
In my server, I has install twincat program and I use the system manager to choose the industrial PC as target.

Any one has idea how I can make this situation work? Please help!
Thank you very much.
 
Last edited:
Hi Shooter, my industrial pc is running Window XP, the ip I has fix it to 192.168.2.xxx. And my server is also in the same LAN and the ip is fix to 192.168.2.xxx as well. My web service is wrote using c#. I has run the code in my development machine which also in the same network. I found that the ADS is success connect to the controller. But when go to ads.Createvariable(".MachineStart"), it threw the target port not found error message.

My Beckhoff controller is without any OS and processor inside. It's control by the industrial PC.
What the causes since it able connect the controller but cannot call the PLC variable.
 
I has add the involved PCs in the AMS router at the twincat system manager in the web server. When I go to check at the industrial PC, the AMS router also has the involve PCs name. The screen cap is the AMS router list capture from the Industrial PC. The LENOVO-THINK is my development PC, the Server08 is the web server where the web services sit in

redir

https://onedrive.live.com/redir?resid=67E4901176EADACF!1718&authkey=!AFf14CaEvUFf-dY&v=3&ithint=photo%2cbmp

Anything I should set in the Remote Manager inside the industrial PC? Below is the screen cap for the remote manager sit inside the industrial pc.
redir

https://onedrive.live.com/redir?resid=67E4901176EADACF!1719&authkey=!ACCLr5J9XfC7-d8&v=3&ithint=photo%2cbmp

Anything I has miss out?
 
Ya, the industrial PC has 2 port. One is using industrial RJ45 cable connect to controller. Another one is use normal RJ45 cable connect to router. I has fix the ip for the industrial pc. I has use my development pc and able to ping the ip belong to industrial pc.
 
It sounds like you are trying to get the server to pass through the industrial PC to get data from the controller. If this is the case, is the industrial pc configured as a router, in other words can you ping the controller from the web server?
 
I not try before to ping the controller. My controller is Beckhoff EK1100. Base on my superior, this controller do not has OS. All is control from the industrial PC. I only can see the netID for the controller from industrial PC. Whether I can set the ip for this controller or where I can find the IP for the controller?
 
I not try before to ping the controller. My controller is Beckhoff EK1100. Base on my superior, this controller do not has OS. All is control from the industrial PC. I only can see the netID for the controller from industrial PC. Whether I can set the ip for this controller or where I can find the IP for the controller?
So the industrial PC is actually running the TwinCAT program and your "controller" is really just some EtherCAT IO. Is the firewall turned off on the industrial PC?
 
Selamat pagi, derickloo (isteriku dari Indonesia).

In my experience, you need the firewall turned off on both sides (PC & web server), though I don't know about web servers. I also haven't tried many combinations. All our controls are on isolated networks so we aren't concerned w/ firewalls.

As Archie said, the EK1100 is not your "controller". It is more like an ethernet switch, simply passing ethernet packages to the E-bus modules (plus status I/O). Your industrial PC must have "TwinCAT run-time" installed, w/ a valid license. Is it running TwinCAT 2 or 3? You also need a programming PC which runs TwinCAT-PLC if TC2 or Visual Studio if TC3. That could also be on the same Industrial PC. I assume you can see the PLC I/O modules from System Manager (stand-alone program in TC2, "System" folder in TC3). This must work before you worry about accessing it from a web server.

In the industrial PC (your TwinCAT run-time), insure that the NIC IP addesses are not in the same domain. This is a problem also w/ Beckoff CX's. As they ship, the NIC used for E-bus is set to DHCP. If you give it a fixed IP address (ex. 192.168.0.3, subnet 255.255.255.0) and the NIC used to communicate to another PC (programming PC or HMI) is in the same domain (ex. 192.168.0.3, subnet 255.255.255.0), Windows gets confused and your routes sometimes fail. Leave the E-bus NIC w/ DHCP since it doesn't need an IP address. This tripped me up in the past, and most Beckhoff app engineers know this.

I suspect your problem is simpler. I recall that you will get "target not found" if the TwinCAT run-time is not in "Run" state. You also will not be able to "log-in to PLC" from the PLC programming environment (TwinCAT-PLC in TC2 or POU menu in TC3 Visual Studio).

Please let us know what you resolve.
 
Last edited:
Hi RocketTester, ,y industry PC has Twincat 2 installed. And the industry PC is connect to the EK1100 coupler with few beckhoff I/O to control my devices like pump, motor and so on. I wrote the PLC program(SFC) and it work fine. I can use the touch screen to turn on and off all the device. In the system manager, it show Run Mode. All my device is function good.
Just when I write a C# program in my development machine which I need to use this c# program to control the PLC program. Then I no need go in to the factory to turn on and off the machine. But every time the C# program start and the Adsclient need create the variable as below, it show me "Target Port not found"
ads.Createvariable(".MachineStart").

Any idea why this happen. I also add my development machine IP in the route table in Twincat program in the industry PC.
 
... I can use the touch screen to turn on and off all the device. ...
What program is running during this? Is is TwinCAT System Manager?
... Then I no need go in to the factory to turn on and off the machine. ...
If "machine" = EK1100, that is just a coupler. Powering it off should not give any indication in TwinCAT, except if you monitor its status variables, and the following I/O will not update.

"Target not found" is a problem in finding the TwinCAT run-time on your industrial PC, independent of the I/O hardware.

I have only used the .net dll (forgot the name), which Beckhoff names "tcClient" in their examples. As I recall, the first call is "tcClient.connect" (w/ AMS ID, port, etc) to locate the run-time. Sorry, I am not at work so can't check. I don't recall the details because I just copy what works. Look at Beckhoff's examples. The port# is different in TC2 & TC3 (801 & 851, respectively I recall, for runtime 1). It appears you might be using lower level ADS calls.
 
Last edited:
I can give you something to try that should give me the information to help you find the problem. You will need to install WireShark on your web server PC and have Visual Studio on it. Here is what you can do:

- Download and extract the AdvancedHMI Solution
- Open the Solution in VS and build the solution
- From the Toolbox add an TwinCATCom to the MainForm
- Set the TargetAMSNetId property to the AMS of your industrial PC
- Set the TargetIPAddress to the IP of the industrial PC
- Set the Username to an Admin account
- Set the Password to that account's password (see note below)
- Add a BasicLabel to the form
- Set the PLCAddressValue property to .MachineStart
- Start WireShark
- Run the Application
- After about a minute, stop Wireshark and save the capture

From this capture I shoule be able to tell you exactly what is happening and why the connection fails. AdvancedHMI will send a packet to atempt to add the route, from the response, I will be able to see specific details of what is happening.

NOTE : The username and password are sent un-encrypted, so it will be visible in a WireShark capture. For security purposes, create a temporary Admin account and password for this test. That will make sure anyone seeing the WireShark capture will not get hold of your permanent Admin account information.
 

Similar Topics

TwinCat3 Beckhoff "Add route to remote system failed ADS Error 1804 (0x70C)" Hi everyone, I have a problem connecting with a Beckhoff CX5120...
Replies
4
Views
39,674
Hello all, I ran in to some trouble. I created 2 virtual machines to try out ADS communicating One machine is a PLC (TC2 32bit (runtime)), other...
Replies
3
Views
19,737
I want to read variables from the PLC with my C# programm. Is it possible to run my c# programm on a computer without the TwinCat System...
Replies
2
Views
2,750
Hello all: I am in the process of writing some drivers on a PC that will communicate with a Beckhoff PLC via AMS/ADS :banghead: . I can request a...
Replies
9
Views
4,504
Hi, I need to make two twincat 3 PLCs communicating together. I read about the Beckhoff ADS communication protocol but could not find that much...
Replies
0
Views
2,584
Back
Top Bottom