Skip to content

Import / Export

On this page

The Import / Export view is the heart of the TIA Portal integration. It opens in the Side Bar when you click the TIA Portal icon in the Activity Bar, just below the Project Explorer.

Layout

The Import / Export view stacks top-to-bottom in one Side Bar pane:

The Import / Export view: selection chips (Software, HMI, Safety, Watch/Force, Hardware), export and import actions, the export-folder path, and the export-folder tree

  • Selection chips (left column): Software / HMI / Safety / Watch/Force / Hardware / Library / JSON. Click a chip to choose which category you are working with. Hover over a chip to see what it exports and imports.
  • Actions (right column): the buttons for the selected chip (for Software: Export Selected, Export All, Import Selected, Import All). The action set swaps when you pick a different chip. Action buttons are enabled only while a project is connected.

Export Folder

The Export Folder is the folder on your file system where exported files are stored and from which files are imported.

Setting:

  1. Click the folder button next to the IMPORT/EXPORT FOLDER path field.
  2. Select a folder.
  3. The path is shown in the field; until one is set the field reads (not set, will prompt on export).

Hover the label or the path to see what the folder is for. The folder belongs to the project profile: save a profile in the Profiles bar of the Project Explorer and the project connects with this folder next time (see Protected items).

Tip: Use a Git repository folder so you can version-control your exports. Open that folder in the Explorer to commit and review changes.

Note: The "Working Directory" in Settings refers to the "Find Unused Blocks" function and is a separate folder.

Export-folder tree

Below the path row, the rest of the pane is a live tree of the configured export folder, filtered to TIA source files (.xml / .scl / .awl / .stl / .db / .udt / .s7dcl / .json) and the WinCC Unified export files (.yml / .js / .xlsx) plus folders, sorted folders-first then by name. The tree mirrors the Project Explorer: every row carries a tri-state checkbox and the matching Siemens block/folder icon. The tree refreshes automatically (so files exported via the action buttons appear immediately), and your checked set is preserved across a refresh. When the export folder is a Git repository, its .git folder is not shown.

  • Tri-state checkbox: checking a folder cascades to every file inside it; a folder with only some descendants checked shows the indeterminate state. The checked set (not the row selection) is what Import Selected acts on.
  • Siemens icon: files get the icon for their real block type (FB / FC / OB / DB / UDT / tag table, including Safety variants), folders get the folder icon. A generically-named file such as Block_2.scl still shows its true block icon, because the icon is refined from the file's content. A file that cannot be classified shows a neutral file icon.
  • Open on click: clicking a file row opens it in the editor (single-click preview, double-click pinned, or open to the side); folder rows expand/collapse.
  • Filter: click the filter icon (funnel) at the right end of the first tree row, or press Ctrl+Alt+F (or F3) with the tree focused. Type part of a name. The tree narrows to the matching files and folders together with their parent folders, exactly like the Project Explorer filter. Click the icon again (or press Esc) to close it and restore the tree's previous state.

When no export folder is set, the tree area shows an inline placeholder (the chips, action buttons, and path row stay visible):

No export folder selected.
[Select Export Folder]

At the right end of the first tree row sit a Filter button to search the tree and a Refresh button to re-read the folder, both shown only while an export folder is set. Next to the folder button of the path field, a Reveal in File Explorer button opens the folder in the file explorer of the operating system. While the folder is re-read, a progress bar runs under the view title, as in the Project Explorer. When the export folder lies in a Git repository, switching the branch re-reads the folder the same way.

Right-click on Folders and Files (export-folder tree)

Right-clicking a row in the export-folder tree opens an explorer-style context menu that acts on the focused / selected rows:

  • Open / Open to the Side: open the file in the editor (hidden on folder rows).
  • Reveal in File Explorer: show the row's file or folder in the OS file explorer.
  • New File… / New Folder…: create inside the focused folder (or the export root). The name is validated against empty names, path separators, and collisions.
  • Rename…: input box pre-filled with the current name, with the same collision validation.
  • Delete: confirms first; when the OS trash is available the dialog offers "Move to Trash", otherwise it warns about a permanent delete. Removing a folder removes its contents recursively.
  • Cut / Copy / Paste: Paste is disabled until something is cut or copied; name collisions get incremental suffixes ("… copy", "… copy 2").
  • Copy Path: copies the row's full filesystem path to the clipboard.

Any editors open on affected files follow renames, moves, and deletes. These file operations are not undoable.

Export Operations

Before every export (whether Export Selected, Export All, or a drag from the Project Explorer), the connected PLC is compiled first, so the exported files reflect a built project. If compilation reports errors, the export still runs.

Export Selected

  1. Check the boxes next to the desired blocks in the Project Explorer.
  2. Click Export Selected.
  3. The selected items are exported as XML. Existing files with the same name are overwritten; all other files in the export folder are kept.
  4. As a shortcut, you can drag blocks, data types, tag tables, or technology objects directly from the Project Explorer onto the export-folder tree; this exports them the same way as selecting them and clicking Export Selected. Dragged folders or PLC nodes contribute every exportable block under them.

