Synopsis

This article will discuss the key points of the UDP communication between vxworks 6.8 and windows.

Code description

On Windows, we run a UDP Server whose name is win_udpServer.exe, which is designed by www.vxbus.com.

On VxWorks6.8, we designed a UDP Client procedure whose name is mkvxUdpClient.c

Please check out the attached file for the source code of them.

Steps to Test

On windows

Open a command terminal console, and then change into the directory where win_udpServer.exe resides, type the name of the application win_udpServer.exe, see picture below:

windows udp server

It will show you how to launch the application correctly, here we can type win_udpServer.exe 5002, see picture above.

After launching the application, we can see the picture below:

windows udp server running

From the picture above, we can see that the IP address of Windows is “192.168.128.240”.

vxworks udp Client

On vxworks6.8

On the shell of vxWorks, type mkvxUdpClient “192.168.128.240”

On windows

We can see the vx68 client is sending the data to the windows server constantly, see picture below:

windows udp Server

Key Notice

On VxWorks

In order to receive and send large data buffer, for example, 10240 bytes every time, we should enlarge the macro of ‘Default socket receive buffer size’ and ‘Default socket send buffer size’, here we change the default value of ‘10000’ to ‘200000’.

Workbench Network Option

On Windows

Same as vxworks, we should enlarge the data buffer of the procedure ‘winUdpServer.c’, for example:

And remember to add ‘libwsock32.a’ to Linker of Project Options, see picture below:

Compile Parameters