Adapter Changes for Changing PLC

When we are using any PLC, it can breaks for some reasons. Some of the reaons could be for example:

problems with a field device

problems with the power supply

module failure of the input/output (I/O)

Whatever the reason could be, you need to replace the PLC quickly. If you have exactly the same PLC in hand then you can download the same run time and start using the system again. But say you were running a CX device but you have in hand a ARM-based PLC. It will not work directly since the memory address are different

Arm based PLC to CX based PLC

Say we are running a simple program.

EtherCAT Terminals (E-bus) are displayed under the EK1200 Bus Coupler in the tree view. We have few terminal cards attached to EK1200. We have two output variables attached to the terminal

EK1501 EtherCAT coupler with ID switch, multimode fiber-optic connection. We have two output variables attached to the terminal

The sample program is shown in the following figure.

Figure 01: Test program for testing the changes 

This is simple test application, we have four outputs. Two are linked to EK1200 device  (Term 10 EL2088) and two are linked to EK1501 device (Term 2 EL2008).

We shall change the PLC and see if those output work after the changes.

Now we shall use or replaced with a CX device.

Figure 02: Press on the search button to find PCI Bus (Terminals connected to EK1200 will be found)

Figure 03: Press on the search button to find PCI Ethernet adapter (If coupler connected that will be found)

CX based PLC to ARM based PLC

These steps are exactly same as previous, we just need to find the right address for ARM based device. If we don’t set the right address we can’t activate the program, hence it will not run. Even if we set the address wrongly, the program will run but the input/output will not be writtent to the I/O cards. So the process will not be executed.

Figure 04: Press on the search button to find device under EK1200

Figure 05: Press on the search button to find device under EK1501

We have shown how to change two different types of PLC, even if we use similar type of PLC for example, one CX version to another, we need find the address/PCI bus correctly.

We can’t activate the program if correct address is not set.

Program may run after activation but the I/O will not happen

Install Ethernet Driver for using PC as a PLC

The TcRTeInstall tool manages real-time Ethernet compatible devices of the control system. This involves installing a real-time capable driver for the standard Ethernet connection of a control system.

If we install and configure we can directly use any devices to do input output from our PC, it means our PC will work as PLC.

Figure 06: Menu system in TwinCAT environment for ethernet adapter

Alternatively you can install the driver by adding a network capable device to the I/O configuration (e.g. EtherCAT). In the adapter dialog of the network capable device, call the TcRTeInstall application with the button Compatible Devices…:

Figure 07: Menu system in TwinCAT environment for ethernet adapter (2nd way)

Call in TwinCAT runtime environments

You can directly call the installation application for the TwinCAT RT Ethernet adapter on a TwinCAT 3 runtime system.

Location: C:\TwinCAT3.1\System\TcRteInstall.exe

Manage network connections

TcRteInstall displays the real-time capable (Compatible devices) and non-real-time capable (Incompatible devices) network interface cards.

Figure 08: Driver installation for Ethernet Controller

1.Select a real-time capable network interface card from the list of “compatible devices”.

2.Click on the Install button.

The TwinCAT driver for real-time Ethernet and the TwinCAT Ethernet protocol are installed for the selected device.

Now if we connect our PC and Select the Ethernet-TwinCAT-Intel PCI Ethernet Adapter then we can SCAN connected devices (couplers) and if we have terminals connected then we can do input output and control any devices. The follwong pictures show IO list without connected coupler and with a connected coupler (EK1100)

Figure 09: A sample I/O when the coupler is not connected

Figure 10: A sample I/O when a coupler is connected with few terminals

References:

Download the sample from the link given above.

Next, let’s try to understand persistent data https://www.hemelix.com/plc/twincat-3-database-server/

Ask questions related to Hemelix sample code and design at Google group https://groups.google.com/g/hemelix