100% found this document useful (1 vote)
3K views

FactoryTalk Optix OnCourse

This section introduces the FactoryTalk Optix Studio interface, which contains the main toolbar, project panel, types panel, and log panel. The project panel displays the project information model and node structure. The types panel contains FactoryTalk Optix native and custom project variable and object types. The log panel displays messages from FactoryTalk Optix Studio, the emulator, and connected FactoryTalk Optix applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
3K views

FactoryTalk Optix OnCourse

This section introduces the FactoryTalk Optix Studio interface, which contains the main toolbar, project panel, types panel, and log panel. The project panel displays the project information model and node structure. The types panel contains FactoryTalk Optix native and custom project variable and object types. The log panel displays messages from FactoryTalk Optix Studio, the emulator, and connected FactoryTalk Optix applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 180

LAB MANUAL

FactoryTalk OptixTM Basic Lab


This documentation, whether, illustrative, printed, “online” or electronic (hereinafter “Documentation”) is intended for use only as
a learning aid when using Rockwell Automation approved demonstration hardware, software and firmware. The Documentation
should only be used as a learning tool by qualified professionals.

The variety of uses for the hardware, software and firmware (hereinafter “Products”) described in this Documentation, mandates
that those responsible for the application and use of those Products must satisfy themselves that all necessary steps have been
taken to ensure that each application and actual use meets all performance and safety requirements, including any applicable
laws, regulations, codes and standards in addition to any applicable technical documents.

In no event will Rockwell Automation, Inc., or any of its affiliate or subsidiary companies (hereinafter “Rockwell Automation”) be
responsible or liable for any indirect or consequential damages resulting from the use or application of the Products described in
this Documentation. Rockwell Automation does not assume responsibility or liability for damages of any kind based on the
alleged use of, or reliance on, this Documentation.

No patent liability is assumed by Rockwell Automation with respect to use of information, circuits, equipment, or software
described in the Documentation.

Except as specifically agreed in writing as part of a maintenance or support contract, equipment users are responsible for:
• properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell Automation
or third-party provided instructions, warnings, recommendations and documentation;
• ensuring that only properly trained personnel use, operate and maintain the Products at all times;
• staying informed of all Product updates and alerts and implementing all updates and fixes; and
• all other factors affecting the Products that are outside of the direct control of Rockwell Automation.

Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell Automation is
prohibited.

Throughout this manual we use the following notes to make you aware of safety considerations:

Identifies information about practices or circumstances


that can cause an explosion in a hazardous environment,
which may lead to personal injury or death, property damage, or economic loss.

Identifies information that is critical for successful application and understanding of the product.

Identifies information about practices or circumstances that can lead to personal injury or death, property
damage, or economic loss. Attentions help you:
• identify a hazard
• avoid a hazard
• recognize the consequence

Labels may be located on or inside the drive to alert people that dangerous voltage may be present.

Labels may be located on or inside the drive to alert people that surfaces may be dangerous temperatures.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 2


Before you begin

This Lab is intended for users who wish to gain an overview of FactoryTalk OptixTM, there is no previous experience
with FactoryTalk OptixTM required to complete this lab.

About this lab


This Lab is an introductory Lab that explores the features and functionality of FactoryTalk OptixTM.
The lab is intended as a select what you wish to learn about lab, each section is independent of other lab sections.
The lab sections contain an explanation and feature details for that particular section in a “Read about” or “Tip” section.
It is not necessary to read these explanations, but a more thorough understanding of the features presented will be
attained if time is taken to read through them.

Tools & prerequisites


There are no prerequisites required for this lab.
The image has the following software running on it.
▪ FactoryTalk OptixTM
▪ FactoryTalk Logix Echo V33
No external hardware is required.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 3


FactoryTalk OptixTM Basic Lab
Contents
Before you begin ........................................................................................................................................... 3
About this lab .................................................................................................................................................................................... 3
Tools & prerequisites ........................................................................................................................................................................ 3
Contents............................................................................................................................................. 4

FactoryTalk OptixTM Studio Interface ............................................................................................................ 5

Welcome aboard RA-1701 - a C-Class Primary Battery Production and asteroid mining ship. ................. 12

Communications ......................................................................................................................................... 13
Monitoring the Status connection of a controller ............................................................................................................................. 22
OPC UA .......................................................................................................................................................................................... 24

Variables, Types and Model ....................................................................................................................... 36

Display Design Concepts ............................................................................................................................ 50

Display construction .................................................................................................................................... 50

Display Containers ...................................................................................................................................... 75

Licensing ..................................................................................................................................................... 76

Language Switching and Locales ............................................................................................................... 78

Datalogging ................................................................................................................................................. 85

Trending ...................................................................................................................................................... 91

Alarming .................................................................................................................................................... 100

Reporting ................................................................................................................................................... 116

Security ..................................................................................................................................................... 133

Evaluators and Key Converters ................................................................................................................ 147

Recipes ..................................................................................................................................................... 156

C# Scripting – Netlogic.............................................................................................................................. 167

Just for fun – because we can .................................................................................................................. 178

Appendix A - FactoryTalk OptixTM Demo Project ...................................................................................... 179

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 4


FactoryTalk OptixTM Studio Interface

The design environment

Part Name Description

A Main toolbar See Main toolbar buttons.

Project information model to display and set the structure of nodes. The
B Project panel
nodes can be organized according to parent/child logics.

Object Types and Variable Types:


• FactoryTalk OptixTM Studio native types, grouped in folders
C Types panel according to their purpose
• custom project types, located in folders that reflect the project
structure visible in Project

Messages related to the operation of FactoryTalk OptixTM Studio (FactoryTalk


OptixTM Studio Output tab), the Emulator (Emulator Output tab), the
D Log Panel
FactoryTalk OptixTM Applications running and connected to FactoryTalk
OptixTM Studio (other tabs with the name of the target).


E Path of the object being edited in the editor

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 5


Part Name Description


F Specific toolbar for the object type being edited in the editor

Graphic editor to set interface objects or to configure other specific object


G Object Editor
types (e.g. tag importers, recipes, etc.)

Editor to display and/or set the properties of the selected node in Project or
H Properties panel
in the object editor

Editor to subscribe methods to events that can be generated by the selected


I Events panel object in Project, or in the object editor or generated by another selected
object.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 6


Main Buttons Function

Create, open or close a project.

Save the project or export the FactoryTalk OptixTM Application.

Undo the last operation.

Redo the last operation.

Open the project resource window for displaying, importing or deleting


project files such as images, videos, documents, certificates, etc.

Open the template library window and template variables. It contains both
default and custom libraries.

Open the .NET project integrated in the FactoryTalk OptixTM project, to


integrate functionality through C# code. The .NET project is opened via the
default editor configured in the settings.

Compile, transfer and run the application on the target.


In the relative drop-down menu, Configure target opens the window to set
the targets.

End the FactoryTalk OptixTM Application on the target.

GitHub Integration

Opens the dashboard page that contains the wizards.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 7


Open the FactoryTalk OptixTM Studio Options window, which contains the
following options:
Label Description

Set the FactoryTalk OptixTM Studio interface


Language
locale.

Activate the display of advanced log messages


Advanced mode
in the log panel.

Show feature Activate the experimental features of


previews FactoryTalk OptixTM.

Set the default code editor for the


Preferred code editor
display/change of the NetLogic C# code.

Preferred physical Set the default unit of measurement for physical


length unit lengths.

Update FactoryTalk Open in the browser the page from which to


OptixTM update FactoryTalk OptixTM.
The following items are available in the relevant drop-down menu:
• FactoryTalk OptixTM Studio Options.
• Create certificate: opens the window to create OPC UA certificates.
Log configuration level per module: opens the window to configure the
maximum information level displayed in the log panel.

• Open the FactoryTalk OptixTM local manual in the browser.

Buttons in
Function
Properties

Go back in the panel selection history.

Go forward in the panel selection history.

Divide the Project panel into two panels.

Create a new node inside the selected node.

Remove the selected node and the nodes it contains.

Group the child nodes: hide them from the Project and make them non-editable.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 8


Buttons in
Function
Properties

Release the child nodes of the group: display them in the Project and make them
editable.

Only for some object types. Open the object in the dedicated editor.

Log Panel
Function
Buttons

Show/hide the error messages of maximum severity.

Shows/hides the error messages of minimum severity.

Show/hide information notices.

(in advanced mode only) Show/hide additional information about the error messages or
information notices displayed.

(in advanced mode only) Show/hide additional debug information about the error
messages or information notices displayed.

Open the logs folder of the running element (FactoryTalk OptixTM Studio at design time,
FactoryTalk OptixTM Application at runtime or Emulator).

Delete messages from the panel.

Open the selection window of the modules to display in the Category column

Information in the log panel

Column
Column Description
name

Information level of the messages:


• • = error of maximum severity
1
• = error of minimum severity
• = information notices

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 9


Column
Column Description
name

• (in advanced mode only) = additional information about the error


or alert
• (in advanced mode only) -= additional debug information about
the error or alert

2 Code (Only for FactoryTalk OptixTM Studio native messages) Message ID code

3 Time Message timestamp

Category of FactoryTalk OptixTM Platform message or module that generated


4 Category
the message.


5 Object

6 Message Message content

Editor Buttons

The buttons displayed change depending on the element being edited.

Properties Panel Buttons

Button Function

Organize the properties in groups.

Sort the properties in alphabetical order.

Add a property to the node.

Remove a property or reset a property to its default value.

Only for some object types. Open the object in the dedicated editor.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 10


Events Panel Buttons

Button Function

In the Events panel header: add an event of another object.


Near an event: associate a method with the event.

Delete the selected method.

Common elements

Element Function

Change the name or value of the element.

Open the dynamic link window to set the value of the corresponding field with a dynamic link.

Open the dynamic link window to edit the existing link.

Open the specific dropdown menu for the relative button.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 11


Welcome aboard RA-1701 - a C-Class Primary Battery Production and asteroid mining ship.

During the lab you will help Alolun the ship’s owner and an Ardvarian from Ardvaria (a small water planet orbiting
sol f-d9jk3-098) to modify his HMI for the Primary Battery making process on board his ship.

Now let’s dive in…

When the image is started, make sure to minimize this OPC UA window.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 12


Communications

In this section of the lab, you will help Alolun add automatic control to the ventilation valve of the drying oven, at the
moment he has to walk or float there and manually adjust the lever for the valve with the chance that he’ll just float
away when he moves the manual lever if he forgets to turn on his magnetic anchoring.

During the course of helping him you will see how many different controller drivers are natively available in
FactoryTalk OptixTM, add and control a tag from a Rockwell controller, investigate how FactoryTalk OptixTM
communicates via OPC UA and how to monitor the status of the connection to a controller.
1. Double click on the Lab Files shortcut on the Desktop.

2. Double click on the FT Optix Start Project > FTOptix_Base_Start Folder and then double click on the
FactoryTalk OptixTM project ROKLive_EMEA_2022_Base_Start, this will open the project in FactoryTalk OptixTM
Studio.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 13


3. Once the project is open, you will see wizards. For this section, you will use the “I want to configure connected
devices”.

The wizards can always be found in the menu by clicking on

The first step in the Configuration of the Communication driver is to configure a Station. In this lab the Station has
already been created.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 14


3. Click on New Station.

Using the IP address, the driver is looking at the controller in slot 0.


If you want to use a controller in a different slot you need the following syntax :
IP address\Backplane\slot for example 192.168.1.20\Backplane\2 would be the controller in slot 2

4. For this lab section you will not add another station but you can see the list of native drivers that can be added to
FactoryTalk Optix as well as communicating via OPC UA. Click the Back to return to the previous screen.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 15


