I need to establish a remote connection between CodeSys (running on a Windows PC) and a remote CAN-based PLC through the Internet. For this purpose, I have foreseen to develop a DLL that functions as an interface between CodeSys and a Network Interface Card of the PC.
The DLL will first open a TCP/IP socket with the remote PLC. Then, it will take the CAN packets generated by CodeSys, encapsulate these packets into TCP/IP frames and send them to the remote PLC. In the reverse direction, the DLL will de-encapsulate CAN packets from the TCP/IP frames received, and forward these CAN packets to CodeSys.
Is this reasonable/feasible?
Do you know if this already exist?
How could I connect CodeSys with my DLL?
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
we would like to use CodeSys v3.5. Regarding the PLC, we still did not select any specific PLC. It will be a PLC interfacing to sensors/actuators through CAN bus. In order to connect the PLC remotely to CodeSys, we have foreseen to use our CAN to TCP/IP interface.
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
should not be needed to write a dll this is for sure.
Just use a gateway on remote side, and connect this by USBPeak-Dongle to your CAN network.
But I would prefer to Login by ethernet to the plc and then use CAN Network for the sensors only.
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I understand that for that we could use a gateway connected to the PLC. That is an elegant solution. However, we would like to use our TCP/IP to CAN interface instead of the gateway.
Is it feasible? How should I connect CodeSys to the interface DLL? The DLL will encapsulate/de-encapsulate the CAN packets from/to CodeSys into/from TCP/IP frames.
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you proposed to use a gateway and connect it to the CAN network with an USBPeak-Dongle. Which gateway do you recommend?
I would like to build a custom gateway based on a 4G SmartPhone. Is there any Android App ready that can communicate using TCP/IP with CodeSys Control Win on my local PC. Would this be feasible?
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks for your response. I have seen that the Gateway server can only run on Windows. Unfortunately, our gateway should run on Linux or even Android, therefore, the Gateway server software is not a solution yet.
What about the CodeSys Control for Raspberry PI? Could we use the Raspberry as a gateway by running the CODESYS OPC/UA Server on the Raspberry PI? how should we connect the Raspberry to the CAN based PLC?
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
what is your real goal?
1. Use a gateway to see/change/update variables in your CAN based plc?
2. Login by CODESYS to the CAN based plc (via CODESYS Gateway)?
-Sure the Raspberry Pi contains a CODESYS Gateway and you could use it for 'Login' to another plc (CAN or TCP/IP / UDP).
-Login via CAN might possible, if you manage to run a socket CAN on the PI (but I never tried this - not sure if this will work reliable...)
-Sure an OPCUA Server is embedded in Raspberry PI too and you could use it to access symbols from the CODESYS application (which is running on the PI)
If you connect the Pi Application by CAN (in that case CANopen Master ) to the second CAN based plc.. yes it is true you could use OPCUA
to access your CAN-Based second plc (act in that case as CANopen slave).
really confusing without having a system overview.
hope i did not confuse to much with that
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
again, thanks for your fast reply, and my apologies if I was not clear in the goal of my project. I will try to better describe the system.
Our PLCs are CAN-based and we need to access to these PLCs remotely (through the internet) from a Windows PC with CodeSys in order to see/change/update variables and download the software of the PLCs. At each PLC we will use a "gateway" based on an Android App (_ or Smartphone). This "gateway" will be the interface between 3G/4G (TCP/IP frames) and bluetooth, and finally we will use a bluetooth to CAN adapter attached to the CAN bus of the PLC.
Would this be feasible?
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes,
might possible, but not out of the box.
Currently we are missing some components in the PI (to use the Pi as CODESYS - CAN Gateway to login)
- using Android is not possible at the possible not realized at the Moment.
So I could not really help at this point.
Guess you need to contact 3S - and official inquiry is needed.
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I need to establish a remote connection between CodeSys (running on a Windows PC) and a remote CAN-based PLC through the Internet. For this purpose, I have foreseen to develop a DLL that functions as an interface between CodeSys and a Network Interface Card of the PC.
The DLL will first open a TCP/IP socket with the remote PLC. Then, it will take the CAN packets generated by CodeSys, encapsulate these packets into TCP/IP frames and send them to the remote PLC. In the reverse direction, the DLL will de-encapsulate CAN packets from the TCP/IP frames received, and forward these CAN packets to CodeSys.
Regards
Hi,
which CODESYS Version are you using and which plc is it?
BR
Edwin
Hello,
we would like to use CodeSys v3.5. Regarding the PLC, we still did not select any specific PLC. It will be a PLC interfacing to sensors/actuators through CAN bus. In order to connect the PLC remotely to CodeSys, we have foreseen to use our CAN to TCP/IP interface.
Regards
Hi,
should not be needed to write a dll this is for sure.
Just use a gateway on remote side, and connect this by USBPeak-Dongle to your CAN network.
But I would prefer to Login by ethernet to the plc and then use CAN Network for the sensors only.
BR
Edwin
Hi Edwin,
thanks for your fast reply.
I understand that for that we could use a gateway connected to the PLC. That is an elegant solution. However, we would like to use our TCP/IP to CAN interface instead of the gateway.
Is it feasible? How should I connect CodeSys to the interface DLL? The DLL will encapsulate/de-encapsulate the CAN packets from/to CodeSys into/from TCP/IP frames.
Regards
Hi Edwin,
you proposed to use a gateway and connect it to the CAN network with an USBPeak-Dongle. Which gateway do you recommend?
I would like to build a custom gateway based on a 4G SmartPhone. Is there any Android App ready that can communicate using TCP/IP with CodeSys Control Win on my local PC. Would this be feasible?
Regards
Hi,
I thought on using the Gateway which is running on a pc.
See the tasktray Icon to start it.
This is available as standalone setup to install
BR
Edwin
Hello Edwin,
thanks for your response. I have seen that the Gateway server can only run on Windows. Unfortunately, our gateway should run on Linux or even Android, therefore, the Gateway server software is not a solution yet.
What about the CodeSys Control for Raspberry PI? Could we use the Raspberry as a gateway by running the CODESYS OPC/UA Server on the Raspberry PI? how should we connect the Raspberry to the CAN based PLC?
Regards
Hi,
what is your real goal?
1. Use a gateway to see/change/update variables in your CAN based plc?
2. Login by CODESYS to the CAN based plc (via CODESYS Gateway)?
-Sure the Raspberry Pi contains a CODESYS Gateway and you could use it for 'Login' to another plc (CAN or TCP/IP / UDP).
-Login via CAN might possible, if you manage to run a socket CAN on the PI (but I never tried this - not sure if this will work reliable...)
-Sure an OPCUA Server is embedded in Raspberry PI too and you could use it to access symbols from the CODESYS application (which is running on the PI)
If you connect the Pi Application by CAN (in that case CANopen Master ) to the second CAN based plc.. yes it is true you could use OPCUA
to access your CAN-Based second plc (act in that case as CANopen slave).
really confusing without having a system overview.
hope i did not confuse to much with that
BR
Edwin
Hi Edwin,
again, thanks for your fast reply, and my apologies if I was not clear in the goal of my project. I will try to better describe the system.
Our PLCs are CAN-based and we need to access to these PLCs remotely (through the internet) from a Windows PC with CodeSys in order to see/change/update variables and download the software of the PLCs. At each PLC we will use a "gateway" based on an Android App (_ or Smartphone). This "gateway" will be the interface between 3G/4G (TCP/IP frames) and bluetooth, and finally we will use a bluetooth to CAN adapter attached to the CAN bus of the PLC.
Would this be feasible?
Regards
Hello, any suggestion?
Yes,
might possible, but not out of the box.
Currently we are missing some components in the PI (to use the Pi as CODESYS - CAN Gateway to login)
- using Android is not possible at the possible not realized at the Moment.
So I could not really help at this point.
Guess you need to contact 3S - and official inquiry is needed.
BR
Edwin