AmesimKnowledge

Using the Simcenter Amesim to Simulink Interface > Using the Simcenter Amesim-Simulink Black-box interface

A more advanced example using all types of global parameter and a table

In the Quarter car example shown previously, no tables are involved, so we will now use a different Simcenter Amesim system to demonstrate the use of data files - we will also demonstrate what happens when using integer and text parameters.

Figure 49: Simcenter Amesim system using all types of global parameter and table file

  1. Define the following global parameters:

     Type
    
    
     Name
    
    
     Title
    
    
     Unit
    
    
     Value
    
    
     Minimum
    
    
     Default
    
    
     Maximum
    
    
    
    
    
     Real
    
    
     freq
    
    
     Frequency to filter
    
    
     Hz
    
    
     10
    
    
     0
    
    
     10
    
    
     1e+06
    
    
    
    
     Integer
    
    
     fluidindex
    
    
     Index of hydraulic fluid
    
    
    
     0
    
    
     0
    
    
     0
    
    
     1
    
    
    
    
     Text
    
    
     expr
    
    
     Expression for function block
    
    
    
     x^2
    
    
    
     x^2
    
  2. Set the following submodel parameters:

     Submodel
    
    
     Parameter name
    
    
     Value
    
    
    
    
    
     FX00-1
    
    
     expression in terms of the input x
    
    
     expr
    
    
    
    
     LAG2-1
    
    
     natural frequency
    
    
     freq
    
    
    
    
     FXA001-1
    
    
     name of ASCII file
    
    
     fxa0data.dat
    
  3. Use the Simcenter AmesimTable Editor to create the file fxa0data.dat setting the following data table:

For data files that are not recognized by Simcenter Amesim you will need to specify the type manually. If there are files used by the model that are not supported by Simcenter Amesim, you should select Other, not supported as the data file type. If unsupported files are used in the simulation, it is necessary to provide these files with the S-Function. You should in this case make sure that the path to the file is relative (for example: data\file_to_use.dat) instead of absolute (for example: c:\path\to\my\data\files\file_to_use.dat). The reason is simple: it is unlikely that the end-user of the ASBB will have the same directory structure as you have.

For the other data file used in the Simcenter Amesim system (fxa0data.dat - used by FXA01), Simcenter Amesim recognizes the file type without any help. This will be the case for all files that have been created using the Table Editor tool in Simcenter Amesim. For files generated by other means, you will need to select the file type manually (or add a first line containing the table type).

Figure 50: Summary of the data files used in the model and their type

The popup (figure above) displays a summary of the data files used in the model and their type. In this list, you will often see expressions used in submodels that accept either expressions or filenames. Since the file generation process has no safe way of determining whether a text parameter is a filename or an expression, it displays these expressions as NOT_FOUND. Most of the time this kind of warning comes from a text parameter which does not refer to a filename - such as the unnamed fluid in FP04 in the current example.

The window that opens when you close the Generating files for Simcenter Amesim-Simulink Black-Box generating files for Simcenter Amesim-Simulink Black-Box popup is the classic System Compilation window (figure below). As we can see from this window, it is clear that:

  • Simcenter Amesim first does a "normal" (re-)compilation of the Simulink S-function. After this,

  • Simcenter Amesim does another compilation of the system, the second time with special options that will include the data files in the generated MEX file. The result of this second mex command of the system (named hydraulic.ame in this case) is a MEX file hydraulic.mexw64 (in recent versions of MATLAB). Figure 51: System Compilation message window

    In MATLAB we will create a submodel including an import AME2SL block. Once the Simcenter Amesim system hydraulic has been selected, the global parameters can be seen via the model parameter window as shown in the following figure. Figure 52: Simulink submodel

    Figure 53: View of all types of global parameter

    From the main window of the AME2SL block, the black-box can be created by clicking on the Create black-box icon. Like any other parameters, integer and text parameters can be modified. Figure 54: View ASBB produced

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Simulink/A_more_advanced_example_using_all_types_of_global_parameter_and_a_table · retrieved 2026-07-17