5. Click on Next.

6. Wait while the driver connects to the controller and uploads the tags. At the bottom right you will see a box
showing Importing tags.

In case you don’t have a controller, you can develop in Offline mode through an L5K, L5X or ACD file.

7. When the list of tags appears, you can look in the list for tag VentValve or you can type the name or part of the
name in the search bar.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 16


8. Check the Checkbox in front of the 2 tags and select Next.

9. The tag is now synchronized, click Exit.

Now we are going to add the tags to objects on a screen.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 17


10. Go to UI > Screens > Drying > Communications, double click on the Communications display.

There was already an object created to open the ventilation Valve in case of an emergency. Let’s add this to the
screen.

11. Open the Template Libraries

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 18


12. You can move the Libraries Popup around on the screen. Go to RA1701, select Ventilation_Valve and drag it
on the communication screen. You can close the Libraries by clicking on the Close button.

Now we can start configuring the Ventilation Valve that we just added.

13. Select the Ventilation_Valve1 that you just added and look at the properties window on the right. In the red box
are the properties you are going to fill in.

14. For the ValveName, move you mouse pointer next to the right of the property until you see the pen appear,
click on it and fill in “Vent1”

For the tag that we are going to associate with the properties, we will show you two different ways.
15. Move your mouse to the right of property ValveValue and select the Add Dynamic Link button.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 19


16. All objects and properties are in folders, to make it easier to go through the folders, minimize the UI folder by
clicking on the arrow on the left.

17. Now you can scroll down to CommDrivers, here under tags, you will find the two tags that you have selected.

18. In Program:CoatingDrying, select tag Out_VentValve and click on Select.

19. For Valve_Command, click on the Add Dynamic Link button.

20. In the top search bar, type in VentValve, select the Inp_CmdVentValve and click on Select.

NOTE : If you don’t see the tag, go back to step 4 and make sure you selected both tags.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 20


21. The two tags have been linked now to the properties of the object you added and should look like picture below.

In the next section we will add a widget to see if the connection to the controller is working.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 21


Monitoring the Status connection of a controller

1. Open the Template Libraries.

2. You can move the Libraries Popup around on the screen. Go to Widgets, select Station Connection Status
and drag it on the communication screen. Click Close when finished.

Each object in the Libraries has a description and instructions on how to use the objects.
In the Libraries, you can sort alphabetically or choose between list or icons.

All these objects are included in the software and more will added in future updates.
For the object that was just added, you could also use the search bar and search for “Station”, this would
filter all the objects where Station is used in name or description.

The desktop pc is one of the many graphical objects that have been added to the library.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 22


3. Select the StationConnectionStatus1 object, we are going to fill in the Station property.

4. Minimize the folders in the folder view, scroll down to CommDrivers and open the folders by using the icons on
the left of the names until you see the LogixStation1.

5. Drag and drop the LogixStation1 into the Station property of the StationConnectionStatus1 object.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 23


OPC UA
Alolun wants to check the temperature at certain points in the drying oven, he has a rummage around the
engineering store hold in the dingy depths of the ship and finds a Temperature unit, unfortunately it can only
communicate with OPC UA, ah ha lucky for him FactoryTalk Optix has OPC UA functionality at its core.
During this section of the lab, you will help Alolun connect to the OPC UA server and monitor the temperature.

Read about OPC UA Connectivity


Besides these stations/drivers that can be added to FactoryTalk Optix, the software has full OPC UA
connectivity
FactoryTalk Optix is compliant with the OPC UA (OPC Unified Architecture) standard and can communicate
with any OPC UA client or server.
Tip: Devices with a configured FactoryTalk Optix Application can operate as an OPC UA client or server.
Use these components to develop your application logic:
OPC UA nodes
OPC UA server object
OPC UA client objects
OPC UA nodes
FactoryTalk Optix Studio enables importing nodes from the OPC UA server.
OPC UA server
Publishes the nodes of the project information model at runtime. The server publishes all project nodes by
default. You can select which nodes to publish to the assigned users.
Important: You can configure a single OPC UA server object in a project.
The server object enables an OPC UA client to:
Read from the server (listen to events)
Write to the server (invoke methods)
OPC UA client
The OPC UA client object enables the communication with the OPC UA server.
Tip: You can configure unlimited OPC UA client objects in a project.
The client accesses nodes published by the server to:
Read from the server (listen to events)
Write to the server (invoke methods)
You can specify the nodes to the server to import at design time or at runtime. For example, an OPC UA
client can read specific object variables or listen to events generated by alarms.
Endpoint URL
In FactoryTalk Optix, the predefined endpoint URL is opc.tcp://localhost:59100
The URL of an endpoint is composed of these elements:
1) Communications protocol: opc.tcp
2) Network address, expressed in one of the following modes:
Localhost, a keyword that expresses local address.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 24


Hostname, the name of the network device on which the server is hosted.
IP address, the IP address of the network device on which the server is hosted.
Tip: Unless there are specific requirements, Rockwell Automation recommends using the localhost keyword.
3)Port
OPC UA Method Calls
In FactoryTalk optix, you can create an OPC UA method callable by an external OPC UA client and then edit
its code in an external code editor.
[CustomBehavior]
public class testTypeBehavior : BaseNetBehavior
{
public override void Start()
{
// Insert code to be executed when the user-defined behavior is started
}
public override void Stop()
{
// Insert code to be executed when the user-defined behavior is stopped
}
#region Auto-generated code, do not edit!
protected new testType Node => (testType)base.Node;
#endregion
}

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 25


1. In your Project View, You can minimize the UI folder by clicking on the arrow.

2. Now scroll down to OPC-UA, right click and select New > OPC UA Client.

3. On the right side, you see the properties, in the Server Endpoint URL you need to fill in
opc.tcp://AzureWin10:48020

If the field is not completely visible, then try to expand the area by moving your mouse near the border of the
property screen on the left wait until this mouse icon appears , click and drag it to the left to make the
property area larger or smaller.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 26


4. Right Click on OPCUAClient1 > New > OPC UA tag importer

5. Double click on OPCUATagImporter. Make sure the Mode is set to Online in 1 of the 2 locations.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 27


6. Go to Demo > BoilerDemo > Boiler1 and select the Heat and TemperatureSensor tag. Click Apply.

NOTE: If you don’t see any tags, make sure that the OPC UA server is running. (Black windows screen, that
you had to minimize in the beginning)
If it is not running, start the UaAnsiCServer

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 28


7. Go to UI > Screens > Drying > Communications, double click on the Communications screen.

8. Now you are going to add three Base Controls to the Screen, Right click on Communications > New > Base
Controls and select Label. Do these steps also for Spin Box and Button.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 29


9. Open the Template Libraries.

10. You can move the Libraries Popup around on the screen. Type analog in the search area and drag and drop
Analog Item Widget on the screen. Click Close when finished.

11. Now align the 4 objects you just added to the screen like below. Label, Spinbox and Button are located at the top
left corner of the screen.

12. Make sure the padlock is locked for the AnalogItemWidget1. If it is not, you can click on it to lock it.

Means that you can only select the group of objects.


Means that you can select the objects within the group.

13. Select the AnalogItemWidget1.

14. In the Properties section on the right side, next to InputVariable, click on the Set Alias button.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 30


15. In the search area, type in Temperature. Scroll down until you see the OPC-UA folder, select Temperature and
click on Select.

16. Now the tag is linked to the InputVariable.

17. Now select Label1.

18. In the Properties of Label1, Under Text and font section, next to Label1, click on the Add Dynamic link
button.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 31


19. In the search area, type in Temperature. Scroll down until you see the OPC-UA folder, select Temperature and
click on Select.

20. Now the tag is linked to the Text property.

Once we run the application, we’ll explain what the difference is between the two objects.
21. Now select Button1.

22. Under Text and font, change the text Button1 to Heat.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 32


23. At the bottom of the properties, you see events. If you don’t see them, make sure you scrolled down completely,
You can always make that area bigger by making the events area bigger.

24. Click on the + besides MouseClick event.

25. Search for heat or go to OPC-UA > OPCUAClient1 > Objects > Demo > 009_BoilerDemo > Boiler1, click on
Heat and click on Select.

NOTE: If you don’t see the Heat method, go back to step 6 and make sure you also selected the Heat tag.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 33


26. You will now connect the spinbox value to the Setpoint parameter. Click on the Add Dynamic Link button.

27. Search for spinbox1 or go to screen Drying > Communications > Spinbox1 and select Value and click on
Select.

28. The spinbox is now linked to the parameter of the OPC UA Method call.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 34


29. Click on the Emulator Play Button and test the modifications you have done on the Communications
screen.

1. Click on Drying
2. Click on Communication icon
3. Click on Switch to open the release valve, then use the slider to release the extra heat.
4. Use the arrows of the Spin Box or click on the number to change the value between 20 and 100. Then click
on the button Heat to change the temperature.
5. Check if LED is green, if it is red, then contact one of the assistants

You will see that the left value is in Fahrenheit, the value next to the spinbox is in Celsius. The original temperature
from the OPC UA server is set in Celsius. Using the object from the Libraries, all this information is passed to the
object. The default user that is logged in, is based in US and therefor the Engineering units is automatically changed
to Fahrenheit.
Close the Emulator when you have finished testing.
Congratulations you have completed this section of the lab and in doing so allowed Alolun to sit in his cabin and
adjust the Ventilation valve and then see what affect it has on the temperature profile of the drying oven.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 35


Variables, Types and Model

Alolun wants to check the critical variables that affect the quality of the electrode during the calendaring process.
In this section of the lab, you will help Alolun add these variables from the controller, they are stored in a UDT and as
the right side of the calendaring roller setup is the same as the left side, you will help him set up aliases from a type
to save on development time.
Read about FactoryTalk OptixTM Objects
An object is an element that identifies a physical (a motor) or non-physical (a digital alarm) object in the
project.
An object has the following characteristics:
can contain variables
can contain other nested objects (for example a motor can contain objects that represent its components)
has attributes that describe it
Example
In the real world, a motor is a mechanical object with specific operational characteristics, e.g. speed, torque,
acceleration and power.
In FactoryTalk OptixTM, the motor just described is represented with an object (Motor) which contains the
variables corresponding to its functional characteristics (Speed, Torque, Acceleration, Power).

Below is an example of how the same object is structured and displayed in FactoryTalk OptixTM Studio:

Attributes
An object always has the following attributes:

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 36


Object types and instances
An ObjectType is a “model” object from which similar objects will be derived, called instances. However,
instances can contain other specific objects and/or variables.
Creating instances is advantageous in terms of speed and consistency, as any changes made to the type are
automatically made to the instances.
Important
if an object type is deleted, the instances are also deleted.
Example
Let us consider that there is a machine consisting of two identical motors.
Instead of configuring individual objects for different motors, in FactoryTalk OptixTM it is possible to configure
the object type Motor with all its functional characteristics
(the Speed, Torque, Acceleration and Power variables) and use it to derive multiple instances, in the
example Motor1 and Motor2.

Read about FactoryTalk OptixTM Information Model


Nodes and information model
In FactoryTalk OptixTM, all the objects, object types, variables, variable types and methods are generically
defined as nodes.
The concept of information model indicates the set of nodes that describes the structure and characteristics
of a node in the project. Each object, variable, type or method is therefore described by its own information
model.
Example
A motor consisting of two parts, a stator and a crankshaft, can be represented by the following information
model. All the elements described are nodes, in particular objects (in blue) and variables (in pink).

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 37


Information Model of a Project
The set of all objects, variables, types and methods in a FactoryTalk OptixTM project is conventionally
defined project information model.
Example

