This simple sample library provides functionalities to determine the parking space occupancy of a car park. The project is specifically designed for a use case in TIA Portal, leveraging the "TIAX" workflow.
The "TIAX - library" use case involves creating a library (of type "lib") within SIMATIC AX and then exporting its contents to a TIA Portal Global Library. This allows for later reuse within TIA Portal. The TIA Portal Global Library will retain the "typed" nature of your FCs, FBs, Classes, and so on, enabling you to utilize all TIA Portal's library features, including central updates across your projects.
Please use a CLI terminal for the following steps:
-
Log in to SIMATIC AX:
apax login
-
Log in to GitHub:
apax login --registry "https://npm.pkg.github.com/" --password YOUR-GH-ACCESS-TOKENYOUR-GH-ACCESS-TOKENcan be created in your GitHub account settings. -
Navigate to your desired project path
-
Create a new project based on this application-example template.
apax create @simatic-ax/ae-counter-tiax --registry https://npm.pkg.github.com ae-counter-tiax
A generic Counter class designed for counting both upwards and downwards.
The ParkingCounter class calculates the filling level (occupancy) of the car park based on a sequence of sensor signals.
This class utilizes two input sensors:
BSensorInsideBSensorOutside
The counter value will be incremented or decremented depending on the order in which these signals are activated.
Example for entering the car park:
If SensorOutside is activated first, followed by SensorInside, the counter will be increased by one.
A TIA Portal compatible ParkingCounterFB that acts as a wrapper function block. It internally uses the ParkingCounter class.
-
Open the project in AX-Code.
-
Install project dependencies.
Use the AX Code CLI terminal.
apax install
-
Adjust the TIA Portal install path
Modify the
TIA_INSTALL_PATHvariable within yourapax.ymlfile to match your TIA Portal installation and version.TIA_INSTALL_PATH: "C:\\Program Files\\Siemens\\Automation\\Portal V20"
-
Create the TIA Portal Library:
apax create-tialib
The Global Library will be saved in the
./TIAPortalLibrarydirectory. -
Create or open an existing TIA Portal project.
-
Open the Global Library in TIA Portal.
-
Call the
ParkingCounterWrapperblock in your application.
Thank you for your interest in contributing! We welcome your feedback. Please feel free to report bugs, suggest improvements, clarify documentation, and highlight any other issues regarding this repository in the "Issues" section. Even better, we encourage you to propose changes to this repository using "Merge Requests." Our designated CODEOWNERS will review and address them.
Happy coding!
🐱💻 BEEP, BOOP, BEEP, BEEP, BOOP 🐱🏍

