Get new content delivered to your inbox every month.
No spam, unsubscribe anytime.
One of the goals of FactoryTalk Design Studio is to bring Object Oriented Programming (OOP) to PLCs. These new capabilities are delivered through Smart Objects (SOs), a new program organizational unit within FactoryTalk Design Studio.
Using Smart Objects, you can create a hardware-abstracted, logical model of a process and improve code reuse.
In this post, I’ll show you what’s possible with Smart Objects in FactoryTalk Design Studio and give you a sneak peek into what functionality will likely be added to Smart Objects in the future.
Let’s start by looking at how Smart Objects can be used to create a hardware-abstracted, logical model of a process.
Smart Objects can be created from a definition, like instantiating an AOI in Logix Designer, or can be standalone instances. This standalone instance, known as a singleton, is used to create a logical model of a system.
To create a singleton Smart Object, click on the plus icon on the system explorer and select Smart Object.
In the Create FactoryTalk Smart Object Instance dialog that opens, give your Smart Object a name and make sure that the Create an instance from a definition switch is set to No.
Finally, click Create to create the Smart Object.
The Smart Object is added to the System pane. You can tell that this is a standalone instance of a Smart Object from the symbol beside the Smart Object’s name. A rectangle with no fill represents a standalone Smart Object.
Since Smart Objects can contain other Smart Objects, you can continue to add Smart objects to the system pane to create a model of a system that includes parent-child and sibling relationships.
Smart Objects can also be definitions that can be reused in your project by instantiating them.
You can create a definition of a Smart Object from scratch in the library pane, or create a definition from an existing Smart Object in your project. To create a definition from a Smart Object in your project, right-click on the Smart Object and select Add to Library.
In the New FactoryTalk Smart Object definition dialog that opens, you can enter a name, description, and version number for the Smart Object definition and then click Create to add the Smart Object definition to the project library.
After clicking Create, you can see that the Smart Object has been added to the Smart Objects folder in the project library. The filled hexagon symbol shows that this is a Smart Object definition.
In the System pane, you can see that PackagingLine1 is an instance of a Smart Object by the linked hexagon symbol beside it. You can also see what Smart Object definition it is an instance of in the definition section of its properties.
Now, if the definition is updated in the library tab, changes are automatically rolled out to all instances of this Smart Object. In this example, I added some programs and routines to the Smart Object, and all of the changes I made are automatically pushed to the instances of the Smart Object.
I can also create new instances of a Smart Object definition by selecting Yes for the Create an instance from a definition option in the Create FactoryTalk Smart Object instance dialog as shown here.
To accommodate minor differences between different instances of Smart Objects, FactoryTalk Design Studio gives you tools to override or extend a Smart Object.
You can override any program in an instance of a Smart Object. To override a program, right-click on the program in the instance of the Smart Object and select Override program.
A dialog box explains that the program in the instance will be replaced without affecting the definition. It also gives you the option to override the program with either a copy of the existing program or with a blank program.
You can see which programs in a Smart Object instance have been overridden from the symbol beside their name in the System pane.
By overriding a program, you can add custom logic inside an instance of a Smart Object while still inheriting updates from its definition. You might use this when you have many conveyors that are the same but one conveyor needs to have special fault logic.
In addition to overriding a program, you can also extend a Smart Object instance. To extend a Smart Object instance, simply add a program or Smart Object to the instance as shown here.
Once again, you can see from the symbol beside the name of the program that this is an extension of the Smart Object definition.
By extending a Smart Object, you can add additional functionality to a specific instance of a Smart Object without affecting the definition. When the definition is updated, the extended Smart Object still inherits all of the changes.
You might use this when you have many conveyors and one conveyor needs additional logic to log data.
Smart Objects have introduced some interesting new features but they are not without their limitations.
In the current version of FactoryTalk Design Studio, which is 2.02, I have found the following limitations:
Smart Objects are sorted in the system pane in alphabetical order. This makes it difficult to create a real model of a process that has a flow from upstream to downstream like a packaging line.
I have given feedback to Rockwell Automation that objects shouldn’t be sorted in alphabetical order and I’m hoping that this behavior will be changed soon. In the meantime, you can work around this “feature” by prefixing objects with a letter to force the order that I want.
Currently, you can’t override a program that is a child of a singleton Smart Object in a Smart Object instance because the option isn’t available on the context menu.
I assume that this is a bug and I have reported it to Rockwell. I hope that this gets fixed in the next release because a key feature of Smart Objects is that they can be nested to create large abstractions.
Currently, Smart Objects don’t have their own interfaces.
Data exchange between Smart Objects has to be done using Program Parameters, which feels clunky and unintuitive.
My understanding is that Rockwell is working on dedicated interfaces for Smart Objects but I’m not sure when they will arrive.
In Studio 5000 Logix Designer, code reuse is typically managed by using Add-On Instructions, or AOIs. AOIs are still supported in FactoryTalk Design Studio and have a different use case than Smart Objects.
AOIs are used to encapsulate small pieces of code that can be represented by a single routine. So you might use an AOI to develop a function that converts temperature or calculates the volume of a tank.
Smart Objects are used for larger abstractions that may require multiple programs, multiple routines, and even multiple objects. They are also used for abstractions that require flexibility because they give you the ability to override programs, extend instances, and (hopefully soon) implement flexible interfaces.
FactoryTalk Design Studio doesn’t support online editing so neither AOIs or Smart Objects in FactoryTalk Design Studio are editable while online with a controller.
It takes a little bit of time to get used to Smart Objects in FactoryTalk Design Studio but they are growing on me.
I like the ability to build a logical model of a process using singleton Smart Objects that shows the parent-child and sibling relationships between equipment (although, there is room to improve how sibling relationships are shown).
I also like the flexibility that Smart Objects bring for code reuse. It's awesome that a Smart Object can contain multiple routines, programs, and objects. It's also really nice to be able to override and extend specific instances (although I can imagine that on a large project that might get messy).
I think the missing piece of the puzzle is the ability to define interfaces to exchange data between Smart Objects. I know that this feature will be added soon, and I’m looking forward to seeing how Rockwell solves that design challenge.