Below is an example of how the different nodes of a project are displayed in FactoryTalk OptixTM Studio. The
project information model is the information model of the MyProject root node.
The nodes are organized in folders for better project readability.

Information models to represent physical objects


Generally, it is recommended to structure the project to mirror as much as possible the machine structure for
which the application is created; the project is thus more readable. Also, in the case of applications for
modular machines, it is convenient to represent these modules by structuring them similar to the physical
world; this is to facilitate their reuse in the project.
Example
Below is a partial example of a project in which the structure of the objects mirrors the structure of the
machine:

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 38


Read about Alias
Introduction
An alias is a particular variable type that points to a source node indicated by its unique identifier
(NodeId attribute). It links two areas of the project information model and makes it possible to set up dynamic
links to create particular dynamic logics that would otherwise be impossible.
An alias is created in an object, or type of object, generically defined as parent node. The source node it
points to identifies the source area, which includes the same source node and all its child nodes.
Note
Typically aliases are created in graphical objects or in folders containing graphical objects, to create dynamic
user interfaces (for example, when creating a widget that represents a motor type and that dynamically
shows the values of different instances of the same type).
A short overview of how an alias works
This diagram summarizes how aliases work. In object A there is an alias that points to the source node B.
From node A and/or any of its child nodes, dynamic links can be created with node B and/or any of its child
nodes.

Dynamic links between aliases


When an alias is not exploited, a dynamic link is created via a relative reference/path from a parent node to
the source node.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 39


When an alias is present, stronger dynamic links can be created. In fact, thanks to its reference to the source
node unique ID (NodeId attribute), the alias acts as an ”intermediary” between the parent node and source
node,
Below is an example where it is wanted to set the value of node C3 using the dynamic link to node B2. In the
first case a dynamic link is used and the reference is ../../B/B2. In the second case, thanks to the alias set on
node C, the link is set up exploiting the alias and the reference is {B}/B2.

When to use aliases


Aliases need to be used to set up dynamic links in the following cases:
When the dynamic link source node, and therefore its child nodes, exist only at runtime (e.g. the session
node). In this case, at design time a link is set up towards a node of the fictitious source area made available
by the alias.
When the dynamic link source node, and therefore its child nodes, also exist at design time, but can change
at runtime by effect of the set dynamic logics (e.g. in the case of widgets).
An alias is also useful as a ”shortcut” for creating dynamic links to recurrent nodes of interest, without
therefore having to look for the same source node every time. At design time, in fact, the source nodes are
grouped and easily accessible in the dynamic links window, while at runtime it is sufficient to know the name
of an alias to access the node to which it points.
Kind alias property
An alias always contains a Kind property, whose value is a reference node. More precisely, it is a reference
to the object/variable type from which the source node derives, or, if the source node is not derived from a
type, a reference to the same source node. The reference node is required to describe the source node
information model. In fact, the alias displays the source area nodes to the parent node and to all its child
nodes based on a known information model, which corresponds to the Kind node model.
When the source node of an alias is set, FactoryTalk OptixTM Studio automatically assigns a value to
the Kind property. For example, if the source node is a Motor instance, the Kind property points to
the Motor node.
However, when the source node of an alias is set at runtime only, e.g. in the case of widgets, the Kind node
must be specified. Thus links can be created in the dynamic links window by exploiting the nodes of
the Kind node information model, which at design time represent the actual project nodes at runtime.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 40


How aliases appear in the dynamic links window
In FactoryTalk OptixTM Studio, in the dynamic links window, the aliases are grouped in the Alias folder, except
for the aliases for Dynamic panel objects generated automatically by FactoryTalk OptixTM Studio, which are
grouped in a specific Dynamic panels folder.

In the window, each alias is identified by a node with icon and its name in curly brackets. The node can
be expanded to navigate the information model of the node to which the alias points, and to select the source
node of the dynamic link.

1. Let’s collapse all the open folders. Right Click on the Application name and select Collapse all.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 41


2. Open the Model > Calendaring until you see the folder Variables.

3. Open the Template Libraries.

4. Open folder RA1701, drag and drop the Calendar_RollerType into the Variables folder.

5. Select Calendar_Rollers1.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 42


6. In the property pane on the right, Change the name Calendar_Rollers1 to Calendar_Rollers_Left. Next to
Alias1, select the Dynamic link icon.

7. Type in the search area CalendarRollers and select the CalendarRollersLeft and click on Select.

8. Right click on Calendar_Rollers_Left, select Copy.

9. Right click on the folder Variables and select Paste.

10. Select Calendar_Rollers_Left1.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 43


11. In the property pane on the right, Change the name Calendar_Rollers_Left1 to Calendar_Rollers_Right.
Next to Alias1, select the Dynamic link icon.

12. Type in the search area CalendarRollers and select the CalendarRollersRight and click on Select.

Now both tags have been added from a Type that was created in the Library.

In this section, you created 2 variables/tags in the model which is the internal tag database. The tags
Calendar_Rollers_Left and Calendar_Rollers_Right are both based on a Type which is similar to a UDT in
the controller. So the 2 tags are an Instance of the Calendar_Rollers (Type). The 2 instances are setup so
they use Min, Max and Engineering unit. We could have used the controller tags straight in the application
but is some cases customers might want to use controllers from a different brand.
This way they just need to link the controller tags to the model tags and they will use the model tags in the
application.
The 2 tags that were linked to the Instances (Tags) in the model are based on a UDT called
Calendar_Rollers_UDT.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 44


13. Double click on Variables screen under Screens > Calendaring.

14. Open the Template Libraries.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 45


15. Open folder RA1701, drag and drop the Calendar_Roller_Image and Calendar_Roller_Widget on the
screen and close the Libraries.

16. Select Calendar_Roller_Widget1, on the right Property pane, select Set Alias.

17. Type Calendar_Roller in the search area, scroll down until you see the Model and click on
Calendar_Roller_Left and click Select.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 46


18. Right click on the Calender_Roller_Widget1 and select Copy.

19. Right click on the Variables folder and select Paste.

20. Move the object Calendar_Roller_Widget2 to the right side, like the picture below

When you click on the padlock next to a group of objects, you can lock it which makes it easier to select and
move around the screen.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 47


21. Select Calendar_Roller_Widget2, on the right Property pane, select Set Alias.

22. Select the Calendar_Roller_Right tag which is below the Calendar_Roller_Left tag and click on Select.

23. Change the text next to Left_or_Right to Right.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 48


24. Click on the Emulator Play Button and test the modifications you have done on the Communications
screen.

Close the Emulator when you have finished testing.

Congratulations you have completed this section of the lab and now Alolun can visualize the calendaring
machine roller’s critical data.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 49


Display Design Concepts

Display construction

In this section of the Lab you will help Alolun learn the fundamentals of constructing Displays with FactoryTalk
OptixTM . You will help him learn about Containers, Widgets, Style sheets, Objects, Types, the Information model,
Aliasing and Instances and how they are used in FactoryTalk OptixTM.

Read about Graphical objects organization


Introduction
The objects that make up the user interface of a FactoryTalk OptixTM Application are organized in
the UI folder.
All the graphical objects directly children of the UI folder, or of one of its subfolders, are object types; they are
then available in the Types panel to create instances.
Hierarchical organization
Typically a user interface is organized in a hierarchical way, that is the different elements that compose it are
organized in a tree in a more specific way according to their function.
The hierarchy of graphical objects within the information model is determined by graphical object containers,
the only ones that can contain other graphical objects. The position of the objects in the information model
determines their position in the layout, at both design time and runtime.
Window
The Window object is the root container graphical object. It must be present when you want to generate a
FactoryTalk OptixTM Application with a user interface. Inside, all the objects that make up the user interface
and the related logics are organized.
It is possible to create several Window objects, to associate with different Presentation engines. For this
reason, a Window object can only exist as a type.
Panels
A panel is a type of container that aggregates several relevant graphical objects. The navigation in a
FactoryTalk OptixTM Application typically takes place between the different panels set up.
User interface navigation
Navigation within a user interface can be created both with graphical objects dedicated to navigation (for
example the Navigation Panel and Dynamic Panel objects) and with customized logics within NetLogic.
The objects dedicated to navigation include interaction mechanisms and runtime logics to navigate between
different set panels. Such objects at runtime create and delete GUI nodes depending on the user’s
navigation.
For the description of the objects for navigation refer to the Reference on objects and variables section of this
manual.
Reusable graphical objects: widget
Typically, in a user interface it is necessary to consistently present - at runtime - and efficiently manage - at
design time - structures of nodes that are identical but associated with different data. To do these types of
graphical objects are needed with which to create identical objects. These types are conventionally defined
as widgets. A widget can be a single graphical object or a group of graphical objects, designed for a specific
purpose of display in the user interface and which includes all the necessary logic, created with dynamic links
and/or NetLogic.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 50


Note
the association with different data in the various instances of the same widget is typically done through an
alias, defined in the widget.
For example, a MotorWidget widget might consist of a panel containing a Circular Gauge object to display
speed and two labels to describe the numeric values of speed and torque. The widget can be created at
design time or at runtime for each motor whose values you want to display. Since the widget is an object, any
changes to the widget structure and formatting propagate across all instances.

Concepts of layout
Introduction
The layout of a user interface in a FactoryTalk OptixTM Application depends on the following elements:
the organization of the graphical objects in the information model
the value of the positioning (alignment and margins) and sizing (width and height) properties of the
graphical objects
the order of the graphical objects on the z axis
the size and aspect ratio of the screen on which the interface is displayed.
Margins, padding and borders
Below is an example of Text box object to present the meaning of the
terms content, margin, padding and border:

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 51


Content: Content text
Padding: space between the content and the edge of the object. Both horizontal and vertical padding are
values relative to the height of the text contained (for example, if the padding is 60%, a label with text 20
pixels high has padding of 12 pixels).
Note
the padding is present only in the Text box, Button, Spin box, Data grid, Drop-down and List
selection objects.
Edge: edge of the object, in the example in red
Margin: space between the edge of the object and the edge of the parent object (container)
Note
The padding, edge thickness and edge corner radius, if any, are global style properties defined in a style
sheet.
Positioning of the objects
The positioning of a graphical object is determined by its alignment on the x and y axes and by its margins
with respect to the sides of the container object. The margins to be set depend on the alignment set, or the
value of the Horizontal alignment and Vertical alignment properties.
The position of objects on the x and y axes in the layout is always relative to the position of the container. If a
container is moved, then all the child objects are also moved.
The position of objects on the z axis compared to other child objects in the same container is determined by
its position in the information model. Objects further down in the information model are higher up on the z
axis.
For a description of all properties related to the positioning, refer to the properties of graphical objects in
the Reference on objects and variables section of this manual.
Size of the objects
The size of a graphical object is defined via the Width and Height properties, only if the alignment on the x
and/or y axes is left, right or center.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 52


If the value(s) of the Width and/or Height properties is/are deleted, the two dimensions take on
the Auto value. In this way, for some objects the size is determined by the intrinsic content (for example the
text in a Text Box object) or by other contained nodes (for example graphical objects in a Panel object). For
example, the height of a Text box object with Height = Auto equals the height of the text, plus any padding
set in the style sheet.
If the alignment on the x and/or y axes is set to Adjust, the width and/or height assume the dimensions of the
container, minus any margins. This setting makes the size of the object dynamic relative to the size of the
container.
Note
It is not possible to scale in percentage the size of an object inside a container with respect to the size of the
container itself.

1. For this section we are going to open a new screen. Go to UI > Screens > Calendaring and double click on
Display_Design.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 53


2. Now we are adding a Horizontal layout, right click on Display_Design > New > Containers and select
Horizontal layout.

