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.

  • Resolved

[FAQ] PSPICE-FOR-TI: PSpice for TI says the model missed .ENDS, but it is there. Why?

Genius 10645 points

Replies: 1

Views: 26

Part Number: PSPICE-FOR-TI

I got an error message about missing ".ENDS" in my model. But I can see it is in the file. How to fix this?

  • A simulation error often happens when using 3rd party models. The error message complains about missing "ENDS" statement (which marks the end of a subckt definition):

    However, the model file clearly contains the ENDS statement:

    This problem is caused by the end-of-line character. Note the this model file uses UNIX end-of-line character which is simply an "LF" (line feed):

    The Windows system, however, uses 2 characters, "CR" (carriage return) plus "LF" to mark the end of a line. So, the last 2 characters are removed from each line when the file is read in before simulation. If the file came from UNIX, an extra character is removed and ".ENDS" become ".END".

    If 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.

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.