Debugging the controller


1 Log file

If an error occurs during a simulation with an External controller (i.e. a controller defined by a dll), it is possible that the issue lies within the dll itself. In that case, you can produce a controller log file with information that will help fix the issue. To do so, you can take the following steps:

  1. When selecting the dll file, tick the Extended debug output box, as shown in the picture below.



  2. Open the %temp% folder. The easiest way to do that is to open an Explorer window, type in %temp% and press Enter, as shown in the picture below



  3. In the %temp% folder, you will find a file named ashescontrollerdebug-{nnn}.txt, where nnn is a hexadecimal key, as shown in the picture below. Open this file.



Note: there might be several ashescontrollerdebug files in the folder, open the largest one.


This file contains the values that the swap array has contained at each time step. Tracking down the values of the swap array can help you understand where the error comes from.

2 Command window

To check that the dll is working correctly, you can run a quick test in the command window. To do so, you can take the following steps:

  1. Open a command window. You can do so by typing cmd in the Windows Search Bar and opening the Command prompt app, as illustrated in the figure below:



  2. In the command window, go to the folder C:\Program Files\Ashes X.xx\ControllerDllWrapper\x64. You can do so by typing the following command in the command window
    1
    cd C:\Program Files\Ashes X.xx\ControllerDllWrapper\x64

    and pressing enter.

    Note: you have to replace X.xx with your current version of Ashes 


  3. In the command window, type 
    1
    ControllerDllWrapper.exe --dllpath="YourDllPath"
     and press enter

    For the default NREL 5 MW controller, if you applied the default settings when installing Ashes, the path will be
    1
    "C:\Users\UserName\Documents\Ashes X.xx\Controllers\NREL Offshore 5MW controller\NREL Offshore 5MW controller.dll"


    Note: you have to replace X.xx with your current version of Ashes, and UserName with your Username under Windows


  4. In the command window, type 
    1
    Update
     and press enter. This will perform a simple test on the dll. If the dll is correctly implemented, the text ok will be displayed