How to Start a Simulation from a Command line for Debug Purposes

When PSCAD can build the executable, but not run the case, perform the following testing using the Debug feature and Windows Command Prompt:

  1. Launch PSCAD.

  2. Select your compiler and load the project into the workspace (refer to this article for instructions).

  3. In Project Settings, enable "Start simulation manually to allow use of integrated debugger" feature.
    For example, for the vdiv.pscx example:
    PSCAD-Debug Feature.png (67 KB)

  4. Start the build/run.

  5. When the build completes but the run fails, a dialog will display as shown in the example below. Click on the “Details” button, and highlight and copy the text that displays, then select “No”.

    PSCAD - Debug Pane.png (50 KB)

  6. Right-click on the project in the Workspace, and select Show in folder" (do not close PSCAD):

    PSCAD - Show in Folder Feature.png (236 KB)

  7. When the Windows browser displays, drill into the folder corresponding to the compiler you selected in Step 2 (for example, *.gf81, *.gf46, .gf42, *.if15).

    For example, when performing this debug using GFortran v4.6:
    PSCAD - Debug Folder.png (310 KB)

  8. In the same folder as bove, check whether the executable file is present (just make a note of this for yourself, for Step 12, below).

    For example, the file is present in the vdiv.gf46 folder in this example:

    PSCAD - Debug Folder - Executable file.png (177 KB)
  9. Open a Windows Command prompt from this folder as shown:

    PSCAD - Debug Folder - Open Command Prompt.png (96 KB)
  10. Perform this next step if either of the following two conditions apply:
    -You are using GFortran v4.6, or
    -You are using any compiler other than GFortran v4.6, AND if the executable (e.g. vdiv.exe) was not present in Step 8 above.

    At the Command prompt, depending on what version of PSCAD you are using (use "_" or "." after the project name as applicable):

    -For PSCAD v4.6.3 Update 5 and newer: Type in <projectname>_mak.bat at the cursor, then click the <Return> key.

    -For PSCAD v4.6.3 Update 5 Update 4 and older: Type in <projectname>.mak.bat at the cursor, then click the <Return> key.

    For example, for the vdiv.pscx project in newer PSCAD, this would be vdiv_mak.bat, as shown in the following view:
    Command Prompt - run vdiv_mak.bat.png (73 KB)


    If you do not perform the above step when using GFortran v4.6, you may get the following error at Step 11, below:
    Command Prompt - Error.png (206 KB)

  11. At the Command Prompt, paste in the text you copied from Step 5 above (Ctrl-V), then press the <Return>key.

    For example:
    Command Prompt - Run Executable.png (212 KB)

  12. Retain screenshots of the full messages in the Command Prompt in case you need to submit your findings to the MHI support desk (see Step 14 below).

  13. Return to the open PSCAD application, and see whether the project ran.

    If the project ran alright from the Command prompt, then something is somehow blocking the run during a non-Command prompt run. The following are some possible causes for your IT Team to look at:

    -The temporary files created during the PSCAD build need to be whitelisted in your protection software. The temporary files will be created in the same folder as your PSCAD project.

    For example, the temporary files when running the vdiv example using GFortran v4.6 are in the following location:

    -PSCAD (user interface) and EMTDC (machine) cannot communicate if Ports 30,000 to 40,000 are not available.

    -Communication over TCP/IP must be enabled, as this is required for the purpose of simulation control and data collection for plots.

  14. If the above suggestions do not resolve your issue, please feel free to contact the MHI Support Desk. Ensure include the following information in your submission:
  • Your PSCAD license number.

  • Your Fortran Medic log file as per this article.

  • Screenshots from the above debug procedure.