This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] PSPICE-FOR-TI: PSpice gave an error message about missing ".ENDS" in my model (or, PSpice says "Name on .ENDS does not match .SUBCKT"). How to fix this?

Part Number: PSPICE-FOR-TI

PSpice gave an error message about missing ".ENDS" in my model (or, PSpice says "Name on .ENDS does not match .SUBCKT"). How to fix this?

  • A simulation error often happens when using 3rd party models. There are two error messages:

    Missing .ENDS in SUBCKT

    or

    Name on .ENDS does not match .SUBCKT

    The root cause is the same. This problem is caused by the end-of-line character.

    The Windows system uses 2 characters, "CR" (carriage return) plus "LF"  (line feed) to mark the end of a line. PSpice must delete the last 2 characters from each line to understand the input file.

    However, if the model file was saved on UNIX/Linux, it is likely to have only 1 end-of-line character which is simply an "LF", as shown below in a text editor:

    So, this means an extra character will be removed and there are 2 scenarios:

    • The .ENDs statement does not contain the subcircuit name and ".ENDS" become ".END". If this happens, this error message is shown:
        • Missing .ENDS in SUBCKT
    • Optionally, the .ENDS statement may end with the subcircuit name (which is checked against the .SUBCKT line). Since an extra character is removed, the name seen by PSpice will not match the name on the .SUBCKT line because the .SUBCKT like does not end with the subcircuit name. If this happens, this error message is shown:
        • Name on .ENDS does not match .SUBCKT

    If the model is produced by TI, please let us know and we'll get it fixed. If this is your model or a 3rd party model and you have easy access to a Unix environment, you can convert the file using the unix2dos command.

    If you have Notepad++ installed, open the file. Then select Edit → EOL Conversion → Windows format. This should convert all line endings to a Windows format. Save and close the file.

    There are many other tools that can convert files between those formats. One option is with just regular Microsoft Notepad. Open a new window ("File" → "New Window"), note that the information bar displays "Windows (CRLF)":

    Now, select everything in the original window (Ctrl-A) and copy that into the new window. Save the new file and edit your simulation profile to use the new file (or overwrite the old file without the need for changing simulation profile). That should resolve this problem.

    If you have easy access to a Unix environment, you could also use the command unix2dos to modify the file.

    View more PSpice for TI FAQs here