Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

TCP/IP communication with a PC

sarma-men
2019-04-09
2019-05-23
  • sarma-men - 2019-04-09

    Hi Forum,

    before opening a new topic i have been searching for an existing one, but without any success

    I would like to establish TCP/IP communication between a software running on PC and PLC (Schneider PacDrive 3 - Codesys based).
    My idea was to start the Hercules software
    Just connect and send data from PLC to Hercules and from Hercules to PLC, to ensure everything is working fine, before i access data on the real software i have connect to.

    The question is where can i find some documentation or examples to start?

    IMG: Bild

     
  • tvm - 2019-04-09

    If you are using Schneider SoMachine, there is an example in the help center, under Communication. It sets up TCP/IP communication between two PLCs.

    IMG: Capture.PNG

     
  • sarma-men - 2019-04-10

    Thank you for your response, but i dont need UDP. I could not find any example for TCP.

     
  • tvm - 2019-04-10

    Look in the TcpClient and TcpServer programs

    IMG: Capture.PNG

     
  • sarma-men - 2019-04-12

    I am missing the Library in SoMachine. I hope this is the right translation in english (german: Bibliotheke)
    I did an export from Codesys:

    And i imported the file into SoMachine. But i have still 8 Errors. Does anyone know what am i doing wrong?

    IMG: Bild

    IMG: Bild

     
  • dFx

    dFx - 2019-04-12

    feels like there is a wrong version of a dependency lib.

     
  • sarma-men - 2019-04-12

    I have the same feeling. But i cant export the dependency separately.
    Can i download the lib from official codesys site?

     
  • dFx

    dFx - 2019-04-12

    please post imported libs in your project.

     
  • johnlee - 2019-04-12

    Hi,

    For Schneider there always have 2 options for TCP/IP :-

    Options 1 Using the Somachine library,
    1.1Open SOMachine
    1.2 Open Project-> Go to Folder SoMachine Software\V4.3\Learning Center\Examples\Comunication\TcpUdpComunication
    1.3 Click Open
    1.4 Now you can enjoy the Schneider version tcp/ip

    Options 2 Using Codesys TCP/IP Library :-
    2.1 GO to Library Manager -> Add library -> Library - > Company, Select 3S - Smart Software Solutions GmbH -> Use Cases , Choice Network
    2.2 Then you can follow the TCP/IP example that in Codesys Store.

    Personally i more prefer options 2

     
  • sarma-men - 2019-04-15

    This is the lib i exported from codesys and imported in Somachine.

    The file is too big for codesys forum. You can find the lib on following link:
    https://uploadfiles.io/y6a628zm

    EDIT:
    If someone has time to export the lib, please post it or send me a private message.

     
  • dFx

    dFx - 2019-04-15

    dFx hat geschrieben:
    please post imported libs in your project.

    I mean, just show us the versions and placeholders names.

     
  • sarma-men - 2019-04-15

    Here you go:

    IMG: Bild

    IMG: Bild

     
  • dFx

    dFx - 2019-04-16

    Many libs have the wrong version. Version should be kept the same.
    CAA Behaviour is 3.5.9.50 expected 3.5.11.0
    CAA List And Tree is 3.5.7.0 expected 3.5.11.0
    …

     
  • sarma-men - 2019-04-17

    dFx hat geschrieben:
    Many libs have the wrong version. Version should be kept the same.
    CAA Behaviour is 3.5.9.50 expected 3.5.11.0
    CAA List And Tree is 3.5.7.0 expected 3.5.11.0
    …

    How to update them? Do i have to export each lib separately?

     
  • dFx

    dFx - 2019-04-17

    may be you could just import an older nbs lib

     
  • sarma-men - 2019-05-22

    Well good news for me I found where the problem was. Finally i am able to download the program without compile errors.
    But i am not able to establish connection between PLC (Client) and my PC (Server)

    Does anyone know what am i doing wrong?

    IMG: Bild

     
  • sarma-men - 2019-05-23

    Well i tried vice versa. If i make the PLC Server and my PC Client, unbelievable but everything is working fine.
    I really don't know what am i doing wrong in the configuration when the PC is server and PLC client

     

Log in to post a comment.