How to use a bit of a tag value

Introduction

Hello and Welcome to a new guide on how to best use Movicon.NExTâ„¢.
In this technote, we are going to see how tag bits are used in a Movicon.NExT project.

Why bits are important

Tag bits can be directly pointed in Movicon.NExT. In fact, as you probably already know, tags are variables formed by elementary parts called bits, that can obtain two values: 0 and 1.
For example, it is good practise to configure alarms on the PLC, usually boolean type, in single word bits (for example 16 bits) to save memory space in the PLC.
The same identitical thing can be done in Movicon.NExT, whereby an alarm can be associated to each tag bit.
However, it does not end here: you can use a tag, for example, to check that everything is working properly and associate each bit to a specific control.

Example

Let's see in more detail how to use bits of a tag to display the value of a binary variable.

Creating the tag

After having opened the Movicon.NExT developement environment and loaded a project, or created a new one, create a tag using the following procedure:

Creating a screen

Create a screen in this way:

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 you have finished configuring the project startup page configuration, click on the Save All icon 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 select and drag the Display object onto the screen.
Insert the UWord tag in the Display object by dragging the tag onto it.

Once you have finished this procedure, make four duplicates of the Display object by simply using the copy and paste techniques, such as the Ctrl+C and Ctrl+V keyboard shortcuts, and place them on screen in an orderly manner.
Each one of these four new Display objects will display a bit of the UWord tag.
To point to a single tag bit:

Repeat the above procedure for each on of the Display objects by changing the associated bit each time.
Click on the Save All button on the top toolbar to save the project.

Runtime Test

Once you have finished, the screen should contain five Display objects. One displaying the UWord tag's integer value and the other four displaying the 0, 1, 2 and 3 bits.
Changing the values of the bits, will change the integer value as a consequence and viceversa.
For example, with the 1111 combination, the interger value will change to 15. When the interger value is changed to 7, the bits will change to 0111.