How-to
Finding HMI screens in TIA Openness via SoftwareContainer
Short answer
TIA Portal Openness does not attach HMI software at a fixed level of a device, so you find it by walking the DeviceItem tree: request the SoftwareContainer service on every item, cast the Software property to HmiSoftware, and use that object to reach the screens. Both the service lookup and the cast can return null, and a null on one item is normal — keep walking.

On this page
In TIA Portal Openness the screens of an HMI device hang off that device's software object, and the software object does not sit at a fixed level of the device tree. You find it by walking the DeviceItem hierarchy: request the SoftwareContainer service on every item, take the Software property of the container that answers, and cast it to HmiSoftware. That object is the documented entry point to the screens, and the same route appears in material for the V15.1 generation and in the current V20 documentation. The steps, the code, the two null checks and the bench test that proves the search are below.
Where the HMI software sits in the device tree #
A Device in TIA Portal Openness holds one or more DeviceItem objects at its top level, and each of those can hold child DeviceItems of its own. Every item exposes a Name of type string, which is what you log while walking, and a Container attribute that names what holds the item. Which item actually carries the software depends on the station: a standalone panel, a panel integrated into another slot and a software-only HMI target do not lay their items out the same way. That is why the documented pattern is a search across the tree, not a read at a fixed position.
Steps to reach the HmiSoftware object #
- Take the Device object of the HMI station from the project you opened through Openness.
- Iterate the DeviceItems collection of that device.
- Call
GetService<SoftwareContainer>()on each DeviceItem. - Treat a null result as a sign that this item carries no software container, and move on — most items in a station are hardware-only and answer null by design.
- On a non-null container, read its Software property and cast it with
as HmiSoftware. - A non-null HmiSoftware is the HMI configuration of that device, screens included — stop the search there.
- Repeat steps 3 to 6 on the child items of every item, so a station that nests its software deeper is still covered.
The search code #
The search is two methods: an entry point that iterates the device's top-level items, and a per-item method that requests the service, casts the software and recurses into children.
static HmiSoftware FindHmiSoftware(Device hmiDevice)
{
foreach (DeviceItem item in hmiDevice.DeviceItems)
{
HmiSoftware found = FindHmiSoftware(item);
if (found != null)
{
return found;
}
}
return null;
}
static HmiSoftware FindHmiSoftware(DeviceItem item)
{
SoftwareContainer container = item.GetService<SoftwareContainer>();
if (container != null)
{
HmiSoftware hmi = container.Software as HmiSoftware;
if (hmi != null)
{
return hmi;
}
}
// No HMI software on this item. Pass each of its child items
// into this same method so nested layouts are covered.
return null;
}
Device, DeviceItem, DeviceItems, SoftwareContainer, its Software property and HmiSoftware are Openness classes; item, container, hmi and found are example variable names you can rename. Both failure paths matter: the service lookup returns null where the item provides no such service, and the cast returns null where the item carries software of another kind, so the method checks both before it returns a result. If your installed version declares this class as HmiTarget instead of HmiSoftware, cast to that name — the walk itself is identical.
The bench test that proves the search #
Worked example: run it on a bench copy of a test project first, and keep the project your line depends on out of the first pass. Open a test project that holds one HMI station and one PLC station. Call the search on the Device of the HMI station — the result is a non-null HmiSoftware, and the Name log shows at which item the container answered. Call the search on the Device of the PLC station — the result is null, and that null is the correct answer, because that device carries software that is not HMI software. A null from the HMI station itself means the walk missed a level: extend the recursion into the child items and re-run before you conclude anything.
What the two nulls tell you #
A null from GetService<SoftwareContainer>() on a hardware-only item is normal, not an error: the service exists only where software lives, so skip that item and keep walking. A null from the cast means the container answered but its Software object is a different application, so this item is not the HMI target. A null from the whole search means the device has no HMI software or the walk never reached the item that carries it — confirm the recursion covered every child level first. The same service-lookup behavior shows up elsewhere in the API: a GetService lookup that stays null on a NetworkInterface documents that case and its fix.
From HmiSoftware to the screens #
Once the cast succeeds, HmiSoftware is the entry point the Openness manual uses for the data of an HMI device, and from it you enumerate the screens of that device; the manual's screens functions also cover creating, exporting and importing them. Two documented limits sit behind that entry point. Screens can be imported only to an HMI device of the same type as the one they were exported from, so finding screens on one panel does not make them portable to any other. And WinCC Unified screens expose no Openness export method at all — that is a limit of the screen functions, not of this search, and why WinCC Unified screens have no Openness export method explains it. Exporting a screen also hands you project data, not an image: why TIA Portal HMI screens do not export to jpg directly covers that gap.
The decision #
Commit to the service-based search in every case — standalone panel, integrated slot or software-only target. Request SoftwareContainer on every DeviceItem at every level, cast Software to HmiSoftware, stop at the first non-null result, and treat every null as a reason to keep walking. Only after the walk has covered the full tree do you accept null as the answer that this device carries no HMI software — and then the screens live on the device that did answer.
Questions asked
Why check for the SoftwareContainer service instead of testing each item's class?
Testing item classes ties the search to one station layout and one API generation. The documented pattern is to request the SoftwareContainer service on every item instead of asking whether an item is an HmiTarget or an HmiTagService, then read the Software property where the service answers. That way the search finds the software wherever the station put it, without assuming a fixed level or a fixed item type.
Can the search run once for a whole project?
The search takes one Device at a time, so sweep the project by enumerating its devices and passing each Device into the same method. Stations without HMI software return null and are simply skipped, while each hit gives you one HmiSoftware object. Collect the non-null results in a list, and you have every HMI target in the project with its screens reachable.
Is this search also the starting point for reading HMI tags?
Yes. The Openness functions for the data of an HMI device cover more than screens: the tags of the device are reached from the same HmiSoftware object your search returns, so the identical traversal is where a follow-up job such as reading the tags that belong to each screen begins.
How do I see which item finally carried the software?
Log the Name of every DeviceItem as the walk enters it, and log it again at the moment a container answers and the cast to HmiSoftware succeeds. That tells you at which level of the tree the software sits for that station. Use it to understand the layout and to debug a null search, but keep the search itself general, because a different station layout can put the software somewhere else.


