DevOps / Deployment

Automated PLC Deployment
for TIA Portal Projects

Automate the full deployment lifecycle: compile hardware and software, establish online connections, compare online/offline states, download firmware and programs to the PLC, and control CPU run state - all scripted via REST API.

Full Deployment Lifecycle Automation

Every step from source code to running PLC, scriptable and repeatable

Compilation

Compile hardware configuration and software blocks individually or together. Compilation results include errors and warnings - integrate into CI pipelines to gate deployment on successful builds.

Online Connection

Establish and terminate online connections to PLCs. Supports PLCSim Softbus, PROFINET, and manual path overrides. Auto-detect connection parameters or specify access points explicitly.

Download Scopes

Choose the download scope per deployment: Software only, Hardware only, Hardware and Software combined, or Software-Only-Changes for minimal impact updates. Precise control over what reaches the PLC.

CPU State Management

Start and stop the CPU programmatically. Read current CPU state before and after deployment. Build safe deployment sequences that transition the CPU through STOP, download, and RUN automatically.

Password-Protected PLC Support

Authenticate against password-protected PLCs before going online. Set, update, and clear online authentication credentials via the API to support secure production environments.

Safety Guards

The confirmPhysicalDownload flag prevents accidental downloads to real hardware - only PLCSim targets allow downloads without explicit confirmation. A critical guardrail for CI/CD pipelines targeting physical PLCs.

Standard Deployment Workflow

Five steps from compiled code to a running PLC

1

Compile

Trigger hardware and software compilation via compile_device or compile_block. Check the result for errors before proceeding. A failed compilation aborts the deployment.

2

Go Online

Call go_online with the target device. T-IA Connect resolves the access point automatically or accepts a manual path. Verify the connection state with get_online_state before proceeding.

3

Compare Online / Offline

Run compare_online_offline to check whether the PLC already matches the project. Skip unnecessary downloads if no delta is detected, reducing PLC disruption in production.

4

Download to PLC

Execute download_to_plc with the chosen scope (Software, Hardware, HardwareAndSoftware, or SoftwareOnlyChanges). Set confirmPhysicalDownload to true only when targeting real hardware intentionally.

5

Start CPU

Issue start_cpu to transition the PLC from STOP to RUN. Confirm the final state with get_cpu_state. Log the outcome for audit trail and CI reporting.

REST API Deployment Scripting

Integrate PLC deployment into any CI/CD tool using standard HTTP calls

Compile and check result

# Compile the device (hardware + software)
curl -X POST http://localhost:5000/api/compile-device \
  -H 'Content-Type: application/json' \
  -d {"deviceName": "PLC_1"}

Go online and download

# Go online
curl -X POST http://localhost:5000/api/go-online \
  -H 'Content-Type: application/json' \
  -d {"deviceName": "PLC_1"}\n\n# Download software only
curl -X POST http://localhost:5000/api/download-to-plc \
  -H 'Content-Type: application/json' \
  -d {"deviceName": "PLC_1", "scope": "Software", "confirmPhysicalDownload": true}

Start CPU and verify state

# Start the CPU
curl -X POST http://localhost:5000/api/start-cpu \
  -H 'Content-Type: application/json' \
  -d {"deviceName": "PLC_1"}\n\n# Read CPU state
curl -X GET 'http://localhost:5000/api/get-cpu-state?deviceName=PLC_1'

Available Deployment Tools

All tools are accessible via REST API and MCP protocol

ToolDescription
compile_deviceCompiles the full device (hardware + software) and returns errors and warnings.
compile_blockCompiles a single program block. Useful for targeted pre-checks in CI pipelines.
go_onlineEstablishes an online connection to the PLC. Supports PLCSim, PROFINET, and manual path.
go_offlineTerminates the online connection and returns the device to offline mode.
get_online_stateReturns the current online/offline connection state for a device.
download_to_plcDownloads project data to the PLC. Scope: Software, Hardware, HardwareAndSoftware, SoftwareOnlyChanges.
upload_from_plcUploads the current PLC program back into the TIA Portal project.
compare_online_offlineCompares the online PLC state against the offline project to detect deltas.
start_cpuTransitions the CPU from STOP to RUN state.
stop_cpuTransitions the CPU from RUN to STOP state before a download.
get_cpu_stateReads the current CPU operating state (RUN, STOP, STARTING, etc.).
list_access_pointsLists all configured access points for resolving PLC connection paths.
list_parameter_setsLists available parameter sets for connection configuration.
get_pgpc_diagnosticRetrieves PG/PC interface diagnostics to troubleshoot connection issues.

Deploy Your First PLC Automatically

Stop clicking through TIA Portal. Script your entire deployment pipeline once and run it on every commit.