Why Automation is Inevitable
Manual engineering in TIA Portal is slow and error-prone. Right-clicking, creating blocks, copy-pasting code... These repetitive tasks must disappear. Thanks to the Openness API (and its T-IA Connect REST wrapper), you can drive TIA Portal like any modern software.
Prerequisites
- TIA Portal V16, V17, V18, V19 or V21 installed
- A T-IA Connect license (or trial version)
- Node.js or Python installed on your machine
Step 1: Start the REST API
Instead of launching TIA Portal manually, we will start the T-IA Connect server which will act as a gateway. Open your terminal and run:
./TiaPortalApi.App.exe --headless
Step 2: Create a Project via Script
No more 'File > New' menus. Let's send a POST request to instantiate a blank project.
{
"name": "My_Automated_Project",
"path": "C:\\Projects",
"version": "V19"
}Step 3: Generate SCL Code
This is where the magic happens. We will inject a complete Function Block (FB) directly into the project.
L'API permet d'injecter des blocs à partir de templates XML ou directement via du code source SCL. C'est l'outil idéal pour les générateurs de code.