TCP/IP Server Listening

MBayer
2015-06-25
2015-06-25
  • MBayer - 2015-06-25

    Hello,

    I'm using Codesys V3 and I need to make a communication between a RFID reader and plc model M251 from Schneider. I tested the TCP/IP communication between then RFID reader and my PC with a software called Hercules (see the image attached) and saw that the reader shows on the network whats is running through it.

    I believe I have to do a program to be listening what run over the Ethernet network as the same way that this Hercules makes.

    Anyone have any examples of this TCP/IP server program for help me do a program with these same function?

    Thanks!

    IMG: Imagem_Hercules.jpg

     
  • TimvH

    TimvH - 2015-06-25

    Add the use case library "Network".
    Then call the function blocks "NBS.TCP_Client" and "NBS.TCP_Read"

    See the screenshot for a (not complete) example.

    PS, the IP address can be initialized e.g. like this:
    stIp: NBS.IP_ADDR := (sAddr := '192.168.1.190');

    PS2, isn't the device a Modbus TCP/IP device. It doesn't seem like a coincidence that the port number is 502...
    In that case it is much easier to use the Modbus TCP/IP communication functionality.

    IMG: ScreenShot.jpg

     

Log in to post a comment.