Tia-Portal-CLI

Read a Siemens TIA Portal project from the command line

The largest family, and the one an AI agent calls first. Nothing here changes the project, so these verbs are safe to run against a live engineering project: they list and export blocks, tags, types, devices, networks and cross-references, and print the project tree in a form a model can read.

123 of the 351 verbs · TIA Portal V19, V20 and V21

tia info [--history N]
project identity: PLCs, devices, author, comment and copyright (the project description written in the GUI), lastModifiedBy, size, version, languages and usedProducts
tia list-devices
See the verb's own --help.
tia list-blocks [--folder A/B] [--type FB|FC|OB|GlobalDB|InstanceDB] [--count] [--comments]
without a filter = ~500 blocks in a real project
tia list-tags [--table "Folder/Table"]
without --table: one line per table, plus one row with an empty table for each folder that has no table at all
tia list-types [--comments]
--comments adds the UDT title and comment when the selected Openness API exposes them (V19 returns a typed capability error)
tia list-system-blocks [--like X]
the SYSTEM blocks folder
tia list-system-types [--like X]
the SYSTEM data types folder
tia tree [--out DIR] [--depth N] ← START HERE: outline of the whole PLC (blocks + tag tables + UDTs) in plc-navi.md, ~26 KB in a project with 476 blocks (the same in JSON: 117 KB); --depth N keeps the first N folder levels and folds deeper folders into their ancestor
See the verb's own --help.
tia find --pattern P* [--kind block|table|tag|type|constant]
* and ? are the only wildcards
tia xref --name X
block, tag or UDT → what it uses
tia reachable [--from BLOCK] [--orphans]
call tree from every OB, or from --from, built from the xref of each block: calls = block → blocks it uses, orphans = FB/FC/DB no root reaches
tia unused
read-only: what the program carries without using it, from one XML export of every block, tag table and UDT into --out/unused: unreachableBlocks = blocks no OB reaches (name, type, folder), unusedTags = PLC tags no block names, per…
tia show-in-editor --name X
opens block, UDT, tag table, watch/force table or device in the Portal editor
tia trace --equipment AG-01
symbols of the equipment + who references them
tia list-hmi [--device X]
WinCC Classic and Unified: screens + tag tables
tia export-hmi-tags --table "Folder/Table" [--device X] [--out DIR]
SimaticML of the HMI tag table
tia import-hmi-tags --file F.xml [--device X] [--folder "Folder/Sub"] [--replace OLD=NEW ...] [--apply]
pair of export-hmi-tags
tia delete-hmi-tag-folder --path "Folder/Sub" [--device X] [--apply]
opposite of the --folder of import-hmi-tags
tia hmi-tree [--device X]
outline of every HMI → hmi-navi.md, grouped by folder
tia export-screen --screen "Folder/Sub/Screen" [--device X] [--out DIR]
SimaticML of the screen
tia import-screen --file F.xml [--device X] [--folder "Folder/Sub"] [--replace OLD=NEW ...] [--apply]
--folder is the full path from the screen root, same as import-block
tia delete-screen --screen "Folder/Sub/Screen" [--device X] [--apply]
opposite of import-screen
tia list-hmi-scripts [--device X]
every VBScript of the panel, by "Folder/Sub/Name"
tia export-hmi-script --script "Folder/Sub/Name" [--device X] [--out DIR]
SimaticML of the VBScript
tia import-hmi-script --file F.xml [--device X] [--folder "Folder/Sub"] [--replace OLD=NEW ...] [--apply]
pair of export-hmi-script
tia delete-hmi-script --script "Folder/Sub/Name" [--device X] [--apply]
opposite of import-hmi-script
tia list-screen-parts [--device X]
the screen objects that are not a screen: templates, pop-ups and the configured slide-ins
tia export-screen-part --kind template|popup|slidein|overview|globals [--name X] [--device X] [--out DIR]
SimaticML of a screen part
tia import-screen-part --kind template|popup|slidein --file F.xml [--device X] [--folder "Folder/Sub"] [--replace OLD=NEW ...] [--apply]
overview and globals have no import
tia delete-screen-part --kind template|popup --name X [--device X] [--apply]
only template and pop-up expose Delete
tia export-hmi-object --kind textlist|cycle|connection --name X [--device X] [--out DIR]
SimaticML of a classic HMI text list, cycle or connection
tia import-hmi-object --kind textlist|cycle|connection --file F.xml [--device X] [--replace OLD=NEW ...] [--apply]
creates, or overrides the object with the same name
tia delete-hmi-object --kind textlist|cycle|connection --name X [--device X] [--apply]
opposite of import-hmi-object
tia list-screen-items --screen "Folder/Sub/Screen" [--device X] [--like P] [--group]
one object per line: name, type, x, y, w, h, tag
tia audit-screen [--screen "Folder/Sub/Screen"] [--device X] [--max N] [--file F.json] [--tags T.json]
compares the tag of each screen object against the HMI's own tags: tags that do not exist, and tags with no equipment code (the editor's tag1 placeholder)
tia set-screen-items --screen "Folder/Sub/Screen" [--set "Name:x=530,y=356"] [--remove Name] [--rename Old=New] [--rename-from-tag] [--group NAME=x,y,w,h] [--device X] [--apply]
all repeatable, one export and one import for N edits
tia copy-screen-items --from-screen "<template>" --region x,y,w,h --screen "<target>" --at x,y [--replace BF-01=BF-05] [--device X] [--apply]
stamping: copies the objects FULLY contained in the region, offsets them, renumbers the IDs and de-duplicates ObjectName
tia list-motion [--like X] [--params]
technology objects: axis, cam, kinematics
tia create-motion --name X --type PID_Compact [--version 3.0] [--folder A/B] [--apply]
creates a technology object
tia delete-motion --name X [--apply] [--no-backup]
deletes a technology object
tia set-motion-param --name TO --param P --value V [--apply]
writes a parameter of a technology object
tia export-motion --name TO --file F [--readonly]
the whole technology object to SimaticML
tia import-motion --file F [--folder A/B] [--override] [--apply]
SimaticML back into a technology object
tia export-cam --name TO --file F [--format mcd|scout|pointlist|binary] [--separator tab|comma] [--points N]
cam data of a TO_Cam* technology object to a file
tia import-cam --name TO --file F [--format binary] [--separator tab|comma] [--apply]
loads cam data from an MCD/SCOUT/PointList file into a TO_Cam* technology object
tia export-interpreter --name TO --file F
MCL program of a TO_InterpreterProgram technology object to a text file
tia import-interpreter --name TO --file F [--apply]
loads an MCL program from a text file into a TO_InterpreterProgram technology object, replacing the whole source
tia map-interpreter --name TO [--alias A] [--to AXIS | --member PATH --type BOOL [--start-index N] [--readonly]] [--remove] [--apply]
mapping of a TO_InterpreterMapping: without --alias it lists, with --alias it writes the alias the MCL program uses for an axis or a DB member
tia list-watch-tables [--like X]
watch tables: folder, name, consistency and the lines
tia set-watch-table --name T --entry "SYMBOL[:format]" [--entry ...] [--folder A/B] [--remove SYMBOL] [--clear] [--show] [--apply]
builds the table and the human reads the value in the Portal
tia list-force-tables [--like X]
force tables: folder, name, consistency and the lines
tia set-force-table --name T --entry "SYMBOL[:format]" [--entry ...] [--folder A/B] [--remove SYMBOL] [--clear] [--show] [--apply]
same mechanics as set-watch-table: PlcForceTableComposition has no Create, so the verb builds the whole table in SimaticML and imports it with Override
tia list-alarm-textlists [--like X]
text lists of the PLC, user and system ones: name, ID, range and comment
tia export-alarm-texts --file X.xlsx [--lang pt-BR ...]
instance alarm text to a spreadsheet
tia import-alarm-texts --file X.xlsx [--lang pt-BR ...] [--apply]
puts the edited spreadsheet back into the project
tia list-text-categories
read-only: the text categories of the project
tia export-project-texts --file X.xlsx [--source pt-BR] [--lang en-US ...] [--category C ...]
every multilingual text of the WHOLE project
tia import-project-texts --file X.xlsx [--update-source] [--apply]
translated spreadsheet back into the project
tia object-id [--name X --kind block|type|device] [--identifier ID]
read-only, both directions: --name gives the long-term stable identifier of the object, --identifier finds the object back
tia export-textlists --file X.xlsx [--name L ...] [--lang pt-BR ...]
text lists to a spreadsheet
tia import-textlists --file X.xlsx [--override] [--apply]
text-list spreadsheet back in
tia export-alarm-classes --file X.dat
alarm classes of the project
tia import-alarm-classes --file X.dat [--apply]
alarm classes back in
tia export-doc --name X | --folder A/B [--dir D] [--unit U]
block as text: .s7dcl declaration + .s7res texts, which is what gets versioned and diffed in Git
tia import-doc --dir D --name X [--folder A/B] [--unit U] [--override] [--apply]
writes the block back from the document pair
tia gen-source --name X | --folder A/B --file out.scl
block(s) → recompilable SCL/AWL source: the missing half of export-doc (the document is for reading/diffing, the source comes back through import-source)
tia list-sources [--like X]
external source node of the PLC: name (with extension) and folder
tia list-opcua-access
read-only: OPC UA server access control
tia list-supervisions [--like X]
read-only: ProDiag supervisions declared in each FB
tia export-supervisions [--kind supervisions|settings] [--file F] [--out DIR]
global ProDiag supervisions → .xlsx, or the supervision settings → .dat with --kind settings
tia list-opcua [--kind server|simatic|reference] [--like X]
OPC UA interfaces of the PLC server: server (by hand), simatic (from the program), reference (imported namespace
tia export-opcua --kind K --name X [--file F.xml] [--out DIR]
OPC UA interface → XML
tia list-protection [--like X]
state of both locks of each block: know-how (hides the code) and write protection (blocks editing)
tia list-connections [--device D]
communication connections configured in the project
tia list-project-users
read-only: UMAC users of the project
tia list-project-roles
read-only: the roles of the project, the fixed system ones and the custom ones, each with its assigned engineering rights, plus the full catalogue of rights available to assign
tia list-device-rights [--device D]
read-only: the device function rights of UMAC
tia list-workspaces [--objects]
read-only: the Version Control Interface workspaces
tia add-workspace --workspace N [--dir ROOT] [--lang xx-XX] [--apply]
creates a VCI workspace
tia delete-workspace --workspace N [--apply]
removes the workspace from the project
tia add-workspace-object --workspace N --name BLOCK [--plc P] [--format F] [--apply]
exports a block into the workspace root and maps it
tia sync-workspace --workspace N --to workspace|project [--name BLOCK] [--apply]
--to workspace writes the project into the files, --to project brings the files back
tia checksum
checksum of the software and of the text lists of the PLC
tia fingerprint [--name X] [--like S] [--kind block|type]
fingerprints of the blocks and UDTs: id/value pair per aspect (Code, Interface, Properties, Comments, ProgramCode...), so diffing two snapshots says WHAT changed
tia delete-watch-table --name T [--folder A/B] [--apply]
removes a watch table
tia list-webserver-users
webserver users of the CPU and the permission flags of each one
tia set-webserver-user --name U [--permissions A,B] [--password P] [--apply]
creates or updates a webserver user
tia delete-webserver-user --name U [--apply]
See the verb's own --help.
tia list-simple-webserver-users --device X [--item I]
read-only: the users a SIWAREX module of the ET 200SP ships for its own web server (SimpleWebserverUserManagement, per device item)
tia set-simple-webserver-user --device X [--item I] --name U [--active on|off] [--permissions None|ReadOnly|ReadWrite] [--password P] [--apply]
changes a user the module already has
tia list-webserver-tables [--kind watch|force]
watch/force tables published on the web page, and the access of each rule
tia set-webserver-table --kind watch|force --table T [--access none|read|write] [--remove] [--apply]
publishes a table on the web page with the given access, or changes the access of the rule that already exists
tia list-channels [--device D] [--item I] [--tags]
read-only: the I/O channels of the modules
tia list-process-image [--device D]
read-only: which controller is registered on each address and on each HW identifier
tia assign-process-image --device D --item I --ob O [--plc P] [--pip N] [--apply]
assigns the partial process image of the module to an OB, so the image is updated in that OB's cycle instead of OB1
tia list-device-groups
read-only: the device group tree of the project (path, device names), the devices at the project root (root: a station added without --group) and the system group of the ungrouped devices
tia add-device-group --name G | "Parent/Child" [--apply]
creates the group and any missing parent on the path
tia delete-device-group --name G | "Parent/Child" [--force] [--apply]
a group holding devices or subgroups needs --force: the Openness Delete takes the content with it
tia net-layout --dir D [--set layout.json] [--apply] [--no-backup]
ring 0, no Portal needed: Devices & networks canvas positions, which no Openness member reaches, read and written in the CLOSED project's D/System/PEData.plf
tia plc-compile-settings [--simulation on|off] [--virtual-plc on|off] [--apply]
the two block-compilation switches PLCSIM needs
tia find-module-types --pattern X [--kind module|container]
read-only: the module (or container) type identifiers that match the partial identifier
tia normalize-module-type --type X
read-only: the normalized form of a type identifier
tia export-card-config --device D [--file F.psc] [--out DIR] [--password P]
device configuration as the .psc file of the card reader
tia export-sysdiag-settings [--file F.dat] [--out DIR]
the system diagnostics settings of the project as one .dat file (the only suffix the provider takes
tia import-sysdiag-settings --file F.dat [--apply]
the file back into the system diagnostics settings
tia generate-loadable [--plc N] --name B[,B2...] | --unit U [--target plc|plcsim] [--file F] [--out DIR]
loadable file of compiled blocks outside software units, or of one unit, for the PLC Program Loader
tia export-opcua-ml --device D --item I [--file F.xml] [--out DIR]
Simatic ML of the OPC UA of a DeviceItem
tia list-web-pages
read-only: the system web pages flag of the CPU and the web applications configured on it (name, type, isDefault)
tia set-system-web-pages --state on|off [--apply]
turns the CPU system web pages on or off
tia list-opcua-users
read-only: the OPC UA users of the CPU server
tia set-opcua-user --name U --password P [--apply]
creates an OPC UA user or changes the password of an existing one
tia delete-opcua-user --name U [--apply]
See the verb's own --help.
tia list-plc-access
the four CPU protection services in one read: protection level, account locking at runtime, central user management (UMC) and master secret
tia set-plc-access [--set Name=Value ...] [--secret on|off --password-env VAR] [--apply]
writes a property of any of those four services
tia export-resource-assignment --file X.json [--set PlcPriority=N] [--apply]
resource assignment of a Software Controller
tia update-module-description [--device X] [--apply]
updates the module description when a newer one is installed
tia export-block --name X [--out DIR]
--out is a file-system path and takes any writable one, .. and UNC included
tia export-tags --table "Folder/Table" [--out DIR]
See the verb's own --help.
tia explain-block --name X | --file F.xml
LAD/FBD → compact text
tia list-interface [--folder A/B] [--name X] [--file F.xml] [--comments] [--out DIR]
Input/Output/InOut signature of the FB/FC of the folder in a single call
tia export-type --name X [--out DIR]
See the verb's own --help.
tia free-memory [--bytes N] [--from B] [--count K]
free gaps in %M memory
tia list-db-members --db X [--path A.B] [--depth N]
members of a DB below --path, native structs and UDT instances expanded, path : type = start

Common questions

How do I export every block of a TIA Portal project from the command line?

tia list-blocks enumerates what is there and tia export-block writes a block as SCL or SimaticML XML. None of the 123 read verbs changes the project, so they are safe to run against a live engineering project.

Can I read a TIA Portal project as JSON?

Yes. tia tree prints the whole project as JSON or Markdown, and tia info, tia list-devices, tia list-tags and tia xref each answer JSON for one slice.

Run these verbs on your own project

Every verb above takes JSON on the way out and plain flags on the way in. Tia-Portal-CLI is local and on-premise: nothing is sent to a cloud service, and every write is a preview until you pass --apply. 14-day free trial, e-mail only, no card.

Start a 14-day free trial

Other verb families