Using expressions to display calculated values

Introduction

Hello and welcome to the new quick start guide on how to best use Movicon.NExTâ„¢.

In this technote you will learn how to use expressions to display calculation results at runtime

The expressions

You can enter expressions or formulas in the object's properties or its animation properties by using the Expression or Inverse Expression fields. This field allows you to:

Example

Let's use an example for better clarification.

Creating tags

Open the Movicon.NExT Editor and create, or load, a project. Then, create two tags in this way:

Once the tags have been configured, save the project by clicking on the Save All icon on the Movicon.NExT Editor's main toolbar at the top.

Creating the screen

We shall now create a screen:

Once the screen has been created, we can now change the project's properties by inserting the screen as the project's Main screen to show when the project starts up. To do this:

Once the project's startup page configuration has terminated, click on the Save All icon located the toolbar at the top to save the project.

Make sure that the Main screen is open, click on the Toolbox tab on the far left of the editor, next to the Properties window, to open the Toolbox library provided by Movicon.NExT.
Expand the Display folder and and select and drag the Display object onto the screen.
Select the Display object on screen to open its Properties window. Go to its Tag property and click on the corresponding button with three dots to configure it.
A window will show allowing you to select a project tag, a local client, a system tag or an item from an external OPC UA Server.
Choose the I/O Data Server tab and select the previously created Tag1 tag.

Repeat this procedure by using a second Display object and assigning it the Tag2 tag.

Insert another Display object like before and assign it the Tag1 tag.
However, unlike the other two Display objects, we will assign this one an expression:

Once the screen configuration has terminated, click on the Save All icon located at the toolbar at the top to save the project.

Runtime Test

The display object configured in this way should will display the result of the Tag1+Tag2+10 expression at runtime.
If you wish to make the newly configured display object editable, you will need to add the inverse expression which is done by repeating the same procedure but by using the [x]-[2:Tags/2:Tag2]-10 expression instead.
If a value is entered in the display object configured with the expressions at runtime, it will be valued with the inverse expression calculating the Tag1 value.