Export All

  1. Click Export All.
  2. ALL blocks, data types, tag tables, technology objects, and software units from the connected PLC are exported, a full project export. Before each PLC is exported, Studio empties that PLC's folder in the export folder, so afterwards it holds exactly what is in the project, with no files left over from renamed or deleted blocks. To keep the other files and only overwrite those with the same name, switch off Clean Target On Export All in the TIA Portal export settings. Export All starts only when the Project Explorer has loaded every item of the PLC; while it is still loading, you get a message to wait and run Export All again.
  3. If the connection to TIA Portal is lost during the export, Export All stops before it empties the folder of the next PLC. The message names the PLCs that were not exported; their folders keep the files of the previous export. Connect again and run Export All once more.

The message at the end of an export counts every block, data type, tag table and technology object once, also when it writes an XML and a source file for it. It names the items that could not be exported: a name that is not in the project, an item whose path in the export folder would be longer than 259 characters (choose a shorter export folder), and items TIA Portal does not permit to export, which are counted as not exportable.

A group whose name ends in a dot or a space, which Windows does not allow at the end of a folder name, gets a numbered folder such as Motor (1) in the export folder, so it never shares a folder with a group named Motor. An import gives the group its original name back.

Blocks with a source file, F-blocks as XML and S7DCL

Standard blocks written in SCL or STL get an editable source file (.scl or .awl) next to the XML, which you can open in the editor, change, and import back. Blocks of the safety program (F-blocks, yellow icon in the Project Explorer) get no .scl source file, because TIA Portal does not generate one for them; they are exported as XML and, on TIA Portal V20 and newer, additionally as an .s7dcl text document when the S7DCL export for LAD/FBD is switched on (see below). You can edit that document, for example add a network, and import it back; the F-signature of the block changes when you do.

Whether a block belongs to the safety program follows from its programming language in TIA Portal (F-FBD, F-LAD, F-DB and so on), not from its name. A standard SCL function named F_Motor, for example, exports like any other standard block, with XML plus .scl source file, and shows the regular block icon.

Import Operations

After every successful import (whether Import Selected, Import All, or a drag onto the Project Explorer), the PLC is compiled, so it is ready to use right away. If compilation reports errors, the import still completes.

Import All also saves the project when it finishes, and its confirmation dialog says so before you start. An import that does not finish, one you cancelled for example, is the exception: the message at the end tells you whether to close the project in TIA Portal without saving or to run Import All once more.

Import Selected

  1. Check the boxes next to the desired files in the export-folder tree.
  2. Click Import Selected.
  3. The checked files are imported (no file picker). Existing blocks with the same name are overwritten; all other PLC content is left untouched.

A block that already exists in the project keeps its folder when you import it again from a single file, and so does a block the AI assistant changes in the export folder and imports again. A block file that sits in a sub-folder of the export folder lands in the matching folder of the project; when the folder does not exist yet, it is created.

Checked watch and force table files are imported into the watch and force tables of the PLC: a watch table that already exists is replaced in the folder that holds it, a new one goes to the top level of the watch tables. The force table is imported only when the force table of the PLC is empty.

Changed files of a folder under Git can also be imported straight from the Source Control view, through the same import; see Git for TIA Portal & PLC Code.

Import All

  1. Click Import All.
  2. The entire PLC program is cleared first (all blocks, data types, and tag tables are deleted), then all importable files for the chosen PLC are imported, a full project re-import. If the export folder contains a sub-folder named after the chosen PLC (the layout Export All creates), exactly that sub-folder is imported; otherwise the export folder itself is used. A warning dialog shows the file counts and requires confirmation.

Important: Import All replaces the complete PLC content with what is in the imported folder. Items marked as protected with the red lock (folders, tag tables, and data types as well as blocks) are neither deleted nor overwritten (and neither is any block that is know-how-protected on the PLC, nor the organization blocks of the safety program). When an organization block sits inside a marked folder, its file is left out entirely, its attributes included. If the import cannot be applied, it is rolled back. The notification says whether the PLC is unchanged or may be incomplete, for example when the rollback did not succeed, names the cause and offers a Show Details button that opens the log. When the PLC may be incomplete, it also tells you how to get the previous content back: close the project in TIA Portal without saving, or run Import All once more if the project was already saved. The same applies when you cancel Import All, and afterwards the Project Explorer shows the current content of the PLC.

Import All does not delete watch and force tables. Once the program is imported, the watch and force table files of the folder are imported as well, each watch table into the folder where a table of that name already is, otherwise at the top level, and a second message reports them.

Tip: Close all editors that are open in TIA Portal (blocks, tag tables, data types) before you start Import All. TIA Portal closes and reopens every open editor while the import changes the project, so each open editor makes the import noticeably slower. Studio cannot close these editors for you, and the confirmation dialog reminds you of this.

Duplicate names: If the imported folder contains the same data type or block twice (twice as a source file, or twice as XML in different locations), the import cannot be applied, because each name may exist only once in TIA Portal. Import All checks for this before any change, stops immediately, and names the affected item and both locations in the message. Rename or remove one of the two files and run it again. The normal export pairing of an XML and the matching source file for the same item does not count as a duplicate.

You can also import by dragging file or folder rows from the export-folder tree onto a PLC node (or its Program blocks / PLC data types / PLC tags folder) in the Project Explorer. Dropping anywhere else warns you. Dropping external files from the OS onto a PLC node (or one of those folders) also starts an import.

SCL blocks are formatted before the import

