Hello and welcome to a new guide on how to best use Movicon.NExT™.
In this technote, you will learn how to display a statistic values
at runtime belonging to a project developed with the Movicon.NExT™ software.
Statistic Values
and Tags
Each tag created within the Movicon.NExT platform has a property
called Enable Tag Statistics. When this property is enabled, the server
will publish the following tag's statistic values:
Minimum
(Min): this is the minimum value obtained by the variable.
Maximum
(Max): this is the maximum value obtained by the variable.
Average:
this is the variable's calculated average value.
Number
of Updates (Num Updates): this is the number of variable updates.
Total
Time On: this is the total time with which the variable remained
at a value other than zero.
The values listed above are saved in the variable’s retentive file.
If you wish to use these values, you will also need to enable the
tag’s Retentivity property.
This property allows you to save last value assumed by the variable
on file before the system shuts down so that it can be resumed at
the next startup.
Statistical values are managed in redundant architectures and are only
displayed for scalar tags; therefore, structure or array tags do not
have them.
Example
We will now see how to display them at runtime.
Inserting a driver
After opening the Movicon.NExT editor and creating, or uploading,
a project, insert an I/O Driver. In this example we will insert the
Demo driver as follows:
Open the I/O Data Server
located in the project resource tree in the Project Explorer Window
and select the I/O Driver tab.
Once
the I/O Driver has opened, right click within the workspace and
select the Add New Driver option from the menu that appears.
Select
the Demo driver from the list that shows. Click on the arrow to
go ahead and configure it.
Leave
all settings set for default in the Driver's General Settings
window and proceed by clicking the arrow to go ahead to the next
step.
Leave
all the values set for default in the Driver's Channel properties
and go to the next step clicking on the arrow.
Leave
all the driver's Station's properties in the configuration window
set for default and proceed with the configuration.
To
conclude the configuration procedure, click on the Finish button
to insert the driver on the project’s driver list.
Creating a tag
Now we will create a tag to connect to the driver:
Open
the I/O Data Server, then go to the Tag List by selecting the
corresponding tab.
Right
click on the workspace and select the Add New Tag from the menu
that appears.
Configure
the tag using the properties window in the following way:
Name:
StatTag
Model
Type: Variable
Data
Type: Int32
Enable
Tag Statistics: checked
Retentive:
checked
Confirm
the changes by clicking on the Accept Changes icon on the tag's
property window toolbar at the top.
Search
for the Physical I/O Address option in the tag's Execution property
group and click on the three dots within brackets on the far right
to access the tag's Driver address configuration.
In
the popup that shows, you can choose Simultation types from the
combobox. In our example, we will select Random as Demo Type.
Configure
the following properties in this way:
Min Value: 0
Max Value: 100
Link Type: Read Only
Station: Station0
Click
the OK button to confirm the configuration.
Confirm
the changes by clicking on the Accept Changes button on the tag's
Properties window toolbar.
Once the tag has been configured, save the project by clicking on
the Save All button located on the Movicon.NExT editor's top toolbar.
Creating a screen
We shall now create a screen:
Look
for the Screens resource in the project's tree structure in the
Project Explorer window and select it.
Right
click it and select the New option from the menu which opens.
A
New Screen popup will appear allowing you to set the screen's
main properties. Configure the screen as follows:
Width:
1920
Height:
1080
Name:
Main
Click
the OK button to confirm the configuration.
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:
Select
the name of the project from the application's tree structure.
Open
the Properties window.
Change
following project's properties as follows:
Startup
Page Type: Main Screen
Startup
Screen Name: Main
Once you have finished configuring the project startup page configuration,
click on the Save All icon the toolbar located at the top to save
the project.
After opened the Main screen, 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.
Select the Display object on screen and 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
tag, a system tag, or an item from a third-party OPC UA Server.
Select the I/O Data Server tab and select the StatTag tag we previously
created.
Create another five Display objects and for each one:
Select
a Display object.
Open
the object's Properties window and expand the Advanced section
in the associated Tag configuration part.
Select
a statistic value.
Once the objects have been configured, save the project by clicking
on the Save All button on the editor's top toolbar.
Runtime Test
Start Runtime by clicking the corresponding icon on the Movicon.NExT
Editor's toolbar at the top.
Once the project is loaded, the configured graph objects will report
the current value of the StatTag tag and its statistical values.