3. In the properties, select next to Vertical alignment, Bottom.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 54


4. For Width and Height set them to -1 which means they are set to Auto mode, for Left and Bottom margin,
set the value to 10.

Next you will add three buttons and set two of them to set different project Style Sheets and the third will be
configured to open a pop up.
Having a style sheet that changes all the display properties of a project is very useful for Alolun, especially
the Dark style sheet as the displays can be very bright in the darkness of space.
Read about FactoryTalk OptixTM Style sheets
Introduction
In FactoryTalk OptixTM, a Style sheet object makes it possible to globally set some style properties of all
graphical objects in the project, or of specific object classes (for example, the properties of Switch objects).
The style properties are then inherited, starting from the style sheet, by the different types and instances in a
project.
Style sheets can be thought of as the same as Themes in windows.
Multiple style sheets can be created in the same project. This can be useful, for example, to allow the user to
switch between a light tone interface and a dark tone interface at runtime.
Note
FactoryTalk OptixTM includes some style sheet templates, available in the templates window (see Use object
and variable templates).
Inheritance of style properties
If the same property is set at more than one level, for example, if the text color is set in both the style sheet
globally and on a custom Label object type, the property is given a value on the single object according to
this order of decreasing priority:
property set on the instance
property set on the type from which the instance derives
property set in the style sheet for the specific object class
property set in the style sheet globally
If the value of a property is set to Default, the value corresponds to the value set at a higher level, in the
same order of priority as above. For example, if the value of Text color is Default on a Label instance, the
value set is the first one found for the same property at the type, object class or global level, in that order.
Example properties that can be set with a Style sheet.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 55


5. Select the HorizontalLayout1, right click on it, go to New > Base Control and select Button.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 56


6. Under HorizontalLayout1, you see Button1. Select the Button1 and set the Left margin to 10.

7. Select Button1 and right click and click on Copy.

8. Select Button1 and right click and click on Paste.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 57


9. Now you can add one more button as you did before so that you have 3 buttons in the Horizontal Layout.

10. Select Button1, under Text and font in the properties area, change the Text from Button1 to Dark.

11. At the bottom of the properties, under Events, select the + at the end of MouseClick event.

12. Go to Commands > Variable commands and select Set variable value and click on Select.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 58


13. Click on Select node

14. Go to UI > NativePresentationEngine and select Style Sheet (Pointer) and click Select.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 59


15. Click on the arrow for the Value property and select FriendlyDark1.

Now you are going to do the same for the second button but link it to the DefaultStyleSheet. Try it yourself
or you can follow the instructions below
16. Select Button1, under Text and font in the properties area, change the Text from Button1 to Default.

17. At the bottom of the properties, under Events, select the + at the end of MouseClick event.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 60


18. Go to Commands > Variable commands and select Set variable value and click on Select.

19. Click on Select node.

20. Go to UI > NativePresentationEngine and select Style Sheet (Pointer) and click Select.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 61


21. Click on the arrow for the Value property and select DefaultStyleSheet.

22. Select Button3, under Text and font in the properties area, change the Text from Button1 to Popup.

23. At the bottom of the properties, under Events, select the + at the end of MouseClick event.

24. Go to Commands > UI commands and select Open dialog window and click on Select.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 62


25. Click Add node.

26. In the search bar, type in Popup and press enter. Select the Popup1 under the Calendaring Screen and
click Select.

27. Right click on the screen name Display_Design, select New > Containers and then select Accordion.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 63


28. In the properties section of the Accordion1, set the Width to 1000 and check the other numbers match the
screenshot.

29. Under the Accordion1, you see Content, right click and go to New > Drawings and select Image.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 64


30. Select Image1 then in the properties area, click on Browse next to Path.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 65


31. Double click on the images folder and select RA_TopCircle4.svg

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 66


32. Under Size and Layout of the image1, set the properties as below.

33. Open the Template Libraries

34. You can move the Libraries Popup around on the screen. In the search type Color and press
enter. Drag and drop the Color picker on the screen next to the image. Close the Libraries.

35. In the properties windows of the Colorpicker1, click on Set Alias.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 67


36. Go to Calendaring > Display_Design > Image1 and select Dynamic color. Click on select

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 68


37. Click on the Emulator Play Button to test the modifications you have done. Go to Calendaring, click on
the second menu item and then the display screen.

1. Dark : you selected the Friendly Dark StyleSheet


2. Default : you selected the default Stylesheet that was created for the project
3. A popup with switch, analog gauge will open
4. When you click on the Accordion, the accordion will open and show the image and the color picker.
When you change the values using the analog gauges and click on Apply, you will see the color of the
image change.

Close the Emulator when you finish testing.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 69


Read about Widgets
Custom widgets:

These included widgets show the full versatility of FactoryTalk OptixTM, you can consider this IDE as a blank
page with a fancy pencil, you can design and develop anything you want using basic elements. In this lab we
provided a Moving Analog Indicator like the one found in Studio5000 that assists in the Situation Awareness
of the operator and replicated them using a mix of panels and rectangles, animation of indicating arrow is
done by passing a variable value to the “bottom margin” of the arrow itself. Using aliases you can in fact pass
any type of object to a type and do some elaboration depending of the status/value of the alias. When you
finished drawing these custom widgets you can drag them into your personal Template Library and store
them for future projects or to share it with other colleagues.

1. Browse to UI > Screens > Drilling and double click on Widgets to open the display editor.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 70


2. Open Template Libraries

3. Go to folder Widgets and drag and drop Tag Grid and Multi-State Selector on the screen.

4. Now go to folder RA1701 and drag and drop Trending_Drilll_Bits to the screen next to the multistate
selector.

5. In the project pane, make sure that that the Trending_Drill_Bits1 and MultiStateSelector1 are both
locked. That makes it easier to configure and move the objects around the screen.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 71


6. Select the TagGrid1 in the project pane. In the Property pane, select Dynamic link.

7. Type in search Val_GuidanceSegment, select the Val_GuidanceSegment tag and click on Select.

8. Select the MultiStateSelector1 and change the values as shown below.

9. Select the Trending_Drill_Bits1, in the right property pane, click on the add Dynamic link for Selector
property.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 72


10. Go to UI > Screens > Drilling > Widgets > MultiStateSelector1, select Value and click on Select.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 73


11. Now click on the Emulator Play Button and test the modifications you have done.

1. Select Drilling
2. Select tab 4
3. Select the widgets icon
4. By changing the multi State Selector, you will see the values change in the trend between Nothing and
Drill bit 1 to 3.
5. This object shows the values from the controller by just adding the tag to the object.

Close the Emulator when you finish testing.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 74


Display Containers

Containers
FactoryTalk OptixTM applications can be navigated using two solutions:
Panel loader: a page display that can be navigated using buttons or UI commands, browsing can be done
with buttons, scripting or events, at design time or run time
Navigation panel: a tab-style navigation menu, all pages are added at design time and browsing is done
manually interacting with top bar
ScaleLayout is a specific container used in a project to resize automatically its children maintaining objects
proportions, this is a very useful container to use for deploying projects on HMIs with different screen sizes
without user modifications.

Congratulations you have completed this section of the lab and now Alolun has a complete grasp of the
fundamentals of Containers, Widgets, Style sheets, Objects, Types, the Information model, Aliasing and
Instances and how they are used in FactoryTalk OptixTM. He can now go and enjoy a game of zero Gravity
Badminton.

Actually, he is so excited he’s going to go off and redesign the whole of his HMI, we can’t wait to see what
he comes up with (spoiler alert, we don’t have to wait for too long, it’ll be in the FactoryTalk Optix Advanced
Lab).

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 75


Licensing

Alolun has been doing a lot of modifications to the HMI system recently and as he is a loyal and honest Ardvarian
and he doesn’t want any features he has implemented to stop running after 2 hours because he doesn’t have the
correct number of tokens for the number of functions, he wonders if there’s a way to find out the number of tokens
that his project is using.
Alolun knows that FactoryTalk OptixTM Development Studio and Runtime will run fully functioning for 2 hours without
licenses, he also knows that any functionality not covered by the number of tokens will stop after 2 hours.
In this section of the Lab you will see with Alolun the licenses token(s) that FT OptixTM Runtime uses and how to see
how many a particular project is going to use.

1. Start the Emulator (F5) or by clicking the Emulator Play Button .

2. Open Emulator Output in FT Optix Design.

3. Take note of how many licenses token(s) FT Optix Runtime using.

4. Navigate in the runtime application and find this information in Calendaring Machine.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 76


Read About Licenses & Tokens
The tokens are free floating and not tied to a specific feature.

Close the Emulator when you finish testing.

Congratulations you have completed this section of the lab and in doing so put Alolun’s mind at ease and he
can go and enjoy a lovely glass of his favorite beverage in the ship’s canteen.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 77


Language Switching and Locales

Alolun tries to be a good ship owner and captain to his crew, to this end he is going to make their lives easier and set
the HMI up so that it switches languages and locales. Although there is a universal translator available and even the
environmentally friendly Babel fish on the market, these only do audible not visual translations.
In this section of the Lab, you are going to help Alolun configure language switching and Locales.

Read about Babel fish

Read About Languages and Locales


Every tab can be customized with localized text or icons using the properties column.
Translations are stored in a specific table, each line corresponds to a translation key, for each key there will
be a column per language.

Note : Translations have already been added with English, Italian and German for each key.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 78


This will be the result:

Read about Locale


Introduction
The term locale means the set of display settings of a user interface based on language and country. It is
represented by a label called locale ID, made up of language and country (e.g., en-US, en-UK, it-IT etc.).
A project can support multiple locales. The locales supported by the project are set in the Locales property of
the project node.
In multilingual projects, the Presentation engine displays the interface based on the session locale, if
configured, and the texts displayed based on the translations available in the LocalizationDictionary object.
Locale IDs
The Locale ID specifies a language and a country, e.g. en-US, en-UK, it-IT. In particular, the second
segment determines the date and time format, the date separator and the measurement system
(International Measurement System, United States Customary System or British Imperial System).
Session locale
The session locale determines the locale of the user interface (i.e. the translation of the texts according to the
project settings), the data display format, and the conversion of all values according to the required
measurement system. It is set at runtime based on the user or object locale UI Session Session UI.
Note
If there are no locale settings at the user or Session UI object level, the session locale is set based on the
locales supported by the project: in particular, the first locale in order of writing in the Locales property has
priority (see Fallback locale).
Fallback locale
If the user-determined session locale is not configured in a project, or if translations of some interface texts
are not available for the session locale, the texts are displayed in the project fallback locales, configured in
the Fallback locales for translations property of the project node.
Note

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 79


When there are multiple fallback locales, at runtime the system uses the fallback locale based on the order of
insertion of the different locales in the Fallback locales for translations property. If the list of fallback locales
contains the locale not supported by the project, this fallback locale takes priority over the others.
User locale
The user locale is personal data used at runtime to set the session locale. It is set in the LocaleIds property
of the objects User User.
Through C#, using the APIs that return nodes (see Access to project nodes), it is possible to set multiple
locales for the same user, i.e. alternative locales if the FactoryTalk OptixTM Application does not support the
main locale. The order in which the user locales are shown determines their priority for setting the session
locale.
When the session locale is set automatically at runtime based on the user locale, if none of the user locales
are configured in the FactoryTalk OptixTM Application, the session locale is set based on the project fallback
locales.
Locale through Session UI
The UI Session Session UI object is useful for managing the session locale in multilingual projects for which
there is no information on the user locale, and therefore the user is asked to choose the locale at runtime.
For the configuration, see Configure the selection of the locale at runtime through the Session UI object.
Customized combinations of language and measurement systems
The traditional locales determine the measurement system based on the country indicated in the locale ID. In
any case, through the Session UI and User objects, it is possible to associate a measurement system of your
choice with a language supported by the project. For example, it is possible to select Italian (it-IT) as the
display language, but the US system of measurement (United States Customary System), which also
determines the data display format.
Customized measurement systems
At runtime, FactoryTalk OptixTM displays the data relating to the physical quantities in the measurement
system required by the session locale.
In any case, it is possible to display the physical quantities in units of measurement other than the standard
units of the reference metric system, or create customized units of measurement.