Before SCL blocks reach TIA Portal, Studio lays them out in the TIA Portal editor layout, with the values from the SCL Formatting section under Editor in the Settings editor (tab width, indent and parameter alignment). A block written outside TIA Portal, by you or by the AI assistant, therefore arrives with the indentation TIA Portal gives it. This applies to every import of .scl files; data blocks, data types and XML files are imported as they are. To import SCL blocks exactly as written, turn off Format SCL Blocks Before Import in the same section. If a block cannot be formatted, it is imported as written and the import message names it. Where to read the values in TIA Portal is described in Settings.

Protected items during an import

Every import leaves items untouched that are marked with the red lock in the Project Explorer: Import Selected and Import All as well as a drag, Import Files…, Import All…, the Compare Editor import, a save from the block editor, from the interface table or from a tag table editor, imports made by the AI assistant, generated test blocks, and deploying from Forge. Each of them says so afterwards instead of changing the item. The message at the end says how many protected items were left unchanged, and Show Details lists them one by one. If the marks of the target cannot be read, nothing is imported and a message names the reason. When you pick files in the file dialog or drop them from the file explorer, only the mark on the item itself counts there, not one on a folder. A mark on a tag table or a technology object also keeps a tag import or a technology object import from overwriting it, and a marked technology object is not saved from its editor. Folder marks also apply when you gave the category folders of the export folder other names in the settings. The full picture is in Protected Items.

Blocks and data types of the safety program are only changed while you are logged in to the safety program (inside TIA Portal, or through Safety Login). Without the login they stay unchanged, and a warning says how many there were and offers Safety Login.

Progress and cancellation

While an export or import runs, a progress footer appears between the path row and the tree, showing the operation name, a current/total count, a live stopwatch (minutes:seconds, switching to hours when a run takes that long), the current item, and a Cancel button. The same progress also shows in the Status Bar at the bottom of the window. Click it to cancel.

When the operation ends, the footer keeps showing its name and total duration until the next operation starts, so you can always see how long the last run took.

Exported files are prepared for version control while the export runs, so they are ready the moment it ends. Some exports, for example with XML Only on, prepare the files in a short step after the last exported item; the footer shows it ("Preparing files for version control (i/N)"). If you cancel an export, a warning tells you how many files were left unprepared. Run the export again to complete it.

For Import All, a notification additionally appears at the bottom right, showing each step live (including the preparation) and offering its own Cancel button.

Import / Export Settings

These options customize import and export behavior. Open the AnyAutomation Settings editor (Ctrl+, or via the gear/menu) and go to the Import/Export Settings category:

Import Options:

Option Description
Ignore Structural Changes Ignores structure modifications when importing
Ignore Missing References Continues import even if referenced objects are missing
Fault Tolerant Import Continues past recoverable per-block errors
Prefer .udt over .xml Off by default: when a data type is in the import folder as both a .udt source and an .xml file, Import All imports the .xml and skips the .udt. Turn it on to import the .udt and skip the .xml instead. If only one of the two is present, that one is imported either way. Note: a .udt source does not carry the fail-safe attribute of a data type, so a fail-safe data type is always imported from its .xml.
Keep Block Number on S7DCL Import Off by default: when TIA Portal gives a block a new number while it replaces the block from its .s7dcl file (when you save a .s7dcl tab in the editor, import a .s7dcl file, or let the assistant import or upload one), the block keeps the number TIA Portal gives it and the result names the old number. Turn it on to get the old number back. A block that TIA Portal numbers automatically without letting you switch that off, for example every block of a software unit, and a block of the safety program keep the new number either way. A block that was numbered automatically already gets its final number from TIA Portal when the PLC is compiled, so the result names no number for it.

Export Options:

Option Description
Program Blocks Which default values are included when exporting blocks: None / With Defaults / With Read-Only.
Data Types As above, for data types.
Tags As above, for tag tables.
Technology Objects As above, for technology objects.
HMI As above, for HMI content.
WinCC Unified Screen Format How WinCC Unified screens are written: WinCC Markup (default) or Spreadsheet (.xlsx), one workbook per screen. Tag tables, lists and scripts always use the markup format.
Export Protected Files When unchecked, items marked as protected (red lock) are excluded from export; folder structure is always preserved. Watch and force tables carry no red lock and are always exported.
Data Types as .udt Source Off by default: data types export as XML only. Turn it on to also get an editable .udt source file next to the XML. Note: a .udt source does not carry the fail-safe attribute of a data type, so fail-safe data types always export as XML only. Has no effect while XML Only is on.

Exports the chat assistant runs for you use exactly these export options and the version control settings below; they cannot be changed from the chat.

Version Control (export optimization):

Option Description
Exclude Document Info (recommended) Removes the volatile document info (including the export timestamp) from the exported XML, for clean version-control diffs.
Normalize Timestamps Normalizes timestamps in the exported XML.
Clear Installed Products Removes the installed-products list from the exported XML.
Remove Object List Removes the object list from the exported XML.
Normalize Whitespace Normalizes whitespace in the exported XML.

These options help resolve common import issues and customize export behavior for version control. Changes take effect on the next refresh, no reload required.

Note: XML Only (XML representation only, without the editable source file) is not a control in the Settings editor. To switch it on, open the All Settings link below the category list, search for xml only and tick Export: Xml Only in the TIA Portal section.

