EcoStruxure Machine Expert Logic Builder Configuration

 

Declaring a Variable to Be Used With OPC

Declaring a Variable with EcoStruxure Machine Expert Logic Builder

Step

Action

Example

1

In EcoStruxure Machine Expert Logic Builder, create an empty project.

ExampleOPC

2

Add and select a controller by executing the Add Device command.

3

Rename the controller by selecting the controller node and clicking it again to make it editable.

MyPLCexample

4

Create a PROGRAM in your application by right-clicking the Application node and executing the command Add Object > POU.... Declare a variable in this POU (refer to the Example column).

Program:

Increment a UINT variable: VARIABLEEXAMPLE

5

Configure the name of the program POU.

MyPOUexample

6

Add a task in your application by right-clicking the Application node and executing the command Add Object > Task Configuration....

MyPOUexample

7

Double-click a task and associate the program to the task.

G-SE-0010079.1.gif-high.gif

 

 

Task name: MAST

Program name: MyPOUexample

8

Execute the Build All command from the Build menu and verify that no error is detected.

9

Create a Symbol Configuration object in your application by right-clicking the Application node and executing the command Add Object > Symbol Configuration....

10

Click the Build button from the Symbol Configuration toolbar.

11

Expand the variables in the list of symbols.

12

Select the variable(s) you want to share with your OPC client from your program.

Variable example: VARIABLEEXAMPLE

Program example: MyPOUexample

13

Execute the Build All command from the Build menu and verify that there is no error detected during execution of the Build command.

Remark:

In the directory where you have stored your project, an XML file is created. It provides a list of the variables which are accessible for the OPC client.

14

Close the tab Symbol Configuration.

15

Log in to your controller and start the downloaded application.

For further information, refer to the Symbol Configuration Editor chapter in the Programming Guide.

XML File Listing the Variables Accessible for the OPC Client

In the directory where you have stored your project, an XML file is created which describes the list of the variables which are accessible for the OPC client.

The XML file is used in SIMULATION3 mode. Also refer to the Project name parameter for controller configuration. When the GATEWAY3 or ARTI3 mode is selected, the XML file is not used and cannot be entered as Project name in the OPC configuration tool. In these modes, the OPC client retrieves the variables shared by the symbol configuration via the OPC server from the controller.