1. Go to the Language Switching in UI > Screens > Calendaring > Language_Switching

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 80


2. Adding three Button for English, Italian and German language switching (Object Name: EN_Btn,
IT_Btn, DE_Btn).

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 81


3. Configuring English Language Switching button (EN_Btn)

a. In the Properties/Text, click on the pen and select English(English) from the list using

arrows and enter keys.

b. In the section Events/MouseClick event click on +.

c. In the Commands/Variable commands select Set variable value.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 82


d. In the section Events/Method/Input arguments/VariableToModify click on the dynamics

link icon

e. In the Aliases/{Session}/Session select ActualLanguages.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 83


f. In the Events/Method/Input arguments/Value click on and select en-US.

Note: Repeat steps a - f above for Italian (ITA_Btn) and German (DE_Btn) language switching respectively.
The Value (in Events/Method/Input arguments/Value) for Italian and German language are it-IT and de-
AT, respectively.

4. Now run the Emulator by clicking the Emulator Play Button ., click on the Calendaring tab.

5. Close the emulator when you have finished testing.


Congratulations you have completed this section of the lab and in doing so Alolun’s crew can understand
the easily understand the HMI.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 84


Datalogging

Alolun is noticing that there are some discrepancies in the coating of the Anode electrode through the Calendaring
machine when he checks the porosity of the calendared electrode with the Scanning Electron microscope. He thinks
this might be down to inconsistent calendaring roller pressures, so he is going to record the pressures over time in a
database to analyze later.
In this section of the Lab, you will help Alolun configure a DataGrid looking at an embedded database that has been
populated with a Datalogger. You will use a widget to configure the Datalogger.
This will be the result:

Creating a DataLogger with the widget.


1. Click on Open Dashboard Page in the Main Toolbar and click on I want to configure a data logger.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 85


2. First, you need to create a new data logger. Click on New data loggers. You will log Cylinder Pressures of the
Calendar, so you can rename the new data logger to CylinderPressures.
Leave all the other settings as default. The result should be like this.

Click Next.
Select CylinderPressures and click Next.

3. Now, you need to create a database or select an existing database.


Select EmbeddedDatabase if already present, otherwise select New database with:
- Name: EmbeddedDatabase.
- Type: Embedded

Read About Databases


Database – In this section of the lab you will use an Embedded database, but with FactoryTalk OptixTM you
can also use an ODBC connection.
- Embedded database: An object that represents an SQLite database internal to the project at runtime.
You typically use an Embedded database object to manage data supporting other objects within the
FactoryTalk OptixTM Application. An embedded database has no read/write limits.
- ODBC store table: An object that represents a local or remote database supported by the Open
Database Connectivity (ODBC) protocol. You can use ODBC to query or populate a remote database
maintained with other systems that contains data for the project. Depending on the access management
policy of an external database, the external database can have read/write limits.
Tip
A best practice is to use the same Database with different tables inside it, instead of creating different
Databases for the same project. In this way, you need less tokens for licensing and less nodes are used, so
less RAM is used as well.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 86


Click Next and select False for the property In memory. After this step, you should have this.

Click Next.

4. Select the tags to log. In this lab you can select the Calendar Cylinder Pressures.
Browse to Model > Calendaring > CylinderPressures and select the four variables in there.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 87


Click Next.
You have now configured the CylinderPressures Data logger to log 4 variables and added it to the
EmbeddedDatabase.
Click Exit.

Adding a DataGrid to a Screen.


1. Browse to UI > Screens > Calendaring > Datalogging and right click on Datalogging > New > Data Controls
> DataGrid.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 88


2. Rename the object to DataGrid by clicking on the pencil on the right of the name.

3. Click on DataGrid object and set its Properties to:


- Horizontal alignment: Left
- Vertical alignment: Top
- Width: 1200 px
- Height: 450 px
- Left margin: 10 px
- Top margin: 105 px

4. Now, you need to add a Model to the Datagrid to view the Cylinder Pressures.
To do that, browse to Loggers and drag the CylinderPressures logger to the Datagrid.

Notice that now the DataGrid is populated.

5. Click on Datagrid and have a look at the properties.


Notice the Auto refresh time. This is set to 0 by default, meaning that the DataGrid does not refresh
automatically. To automatically refresh the DataGrid every second, change the Auto refresh time value to
0000:00:01.000.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 89


6. Launch the Emulator by clicking on the Emulator Play Button in the Main Toolbar.

Click on the Calendaring tab and click the third icon on the left and then the third icon again to show the
Datalogging.

Close the Emulator when you finish testing.

Congratulations you have completed this section of the lab and in doing so have allowed Alolun to study the data
stored in the database to see if he can spot an anomaly.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 90


Trending

Alolun is noticing that there are some discrepancies in the coating of the Anode electrode through the Calendaring
machine when he checks the porosity of the calendared electrode with the Scanning Electron microscope. He thinks
this might be down to inconsistent calendaring roller pressures, so he is going to record the pressures over time in a
database and then monitor them on a trend.

In this section of the Lab, you will help Alolun configure a Trend to show both live and historical data of Calendaring
Cylinders Pressures.
This will be the result:

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 91


Adding a Data Trend to a screen.
1. Browse to UI > Screens > Calendaring > Trending. Right click on Trending and select New > Data controls >
Trend.

2. Rename the object to Trend by clicking on the pencil on the right of the name

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 92


3. Click on Trend object and set its Properties to:
- Horizontal alignment: Left
- Vertical alignment: Top
- Width: 1200 px
- Height: 450 px
- Left margin: 50 px
- Top margin: 105 px

Creating a Datalogger and a DataStore


You need to create a Datalogger to log data from Cylinders Pressures.
If you already created the Datalogger CylinderPressures and the DataStore EmbeddedDatabase from a
previous section of the lab, you can skip this part.

1. Right click on Loggers > New > Data logger.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 93


2. Rename DataLogger1 to CylinderPressures.
Click on CylinderPressures and select the icon in the Properties panel.

You should see in the Object Editor all the selectable variables.
3. Select the variables to be logged.
Browse to Model > Calendaring > CylinderPressures and select all the four variables in that group.

Click on Apply.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 94


4. Create now a DataStore.
Right click on DataStores > New > EmbeddedDatabase (if you already have the EmbeddedDatabase in your
project, you can skip this part).

5. Rename EmbeddedDatabase1 to EmbeddedDatabase.


Now, you should assign the Data logger to the Database.
To do it, click on CylinderPressures and assign the EmbeddedDatabase to the Store property.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 95


6. Click on EmbeddedDatabase and Verify that CylinderPressures is a Table in the properties tab.

Adding Pens to the Trend


1. Browse to UI > Screens > Calendaring > Trending and click on Trend.
Drag CylinderPressures to the Model property of Trend.

2. In the Trend Properties, click the plus symbol on the right of Pens to add a new pen. Add 4 pens to the trend.
3. Rename TrendPen1 to Crown Cylinder Pressure Left.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 96


4. Select the Add dynamic link symbol close to Crown Cylinder Pressure Left and browse to Loggers >
CylinderPressures > Variables to log > Out_CrownCylinderPressureLeft > Last Value.
Click Select.

Change the Thickness property to 2.


Change the Color to Blue (click on the pencil, write “blue” and press Enter).

5. Repeat the above operation for TrendPen2, TrendPen3 and TrendPen4.


a. Rename the three pens as follows:
TrendPen2: Crown Cylinder Pressure Right
TrendPen3: Gap Cylinder Pressure Left
TrendPen4: Gap Cylinder Pressure Right

b. Select the Add dynamic link symbol close to Crown Cylinder Pressure Right and browse to
Loggers > CylinderPressures > Variables to log > Out_CrownCylinderPressureRight > Last
Value.
Click Select.
Change the Thickness property to 2.
Change the Color to Red (click on the pencil, write “red” and press Enter).

c. Select the Add dynamic link symbol close to Gap Cylinder Pressure Left and browse to Loggers >
CylinderPressures > Variables to log > Out_GapCylinderPressureLeft > Last Value.
Click Select.
Change the Thickness property to 2.
Change the Color to Lime (click on the pencil, write “lime” and press Enter).

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 97


