Create a SIMATIC AX library - Manual - AX2TIA - This package contains the documentation for ax2tia - Converting SIMATIC AX libraries to TIA Portal libraries,

AX2TIA CLI Tool (ax2tia)

Portfolio
SIMATIC AX
Product
AX2TIA
Software version
9.1.8
Edition
11/2024
Language
English (original)
Package Name
@ax/ax2tia-docs
  1. Open a shell and navigate to the folder on your local hard disk in which the library is to be stored.
  2. Login to apax.
    The general operation of apax and details of the login command are described here.
  3. Create a new library with apax based on the tiax-lib template, install dependencies, and open the library created using AX Code:

    apax create tiax-lib my-sample-tia-library
    cd my-sample-tia-library
    apax install
    axcode .
    

    The prepared TIAX Lib template is shown at the end of the chapter.

  4. If you installed the TIA Portal in a folder other than the default folder, edit apax.yml and set the TIA_INSTALL_PATH variable to your local installation of the TIA Portal.

  5. Program the library.

    Place some sample code in the src folder, for example an Abs function:

    AX library example

    NAMESPACE Siemens.Tiax
    
       FUNCTION Abs : LREAL
          VAR_INPUT
             value : LREAL;
          END_VAR
    
          IF value < 0.0 THEN
             Abs := value * -1.0;
          ELSE
             Abs := value;
          END_IF;
       END_FUNCTION
    
    END_NAMESPACE
    
  6. Compile the code and build the library:

    apax build
    
  7. Convert the library. The results are placed in the folder ./bin/handover-folder:

    apax export-tia-handover-documents
    

To generate handover library documents for SINUMERIK ONE, update the export-tia-handover-documents script as outlined below:

scripts:
   export-tia-handover-documents: ax2tia -i ./bin/sinu/*.lib -o ./bin/handover-folder -t sinu

Note

To generate handover library documents for a SINUMERIK ONE, ensure to include the relevant targets in the apax.yml file as detailed in the targets section. When creating handover library documents for the SIMATIC S7-1500 Software Controller, use the option -t swcpu.

NOTICE

TIA Portal Library Importer performs an integrity check on the folder containing the handover library documents. If any of the handover library documents are modified, deleted or if new files are added to the folder, import of TIA Portal library fails.