Tia-Portal-CLI

Configure Siemens PLC hardware from the command line

The hardware configuration as data. These verbs read the catalogue, add and delete devices, plug modules into slots, and read or set any attribute Openness exposes on a device, so a rack can be built or audited without opening the editor.

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

tia list-catalog --like F [--for TYPEID] [--max N]
read-only search in the Portal's hardware catalog, no project needed
tia add-device --mlfb "6ES7 ..." --name X [--station S] [--group G] [--apply]
an --mlfb with no /Vx.y takes the highest version in the catalog, and the answer says which
tia delete-device --name X [--apply]
See the verb's own --help.
tia list-attrs --device X [--item I] | --block B [--like SUB]
read-only: attributes, access mode and values of a device item, or of a PLC block with --block
tia set-attr --device X [--item I] | --block B --name A --value V [--apply]
any attribute list-attrs shows
tia set-attrs --device X [--item I] --set A=V [--set B=W ...] [--on-invalid abort|ignore] [--apply]
N attributes in ONE SetAttributes call, so a bad name does not leave half of them written
tia custom-identity --device X [--item I] --key K [--value V | --remove] [--apply]
a user key/value pair stored on a device or device item, e.g
tia plug-module --device X [--item I] [--type TID] [--name N] [--pos P] [--apply]
without --type: list of free slots
tia list-telecontrol-points --device X [--item I]
read-only: every telecontrol CP of the device (TelecontrolManagement
tia set-telecontrol-point --device X [--item I] --name N [--tag T] [--set A=V ...] [--apply]
creates or updates one datapoint
tia delete-telecontrol-point --device X [--item I] --name N [--apply]
See the verb's own --help.
tia export-telecontrol-points --device X [--item I] --file F.csv
the CP's datapoints as the feature's own CSV
tia import-telecontrol-points --device X [--item I] --file F.csv [--apply]
REPLACES every datapoint of the CP with the CSV
tia list-telegrams --device X
read-only: SINAMICS drive objects, the telegrams of each one and the address of each telegram
tia list-drive-params --device X [--item I] [--drive-object N] [--like SUB] [--count]
read-only: parameters of the SINAMICS drive
tia set-drive-param --device X [--item I] --name p1082[0] --value V [--apply]
project value of the parameter
tia list-drive-fi --device X [--item I] [--drive-object N]
read-only: the drive function interface (DFI) of each drive object
tia list-drive-projection --device X [--item I] [--drive-object N] [--motor N] [--encoder N]
read-only: the third-party motor and encoder data of a drive axis (HardwareProjection)
tia set-drive-projection --device X [--item I] [--drive-object N] --motor N | --encoder N [--set NUM=V ...] [--encoder-type Rotary|Linear[,Absolute|Incremental]] [--equivalent-circuit on|off] [--apply]
writes entries into the motor data set or encoder configuration and projects it onto the drive
tia set-drive-object-type --device X [--item I] [--drive-object N] --type T [--apply]
changes the type of a drive object
tia set-drive-object-active --device X [--item I] [--drive-object N] --state Activate|Deactivate|DeactivateAndNotPresent [--apply]
three states, not two: Deactivate leaves the object configured but inactive, DeactivateAndNotPresent also says the hardware is off the bus
tia list-drive-modules --device X [--item I]
read-only: the hardware modules of a SINAMICS drive
tia set-drive-module-type --device X [--item I] --type "OrderNumber:..." [--apply]
swaps the catalog type of one drive element
tia list-drive-safety-tests --device X [--item I]
read-only: the SINAMICS acceptance-test functions and whether each one is selected
tia set-drive-safety-test --device X [--item I] --name ID --state on|off | --clear [--apply]
selects or deselects one acceptance-test function by identifier
tia export-drive-safety-report --device X [--item I] --out FILE [--override] [--apply]
writes the acceptance-test protocol of the drive to a file
tia list-tech-extensions [--device X] [--item I] [--drive-object N]
read-only, two levels: the packages installed in the project, and the extensions present on each drive object
tia install-tech-extension --file F [--apply] | --remove --identifier I [--force] [--apply]
installs a technology extension package into the project and returns its identifier
tia list-axis-hw-conn [--plc P] [--like X]
read-only: where each motion TO is wired
tia connect-motion-hw --name TO [--interface actor|sensor|torque] [--index N] [--module M --device X] | [--input-module A --output-module B --device X] | [--channel N --device X [--item I]] | [--input-address N] [--output-address N] | [--tag T] | [--db-member PATH] | [--telegram N --device X [--item I]] | [--disconnect] [--all-modules] [--apply]
wires a motion TO to hardware
tia insert-telegram --device X --number N [--type Main|Supplementary|Safety|Torque|Edge] [--item I] [--drive-object D] [--change] [--apply]
--change replaces the current telegram: a new G120 already comes with the first one) (a drive telegram is NOT a catalog submodule
tia set-address --device X [--ip A.B.C.D] [--mask M] [--pn-name N] [--device-number N] [--dp-address N] [--item X1] [--apply]
a device with more than one interface requires --item
tia set-io-address --device X [--item I] [--io Input|Output] [--start N] [--apply]
base address of an I/O module
tia list-io-map [--device X] [--io Input|Output]
read-only: every I/O address in the project
tia list-net [--device X]
read-only: one network node per line
tia connect-subnet --device X --subnet S [--io-system IO] [--item X1] [--move] [--apply]
a device with more than one network interface requires --item
tia list-ports [--device X] [--item I]
read-only: the PROFINET port-to-port topology
tia connect-port --device X --port P --to-device Y --to-port Q [--apply]
wires two PROFINET ports in the project
tia disconnect-port --device X --port P --to-device Y --to-port Q [--apply]
See the verb's own --help.
tia list-transfer-areas [--device X] [--item I]
read-only: the I-device / I-slave address mapping
tia list-gsd [--device X]
read-only: which devices come from a GSD/GSDML file, with the GSD id that defines each one
tia export-gsd --device X [--item I] [--file F] [--title L] [--comment C]
writes the GSD file of an I-device, the file the partner's project imports
tia list-mrp [--device X]
read-only: ring redundancy (MRP domains and instances, with the ring ports) and IRT sync domains
tia set-memory-bytes --device X [--system 1] [--clock 0] [--apply]
enables FirstScan/AlwaysTRUE/Clock_1Hz in the CPU
tia export-cax [--out DIR]
the whole project hardware as AutomationML
tia import-cax --file F.aml [--apply]
AutomationML back into the open project, RetainTiaDevice

Common questions

How do I add a Siemens device from the TIA Portal catalogue by command?

tia list-catalog finds the order number, tia add-device inserts the device and tia plug-module fills its slots. The hardware family is 46 verbs.

Can I read or set any attribute of a PLC module?

tia list-attrs prints every attribute Openness exposes on a device and tia set-attr or tia set-attrs write them. PROFINET wiring goes through tia connect-subnet, tia connect-port and tia set-io-address.

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