mash

UDP connection

6 posts in this topic

Does anyone have a simple example for download to see how to make a UDP connection ?

I want to make a connection to a NAS harddisk system for wake-on-LAN.

I used the UDP_open, UDP_send and UDP_close function blocks.

But UDP_open gives always the result NG with error code 1025. I can´t find the reason why it doesn´t works.

Share this post


Link to post
Share on other sites

thanks for your reply

here is the (reduced) program

now only the "wake-on-LAN"-sequence is still inside

 

I tried to open an UDP connection with the internal ethernet card at the CPU, but the function block gives always the result NG with error code 1025.
What is the reason ? What is wrong ?
Made the test with unit number 1 (as used in the hardware config) and with 0 (in the manual I could read that the internal board needs a 0).
But always unable to open the UDP connection.

LP2100_32_20181113_UDP.cxp

Edited by mash

Share this post


Link to post
Share on other sites

You have a couple of issues with your setup.  

1)  You point your UDP open function block at unit 0.  When I open your I/O table, I don't see a unit 0.  The built in EIP port is set to 1 and the CJ1W-EIP21 is set to unit 12.

2)  Number 1 does not really matter though because only the ETN21 module supports socket services.  I do not see an ETN21 in your I/O table.  See the chart below for details on socket services support by module:

SocketServices.jpg.972e7c4a5fdcf7e4c89e5

 

1 person likes this

Share this post


Link to post
Share on other sites

1) I already tried with &0 , &1 , &12 , but always with the same result

2) I see ! now I understand why it doesn´t works. Thanks for your support.

 

kind regards,

Michael Malsch

Share this post


Link to post
Share on other sites

ok, thank you for your support !

now I was able to use the function blocks for UDP open, send and close

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