Hello and welcome to a new guide on how to best use Movicon.NExTâ„¢.
In this technote, we are going to show you how a Movicon.NExTâ„¢ project tag can be used as
a gateway to propagate its value to two or more communication drivers
and, therefore, to two or more devices.
Tag as Gateway
When a tag is assigned two or more communication addresses, therefore,
when it is associated to two or more different communication drivers
simultaneously, it assumes the function of a gateway.
In this scenario, the change of the tag's value will be propagated
to both the drivers.
Or if a driver associated to the tag changes the tag's value, the change
will be propagated to all the addresses associated to the tag and,
therefore, to all the devices associated to it.
There are no connection type restrictions, therefore, each I/O address
can be only read, only write or read/write.
The latter type, or rather in the read/write scenario, you will need
to pay attention because the value read on anyone of the drivers associated
to the tag will be reported to the others and it will be the last
reading that establishes the tag's value, and as a consequence drivers
cannot be prioritized.
In addition, you cannot import the same tag using the import method
of two different drivers because the second one will overwrite the
first and therefore the tag's dynamic link will also be overwritten.
Example
We will now use an example to show you how the tag functions as
a gateway.
Simulators
To do this, we will use the ModRS_Sim simulator for communications
using the Modbus TCP-IP driver and the Prosys OPC UA simulator for
communications using the OPC UA Client driver.
Start both simulators.
Check that the Constant item in the Prosys OPC UA simulator is Int32
type. To do this, after the simulator has been opened and started
up:
Select the Objects
tab and expand the Simulation folder.
Select
the Constant item from within the Simulation folder. Its properties
will appear on its right hand side.
Select
the Value tab within the item's properties window and check that
the value set in the Data Type property is Int32.
If
not, click on the value shown (default Double) and expand Integer
in the window that shows and select Int32.
Click
OK to confirm.
Click
the Reset button on the simulator's toolbar, next to the update
interval value.
The Movicon.NExT project
After having opened the Movicon.NExT developer enviornment and loaded
a project, or created a new one:
Double-click to open
the I/O Data Server found in the application's tree within the
Project Explorer window.
Select
the I/O Drivers tab and configure at least two drivers. For example,
Modbus TCP-IP and OPC UA Client.
To configure the Modbus TCP-IP:
Right-click
within the workspace and select Add New Driver.
Select
the Modbus TCP-IP driver from the list that appears. Click on
the next step arrow to go ahead and configure it.
Leave
everything set for default in the Driver's General Properties
window and click the arrow to go to the next step.
Enter
the IP address of your PC in the driver's Channel settings. In
our example, we will use the the local loopback IP address, being
127.0.0.1. Leave the other properties set for default and go to
the next step.
Leave
everything set for default in the driver's Station settings window
and go to the next step.
Terminate
the configuration by clicking on Finish to insert the driver on
the driver list.
To configure the OPC UA Client:
Right-click
within the workspace and select Add New Driver.
Select
the OPC UA Client driver from the list that appears. Click on
the next step arrow to go ahead and configure it.
Leave
everything set for default in the Driver's General Properties
window and click the arrow to go to the next step.
Leave
the properties set with the default values in the driver's Channel
settings and go to the next step.
Leave
everything set for default in the driver's Station settings window
and go to the next step.
Terminate
the configuration by clicking on Finish to insert the driver on
the driver list.
Now that the drivers have been configured, we will create a tag.
To do this:
Go
to the Tag List by selecting the corresponding I/O Data Server
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: GatewayTag
Model Type: Variable
Data Type: Int32
Confirm the changes by clicking on the Accept Changes icon
on the tag's property window toolbar at the top.
Now configure the communication address:
The configuration for the Modbus TCP-IP driver is:
Function Code: MultipleRegisters
Start Address: 10
Link Type: Read/Write
Station: Station0
By using the OPC UA Browser for the OPC UA Client connect to
the Prosys simulator's endpoint and search for the Costant item
within the Simulation folder.
Save the project by clicking on the Save All icon on the Movicon.NExT
editor's toolbar.
Runtime Test
Now that the project has been configured, you can startup the project's
Server side only by clicking the Start Server icon.
Once the Server has started up with the OPC UA Browser window open,
select the Tags folder and change the value of the GatewayTag tag.
Once the tag value has been changed, it will be reported to both simulators.
First change the value on the Modbus simulator and then on the OPC
UA simulator. If no errors occur, the value will be reported to Movicon.NExT
and the OPC UA Server and Movicon.NExT and the Modbus simulator respectively.