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

Connecting a PLC through VPN

pemat
2015-02-25
2015-02-27
  • pemat - 2015-02-25

    Hello,

    I have read the FAQ at l viewtopic.php?f=22&t=5641&p=10068#p10068 l but I don't understand how it is supposed to work. We have a VPN gateway (non-codesys based router) which does not allow UDP broadcasts so Codesys does not detect the PLC behind the VPN.

    1. Quote from the FAQ: "An Option is to use the TCPBlockdriver then you need to Forward TCP Port 11740-11743". What does this mean, "use TCPBlockdriver"? Use how, could you give an example?

    2. Another quote: "Workaround if not possible: use a running Gateway on remote VPN side (either a standalone gateway or if possible an active gateway in the plc)
      In case of using Windows there is a standalone setup of the gateway available in case there is no Windows running it could also be a 3S plc with embedded gateway component like for example Raspberry Pi could act as gateway." <- How does one set up this Gateway component?

    I'll try to describe our VPN setup:

    • Connecting PC with Codesys is at IP 10.5.4.17
    • The VPN router at the target site is at IP 192.168.1.1
    • The PLC is at IP 192.168.1.82

    Now, the router routes traffic from the PC into 192.168.1.0 network. I can ping the router 192.168.1.1 and I can ping the PLC 192.168.1.82. But I cannot connect the PLC with Codesys. If I set the IP of the gateway in Codesys into 192.168.1.1 the little ball stays red. I'm guessing it still needs the UDP broadcasts to detect whether the gateway is there so doesn't connect.

    So the question is: how to use the TcpBlockdriver, I haven't found any help how to use it?

    I am using Win 7 x64 Pro with Codesys v3.5 SP3 Patch1.

     
  • eschwellinger

    eschwellinger - 2015-02-25

    Hi,

    two things to check:

    1.Which plc are you using?
    Does it have the tcpblock Driver component?

    1. Did you add it like in my screenshot?

    BR
    Edwin

    IMG: ConnectTCP.jpg

     
  • pemat - 2015-02-25

    Hi Edwin,

    1. We are using Crevis Modbus TCP/IP PLC. This is a very simple PLC so I'm not sure about the block driver component... How do I check this?

    2. I have tried to set the IP as in your screenshot. The ball goes green but still does not connect to PLC. 10.5.4.17 is the connecting PC

     
  • eschwellinger

    eschwellinger - 2015-02-25

    Hi,
    two options again:
    1. which Version is the plc (check in the right side on the communication dialog)
    2. ask Crevis if they Support CmpBlkDrvTcp with their plc

    BR
    Edwin

     
  • pemat - 2015-02-25
    1. Target Version is 3.5.3.0

    2. I will ask them.

     
  • pemat - 2015-02-26

    I don't think that Crevis supports that cmpBlkDrvTcp but I would still like to test it with another PLC. How to I get the library which includes the component? I didn't find it in Library Repository in Codesys.

     
  • eschwellinger

    eschwellinger - 2015-02-26

    Hi,

    this is not a library it is a runtime component.
    Therefore you will not find it in the LibraryManager.

    If you need a workaround and this only a temporary VPN Access maybe
    to add a Raspberry Pi as Gateway would solve the problem.
    Sure the same does work with a Gateway installed on a Windows machine which is in the same Network like the Crevis plc

    BR
    Edwin

     
  • pemat - 2015-02-27

    Hi,

    "this is not a library it is a runtime component.
    Therefore you will not find it in the LibraryManager."

    • Where can I find it and how to use it?

    "If you need a workaround and this only a temporary VPN Access maybe
    to add a Raspberry Pi as Gateway would solve the problem.
    Sure the same does work with a Gateway installed on a Windows machine which is in the same Network like the Crevis plc"

    • I have a raspberry pi, how do I configure it as a gateway and how do I use it from Codesys IDE?

    Thanks!

     
  • eschwellinger

    eschwellinger - 2015-02-27

    Hi,

    the component must be provideded by Crevis you could not add it by your own,
    you need an runtime update on the Crevis device.

    Pi:

    you need to download this Package:

    http://store.codesys.com/systeme/codesy ... pi-sl.html

    install the SD card Image or the debian package on Pi side if you have already a wheezy running.
    On CODESYS side install the CODESYS_Control_for_Raspberry_PI.package in the CODESYS Package Manager.

    Then connect the pi to the plc network and use the Pi as Gateway.

    BR
    Edwin

     

Log in to post a comment.