You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old March 26th, 2015, 12:36 AM   #1
derickloo
Member
Malaysia

derickloo is offline
 
Join Date: Mar 2015
Location: Malaysia
Posts: 15
Beckhoff ADS - Target port not found

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 by derickloo; March 26th, 2015 at 12:41 AM.
  Reply With Quote
Old March 26th, 2015, 11:52 AM   #2
shooter
Member
Netherlands

shooter is offline
 
shooter's Avatar
 
Join Date: Sep 2002
Location: duketown
Posts: 2,633
make a sketch and check the IP numbers, all should be same apart from last one like 192,168,100,xxx
__________________
shooter@home.nl
skype shooter paul.deelen
Computer Shooter
Paul Deelen
J. Wassenaerstraat 29
NL 5224 GG 's-Hertogenbosch
+31653300739
  Reply With Quote
Old March 26th, 2015, 07:36 PM   #3
derickloo
Member
Malaysia

derickloo is offline
 
Join Date: Mar 2015
Location: Malaysia
Posts: 15
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.
  Reply With Quote
Old March 26th, 2015, 08:07 PM   #4
Archie
Member
United States

Archie is offline
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,754
Are the AMS router entries for all the involved PCs in each other's router tables?
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old March 26th, 2015, 08:38 PM   #5
derickloo
Member
Malaysia

derickloo is offline
 
Join Date: Mar 2015
Location: Malaysia
Posts: 15
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


https://onedrive.live.com/redir?resi...nt=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.

https://onedrive.live.com/redir?resi...nt=photo%2cbmp

Anything I has miss out?
  Reply With Quote
Old March 27th, 2015, 12:35 AM   #6
Archie
Member
United States

Archie is offline
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,754
Does you industrial PC have 2 network cards? One connecting to the controller and the other connecting to the wireless router?
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old March 27th, 2015, 12:48 AM   #7
derickloo
Member
Malaysia

derickloo is offline
 
Join Date: Mar 2015
Location: Malaysia
Posts: 15
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.
  Reply With Quote
Old March 27th, 2015, 04:11 AM   #8
Archie
Member
United States

Archie is offline
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,754
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?
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old March 27th, 2015, 04:21 AM   #9
derickloo
Member
Malaysia

derickloo is offline
 
Join Date: Mar 2015
Location: Malaysia
Posts: 15
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?
  Reply With Quote
Old March 27th, 2015, 05:14 AM   #10
Archie
Member
United States

Archie is offline
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,754
Quote:
Originally Posted by derickloo View Post
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?
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old March 27th, 2015, 09:56 AM   #11
derickloo
Member
Malaysia

derickloo is offline
 
Join Date: Mar 2015
Location: Malaysia
Posts: 15
ya, it is turning off the firewall on the industrial pc.
  Reply With Quote
Old April 9th, 2015, 09:10 AM   #12
RocketTester
Member
United States

RocketTester is offline
 
Join Date: Oct 2009
Location: Sacramento, CA
Posts: 185
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 by RocketTester; April 9th, 2015 at 09:18 AM.
  Reply With Quote
Old April 10th, 2015, 10:01 AM   #13
derickloo
Member
Malaysia

derickloo is offline
 
Join Date: Mar 2015
Location: Malaysia
Posts: 15
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.
  Reply With Quote
Old April 10th, 2015, 10:25 AM   #14
RocketTester
Member
United States

RocketTester is offline
 
Join Date: Oct 2009
Location: Sacramento, CA
Posts: 185
Quote:
Originally Posted by derickloo View Post
... 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?
Quote:
Originally Posted by derickloo View Post
... 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 by RocketTester; April 10th, 2015 at 10:27 AM.
  Reply With Quote
Old April 10th, 2015, 10:42 AM   #15
Archie
Member
United States

Archie is offline
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,754
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.
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Mapping large amount of errors in InTouch twibs LIVE PLC Questions And Answers 3 February 7th, 2014 01:23 AM
GE Versamax & QuickPanel Communication Problem Gustavo. LIVE PLC Questions And Answers 3 July 13th, 2009 02:23 PM
FX PLC RS422 Port shrirampendse LIVE PLC Questions And Answers 4 March 16th, 2009 12:19 AM
S7 313C communication port repair sttchui LIVE PLC Questions And Answers 1 March 25th, 2008 05:14 AM
Ethernet or Serial port AGENTTINFOIL LIVE PLC Questions And Answers 6 January 22nd, 2007 09:22 PM


All times are GMT -5. The time now is 11:47 AM.


.