Help - Search - Members - Calendar
Full Version: UDP Broadcast Message
Forums.MrPLC.com > PLCs and Supporting Devices > Omron > CX-Programmer
dfwise
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.
PdL
QUOTE (dfwise @ Jul 27 2009, 04:31 PM) *
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.


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!



dfwise
Thank you! I will try it and let you know what happens.
Jay Anthony
Awesome Documentation, PdL:! thumbsupsmileyanim.gif
PdL
QUOTE (Jay Anthony @ Jul 30 2009, 07:49 PM) *
Awesome Documentation, PdL:! thumbsupsmileyanim.gif


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 blush.gif
dfwise
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.