Sign in to follow this  
Followers 0
freleyns

UDP communications problem

5 posts in this topic

Hi, We are trying to have a 2 directional UDP communication between a CJ1-ETN21 ethernet unit and a PC . The problem is n ow that both sides should use identical portnrs (9600 if you choose the default), both for sending and receiving. When configuring the ETN module with dynamical IP destination addresses, the PC can send the FINS commands without problems, but the ETN module sends the responses or other data to portnrs that change all the time, so we cannot ask the PC to poll a certain portnr since the nr is different each time. To get around this, one can configure the ETN module so that the dynamically destination address does not change and stays 9600 each time. Now it's possible for the PLC to send the data, but the PC cannot send anything anymore since it cannot send and receive data over the same UDP port. Still the PLC wants to send and receive data over that same port. How can we get around this problem ? Can the PLC be configure to use UDP 9600 port, and still use a SEND functionblock that tries to use an other destination UDP port ? Thanks for all help, Frederik

Share this post


Link to post
Share on other sites
Sounds like DHCP is being a bitch. Can you not asign static IP's. Else you will need to be able to work out the IP addresss of the PLC and PC and ensure they know each other address so you can make sure node numbers are correct.

Share this post


Link to post
Share on other sites
Hi, of course, a PC can send and receive on the same port number, only it seems, you don't know how to do it? In FINS-communication only one should be active (the PC/ it is the client), the PLC should only answer questions(server). If the PC waits on something changing in the PLC it should poll. A SEND should go to annother PLC, not to the PC. A PLC has a FINS-Server and FINS-client. If you want to send a SEND also to the PC you have to program a FINS-Server also. And then it has to have the same port number. May be it is easier for you, to program a TCP-FINS-Client with one port number and additionally an UDP-FINS-Server with annother port number? (SEND is always UDP only)

Share this post


Link to post
Share on other sites
A SEND command will send data with a fins header to the destination. You would still need software on the PC capable of receving a fins command, processing it and doing something with the data. My prefered option is for the PC to POLL the PLC.

Share this post


Link to post
Share on other sites
If i understand the question correctly i think theres a bit of confusion. The Fins PORT is not changed dynamically, what is changed is the source/destination IP address to a FINS node number. The last octet of the IP address of the PC is converted to a FINS node number, either dynamically or not (static). The UDP ports must be the same on the PC and the ETN to which the pc is talking to. You can choose to convert the node number dynamically but that will add some overhead to packet processing. Because you are using a PC im assuming you are using some sort of Fins/Ethernet DA Server? Opc to Fins? Remember that in order to get an ETN talking to a PC via fins/ethernet the node and network must be set. you can set a network add to the ETN with the routing table tool. Eg: Put the ETN on UDP port 9610, then make the PC DA server talk using UDP Port 9610. Set the ETN network to 10 with the routing table. On the PC configure the DA server to: Source network:10 Destination Network:10 Source Node: (Last Octect of the IP address of the PC) Destination Node (Last Octect of IP address of ETN) hope it helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0