I have put together an amplifier circuit that uses the AD811 that simulates properly.
I would like to try using the Texas Instruments opamp OPA814 instead.
I downloaded the official model from the TI website:
https://www.ti.com/product/OPA814#tech-docs
Link to file, I renamed to .lib for consistency with some other custom parts (they work fine).
https://www.ti.com/lit/zip/SBOMCE1
When I look at this file in a text editor, it looks pretty good. Not encrypted, looks like a standard SUBCKT to me, with the only exception being that the pin order is
.subckt OPA814 IN+ IN- OUT V+ V-
instead of the LTSpice opamp model that has IN+ IN- V+ V- OUT.
I put this file into my working folder and imported it with spice directive
.LIB OPA814_Model_V1p1.lib
to match the filename in the working folder.
I placed a opamp2 symbol, made the value OPA814 to match the name in the .subsck definition in the library file, and ctl-clicked the part to check the prefix is X and the Value is OPA814.
When I then try to simulate it, I get errors like the following:
C:\Dropbox\Spice Files\High Voltage Amplifier\OPA814_Model_V1p1.lib(222): Expected device instantiation or directive here.
.ends OPA814 IN+ IN- OUT V+ V-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
C:\Dropbox\Spice Files\High Voltage Amplifier\OPA814_Model_V1p1.lib(255): Expected device instantiation or directive here.
.ends FEMT_0 1 2
To me this says that the .lib file is being read, but it is upset about the lines starting with .ends. In the library file these lines are unremarkable to me and I am not sure how to correct the error, however the mentioned line numbers are the lines that have those directives.
I know that I will have to figure out how to also correct the pin ordering, but for now it seems like a library parsing issue. Could you please help me to fix the library parsing to avoid this error?