Implement user-written subroutines in C

The method you use to implement user-written subroutines in the C programming language depends on the source files you choose to run the simulation. To generate a DLL automatically, use the USER1.c file that contains the C source code in the run directory. To use a generated DLL that you can share with others users, use the tmgopen_user.dll(so) file.

  1. Add the INPF file to your run directory.
  2. Verify that the INPF file contains and ends with:
    PARAM USERDLL
    -1
    -1
  3. Add the USER1.c file to the run directory.
  4. (Optional) To use a DLL that you can share with others users, generate the tmgopen_user.dll(so) file as follows:
    1. Add the createUserDllC.cmd (Windows) or createUserDllC.com (Linux) scripts to the run directory.
    2. Run the script without any arguments in the run directory.
    3. Delete the USER1.c file.

    During the run, the tmgopen_user.dll(so) file will be used according to its implemented functionality instead of generating the DLL automatically from the USER1.c file.

  5. Run the simulation.