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. 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.
=> 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.
=> Once you have installed the Visual Studio then it is 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:
=>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 the 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.
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!
Architecture, how HMI works in Windows platform
A Windows sockets (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 works on a client-server basis.
Windows operating systems includes 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.
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.
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:
Describes the TC3 Base System to which the product belongs. Possible entries are: E=EngineeringC=RuntimeF=Function
Describes the product class. If the product belongs to the Base-System “Runtime” or “Engineering”, this is always “1”.
Number, which uniquely identifies a product in its corresponding product class.
Reserved for later use, at the moment filled out with “00”.
Describes the hardware platform, on which the product has been licensed.
(Optional) Build number, describing the version number of a product in more detail.
For a better understanding, the following table shows some product examples:
TC3 ADS, belonging to the Base-System “Runtime” with product class “1”. Has been licensed by the customer for hardware category 10.
TC3 ADS, belonging to the Base-System “Runtime” with product class “1”. Has been licensed by the customer for hardware category 20.
TC3 Engineering, belonging to the Base-System “Engineering” with product class “1”. Has been licensed by the customer for hardware category 30.
TC3 OPC-UA, belonging to the Base-System “Function” with product class “6”. Has been licensed by the customer for hardware category 70.
TC3 TCP/IP, belonging to the Base-System “Functions” with product class “6”. Has been licensed by the customer for hardware category 20.
Figure x. 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/beckhoff-hmi/my-first-twincat-hmi/
Ask questions related to Hemelix sample code and design at Google group https://groups.google.com/g/hemelix