The TIAX use case is a workflow, which converts a library written in ST and SIMATIC AX to TIA Portal global library for TIA Portal > V18
This application example shows two different use cases. To read the description of the use cases, just follow the link below.
- Traffic light : A traffic light which is realized with the statemachine library.
- Parking Counter : A simple parking counter simulation
- JSON serializer (in work) : A JSON structure created with the usage of the JSON library can be filled with parameters and serialized to an ARRAY OF CHAR.
- Further ideas? Just create an issue or even better a
pull request
.
Run the following commands in a CLI
apax create @simatic-ax/ae-tiax --registry https://npm.pkg.github.com ae-tiax
axcode ae-tiax
Before you can use the application example, you've to install all the dpendencies with:
apax install
AX Code starts with the content of the application example
Setup:
Before we can create the TIA Portal global library, please check, if the TIA_PORTAL_INSTALL_PATH
in the .env
file points to your TIA Portal installation.
Default value of TIA_PORTAL_INSTALL_PATH
:
TIA_PORTAL_INSTALL_PATH="C:\Program Files\Siemens\Automation\Portal V18\Bin"
- Compile the ST code with
apax build
- Export the compiled library into HandoverFiles with
ax2tia...
- Import the HandoverFiles with the TIA Portal
Importer.exe
That can be done manually step by step. Or you can use the predefined scripts in the apax.yml
-
The scripts in the apax.yml
To make the creation of the library easier, in the apax yml are some scripts predefined:
scripts: export-tialib: ax2tia -i bin/1500/*.lib -o "bin/$LIBRARY_DOCUMENTS_FOLDER" import-tialib: '"$TIA_PORTAL_INSTALL_PATH/Siemens.Simatic.Lang.Library.Importer.exe" -i "./bin/HandoverLibraryDocuments" -o "./$GLOBAL_LIBRARY_PATH" -u' create-tialib: - apax build - apax export-tialib - apax import-tialib
export-tialib
: generates the HandoverFilesimport-tialib
: Import the HandoverFiles and creates the TIA Portal global librarycreate-tialib
: Executes the steps: build, export, import
-
Set the library version
Adapt the version of the TIA Portal global library in the file
apax.yml
name: "@simatic-ax/ae-tiax" version: 0.0.1 type: lib
for the first run, it can be kept at 0.0.1. If you create it a second time, please mind, that the same version must not exist in the gloabal library.
- via user interface
-
Create the TIA Portal global library
Via command line
-
Find the imported TIA Portal Global Library
The generated global library you'll find in the following folder:
If you want to adapt the name of the library (and output directory), you can modify the apax.yml
variables: GLOBAL_LIBRARY_PATH: "TIAPortalGlobalLibrary"
This library can now opened in TIA Portal >= V18
The following Wrapper Function Blocks will be generated into the library. They can be used in TIA Portal.
- TrafficlightWrapper
- JsonStructure
- ParkingCounterWrapper
Thanks for your interest in contributing. Anybody is free to report bugs, unclear documentation, and other problems regarding this repository in the Issues section or, even better, is free to propose any changes to this repository using Merge Requests.
This workspace will be checked by the markdownlint-cli (there is also documented ho to install the tool) tool in the CI workflow automatically.
To avoid, that the CI workflow fails because of the markdown linter, you can check all markdown files locally by running the markdownlint with:
markdownlint **/*.md --fix
Please read the Legal information