Data types as editable source files

Exporting data types gives you the XML. To also get a readable source file (.udt) next to it, just like blocks, turn on Data Types as .udt Source in the export options. You can open these source files in the editor, change them, and import them back into a project. With the option off, an export also removes an older .udt of the same data type from the export folder, so the folder never keeps an outdated source.

Data types that build on other data types get their .udt the same way and can be imported back as well. XML Only drops the source file for blocks and data types alike, so while it is on, data types export as XML only whatever Data Types as .udt Source says.

When you run Import All on a folder that holds a data type as both a .udt and an XML, Prefer .udt over .xml in the import options decides which one is used: off (the default) imports the XML, on imports the .udt, and the other one is skipped. If only one of the two is in the folder, that one is imported either way.

The chat assistant follows both options when it exports or imports data types for you.

Note: A .udt source does not carry the fail-safe attribute of a data type. That is why a fail-safe data type always stays XML, as described below.

Fail-safe data types as XML only:

A PLC data type of the safety program is exported as .xml only, whatever Data Types as .udt Source says. If an older .udt of that same data type still sits next to the .xml in the export folder, the next export removes it.

On import, a fail-safe data type always comes from its .xml, whatever Prefer .udt over .xml says; a .udt next to it is skipped and listed in the details with the reason.

A .udt, or a source file that declares a data type which is fail-safe in the project, is not imported: it is listed with an explanation, and the data type in the project stays fail-safe. From such a source file Import All still takes everything else it contains, that is the other data types and blocks in it.

A fail-safe data type can only be imported into a fail-safe CPU. On a standard CPU it is not imported, and the message says so.

With Open UDTs as .udt on in the editor settings, a fail-safe data type opened from the Project Explorer shows its source document for editing on TIA Portal V20 and newer: change it and press Ctrl+S to write it back into the project and recompile the PLC, with the same confirmation as any other block save. Without the login to the safety program the save is refused, and the message offers a Safety Login button. On an older TIA Portal version it opens read-only, and with the option off it opens as read-only XML. The export is unaffected: such a type is still written as .xml only.

S7DCL Export (TIA Portal V20+ only):

S7DCL (SIMATIC source documents) is an additional text-based export alongside the standard XML and source-code files (it appears as .s7dcl files in the export folder). It can be enabled per source language (SCL, STL/AWL, LAD/FBD). It is ideal for code review and diff comparison in Git/SVN, and for LAD/FBD blocks it provides a text representation that would otherwise not exist.

S7DCL Import (TIA Portal V20+ only):

.s7dcl files can also be imported back into the project: through every selective import path: check them in the export-folder tree and click Import Selected, drag them (or their folder) onto a PLC in the Project Explorer, pick them in the import file dialog, or drop them from the Windows Explorer.

  • If the same block is also present as a .scl, .awl, or .xml file in the same import selection, that file is used and the .s7dcl is skipped. The result notification lists the skipped files. A .s7dcl is therefore imported exactly when it is the only representation of that block in your selection.
  • Import All deliberately leaves .s7dcl files out, because the regular export files next to them carry the same content. To import a standalone .s7dcl, use one of the selective import paths above.
  • If a .s7res file with the same name sits next to the .s7dcl, its comments and texts are imported along automatically. Keep the two files together when copying or renaming.
  • An existing block is replaced in place. When TIA Portal refuses the document, the block stays as it was, and the result names the block as failed with TIA Portal's reasons. When the block sits in another folder of the PLC than the one you import into, Studio moves it there; if TIA Portal then refuses the document, the block goes back into its old folder and the result says so. A block that cannot be saved first, for example a know-how protected one, is never removed: the import of its document is refused instead.
  • TIA Portal can give the replaced block a new number. It does this when the document names no block number (the line S7_BlockNumber is missing, for example in a document written by hand or by another tool), and it then numbers the block automatically, so the block gets its final number when the PLC is compiled. The result names the old number and says that TIA Portal now numbers the block automatically, and the block keeps the number TIA Portal gives it. Turn on Keep Block Number on S7DCL Import in the import options (off by default) and Studio sets the old number back instead, except for blocks TIA Portal numbers automatically without letting you switch that off and for blocks of the safety program. If another block already carries the old number, or Studio cannot check that, Studio leaves the number as it is and the result says why. A number the document names is taken as it is and never set back, and the result says that the block took it from its document; when another block already carries that number, the result names that block, and the compile of the PLC reports the duplicate number.
  • When an export could not write the .s7dcl of a block, the result says so and gives TIA Portal's reason; the other files of the block are written as usual.

Important Notes:

  • S7DCL is an additional export, not a replacement: you always get the standard formats.
  • S7DCL export and import require TIA Portal V20 or higher; on an older version the import reports the affected .s7dcl files as failed with a clear message.

Named value types (TIA Portal V20+ only):

The named value types of the software units are exported with the data types, one .nvt file each next to the data types of their unit, and imported back through Import Selected, Import Files, drag and drop and Import All. A .nvt file goes into the software unit and folder its place in the export folder names and replaces a named value type of the same name; a file outside the export folder of a software unit is refused with the reason. Import All imports the named value types before the program; they stay when the import of the program is rolled back, and the result says so. An export folder that holds only named value types is not empty for Import All: the confirmation counts them and says that the program of the PLC stays unchanged. See Project Explorer.

