TwinCAT HMI Symbol Data

In TwinCAT HMI a variable is called a symbol. This symbol can be mapped or linked to PLC variable. Some symbols can be local to HMI server. That means it is not read from PLC.

Mapping is the event of telling HMI Server where the needed symbols are located in PLC

Binding is a process of linking between 2 variables from target devices (PLCs) with ADS protocol.



How to make PLC data available to HMI Server

=> First we need to give access to the PLC. The PLC can be in the local network, remote network, or even the local machine (PLC program is running in the same machine). The PLC is identified by the Ams NetId.

=> If the PLC is in the network then the HMI Server computer (where the HMI Server is running) should have the route, for details see how to add a route for searching Beckhoff PLC.

=> If the PLC is running on the local PC, we add the localhost address “127.0.0.1.” + “1.1”

=> For remote machine, it is wise to set the AmsNetId to  IP address + .1.1,  this help to remember the AmsNet Id, see how to change Ams Net Id

=> You can bring the left-hand side setting dialog by selecting HMI Project | Server and then from the menu  TWINCATHMI | TwinCAT HMI Server Configuration.

=> Set Enabled to true, AmsNetId and the port number and press accept.

Note: In some smaller controller Symbol name is not supported, in this case the data can be accessed directly by using indexGroup and indexOffset (in that case,  we press on Symbols and then Add)


Mapping variables to TwinCAT HMI

Adding Ams Net Id establish a link between the HMI Server  and the PLC. HMI Server does not know what kinds of variables are available in the PLC yet. The mapping process establishes a  connection between HMI Server and the PLC so that HMI Server can read those data over the Beckhoff ADS protocol.

 

 

=> Select the HMI project and then Server in the solution explorer

=>Now select the HMI Configuration as shown in the left image

 

 

=> Select the HMI project and then Server in the solution explorer

=>Now select the HMI Configuration as shown in the left image

=> If we press on the All Symbols then it will show all PLC variables under the MAIN PLC, if this does not show any variables then refresh the configuration

=> To map a variable, we right click on the PLC variable and select and select Map Symbol and press OK. Now this variable will be available in the HMI

=>We can map all the necessary variable one by one or selecting all by in single mapping.

=>Mapped Symbols will show all the mapped variables in the system

 

Server Symbols

Server symbols can be created centrally in the server under Mapped Symbols. They can also be used offline without a PLC. Clicking on the button Create Server Symbol opens a dialog for adding server symbols. Server symbols can be used to hold some internal variable for processing  business logic. This can be mapped to PLC variable as well. This variable can be persistent meaning if the server restarted the value is saved.

=> Right click on the Mapped Symbols

=> Select create new server symbol

=> Fill the necessary information as shown in the following image


Internal Symbols

Internal symbols are independent of the server and are valid within a browser instance. The internal symbols thus enable variables to be saved individually for each client.

=> Internal Symbol can be created as same way as server symbols

=> Right click on the internal symbol and fill the necessary information as shown in the following image


Test Application

The test application can be downloaded from hemelix.com and test it.

Here is short description what the test application does.

It reads a server internal variable and shows in a edit box, the value can be increased or decreased by pressing 2 buttons. The updated value can be written to a PLC variable. It shows also a text value by reading from a internal symbol

We shall add a video here and explain the project more details, so please visit us again

Tips: Why my HMI does not updated with initial value set in the server or in server extension?

Data need to changed if we want to display data on the UI. One way to configure the UI with custom events as shown in the following image.