Sign in to follow this  
Followers 0
dfwise

UDP Broadcast Message

6 posts in this topic

Hello, I need to broadcast a short UDP message to a server from a CS1G/H-CPU45's ETN21 card. The card is in slot 8 on the main rack, is marked as unit 1 and the addresses start at 1525. What is the bare minimum I need to send this message? I do not need a reply from the server. I've been looking in the manuals and I saw that there are 4 different UDP messages (Open, Send, Receive, and Close). Do I need to open the port before I can send or can I just send the message and put in the broadcast address? The server is set up to look for a broadcast so it does not need to be addressed directly. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
I will try to help you get started a little bit. To start I suggest you download the following 2 manuals : CS1W-EtN21/CJ1W-ETN21 Series, Ethernet Units Construction of Applications Operation Manual CS1W-ETN21/CJ1W-ETN21 Ethernet Units Construction of Networks Operation Manual Section 2 of the second manual will guide you in the basic setup of the card, assigning an IP address etc. Secondly you will need to use socket services to send a message to a non-Omron ethernet device. In short: -Open socket -Send Broadcast command -Close socket See section 6 in the first manual on how to use socket services. Section 7-3-6 in the second manual describes the UDP broadcast command. Asuming your CPU supports Function Blocks, you might want to have a look at the standard FB library included with CX-One. These are located in the C:\Program Files\OMRON\CX-One\Lib\Lib\FBL\omronlib\PLC\ETN folder. To insert them in your project, right click function blocks > insert > from file and navigate to this location. When inserted, you -should- be able to open a short PDF guide on how to use the FB parameters by right clicking on the FB and selecting "FB Library reference". However this function somehow does not work for me anymore so I will attach the files. They are located in the same folder as the FB files. Press F in an empty rung to insert a FB instance. Select an input/output parameter position and hit Enter to define the address/parameter. Hope this helps! _ETN011_SOCKET_UdpOpen.pdf _ETN015_SOCKET_UdpSend.pdf _ETN013_SOCKET_UdpClose.pdf

Share this post


Link to post
Share on other sites
Thank you! I will try it and let you know what happens.

Share this post


Link to post
Share on other sites
Awesome Documentation, PdL:!

Share this post


Link to post
Share on other sites
Thanks Jay. I never use socket services myself actually so these topics are a good opportunity to learn a bit more myself too without really trying it. Just as if I was standing in the topicstarters shoes... Now let's hope I didn't set him off on something that doesn't work

Share this post


Link to post
Share on other sites
I haven't had any luck yet but I think we are having some network issues as it is. I'm going to try some changes and if that doesn't work I'll post my code and see if anyone finds anything wrong with it. Edited by dfwise

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