HMI Export/Import

For projects with HMI devices (WinCC Unified, Comfort Panels, etc.), click the HMI selection chip, then use the actions in the right column:

Export HMI Selected:

  1. Tick HMI elements in the Project Explorer (under the HMI device node).
  2. Click Export HMI Selected.
  3. Choose the HMI device if the project has more than one.
  4. The ticked screens, templates, tags, and scripts are exported into a subfolder named after the device in your export folder.

Export HMI All:

  1. Click Export HMI All.
  2. Choose the HMI device if the project has more than one.
  3. All elements of that HMI device are exported into your export folder.

Supported HMI Elements:

  • Screens and Popups
  • Screen Templates
  • HMI Tag Tables
  • VB Scripts
  • Connections
  • Text Lists
  • System Text Lists
  • Graphic Lists
  • Cycles
  • Slide-in screens (classic HMI devices)

Cycles and slide-in screens of classic HMI devices

The export of a classic HMI device writes its cycles into a Cycles folder and its slide-in screens into a Slide-in Screens folder, both inside the device folder next to Screens, Text Lists and the other categories. The standard cycles of TIA Portal are exported as well, and each slide-in screen file is named after its position (Top, Left, Bottom or Right).

To bring such files back, tick them in the export-folder tree and click Import Selected. The checked files of each classic HMI device go into that device, with one result per device; the other checked files are imported into the PLC as before. This works whether the Project Explorer is open or not.

  • An unchanged standard cycle is skipped: the message says how many items were skipped and names them, with the reason Standard cycle unchanged, nothing to import.
  • A standard cycle that the file changes is not imported, and the message names what the file changes. Change a standard cycle in TIA Portal instead. A file that holds a standard cycle together with other cycles is not imported either: a file with a standard cycle can only be imported on its own.
  • A slide-in screen replaces the slide-in screen at the position named inside the file, whatever the file is called. When the file name points to another position, the message says which slide-in screen was replaced. A slide-in screen file must hold exactly one slide-in screen, and a device without slide-in screens refuses the file because it has no place for this kind of item.
  • Your own cycles are imported and replace a cycle of the same name.
  • A file that is refused is named in the message by your own file path, with the reason: "..." was not imported: ...

WinCC Unified Screen Export/Import

WinCC Unified screens are exported as JSON files (not XML like Classic HMI). The export includes all screen items with their properties, positions, colors, fonts, texts, compositions (e.g., ListBox entries), dynamizations, and events.

  • Export Selected: Select screens in the HMI tree, click Export HMI Selected.
  • Export All: Click Export HMI All, choose the device: exports all screens of that device preserving the folder structure (e.g., Screens/Popups/Mixer.json).
  • Import: Check the JSON files in the export-folder tree, click Import HMI Files…. Existing screens with the same name are deleted and recreated. A screen with a range condition whose limits TIA Portal does not hand out is not imported; the message names the affected conditions, and the screen in the project stays as it is.
  • Screen format: under Import/Export Settings, WinCC Unified Screen Format chooses how each Unified screen is written: WinCC Markup (the default, the export described above) or Spreadsheet (.xlsx), one workbook per screen under Screens. A workbook opens in Excel, and Import HMI Files… or Import HMI All… brings it back; every sheet in it is one screen, and a cell you leave empty is not written back. Tag tables, lists and scripts always keep the markup format. A screen too wide for a spreadsheet is reported as failed, and the message points to the markup format instead.
  • Inside a workbook: the first row is the header and names one property per column, starting with Type and Name. The second row is the screen itself, and every row below it is one object on the screen. A property that sits inside another is written with dots (Caption.Font.Name), an entry of a list carries its position in square brackets (Columns[4].Header.Text), and a text kept in several project languages gets one column per language (Caption.Text.en-US, Caption.Text.de-DE). Colours are written as 0xAARRGGBB, a switch as TRUE or FALSE, and a choice by its name. Change the cells you want and import the workbook back; an empty cell means the property is left as it is, so a text you really want empty has to go through the markup format.
  • Opening an exported screen: click an exported screen in the export-folder tree to open it in the Screen editor, also when no project is connected, and import it back into the device it came from.
  • Screens keep their folders: the export writes every screen into the screen folder it has in the project, empty screen folders included, and a screen is imported back into the folder it was exported from.
  • Tag tables: HMI tag tables are exported into the tag table folders they have in the project (e.g., HMI Tags/Mixing Plant/Dosing/), empty folders included, and are imported back into them; a tag table folder that is missing on the device is created during the import.
  • Text lists and graphic lists: all text lists of a device are exported as one file under Text Lists, all graphic lists as one file under Graphic Lists, and the system text lists the device carries as one file under System Text Lists. Each of the three comes back on import from the folder it was written into. Ticking single lists exports the whole category, because TIA Portal offers no export of a single list. System text lists need TIA Portal V20 or newer, graphic lists V21.
  • Pictures: the export also writes the pictures the exported screens use into a Graphics folder next to them, in their original size, so an exported screen shows its artwork on a machine without TIA Portal. The message after the export says how many pictures were written, or that the screens were written without them. The folder is written for you to look at, not to import: it is left out of Import All, Import Selected and Import HMI Files…, and if you pick one of its files by hand, Studio tells you how many it left out.
  • In the export-folder tree: the exported tag tables, scripts, text lists and graphic lists are listed with the icon of their category, and a folder under HMI Tags that holds further folders shows the folder icon. Import Selected leaves WinCC Unified files to Import HMI Files… and tells you how many it left out.

