KevinVR

udp Setting up UDP: Not receiving data

7 posts in this topic

Dear,

I am trying to setup an UDP connection between my Omron NJ301 PLC & my LED power supply CCS PD3-10024-8-EI (https://www.ccs-grp.com/products/model/3329).

 

My setup:

  1. I Close all used sockets.
  2. I SktUDPCreate Socket 1 for sending messages.
  3. I Fill in DstAdr & DstPortNo to 192.168.000.002 & 40001 (I have pinged with cmd and the IP adress does respond).
  4. I Fill in the sendstring with "@00E01172.016.110.007A2CRLF" as per manual.
  5. I SktUDPSend this string.
  6. I clear the receive buffer to be sure it is empty.
  7. I Create socket 2 for receiving messages.
  8. I tried filling in only the Dst and filling in both Dst and Src but it has the same result. (DstAdr 192.168.000.016 & DstPortNo 30001)
  9. I SktUDPRcv without error then used a TON for 10ms before I check my buffer
  10. I Check my receive buffer and it is empty (Size 0)

When trying to ping (by using laptop in same network) 192.168.000.016 it automaticly tries to ping 192.168.000.014 without succes.

 

So my question:
Is there another way then using 2 sockets?
And does anybody have any clue what I'm doing wrong?

Edited by KevinVR
I made progress so the problem shifted

Share this post


Link to post
Share on other sites

I will have a look at the functions, but for now I suggest you send and receive using only the plc and your computer. That way you can clear out it's not the plc.

Normally I use the Hercules tool (HW group) or Wireshark. Hercules lets you set up tcp/udp servers and clients though. You can receive/write from Hercules back to your plc.

There's many things that may not work here so the first thing to check out is that the UDP loop in the plc works.

Share this post


Link to post
Share on other sites

I see in your ip address you are using 192.168.000.002, try using 192.168.0.2 instead. Alot programs don't like the extra zeros in the ip address.

Share this post


Link to post
Share on other sites
On 25-6-2021 at 4:51 PM, Danderson said:

I see in your ip address you are using 192.168.000.002, try using 192.168.0.2 instead. Alot programs don't like the extra zeros in the ip address.

Thank you for the hint, but the manually (of the light source) states that there must be leading 0's as there should always be 3 digits

Share this post


Link to post
Share on other sites
On 23-6-2021 at 10:31 PM, viman said:

I will have a look at the functions, but for now I suggest you send and receive using only the plc and your computer. That way you can clear out it's not the plc.

Normally I use the Hercules tool (HW group) or Wireshark. Hercules lets you set up tcp/udp servers and clients though. You can receive/write from Hercules back to your plc.

There's many things that may not work here so the first thing to check out is that the UDP loop in the plc works.

Hello, thank you for the suggestion.

My company manages my network and prohibits use of wireshark

Share this post


Link to post
Share on other sites
1 hour ago, KevinVR said:

My company manages my network and prohibits use of wireshark

That's like telling an electrician that voltmeters are prohibited.

Seriously.  If there are network communication problems with low-level industrial protocols, an engineer sometimes needs to examine the packets involved.

Edited by pturmel

Share this post


Link to post
Share on other sites
25 minutes ago, pturmel said:

That's like telling an electrician that voltmeters are prohibited.

Seriously.  If there are network communication problems with low-level industrial protocols, an engineer sometimes needs to examine the packets involved.

I've filed a request, I'll have to wait for it to be approved

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