TCP/IP Server Client working example S7G2

Hello,

Can anybody share TCP server and client working example for S7G2? I have read NetX manual but my project does not work.

Thanks

Wasi

  • Hello wasim,

    I posted examples to another thread where you posted recently. One thing to keep in mind when working with NetX is that on SK-S7 kit, you will need to change your ETH1 reset pin to IOPORT_PORT_08_PIN_06.

    Regards

  • In reply to Karol:

    Hi Karol,

    I have try the example for TCP server and client but not sure I have it work correctly.

    I ran the TCP server on the SK-S7G2 and from my computer, I have a LabView to connect to the S7G2. I couldn't make it work.

    Do you have any suggestion.

    Thanks.

  • In reply to dle:

    Hello

    Is your IP for the board set to the same subnet as your router and other machine?

    Regards

  • In reply to Karol:

    Hi Karol,

    I connect the ethernet cable directly from the SK-S7G2 to my computer ethernet port.

    I set my computer IPV4 to 192.168.0.100;  255.255.255.0; 192.168.0.1

    From the tool I user such as Putty, I set IP address to 192.168.0.90 and I'm not sure where to find the port number from the example.

  • In reply to dle:

    Hello

    The TCP server is listening on port 7. Once client connection is received, data is retrieved and echo'ed back to the client. Can you verify that you're able to ping 192.168.0.90 from the command line in your PC?

    Regards

  • In reply to Karol:

    Thanks Carol, it is the port number which I have never tried the correct one.

    I wasn't looking hard enough, it is clearly defined in here: nx_tcp_server_socket_listen(&ip_0, 7, &socket_echo, 5,NX_NULL);

  • In reply to Karol:

    Hi Karol,

    I used your posted example of tcp client and it works great . The problem is, I'm using TraceX but i cannot detect NetX threads. It does sent data and recieved to the tcp server I am using. In the NetX statistics in TraceX, the TCP Statistics is empty even though I am already connected to a tcp server throught ethernet from the broad.

    Regards
  • In reply to Dash:

    Hello Dash,

    You will need to add NetX Source to your project as well. Pre-built NetX library has TraceX events disabled. In order to enable them, NetX Source is required (new ThreadX Source settings will be applied).

    If you're seeing a build problem, please refer to the following thread: http://renesasrulz.com/synergy/f/synergy---forum/7821/adding-nx_src-produces-multiple-definitions-of-error .

    Regards