Note: For WinCC Unified screens, all elements will be placed in Layer 0 after import, because TIA Portal does not hand out layer assignments. Positions and all other properties are preserved correctly.

Safety

For safety programs, click the Safety selection chip, then use the action in the right column:

  • Export F-Signatures: exports the F-signatures of the safety program. Pick the PLC, then choose where the report is written: the save dialog offers the file type Text (Tab delimited) and suggests the name <PLC>_FSignatures.txt. The report holds one line per safety block with its signature, and its columns are separated by tabs. With TIA Portal V21 or newer, the head of the report also lists the signatures of the whole safety program: the collective F-signature, the collective F-SW-signature, the collective F-HW-signature and the F-communication address signature, written the way the Safety Administration editor shows them. A signature the program does not have reads none. With an older TIA Portal version the head of the report says that these signatures are not available, because only V21 and newer hand them out. A notification then says how many signatures were written and where.

Watch/Force

Click the Watch/Force selection chip to export and import watch and force tables. The right column offers:

  • Export Watch Tables: exports the project's watch tables into the export folder.
  • Export Force Tables: exports the project's force tables into the export folder.
  • Import Tables…: brings exported watch and force tables back into the project.

To write entries into a watch table, import a watch table file with Import Tables…: for each entry the file can carry the address, the name, the display format, the monitor and modify triggers, the modify value and a comment. Creating, renaming and deleting watch tables and their folders, and reading the entries of a table, is done in the Project Explorer.

After an import the message counts the imported tables and names them. If the watch table of a file already exists in the project and a web server access rule names that table, the import is refused, and the message asks you to remove the rule in TIA Portal first. The name of a watch table counts for the whole PLC: a file whose watch table name is already used in a folder of the watch tables is not imported, and the message names where that table is; a watch table of the same name at the top level of the watch tables is replaced. The force table is only imported when the force table of the PLC is empty. If a watch table cannot be exported, for example because it is not consistent, the message names it, and the other tables are still exported.

Software-Unit metadata round-trip

Software Units appear in the Project Explorer with their namespace shown next to the name (for example Unit_1 [A]), while the bare name is kept for every operation. When you export and later re-import a Software Unit, its namespace, author, and comment are preserved across the round-trip, and its blocks, data types and tag tables go back into the unit, also when you import single files or drag them onto the Project Explorer.

A block of a software unit that has a namespace is exported as <name>@<namespace>, for example FB_Motor@Drives.xml, so blocks of the same name in different namespaces keep their own files, and an import puts each file back onto its own block. Files with the old name from an earlier export can be deleted once the new files are there; scripts or tools that read your export folder by block name should look for the new file names. A PLC data type of a software unit that has a namespace is exported the same way, for example UDT_Motor@Drives.xml, and an import puts it back onto the data type of that namespace. See Project Explorer.

Import All puts every file back onto its own block or data type, also when two blocks of one name sit in the same software unit. When the export folder still holds a file with the old name from an earlier export next to the new file of the same block or data type, Import All stops before it changes anything and names the older file: delete that file, or run Export All again with Clean Target On Export All switched on in the TIA Portal export settings.

Hardware Export

Export the device configuration as an AutomationML (.aml) file:

  1. Click the Hardware selection chip.
  2. Click Export AML in the right column and enter the file name in the save dialog Save AML Export, which opens in the folder that holds the project folder. If the file already exists, the save dialog asks whether to replace it, and Studio does not ask again.
  3. Use Import AML in the same column to bring an .aml file back into the project.

Note: AML export covers the full hardware configuration of the selected PLC. The resulting .aml file can be re-imported or kept for documentation.

On import, after you pick the file, Studio asks What happens with a device that already exists in the project?:

  • Overwrite Devices in the Project: a device of the file replaces the device of the same name in the project. TIA Portal deletes that device and builds it again from the file, so everything set up on it only in TIA Portal is lost, such as the PLC program, module parameters, module names and network settings. Before it imports, Studio names the devices of the project that carry exactly the name of a station in the file and asks: click Replace and Import to continue or Cancel to stop without changing anything. When no device is replaced, the import starts right away. If Studio cannot read the file as AutomationML, nothing is imported and a message says so. TIA Portal can still refuse the replacement per device and keep the device, so check the result.
  • Keep Devices in the Project: a device that already exists stays as it is; only devices without a conflict are added.
  • Move Conflicts to the Parking Lot: a conflicting device of the file goes to the device group ParkingLot at the top of the project, and its name gets the suffix _CAX; a name with a slash is shortened. The message names the moved devices. While the ParkingLot group still holds devices, another such import is refused and nothing is imported: move or delete those devices in TIA Portal, then import again.

What TIA Portal reports on an import or export is shown in the message with up to ten entries, errors first; Show Details opens the TIA Portal output with every message, indented by its level. An export can write a file even though TIA Portal reported errors, for example when it skipped a classic HMI device: the message then says the file was written but parts of the project are missing in it. If the project cannot be exported as a whole, one file is written per device, and the message starts with TIA Portal could not export the whole project, so it wrote one AML file per device and names the files written or, when the files are named after the device in the folder of the chosen file, how many devices were exported, along with how many were skipped.