d. Select the Add dynamic link symbol close to Gap Cylinder Pressure Right and browse to Loggers >
CylinderPressures > Variables to log > Out_GapCylinderPressureRight > Last Value.
Click Select.
Change the Thickness property to 2.
Change the Color to Purple (click on the pencil, write “#800080” and press Enter).

The Trend properties should look like this.

As default, the trend has a Refresh time of 2s. You can change it from the Properties of the Trend.
You can also configure the X axis and the Y axis. You can choose if the axes should be interactive or not.
The X axis can be set to automatically scroll forward in time during runtime by setting the Follow property to
True. The Y axis can be set to automatically scale at runtime to resize the trend graph according to the
values being displayed, by setting the Automatic scaling to True.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 98


6. Launch the Emulator by clicking on the Emulator Play Button in the Main Toolbar.
7. Click on the Calendaring tab and click the third icon on the left and then the second icon to show the Trending.

8. Notice that if you change page and go back again in the Trending page, the Trend is already populated. This is
because you are logging both live and historical data.
9. Familiarize yourself with the Trending and close the Emulator when you have finished.

Congratulations you have completed this section of the lab and in doing so have allowed Alolun to trend the data
that he wanted to help him solve the annoying inconsistencies in quality.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 99


Alarming

Alolun although the ship’s owner, captain and chief bottle washer is an engineer at heart, he has alarms occurring on
his HMI and would like to set up some new ones and investigate the functionality of the objects that are displaying
these alarms and allowing him to interact with them.
You are going to help Alolun configure a digital and an analog alarm. You will also help him to add an Alarm Banner
and Alarm Grid to visualize the real time alarms, and an Alarm History Grid to visualize the historical alarms.

This will be the result:

Read about FactoryTalk OptixTM Alarms


Introduction
An alarm is a significant event regarding the process or status of the machine, typically linked to anomalies
that require the attention or intervention of the operator. An alarm event occurs, and therefore the alarm
is activated, particularly when the value of a monitored variable (e.g. a temperature variable, or a variable
dedicated to signaling a specific alarm) is different from one or more values set as “normal”.
When a PLC with a non-OPC UA server is used, the PLC variables to monitor have to be imported into
FactoryTalk OptixTM and referenced in alarm type objects.
On the other hand, if your application communicates with an OPC UA server, FactoryTalk OptixTM can
natively communicate with these servers through the OPC UA client object. In particular, it can automatically
read the alarm events exposed by the server, their relative statuses, and all other available associated
information.
FactoryTalk OptixTM makes it possible, through various objects and widgets, to display alarm data at runtime,
to acknowledge them and confirm them.
Alarm types
In FactoryTalk OptixTM Studio, different objects are available for different alarm types. These objects
generate an alarm event at runtime when the monitored variables reach the set critical values.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 100


Exclusive and non-exclusive alarms
All the alarms except digital alarms are called Limit alarms. In these alarms, it is possible to set up to four
limits through the Low-low limit, Low limit, High limit and High-high limit properties. Depending on the
alarm type, these limits determine values or ranges of values in which the monitored variable can be found.
The alarm can signal one or more limits reached:

Native widgets to view and manage alarms


The Alarm grid widget makes it possible to display and manage the alarms at runtime. View the information
on alarm events (timestamp, name, source variable, message, severity) and its statuses (active,
acknowledged, confirmed) in a table and allow the user to acknowledge and confirm one or all the alarms
with dedicated buttons.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 101


The Alarm history grid widget displays the log of alarm events recorded by a suitably configured event
logger (library object Alarm events logger) in a database. View the information on alarm events (timestamp,
name, source variable, message, severity) and its statuses (active, acknowledged, confirmed) in a table.
Every row in the table corresponds to a change in status of the alarm event.
The Alarm history grid with filter widget displays the logged data in the same way and makes it possible to
filter them temporally.
Custom alarm types and instances
To customize native alarm types with additional properties, custom alarm types can be configured. Typically,
custom alarms are configured to display columns with additional information in the Alarm Grid, for example,
the name of the mechanical system affected by the alarm, or to be able to filter the alarms in the grid
according to a specific criterion.
Creating custom alarm types also guarantees efficiency and consistency, since it is possible to derive their
instances.
Example
Let us consider that there is a machine with several temperature detectors.
Instead of configuring individual alarms for the different detectors, in FactoryTalk OptixTM it is possible to
configure the TemperatureAlarm alarm type with a custom DetectorID field specific for the ID of the
detector connected to the monitored variable.
By creating instances of TemperatureAlarm in the Alarm Grid, it is possible to distinguish the DetectorID at
the origin of the alarms and filter the alarms in the grid according to a specific value of DetectorID.
Branching enabled
At runtime, if the same alarm activates repeatedly, by default the related alarm object in FactoryTalk OptixTM
only signals the most recent event and displays it in the Alarms grid widget. The alarm must then be
acknowledged and confirmed. Disappears if the relative variable returns to its normal status in the PLC.
However, using the Alarm branching property of the project node, it is possible to enable the signaling of
multiple active alarms for a same alarm object. In the Alarms grid widget, all the active alarms for a same
alarm object are then displayed, which must all be acknowledged and confirmed. The alarms stop if the
related variables return to normal status on the PLC.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 102


Adding a Digital Alarm.
1. Right click on Alarms and select New > Digital alarm.

2. Rename DigitalAlarm1 to DigitalAlarm, by clicking on the pencil on the right of the object.

3. On the Properties Pane, select the Input variable.


Click on the clip symbol on the right of Input variable and write on the search box Alm_DigitalVariable. Select
the variable Alm_DigitalVariable.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 103


4. Write in the Message a message related to that alarm. For example, type “Digital Alarm is Active”.
Your configured Alarm should be like this.

Adding an Analog Alarm.


1. Now you will add an Analog Alarm. The procedure is the same as adding the Digital Alarm.
Right click on Alarms and select New > Exclusive level alarm.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 104


2. Rename ExclusiveLevelAlarm1 to AnalogAlarm, by clicking on the pencil on the right of the object.
3. On the Properties Pane, select the Input variable.
Click on the clip symbol on the right of Input variable and write on the search box Alm_AnalogVariable. Select
the variable Alm_AnalogVariable

4. In this example, you will set the High Limit. In this way, when the Input variable overcomes the High Limit, the
alarm is triggered.
Set High Limit to 80.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 105


5. Write in the Message a message related to that alarm. For example, type “Analog Variable is more than 80”.
Your configured Alarm should be like this.

Adding the Alarm Banner.


1. Browse to UI > Screens > Calendaring > Alarming. Double click on Alarming to show the screen.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 106


2. In the Main Toolbar, click on the Template Libraries to open the libraries.
In the Search Box, type Alarm, select the Alarm Banner and drag it to the Alarming screen.
Close the Template Library.

Libraries
When you select an object from the Template Library, notice that there is some information about what the
object is used for and how to use it.
You can add your own library to the Template Library.

3. Rename AlarmBanner1 to AlarmBanner.

4. Click on AlarmBanner object and set its Properties to:


- Horizontal alignment: Left
- Vertical alignment: Top
- Width: 371 px
- Height: 50 px
- Left margin: 409 px
- Top margin: 0 px
- Content alignment: Left aligned

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 107


Adding the Alarm Grid.
1. Browse to UI > Screens > Calendaring > Alarming. Double click on Alarming to show the screen.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 108


2. In the Main Toolbar, click on the Template Libraries to open the libraries.
In the Search Box, type Alarm, select the Alarm Grid and drag it to the AlarmGridGroup in the Alarming
screen.
Close the Template Library.

3. Rename AlarmGrid1 to AlarmGrid.

4. Click on AlarmGrid object and set its Properties to:


- Horizontal alignment: Left
- Vertical alignment: Top
- Width: 1155 px
- Height: 300 px
- Left margin: 10 px
- Top margin: 40 px

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 109


5. Run the Emulator by clicking on the Emulator Play Button in the Main Toolbar.

Click on the Calendaring tab and click the third icon on the left and then the fourth icon to show the Alarming
Screen.

Try to trigger Digital and Analog alarms by using the objects in the Alarms Simulation group.
Notice that alarm notifications appear in both the Alarm Banner and the Alarm Grid.
Familiarize yourself with Acknowledgement and Confirmation of alarms.
Close the Emulator when you finish testing.

Adding the Alarm History Grid


1. You will now add an Alarm History Grid to show historical alarms.
Browse to UI > Screens > Calendaring > Alarming. Double click on Alarming to show the screen.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 110


2. In the Main Toolbar, click on the Template Libraries to open the libraries.
In the Search Box, type Alarm, select the Alarm History Grid and drag it to the AlarmHistoryGridGroup in the
Alarming screen.
Close the Template Library.

3. Rename AlarmHistoryGrid1 to AlarmHistoryGrid.

4. Click on AlarmHistoryGrid object and set its Properties to:


- Horizontal alignment: Left
- Vertical alignment: Top
- Width: 1155 px
- Height: 220 px
- Left margin: 10 px
- Top margin: 40 px
(Scroll to the bottom to find Size and layout properties).

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 111


5. You will now create an AlarmEventLogger to keep trace of historical alarms.
In the Main Toolbar, click on the Template Libraries to open the libraries.
In the Search Box, type Alarm, select the Alarms Event Logger and drag it to the Loggers folder in the Project
Panel.
Close the Template Library.

6. Rename AlarmsEventLogger1 to AlarmsEventLogger.

7. Select AlarmsEventLogger and assign EmbeddedDatabase to Database property.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 112


8. Browse to UI > Screens > Calendaring > Alarming > AlarmHistoryGridGroup. Select AlarmHistoryGrid and
drag AlarmsEventLogger (from the Loggers folder) to the AlarmEventsLogger property.

9. You will now create a Refresh Button to refresh the Alarm History Grid.
Browse to UI > Screens > Calendaring > Alarming > AlarmHistoryGridGroup.
Right click on AlarmHistoryGridGroup > New > Base controls > Button.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 113


10. Rename Button1 to Refresh.

11. Click on Refresh button and set its Properties to:


- Horizontal alignment: Left
- Vertical alignment: Top
- Width: Auto
- Height: Auto
- Left margin: 1105 px
- Top margin: 6 px
- Text: Refresh

12. Click on Refresh button and click on the plus symbol close to the MouseClick event.
Browse to UI > Screens > Calendaring > Alarming > AlarmHistoryGridGroup > AlarmHistoryGrid and
select Refresh.
Click Select.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 114


13. Run the Emulator by clicking on the Emulator Play Button in the Main Toolbar.

Click on the Calendaring tab and click the third icon on the left and then the fourth icon to show the Alarming screen.

Try to trigger Digital and Analog alarms by using the commands in the Alarms Simulation group.
Refresh the Alarm History Grid and notice that new alarm notifications are shown.

Close the Emulator when you have finished testing.

Congratulations you have completed this section of the lab and with your fantastic help, Alolun will be able to
configure any alarms for any piece of equipment that he wants.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 115


Reporting

Alolun is noticing that there are some discrepancies in the coating of the Anode electrode through the Calendaring
machine when he checks the porosity of the calendared electrode with the Scanning Electron microscope. He thinks
this might be down to inconsistent calendaring roller pressures or temperatures and would like to generate a report of
this data for later reading. In this section of the Lab, you will help Alolun set up reports and see that pdf reports can be
generated in custom styles in Runtime.

Read about Reports


Introduction
You can design, layout, and generate PDF reports by using a Reports object. The reports can include data
extracted from FTOptixApplication and databases.
You can customize the appearance of report contents with the Report Stylesheet and save reports to a
specific location.

Report components

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 116


Report example

1. Open folder/Node Reports

2. To have different custom style Reports we have to create at least 2 different style sheets for these
reports. Right click Reports > New > All > Reports > Style sheet. Repeat this step a second time so
that we have 2 Style sheets.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 117


3. Double Click StyleSheet1 and update the properties as follows
Global Style
• Border width: 0.001 mm
Control Styles
• Header background color: #e6e6e6

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 118


4. Double Click StyleSheet2 and update the properties as follows
Global Style
• Border color: #ffffff
• Border width: 0.001 mm
Control Styles
• Alternate background color: #f0f0f0
• Header background color: #0fafff
• Header text color: #ffffff

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 119


5. Right click Reports > New > Reports.

6. Select Reports1 and change the Page orientation property to Landscape.


7. Expand Reports1 and you will see the 3 components a Report contains. Header, Sections and Footer.
8. Double Click on Header and you will see the Header in the Editor Part of the window.
9. Right Click Header and add a Image and a Label.

10. Click on the new created Image1 and change the Properties according to the screenshot

If you don’t see the Size and Layout, then double click on the header and then on the image again.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 120


11. Click on the newly created Label1 and change the Properties according to the screenshot

12. Header is done, now we create the Footer content. Right click Footer and add 3 Labels.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 121


13. Rename the Labels to ReportFooter, Copyright and PageCounter by clicking right to the Label.

14. Click the ReportFooter Label and update the Properties


• Text: This report has been automatically generated by FTOptix Studio

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 122


15. Click the Copyright Label and update the Properties
• Text: Copyright ©2022 Rockwell Automation, Inc.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 123


16. Click the PageCounter Label and update the Properties

17. Click the Add Dynamic Link and then on the Advanced… button

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 124


18. In the Complex Dynamic Link editor click the and String formatter

19. Update the Format to Page {0} of {1}

20. Update {0} DynamicLink

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 125


21. Update {1} DynamicLink

22. Next up Sections. Right Click Sections and a Panel section and a Datagrid section.

23. Rename the PanelSection1 to ParametersHeader and the DataGridSection1 to ParameterGrid.


24. Select ParameterHeader and update the Height property to 10 mm.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 126


25. Right click the ParameterHeader and add a new Label. Rename the new Label1 to
LineParametersLogging

26. Update the Properties according to the screenshot

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 127


27. Select the ParametersGrid.
28. In order to get data in our Report first we have to define where the data is coming from. We will use a
local Database that is already prepared for you. Expand Datastores select EmbeddedDatabase and
drag it to the Model property.

29. Update the Query property with SELECT * FROM "Reporting" LIMIT 300

30. You can add all the columns manually but for the lab you will drag and drop the Reporting Logger into the
report Data

31. The Report structure is now done. Finally, we must update our Reporting screen in order to work with the
right Style sheets. Open folder/Node UI > Screens > Calendaring and double click on Reporting.

32. Select CheckBox1 at the bottom of the screen, Add a dynamic link to the VariableToModify.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 128


33. In the search bar, type in StyleSheet, select the var StyleSheet (Pointer) and click on Select.

34. Select CheckBox1 and update the Value in the Events properties to StyleSheet1.

35. Do the same with CheckBox2 but use StyleSheet2 as Value here.

36. Select the Generate Report button and on the right Properties pane, add a MouseClick Event. To do so,
select the small plus “+” icon next to MouseClick event. Type “generate” in the search bar
and select Generate PDF.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 129


37. On the OutputPath, select the pencil and type in C:\Lab Files\Reports\DataReport.pdf

38. Save your work.

39. Start the Emulator, click on the Calendaring tab, on the left Menu click the Trend icon and then the
Reporting icon.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 130


40. Check the Report Stylesheet1 checkbox.

41. Click on Generate Report.


42. Open the folder C:\Lab Files\Reports.
Double click on the DataReport pdf.

The pdf report will open in Adobe PDF.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 131


43. The pdf report will open showing the Calendaring Rollers Parameter Log parameters. Close the pdf down.

44. Check the Report Stylesheet2 checkbox and Click on Generate Report.

45. Open the folder C:\Lab Files\Reports and Double click on the DataReport pdf.

46. The pdf report will open showing the Calendaring Rollers Parameter Log parameters in a different style.

Close the emulator and close the pdfs when you have finished testing.

Congratulations you have completed this section of the lab and with your fantastic help, Alolun will be able
to view the data in the report from the comfort of his cabin.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 132


Security

Although Alolun trusts his intrepid crew, the HMI is very complex and he thinks he might need to add security to
stop some itchy tentacles pressing buttons they shouldn’t.
In this section you will help Alolun add a user and use a wizard to easily configure users and groups.
During helping Alolun, you will also see how easy it is to import widgets to configure users and groups online and
how to keep these users even when you download an updated version of your application.

Domain – In this section of the lab you will use local users but FactoryTalk OptixTM also has the ability to use
users from a domain controller.

1. Open folder/Node Security

2. Open Users folder/node and also Groups folder/node


As you can see, some users and groups for this project have already been created

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 133


3. Right click on the Users Folder and then select New > User

4. On the right side you will see that the User1 Properties are shown.

Change the User1 to rockwell with password rockwell, LocalIDs and Languages to en-US and Measurement
system to International system of units.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 134


Tips :
The Domain is empty since a domain controller is not used in this lab. You can use user from Optix, Local
PC users or Domain users or any combination.
For the Measurement system, you have 3 options
International system of units
US Customary measurement system
British Imperial units
This measurement system is used to change the engineering units automatically when a user logs is.
You will see this this when the application is run.

5. Now you will use a wizard to assign the users to the security groups. Click on next to Emulator.
6. Select Manage users and groups

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 135


7. Next you will assign the user rockwell to the operator group. Select the user rockwell and drag it to the
Operator group.

8. You can see that the user rockwell is now user the Operator group.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 136


There are 2 other ways that can be used to manage users and groups.
When you select a user and click on the button Assign users to groups, you can select which groups you
want the user to belong to.
When you select a group and you click on Assign groups to users, you can select the users that you want
to move into the selected group.
You can also select multiple users and groups and use the assign buttons.

When you click on the Template Libraries icon then you will see a popup open with some
template scripts, stylesheets, GraphicElements, Misc and Widgets.
The search bar makes it easy to find anything in the library.
When you click on Widgets and then user Editor, you can see what is needed to be done to implement this
widget into your application.

The login form that you will use in your application is also available in these widgets.
Using the List or Tile switch, you can switch between a list or icons for all the objects.

Since all the objects are already included in the application you will not add them so you can just close the
Libraries if you opened it.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 137


9. Go to UI > Screens > Templates > UserEditor.

This is where we added the Widget Template for you. In the next step we will use this Template and instantiate
the User Editor Widget on our Security screen.

10. Go to UI > Screens > Calendaring > and double click on Security (type) to open the screen.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 138


11. Right click on Security and select New > Templates > UserEditor > UserEditorOverview.

12. Select the added User Editor Widget and change the properties Left Margin to 40 and the Top Margin to
110.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 139


It should now look like this

13. Now you will move the users and groups into the properties of the object you just selected.
In the left column, go to Security > Users, select this folder and drag it to the Users in the properties of the
object.
Do the same for the Groups to the Groups Property.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 140


14. The properties of the object should look like this.

Now you will test the modifications you have implemented so far.
15. In the top bar, click on the Emulator Play Button .
16. Navigate to the Calendaring tab, on the left Menu click the Trend icon and then the Lock icon.

Click on the Logout button.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 141


17. A drop-down menu will appear, click on Guest user and change to Davide and click on Login.
With the login things changed.
a. All the text fields and menu are changed to Italian.
b. All the values and engineering units changed to that which are commonly used in Italy as
measurement system.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 142


Language and measurement
For each user, you define language and measurement system.
Measurement system

You can select between 3 different measurement systems : US customary measurement system,
British imperial units and International system of units.
You can always modify certain measurements or add a new measurement system if that would be needed.
Languages
Under the folder Translations you can see the Localization Dictionary.

In here you can add Locale or languages and also do the translations.

Every text field in the application gets a unique name called Key which is the first column you see in the
table.
When you click on View Translation References, you will see all they strings used in the application and each
string has a unique Key. So even if for example Start is used multiple times in your application, it will only be
shown as 1 key so you only need to translate it once.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 143


18. You can switch to other users to see what happens; all users are created without password only the user
rockwell has password rockwell.
You may have noticed that Max has the right to adjust the Calendar Roller displacement force.

19. Logout and Login as user guest. As soon and you logout, you will see the User Editor is grayed out. The
User Editor was configured so that only Administrators has access to.

20. Login as Davide who is part of the administrators group has access to the User Editor.

Note that all the users in your application are included on this User Editor object.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 144


21. Click on rockwell and you will see the locale is en-US and that he is part of the Operator group.

22. Click on Create and create a new user using your own name (remember to hit the <Enter> key after
entering yourname) and assign yourself to Administrator group so that you have access to the User
Editor. When finished, click Apply. Make sure to press on the Enter key when you have filled in your
username and password.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 145


23. The user that you created is now in the application.

When you close the application and run the emulator again, all the users you online added will still stay in the
application.
The reason that this is possible is because a Retentivity database has been added to the application.

In this case it is used it for security but this retentivity database can also be used for internal tags.

Close the emulator and close the pdfs when you have finished testing.

Congratulations you have helped Alolun complete the Security setup, he is a happy Ardvarian and those
sticky tentacles won’t be able to reach where they aren’t supposed to reach.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 146


Evaluators and Key Converters

Whilst Alolun is modifying the HMI to suit his needs, he sees that FactoryTalk OptixTM has 6 different converters and
has expression evaluators, he thinks he might have a use for these in the future and decides to investigate how they
work and what they can do.
In this section of the Lab you will help Alolun investigate how Converters are used in FactoryTalk OptixTM.

A converter is an object that converts the source value and then assigns it to the parent node. A converter
can be either a local converter, or a converter type created in the Converters folder that has related
instances that you can reuse.
An example converter in the Advanced dynamic link editor may contain:

Tip:
If you use a converter and its properties in a single advanced dynamic link, create a local converter in the
Advanced dynamic link editor. If you use a converter and its properties in several advanced dynamic links,
you may want to create a converter type in Projects view and then use the converter type in the Advanced
dynamic link editor.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 147


FactoryTalk Optix has 6 different converters.
Engineering unit converter
Linear converter
Key-value converter
String formatter
Expression evaluator
Conditional converter

Engineering unit converter


Use the Engineering unit converter to convert raw data values into scaled values based on a range of
customizable values. For example, the engineering unit converter can transform values from 0 to 65.535
supplied by a temperature sensor into corresponding values on a scale from -20 to +70. The input of an
engineering unit converter is generally a dynamic link to an imported tag.

Linear converter
Convert raw data values into scaled values based on the linear relationship applied to the input.

Key-value converter
Convert the value of the source to its corresponding parent value based on a table of key-value pairs. The
key-value converter converts heterogeneous data, such as a color to value.

String formatter
Modify the formatting of one or more values according to a customizable rule.
Using the string formatter, you can, for example:
Add characters before or after a value, if the value of the source variable numeric.
Format and parameterize SQL queries to use in database objects
Link multiple strings together in a series
Apply formatting, such as decimal places or float rounding, to numbers

Expression evaluator
Calculate the result of an expression with integers, decimals, numeric variables, string variables for string
comparisons, arithmetic and Boolean operators, or a set of functions.

Conditional converter
Check if the result of a condition is true or false.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 148


1. Expand the Folder UI > Screens > Calendaring and double click on Expressions

2. In the left side of this screen, you will find the Expression Evaluator part. Inspect the 4 different equations
that are shown.

By clicking on the padlock next to the object, you can lock or unlock a group of objects.

You will see that the Calculation is done in a Complex Dynamic Link – Expression Evaluator

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 149


3. In the Conditional converter part select the #### next to Result and click Add Dynamic Link.

4. Select Advanced

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 150


5. Add a Conditional converter by click on the + and select Conditional converter.

6. Change the Condition DynamicLink to a Condition ExpressionEvaluator.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 151


7. Update the True, False value and the Expression according to the screenshot.

And the Dynamic Links to {0} DynamicLink and {1} DynamicLink.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 152


8. In the EngineeringUnit Converter part select the LinearGauge2 on the right side, click on Value and click
the Change Dynamic Link button from the Value property.

9. Update the Raw and Scaled Min/Max values.


Raw min: 4, Ram max: 20, Scaled min: -20, Scaled max: 70

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 153


10. In the Key-value Converter and String formatter part, we have a Label2 that uses a String formatter and
a Key Converter together.
The String Formatter combines the “Day of the Week:” text with the output of DayOfTheWeek(type) Key
Converter.

11. To get this to work we must update the DayOfTheWeek (type) Key Converter. Expand Converters and
double click on the DayOfTheWeek (type).

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 154


12. Update the Keys and the Values. The Keys are the Weekday and the Values the Day of the week.
Monday gets 1, Tuesday gets 2, etc.

13. Now you will test the modifications you have implemented so far. Run the Emulator by clicking on the
Emulator Play Button .

14. Navigate to the Calendaring tab, on the left Menu click the icon with the magnifying glass and test the
Evaluators and Converters you just created or modified.

Close the emulator when you have finished testing.

Congratulations you have completed the section on Expressions, Converters and Formatters and increased
Alolun’s knowledge of how they work, at this rate he’ll need to buy some extra memory at the cranial
extensions shop when he next docks to help him store all that he’s learnt.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 155


Recipes

Alolun wants to create, store and download the asteroid drill parameters, how can he possibly do this, ah ha
FactoryTalk Optix has recipes.
In this section of the Lab you will help Alolun configure recipes using a widget.

Read about Recipes


Introduction
In FactoryTalk OptixTM, recipe management is done through one or more Recipe schema objects.
A Recipe Schema object defines a set of variables, or ingredients, with which it is possible to configure
different recipes, i.e. different sets of values for the same set of variables.
This object can be used to define the values of a configuration and save them to be reapplied as needed. It
can be useful, for example, to restore the initial settings of the machine following changes that compromise
its operation.
Ingredients of a Recipe Schema
To define the ingredients in a Recipe Schema, a destination node must be set at design time that contains,
among all the child nodes, the variables of interest. It can be any node of the project and the choice depends
on the structure of the project and its complexity. For example, the destination node can be the Model folder,
an object inside the Model folder, or a node that contains variables of one or more PLCs.
Hint
To define variables contained in different nodes of a complex project as ingredients of a Recipe Schema,
create a dedicated object in the Model folder and add variables inside it, then create a dynamic link between
the variables and desired ingredients. In fact, if the object is selected as destination node, the selection of the
Recipe Schema ingredients is more intuitive, as only the variables referenced in the object are shown.
Recipe management at runtime
To design recipe management at runtime, the Recipes Editor widget included in FactoryTalk OptixTM Studio
can be used.
The widget can be used as provided or some of its components can be reused to design a customized
solution.
Edit model
When the user creates, edits or loads a recipe from the database at runtime, an Edit model node is
automatically created in the project root node that can be referred to at design time. The Edit model node
contains a temporary copy of the created/edited/loaded recipe data, until it is saved, deleted or sent to the
PLC.
Important
if execution of the FactoryTalk OptixTM Application is stopped, the Edit model node and the data it contains
are deleted.
To design custom recipe management, the mechanisms related to the Edit model node must be known. On
the other hand in the Recipes Editor widget, the references to the Edit model node are already correctly set
to guarantee all features at runtime.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 156


This will be the result:

Adding 3 parameters in RecipeSchema


Recipes parameters are stored in a database table that is connected to a RecipeSchema, this data block
will manage a set of recipes containing all desired values.
1. Expand Recipes and double click DrillingRecipe to open the RecipeSchema editor and select the following
under /Model/Drilling/Recipe:
• Val_GuidanceDistance
• Val_HeadRotationSpeed
• Val_LubeHeatersTemperature

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 157


2. Press Apply.

Tip:
RecipeSchema parameters contain the used database where recipes tables are created, you can manually
specify a Table name or leave that automatic (blank)

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 158


Tip:
There is also a Recipe wizard available to create a new recipe.
This includes database selection or creation and all the tags needed in your recipe.

Only 4 steps are needed to configure a recipe.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 159


Configuring the Recipes editor widget
Importing and adding Recipes editor in UI/Screens/Drilling/Recipes.

1. Double Click on UI>>Drilling>>Recipes (type) to open the screen.


Open the Libraries and in the Widgets folder search, drag and drop the Recipes Editor widget
to the blank box in the center of the screen. Close the Libraries. The widget has just been imported
into the project.

2. Adjusting the RecipesEditor


Click on RecipesEditor1 object and set it Properties to:
- Horizontal alignment: Left
- Vertical alignment: stretch
- Left margin: 600
- Right margin: 20
- Top margin: 50
- Bottom margin: 0

Items in a project are arranged in containers and content, content parameters are always related to its
container, if you set a content to stretch it will fit the whole area of its parent element

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 160


3. Attaching the RecipesEditor to a RecipeSchema
Drag and drop the RecipeSchema you previously configured to the RecipeSchema parameter of
RecipesEditor.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 161


4. Populating the RecipesEditor widget
Expand the RecipesEditor1 you just configured and right click on the RecipesEditorUISetup. Select
Execute Setup script to trigger the Execute Setup function; this will populate your widget with the whole
set of variables you configured in the RecipeSchema.

5. Adding Recipe Controller Script


Open the Libraries and in Scripts folder search, drag and drop the Recipe Controller script to
the NetLogic Folder. Close the Libraries. The script has just been imported into the project.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 162


6. Configuring Recipe Controller Script in NetLogic folder
Select RecipeController in NetLogic folder. Drag and drop the RecipeSchema you previously configured
to the RecipeSchema parameter of RecipeController.
Insert CSVFile Path. For Example, C:\Lab Files\Recipes\Recipe.csv.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 163


7. Configuring Recipe Import Export in UI/Screens/Drilling/Recipes
Add two Button for Import/Export (Object Name: RecipeImportButton and
RecipeExportButton) and one Text box (Object Name: Path).

a) Configuring RecipeImportButton and RecipeExportButton


