Historical visualization using a Grid object

Introduction

Hello and welcome to a new guide on how to best use Movicon.NExT™.

In this technote, we are going to show you how to visualize the historical of a tag’s values coming from a PLC by using the Historian Viewer object.

Historical data visualization

Movicon.NExT offers several graphical objects to display and view the history of tag values stored on a database with the Historian module or the Data Logger module. These objects include:

Example

In the following example you will see how to visualize the trend of a tag from a PLC Modbus TCP simulator by using the Historian Viewer object. The procedure to display stored data in the Data Logger object is similar to this one.
The simulator used in this example is the ModRS_Sim, which is available and offered free of charge on the internet.
Start up the Modbus simulator by double-clicking on its icon and then load a script to simulate the values.
If you do not have any scripts ready, you can use the following code saved on a file with the .vbs extension:

dim x
dim n
n=0
for n=0 to 240
    x = getregistervalue(3,n)
    SetRegisterValue 3, n, x+1
next

How to insert and configure the driver

After having started Movicon.NExT up in development mode and created, or loaded, a project:

How to create the tag

We shall now define an Int16 type tag to connect to the PLC simulator. To do this:

Now that you have finished configuring the tag, save the project by clicking on the Save All button on the Movicon.NExT Editor’s toolbar at the top.

How to create the Historian

Now that the driver and tag have been instantiated, you can proceed with creating the Historian and assigning the MbtcpTag tag to it. To do this, open the I/O Data Server and then:

To assign the MbtcpTag tag to the newly created Historian:

How to create the screen

Now, we will need to create a screen:

Once the screen has been created, you can then change the project's properties by inserting the screen as the project's Main screen which will show when the project starts up. To do this:

Once you have finished configuring the project startup page, click on the Save All icon located on the toolbar at the top to save the project.

Now, open the Main screen and click on the Toolbox tab, which is located on the far right of the editor window, next to the properties window, to open the Toolbox library provided by Movicon.NExT.
Select and drag the Display and Historian Viewer objects on screen. These objects are found in the Displays and Historian Data Viewers folders, respectively.
Assign the MbtcpTag tag to the Display object in this way:

We shall now configure the grid to display the data in table format:

Save the project by clicking on the Save All button on the Movicon.NExT Editor’s toolbar at the top.

Runtime Test

Now test everything in runtime mode by clicking the Start Runtime icon.
As soon as the configured Modbus TCP IP Driver starts reading data coming from the PLC simulator at runtime, you will see the current tag value in the Display object and see the grid populated with data from the database. To update this data, click on the object’s Refresh button.
The Historian Viewer object allows you to export the data displayed in various formats (CSV, HTML, XLS, PDF). To export data, simply select the format desired from the combobox and then click the Export button.