AML import and export are not offered for TIA Portal V18; use V17 or V19 and newer.

Export OPC UA Nodes

Export a CPU's OPC UA server interface as a single XML file:

  1. Right-click the CPU in the Project Explorer and choose Export OPC UA Nodes from the Export submenu (also available from the Command Palette as TIA Portal: Export OPC UA Nodes).
  2. If no export folder is configured yet, a folder picker appears, so you can choose where to write the file.
  3. Studio writes the CPU's OPC UA server interface to a single XML file named after the CPU, into the export folder. It is the same XML the CPU's OPC UA export button produces in TIA Portal: it contains all tags and DB variables the CPU exposes to OPC UA.

Progress is shown while the export runs; on success you can open the folder straight from the notification. Hand the resulting XML to any OPC UA client to configure it offline.

Note: The CPU must be offline. If it is online, you get a clear message to go offline first. The whole CPU interface is always exported as one file; there is no per-tag or per-DB selection.

From the assistant: you can ask for the same export in the chat. Name the CPU and the folder, and the assistant shows you what it is about to write before it writes it, including that files of the same name are overwritten; it runs only after you approve. The folder has to sit in your Documents, on your Desktop or in your temporary folder.

Add OPC UA Server Interfaces and Reference Namespaces

Besides the standard interface every CPU publishes, a CPU can publish your own OPC UA server interfaces, for example a small set of nodes for a SCADA system, a text in several languages or a value shown with names instead of numbers. Studio adds such an interface, and the reference namespace that brings its own data types, from XML files:

  1. Right-click the CPU in the Project Explorer and choose Import OPC UA Reference Namespace... or Import OPC UA Server Interface... from the Export submenu (also in the Command Palette under the same names).
  2. Pick the XML file. A reference namespace is a NodeSet2 file with data types, for example an enumeration; a server interface file describes the nodes and the PLC tag each node reads and writes.
  3. Enter the name the new object gets in the project. Studio proposes the file name and refuses a name the CPU already uses for a server interface or a reference namespace.
  4. Confirm. Studio adds the object and tells you when it is done.

The import only ever adds: existing server interfaces, reference namespaces and the settings of the CPU stay as they are. To export, check, replace, change or delete an interface the CPU already has, see the next section. If TIA Portal does not accept the file, nothing is added and the message gives the reason. The new nodes reach the PLC after you compile the CPU and download it.

Note: Adding an interface needs the Pro plan. Server interfaces need TIA Portal V15.1 or newer, reference namespaces V16 or newer, and a CPU with an OPC UA server.

From the assistant: ask in the chat to list the server interfaces of a CPU or to add one from a file. Before anything is added, the assistant shows you the name, the file and the CPU, and it runs only after you approve.

Export, Check and Replace OPC UA Interfaces

With the Pro+ plan, the Export submenu of a CPU in the Project Explorer offers five more commands, right below the two import commands, for the server interfaces and reference namespaces the CPU already has. They appear while Studio is connected to TIA Portal and are also in the Command Palette under the same names.

  • Export OPC UA Interface File...: pick a server interface and a file name. Studio writes the interface as a NodeSet XML file. You can edit the file and bring it back with Replace OPC UA Interface from File.... Reference namespaces cannot be exported; keep the file you imported them from.
  • Validate OPC UA Interface File...: pick the CPU and the file, choose whether the file is meant as a server interface or a reference namespace, and pick the interface it would replace or A new interface. Studio checks the file and opens a report with errors and warnings: the structure of the NodeSet, nodes and references that cannot be found, the OPC UA properties such as engineering units and ranges, every mapping to a PLC tag (does the tag exist, does the data type fit) and how many nodes the server interfaces of the CPU would use compared with the limit of the CPU. Nothing is changed.
  • Replace OPC UA Interface from File...: pick a server interface or a reference namespace and a file. Studio checks the file first. If it has errors, nothing is imported and the report lists them. Otherwise a confirmation shows the warnings and the node count; after Replace the content of the interface is replaced as a whole by the file. The interface keeps its name and its place in the project. When you replace a reference namespace, server interfaces that use a type the file no longer contains get warnings at the next compile.
  • OPC UA Interface Properties...: switch an interface on or off, and change its author and its comment in each project language. When TIA Portal does not report whether an interface is switched on, Studio asks you to choose Enable or Disable. Creation time, last change and, from TIA Portal V21, the generation settings of a reference namespace are shown for information.
  • Delete OPC UA Interface...: removes a server interface with all its nodes, or a reference namespace with its types, after a confirmation.

Studio does not pass on a file that contains a document type or entity declaration, or a file larger than 50 MB: the report names the reason, and nothing is imported.

After each change the message offers Compile. The PLC publishes the change only after you compile the CPU and download it.

Note: These commands need the Pro+ plan. Server interfaces need TIA Portal V15.1 or newer, reference namespaces V16 or newer.

From the assistant: the assistant can do the same: export an interface file, check a file, replace the content of an interface, change its properties and delete it. It checks every file before it asks you, and a file with errors is never imported. Every replace and every delete asks you first, also when you allowed the tools for the session.

Single tags and user constants

