In this short SIMATIC AX tutorial, I create and organize the project’s MainProgram.
Because MainProgram is assigned to the cyclic Main task, its role is similar to OB1 in TIA Portal.
First, I reference the global tank interface through VAR_EXTERNAL. Then I declare the function-block instances inside VAR. Each function-block type creates an instance with its own retained data.
Finally, I organize the execution order into three sections:
Read and scale physical inputs.
Run the control logic.
Scale and write physical outputs.
The mapping functions are called directly, while the declared function-block instances are called in the control section.
GitHub project:
https://github.com/yuriyOtomakeit/ax-...
Previous tutorials:
Create Structured Text Files in SIMATIC AX:
[PASTE VIDEO URL]
Create a Function in SIMATIC AX:
[PASTE VIDEO URL]
Create a Function Block in SIMATIC AX:
[PASTE VIDEO URL]
Create a UDT in SIMATIC AX:
[PASTE VIDEO URL]
Create a Global Variable in SIMATIC AX:
[PASTE VIDEO URL]
Earlier tank-demo videos:
Tank Control Requirements Before Code:
• SIMATIC AX Tank Demo: Requirements Before ...
GitHub, TIA Selection Tool, and AX Hardware Compile:
• SIMATIC AX Tank Demo #20: GitHub, TIA Sele...
More SIMATIC AX articles:
https://otomakeit.com/tags/simatic-ax/
#SIMATICAX #MainProgram #FunctionBlock #StructuredText #PLCProgramming #IndustrialAutomation #Otomakeit