Hello and welcome to a new guide on how to best use Movicon.NExT™.
In this technote we will use an example to show you how to display
a value from a field device on screen.
Example
Movicon.NExT offers numerous objects designed to display values.
In our example, we will use the Display object which can be found
in the Display folder from the Toolbox library.
The value to be displayed will be transmitted from a PLC Modbus TCP
simulator.
We will use the ModRS_Sim which is a Modbus simulator that can be downloaded
for free from the internet.
Launch the modus simulator by double-clicking on its icon and load
a script to simulate the values.
If you do not have any scripts ready, you can use the following code
saved on 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
Inserting and configuring the driver
After having launched the Movicon.NExT development environment and
created, or loaded, a project:
Open the I/O Data Server listed in the project tree displayed
in the Project Explorer window.
Select the I/O Driver tab to add the Modbus TCP-IP driver.
Once opened, right-click within the workspace and select the
Add New Driver item from the menu that appears.
Select the Modbus TCP-IP driver from the list that appears.
Click on the arrow to proceed with its configuration.
Leave all the default settings in the Driver’s General Settings
window as they are and click on the arrow once again to continue.
Insert your PLC’s IP address in the Driver’s Channel configuration.
In our example, we are using the Modbus simulator on the same
device installed with Movicon.NExT and, therefore, will use the
local loopback IP Address which is 127.0.0.1. Leave all the other
properties set with the default values and continue onto the next
step.
Leave all the default settings in the Driver’s Station configuration
as they are and continue onto the next step.
Now that the configuration has been completed, click on Finish
to conclude and insert the Driver on the Driver list.
Tag creation
We shall now define an Int16 type tag to connect to the PLC simulator.
To do this:
Access the Tags List
by selecting the corresponding tab after having opened the I/O
Data Server listed on project tree within the Project Explorer
window.
Right-click
within the workspace and select the Add New Tag option from the
menu that appears.
Configure
the tag by using its properties window in the following way:
Name
MbtcpTag
Model Type
Variable
Data Type
Int16
Confirm
the changes by clicking the Accept Changes icon on the toolbar
at the top of the tag’s property window.
Go
to the tag’s Execution property section, open the Physical I/O
Address drop-down list and select the driver from the list. Click
on the corresponding three dotted button to open the tag’s PLC
address configuration window.
Leave
the properties in the popup that appears set for default and select
the Station from the combobox if not already done so.
Click
Ok to confirm.
Confirm
the changes by clicking the Accept Changes icon on the toolbar
at the top of the tag’s property window.
Once you have completed configuring the tag, save the project by
clicking on the Save All button on the Movicon.NExT editor's top toolbar.
Screen creation
Now create a screen if not already done so:
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 through which you can 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, 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:
Select
the name of the project from the application's tree structure.
Open
the Properties window.
Change
the following project properties in this way:
Startup
Page Type: Main Screen
Startup
Screen Name: Main
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.
Double-check that the Main screen is open and then click on the
Toolbox tab, offered by Movicon.NExT, on the far right of the editor
next to the Properties window.
Drag the Display and RealTime Trend objects, which are found in the
Displays and Trends folders respectively, on screen.
Assign the MbtcpTag tag to the Display object. To do this:
Select the Display object on screen and open its Properties
Window.
Assign the MbtcpTag tag to the object by entering it in the
object’s Tag property textbox.
Confirm the changes by clicking the Accept Changes icon on
the toolbar at the top of the object’s property window.
Next, select the RealTime Trend object and open its Properties Window
to configure it:
Find the Object Configuraton property in the Trend – Settings
section and click its corresponding three dotted button.
In the configuration popup that opens, click on the + symbol to add a pen to the trend.
Configure the pen in this way:
Color: Red
Tag Name: MbtcpTag
Click OK to close the popup and confirm the changes.
Click on the Save All icon located on the toolbar at the top of Movicon.NExT editor to save the project.
Test Runtime
Test everything you have just created by clicking the Start Runtime icon to launch the project into runtime.
As soon as the configured MBTCP driver starts reading the data coming from the PLC simulator at runtime, the Display object will show the current MbtcpTag tag’s value while the RealTimeTrend will chart its trend in realtime.