Entering macros in file names

You can substitute all or part of a file name with a macro; that is, either a path alias or variable. This provides the ability to assign a unique name to each simulation run of a multi-run simulation. For example, suppose you create a time stamp variable, as shown below:

macro expansion ex

Here the variable name DAQfile expands to the current date and time.

If you apply the DAQfile variable to the file name in the export block, the name of the resulting file becomes the current date and time. If the simulation is set up to run more than once, the data from each run is then written to a separate file.

Specifying macros

You specify macros in file names in the following format:

$(path-alias or variable-name)

The standard DOS file naming conventions apply to variables used as part of a file specification. For example, you cannot use /  \  : * ? “ < > | in a variable name.

Macro expansion

During normal operation, the value of the macro is expanded at the end of simulation. This means that when using variables in file names, the file name may be different at time 0 and time n.