How to connect Wincc OA with UDP Protocol?

Find and share HowTos to various installations / configurations!
Search

Post Reply
15 posts • Page 1 of 2
Kalai123
Posts: 17
Joined: Wed Jun 27, 2018 10:16 am

How to connect Wincc OA with UDP Protocol?

Post by Kalai123 »

Hello Everyone

I just want to know how to communicate Wincc OA with UDP Protocol!!

mkerk
Posts: 75
Joined: Wed Oct 20, 2010 12:25 pm

Re: How to connect Wincc OA with UDP Protocol?

Post by mkerk »

Hi,
you can try to use the WinCC OA UDP CONTROL functions: udpRead(), udpWrite(), udpOpen(), udpClose().
Please refer to the WinCC OA documentation for detailed information about these functions.

Br,
Mousser

Kalai123
Posts: 17
Joined: Wed Jun 27, 2018 10:16 am

Re: How to connect Wincc OA with UDP Protocol?

Post by Kalai123 »

Can you please give some example code for the communication?

Kalai123
Posts: 17
Joined: Wed Jun 27, 2018 10:16 am

Re: How to connect Wincc OA with UDP Protocol?

Post by Kalai123 »

Dear Sir,

Any updates ? Do you have any sample program for UDP read/write data from PLCs?
Please provide the same.

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to connect Wincc OA with UDP Protocol?

Post by leoknipp »

As written by Mousser Kerkeni the UDP CTRL functions are described in the WinCC OA Documentation.
At the description of the functions you will also find some simple examples how to use the functions.

Maybe your PLC also supports some other standard protocols, e.g. OPC DA.
If you know the protocol you can have a look if WinCC OA has a driver which supports the protocol.
This is maybe a better approach than to implement the PLC communication on your own.

Best Regards
Leopold Knipp
Senior Support Specialist

Kalai123
Posts: 17
Joined: Wed Jun 27, 2018 10:16 am

Re: How to connect WinCC OA with UDP Protocol?

Post by Kalai123 »

https://www.winccoa.com/fileadmin/image ... 81108.docx I used UDP functions to connect with Wincc OA. But it is not working.

I attached the results of our program.

Could You please go through the attached file and give me the solution?
Attachments
Challange_in_UDP_Comminication_at_WinCC_OA_V3.docx
(1.5 MiB) Downloaded 380 times

Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 10:37 am

Re: How to connect WinCC OA with UDP Protocol?

Post by Gertjan van Schijndel »

At 'udpOpen' you must specify your local address at which the data should be received (to which address the function should bind to).
In this case (single cast) it should be the address to which the partner sends the data to.

The 'host' and 'port' are out parameters of the 'udpRead' function, so assigning values is not needed. To keep receiving values 'udpRead' must be placed in a loop.
The 'udpClose' must use the actual value returned by 'udpOpen'. With the current code only the socket with id '0' (default value) is closed.
Last edited by gschijndel on Fri Sep 13, 2019 10:51 am, edited 1 time in total.
Reason: Fixed wrong functions

Kalai123
Posts: 17
Joined: Wed Jun 27, 2018 10:16 am

Re: How to connect Wincc OA with UDP Protocol?

Post by Kalai123 »

I tried the program,like what is mentioned in the above instruction.

But i am not able to set the proper communication between PLC and SCADA.

I attached the program and results with this. Please let me know the step what i have to do further. https://www.winccoa.com/fileadmin/image ... rogram.zip
Attachments
UDP_Program.zip
(187.1 KiB) Downloaded 336 times

Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 10:37 am

Re: How to connect Wincc OA with UDP Protocol?

Post by Gertjan van Schijndel »

You have not specified a port to open, so that could be the reason why it is not working. It should be the port the partner is sending to.

Is 10.170.12.30 the local address of the host running this UDP program and is the partner sending its data to this address?

Kalai123
Posts: 17
Joined: Wed Jun 27, 2018 10:16 am

Re: How to connect Wincc OA with UDP Protocol?

Post by Kalai123 »

10.170.12.30 is the ip address of the PLC.

10.170.14.100 is the ip address of the WinCC OA.

We considered the port number of WinCC OA is 4700 and PLC is 2001.

Here i attached the Data Block of PLC side, the program and the result of WinCC OA side.

In WinCC OA, we are not able to open the port even though the port number written in the program.

Please check the attachment and give us a solution for that.

Thanks in advance. https://www.winccoa.com/fileadmin/image ... rogram.zip
Attachments
Program.zip
(189.24 KiB) Downloaded 364 times

Post Reply
15 posts • Page 1 of 2