Select RecipeImportButton. In the Properties pane, section Events, click on the + next
to MouseClick Event. In the UI/NetLogic/RecipeController select Import. In the Text
field enter Import.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 164


Note: Repeat the same step for the RecipeExportButton and in the
UI/NetLogic/RecipeController select Export. In the Text field enter Export.

b) Configuring Path
Select Path. In the Properties pane, section Text, click on the Change Dynamic Link.
In the UI/NetLogic/RecipeController select CSVFile.

The host pc must have administrator rights for writing recipe parameters in C:\Lab Files\Recipes\Recipe.csv

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 165


8. Now run the by clicking the Emulator Play Button , click on the Drilling tab.

9. Close the emulator when you have finished testing.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 166


C# Scripting – Netlogic

Times are good for Alolun and he has enough money in his piggy bank to set up a new asteroid mining ship and
Battery line (who knows one day he might own a whole fleet and his company could trade on the stellar stock
exchange). Alolun won’ have time to configure the HMI himself when this happens so he is going to see how the
Netlogic scripting can generate displays and objects at Runtime.
In this section of the Lab, you will work with Alolun to configure C# scripting NetLogic.

This will be the result:

Read About NetLogic


Introduction
FactoryTalk OptixTM Studio enables development of customized runtime and design time logics written in C#
language. At runtime, using these logics, it is possible to run operations in the information model (for
example change the value of a variable when another variable changes status) or outside the information
model (for example send an e-mail when a specific variable change status).
To develop these logics, special objects called NetLogic are used.
What is a NetLogic
A NetLogic is an object that contains C# code to execute at runtime or design time. The following templates
are available:
Runtime NetLogic,
To create runtime logics linked to the life cycle of the node that contains it or to define new OPC UA methods.
Note

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 167


