Installation, IDE, Architecture
We need to install the software before we start developing SCADA/HMI or PLC program in the Beckhoff platform. As we have already understood the differences between HMI and SCADA, we shall mention only HMI on this page. Download the following software on your hard disk from Beckhoff.com. The video tutorial is at the end of this page!
Download Microsoft related software:
=> .Net 4.7.2 developer pack or equivalent (https://dotnet.microsoft.com/download/dotnet-framework/net472)
=> Visual Studio (2013, 2017 or 2019) community (make sure to include web-related components if visible) or pro version https://visualstudio.microsoft.com/downloads/, see the following image.
Figure 1. Visual Studio installation options, we must select :Net and ASP options
=> If you have to reinstall VS then during uninstall case remove the folder (C:\Program Files (x86)\Microsoft Visual Studio\2017), otherwise it can be messed up sometime, see the following image.
Figure 2. Visual Studio folder in the system, we might need this sometimes
=> Once you have installed the Visual Studio then it is a good idea to create a hello world type small application and see if it works, that will make sure that the installation has gone fine.
Download Beckhoff related software:
=>Create an free account at Beckhoff.com and download the following software package
=> TwinCAT 3.1 – TwinCAT 3 download | eXtended Automation Engineering (XAE) version 3.1.4024.7 or the latest (https://beckhoff.com/)
=> TE2000 | TC3 HMI , version 1.10.1336.404 or latest (https://beckhoff.com/)
Figure 3. Download the latest version of TwinCAT software from Beckhoff.com
=>Engineering version and Runtime version. If you are developing software then you need the engineering version. You have the necessary tools integrated with the engineering version. The engineering version is mostly used in your own development machine. For example, if you are developing a program and you need to debug it, that debugger is part of the engineering environment.
Runtime describes software/instructions that are executed while your program is running, especially those instructions that you did not write explicitly but are necessary for the proper execution of your code. Low-level languages like C have very small (if any) runtime. More complex languages like C#, have a much more extensive runtime.
For Beckhoff SW installation, you might need to enable the virtualization in BIOS as shown in the following image.
Figure 4. We might need to check the virtualization if it is enabled
Beckhoff software has an engineering version and run time version. We shall use the engineering version for developing the application and on the other hand, run time is used for only executing the program. One good example is that when we install Beckhoff TwinCat Software to PLC, we install only the run-time version. Even it is not possible to install the engineering version to PLC due to memory constraints. The engineering version offers all the development, debug, etc tools on top of run time.
Download all the software and run those executables as an administrator. Good to install visual studio before installing TwinCAT 3.1.
You are ready to GO!
Update with the latest version, one version to another version the requirements are changed:
The above table describes what kinds of tools are needed from Microsoft to continue the development. The most important requirement is the .NET Framework and .NET Core SDK. Different version has different requirement, take a look at https://infosys.beckhoff.com/english.php?content=../content/1033/te2000_tc3_hmi_engineering/2669710091.html&id=
Some of the software I used are here (from Microsoft dot net related)
dotnet-sdk-6.0.420-win-x64
ndp472-devpack-enu
NDP481-DevPack-ENU
Reinstall HMI Server if needed
In most cases, if we install it for the first time, it does not ask what we are installing, but later, if we need to install the HMI server again, we might have a problem.
=> Check if it was installed in 32 bit or 64-bit version (make sure the engineering version in the development machine and the HMI server machine have the same version)
=> Keep checked if you need support for CE devices
=> Keep checked if you need to delete an existing configuration
=> Keep unchecked Enable HTTP access from all IP addresses (default only local host)
=> If you are not sure what version of your HMI project is, try 32-bit first and then update with 64-bit and try to publish.
Figure 5. Reinstallation options for TwinCAT HMI server
Architecture, how HMI works in Windows platform
A Windows socket (Winsock) is an application programming interface (API) that allows for communication between Windows network software and network services, such as Transmission Control Protocol/Internet Protocol (TCP/IP). Winsock is based on the Berkeley Unix sockets interface. These work on a client-server basis.
Windows operating systems include a data link layer named winsock.dll, which helps to make the Windows programs and the TCP/IP services work together. If you are more interested you could take a look at this link to know how these work. Since our job is to develop HMI we don’t need to know these in detail. Beckhoff has done it for us.
Figure 6. Architecture view of TwinCAT HMI software
Winsock enables programmers to create advanced Internet, intranet, and other network-capable applications to transmit application data across the wire, independent of the network protocol being used. With Winsock, programmers are provided access to advanced Windows networking capabilities such as multicast and Quality of Service (QoS).
Winsock follows the Windows Open System Architecture (WOSA) model. As we see from the above picture the TwinCAT HMI server can access ADS, OPC UA, BACnet, and also our custom protocol. This can be achieved by the extension module of the HMI server. You could take a look at our tutorial.
Single HMI can be used for multiple PLCs
TwinCAT HMI supports OPC UA, which means it can connect to any OPC UA server and get data from there and is able to display it. It can also write data to any device over the OPC UA. If we run the OPC UA server to any device (PLC or any other device where we can run the OPC UA server) then Beckhoff HMI is able to connect. The same HMI can be used for any other manufacturer’s PLC as shown in the following image.
Figure 7. Same HMI can be enabled with other platform via OPC UA technology
TwinCAT Naming Concept
It is important to understand that TwinCAT 3 products are being identified via a new naming convention, which groups products into three different categories:
TE xxxx-xxxx: TwinCAT 3 XAE (Engineering)
TC xxxx-xxxx: TwinCAT 3 XAR (Runtime)
TF xxxx-xxxx: TwinCAT 3 Functions (former “Supplement” products)
The abbreviations represent the basic TwinCAT 3 naming concept and are therefore also important for later reference when activating or ordering a TwinCAT 3 license. The general schema of the TwinCAT 3 naming concept is as follows:
Figure 7. Convension for TwinCAT software
Abbreviation | Description |
T | TwinCAT |
b | Describes the TC3 Base System to which the product belongs. Possible entries are: E=EngineeringC=RuntimeF=Function |
c | Describes the product class. If the product belongs to the Base-System “Runtime” or “Engineering”, this is always “1”. |
nnn | Number, which uniquely identifies a product in its corresponding product class. |
rr | Reserved for later use, at the moment filled out with “00”. |
pp | Describes the hardware platform, on which the product has been licensed. |
bbbb | (Optional) Build number, describing the version number of a product in more detail. |
For a better understanding, the following table shows some product examples:
Product Identifier | Description |
TC1000-0010 | TC3 ADS, belonging to the Base-System “Runtime” with product class “1”. Has been licensed by the customer for hardware category 10. |
TC1000-0020 | TC3 ADS, belonging to the Base-System “Runtime” with product class “1”. Has been licensed by the customer for hardware category 20. |
TE1000-0030 | TC3 Engineering, belonging to the Base-System “Engineering” with product class “1”. Has been licensed by the customer for hardware category 30. |
TF6100-0070 | TC3 OPC-UA, belonging to the Base-System “Function” with product class “6”. Has been licensed by the customer for hardware category 70. |
TF6310-0020 | TC3 TCP/IP, belonging to the Base-System “Functions” with product class “6”. Has been licensed by the customer for hardware category 20. |
|
|
Figure 9. In different HMI engineering versions, there are some incompatibility issues from one version to another.
Now ready for the first Hello TwinCAT HMI, browse next https://www.hemelix.com/scada-hmi/twincat-hmi/my-first-twincat-hmi/
Ask questions related to Hemelix sample code and design at Google group https://groups.google.com/g/hemelix