Export: open a PLC tag table, select one or more rows with Ctrl or Shift, right-click and choose Export Selected Tags.... Each selected tag and user constant is written as its own XML file into the Tags subfolder of the export folder of the PLC. Members of a structure, system constants and section rows are not exported. The message counts the files and names every row that was not exported, with the reason, and the first file is shown in Windows Explorer.

Import: right-click a tag table in the Project Explorer and choose Import Tags into Table.... Pick one or more files; the picker opens in the Tags folder. Studio reads from each file whether it holds a tag or a user constant, and for files that do not say, it asks you once which of the two they are. A file that holds a whole tag table is not imported here, and the message points you to Import Selected in the Import / Export view. A confirmation names the table and the files and says that an object of the same name already in the table is replaced, moves to the end of the table and keeps only the comment languages the file carries. Afterwards the message names the imported files and every refused file with the reason: a file of the other kind, a name that already exists in another tag table of the PLC, or a fail-safe tag while you are not logged in to the safety program. It also names the tags that moved to the end of the table and the comment languages that were cleared because the file did not carry them. The tree of the PLC is refreshed.

Data block snapshot

To keep the actual values TIA Portal stores with a data block, right-click the data block in the Project Explorer, choose Export Snapshot and click Save XML in the tab that opens: the snapshot is written as an XML file named after the block into the export folder of the PLC. The file is not imported back into the project. For the snapshot tab itself, see Project Explorer.

Source with dependencies

Right-click a block or a PLC data type in the Project Explorer and choose Export Source with Dependencies: Studio writes the source of the item together with everything it depends on, the blocks it calls and the data types it uses, as one file into the export folder of the PLC, the dependencies first. A block gives a .scl file, a PLC data type a .udt file, named after the item. If a file of that name already exists, Studio asks before replacing it, and if the export fails, your existing file stays as it was. The message names the file and how many objects it holds, and the file is shown in Windows Explorer.

TIA Portal writes such a source only when every object in it is available as text: a block that is not written in SCL, for example in LAD or FBD, a know-how protected block or a fail-safe block anywhere among the dependencies makes it refuse, and the message names the object and the reason. The export is also refused while the PLC is online.

To read the same text without writing a file, open the block or PLC data type in the editor and choose Show Source with Dependencies in the More Actions menu (...) of the editor title bar or in the Command Palette: a read-only tab titled with the name and (with dependencies) opens. Choosing it again reads the source again.

ProDiag exports

Three entries in the Project Explorer write ProDiag information into the ProDiag subfolder of the export folder of the PLC:

  • Export ProDiag Alarms (CSV), on a function block written in ProDiag: the alarm texts as CSV files, one per project language. The block and its instance data block have to be compiled.
  • Export Supervisions (Excel), on a function block written in ProDiag: the supervisions of the block as an Excel workbook; on a PLC: the supervisions of all its blocks.
  • Export Supervision Settings, on a PLC: the supervision settings as a settings file.

If files of the same name already sit in the ProDiag folder, Studio asks once before replacing them. The first file is shown in Windows Explorer, and the message names where the files went. If TIA Portal ends the Excel export with a state other than success, a warning names that state and, where there is one, its log file. A block not written in ProDiag, a block or an instance data block that is not compiled, and a missing instance data block are refused with a sentence. The Properties of a function block show how many supervisions it carries.

Library

Click the Library selection chip to export Project Library types as XML files. The right column offers:

  • Export Selected: exports the library type selected in the Project Explorer; if a library folder is selected, every type beneath it is exported.
  • Export All: exports every type in the Project Library.

The types are written as XML into a Library subfolder of your export folder, mirroring the library's folder structure; the latest version of each type is exported. As a shortcut, you can also drag library types (or a whole Types folder) straight from the Project Explorer onto the export-folder tree; they export the same way.

Note: Master Copies are not included: they cannot be exported directly to a file. For more about the library, see Library Management.

JSON

Click the JSON selection chip to export data blocks, PLC data types and tag tables as JSON files, for example for a SCADA system. The right column offers:

  • Export Selected exports the data blocks, PLC data types and tag tables you checked for export in the Project Explorer.
  • Export All exports every data block, PLC data type and tag table of every PLC.

The files land in the same export folder as the sources of your program, in the folder of each PLC under Json: data blocks in Json/Datablocks, PLC data types in Json/Datatypes and tag tables in Json/Tags. Each file is named after its object, for example DB_Motor.scada.json. Global and instance data blocks are exported the same way.

When emptying the folder before "Export All" is switched on in the settings, Export All removes from the Json folder after the export every file that no longer belongs to an object of the project, for example of deleted or renamed blocks. When you cancel the export, the files of the previous export stay. A Software Export All leaves the Json folder in place. A file whose content has not changed stays as it is, so version control shows only real changes. Items with the red lock are included, as in the Software export, only when protected files are exported. Import Selected and Import All skip the JSON files.

The JSON export needs a connected project. While it runs, the area below shows the progress and the time, and Cancel stops it. At the end Studio tells you how many files were written and names the objects that could not be exported; Show Details opens the log with the reason. You can also ask the AI chat for the JSON export, of a whole PLC or of single objects; the files land in the same folders, and the chat never empties the Json folder. You can also save single items to a place of your choice with a right-click in the Project Explorer and Export as JSON, see Forge.