the OPC UA methods, unlike C# methods, are exposed by NetLogic and can be referenced in any point of
the FactoryTalk OptixTM Studio project at design time. They can then be invoked at runtime according to the
project logics or by a OPC UA client.
Design time NetLogic
to create scripts to execute at design time to automate specific operations (for example read a CSV file
containing alarm descriptions to write automatically in the project).
NetLogic and C# classes
A NetLogic contains a C# class with the same name in its code, automatically created by FactoryTalk OptixTM
Studio at design time. When a NetLogic object is renamed, FactoryTalk OptixTM Studio also automatically
renames the corresponding contained C# class.
Warning
To change the name of this class, rename the NetLogic in FactoryTalk OptixTM Studio. Do not change the
name of the class in the code as this would compromise its operation.
For example, a NetLogic called PanelLogic contains the following declaration which defines the PanelLogic
class:
public class PanelLogic : BaseNetLogic Note
the class in a NetLogic is always derived from the FactoryTalk OptixTM Platform BaseNetLogic class, i.e. the
base class that supplies most of the methods to NetLogic, including the Start and Stop methods
All C# classes are grouped in a .NET project created and automatically updated by FactoryTalk OptixTM
Studio.
NetLogic related to the life cycle of a node
The life cycle of a runtime NetLogic, i.e. its existence at runtime, is equivalent to the life cycle of the node that
contains it. Therefore, it exists from the time the parent node is created (for example a Panel object) to the
time when the same node is removed. These two moments are represented in the C# code of a NetLogic by
the Start() and Stop() methods. In these methods it is therefore possible to define the logics to be executed
at runtime when the parent node is created and deleted.
Where to create a NetLogic
NetLogics can be created in any node of the information model. In general, there are two possible positions
with different effects at runtime:
In a type (for example in a MotorType). In this case, at runtime the NetLogic exists in each instance of the
type until the same instance is deleted. Outside a type (for example, inside a folder, inside other instances,
inside the root node of the project). In this case, at runtime the NetLogic is created at project start and
deleted at project closure.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 168


DesignTimeNetLogic: Execute CreateMotors Scripting
The CreateMotors scripting will create 5 Motor templates (UI/Templates/Motor) in Calendaring Scripting screen
(UI/Screens/Calendaring/Scripting) already configured.

1. Expand the folder node NetLogic. Right click on DesignTimeNetLogic\Execute CreateMotors.


UI/NetLogic

UI/Templates/Motor

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 169


2. Check if the Motor templates have been created correctly in UI/Screens/Calendaring/Scripting from
Motor0 to Motor4.

3. Move the Motor templates objects created and arrange the Scripting screen as below.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 170


DesignTimeNetLogic: Modify CreateCustomWidget Scripting
The CreateCustomWidget scripting will create 4 CustomWidget templates (UI/Templates/CustomWidget) in
Calendaring Scripting screen (UI/Screens/Calendaring/Scripting) already configured.

1. Double click on DesignTimeNetLogic Scripting in NetLogic folder.

2. Microsoft VisualStudio will open and in Solution Explorer, double click on the
DesignTimeNetLogic.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 171


3. This code will appear. A part of this is the one used above to create Motor templates.

4. From row 40 modify the code to add 4 CustomWidget templates (UI/Templates/CustomWidget) and click
Save.

UI/Templates/CustomWidget

5. Expand the folder node NetLogic. Right click on DesignTimeNetLogic and select
Execute CreateCustomWidget.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 172


6. Check if the CustomWidget templates have been created correctly in UI/Screens/Calendaring/Scripting
from CustomWidget0 to CustomWidget3.

7. Move the CustomWidget templates objects created and arrange the Scripting screen as below.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 173


RuntimeNetLogic: Check the RuntimeCreateWidgetLed Scripting (Optional)

The RuntimeCreateWidgetLed scripting will create Widget Led templates (UI/Templates/ToggleLed) in runtime
mode in Calendaring Scripting screen (UI/Screens/Calendaring/Scripting) already configured.

1. Double click on RuntimeCreateWidgetLed Scripting in


UI/Screens/Calendaring/Scripting/RuntimeCreateWidgetLed.

UI/Templates/ToggleLed

2. Microsoft VisualStudio will open and in Solution Explorer, double click on the RuntimeCreateWidgetLed.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 174


3. Study the code

4. The maximum number of instances the user can create is 7.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 175


Application Test

6. Now run the Emulator by clicking on the Emulator Play Button , click on the Calendaring\Scripting tab.

7. Close the emulator when you have finished testing.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 176


Read about NetLogic Code Debug
To debug the code that FT Optix Runtime is running then in Visual Studio select Attach to process… from the
Debug menu.

In Attach to Process select FTOptixStudio.exe or FTOptixRuntime.exe (if the Emulator is in Run)


and press Attach, as show below.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 177


Just for fun – because we can

What do asteroid miners do to relax… they play the classic arcade game Asteroids of course.

1. Double click on the Asteroids.optix file in the Lab Files>>Asteroids folder and open the project.
2. When the project has loaded click the Emulator Play Button and have some fun.
Hold down the mouse on the Turn left or Turn Right touch areas to steer the spacecraft and click on the spaceship
to fire.

Click on to close the application.

Trivia Questions
1. Which great legacy does the ship RA-1701 pay homage to?
2. Where did the Babel Fish first see the light of day?

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 178


Appendix A - FactoryTalk OptixTM Demo Project

The FactoryTalk OptixTM Demo Project is a project developed to showcase the functionality of FactoryTalk OptixTM,
this section of the lab is an additional section that allows you to explore this demo.
Close down FactoryTalk OptixTM Studio and stop the Emulator if they are running.

1. Navigate to C:\Lab Files\FT Optix demo project. Double Click on the FeaturesDemo project located in the
folder.

2. The Demo project will open in FactoryTalk OptixTM Studio.

3. When the project has finished loading, click the Emulator.

4. The Project will run in the Emulator, explore the application and if you see some functionality of particular
interest then feel free to investigate it in FactoryTalk OptixTM Studio.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 179


Rockwell Automation is a trademark of Rockwell Automation, Inc. Trademarks not belonging to Rockwell Automation are property of their respective companies.

Copyright© 2022 Rockwell Automation, Inc. All rights reserved.

ROKLive EMEA 2022 FactoryTalk OptixTM Basic Lab 180

You might also like