I have a LM13700 subcircuit file that runs well in LTSPICE. I copy&pasted it to QSPICE to autogenerate a symbol. I added some basic power supply, signal input and some components to run a .tran analysis.
Problem : Although I’ve placed a “.tran 5m” command, QSPICE says it’s missing it.
Obviously QSPICE has a problem with this subcircuit:
.SUBCKT LM13700 LIN INP INN IAB OUT VCC VSS BIN BUF
QN1 IAB VN2B VSS npnv 3
QN2 VN2B VN2B VSS npnv 3
QN3 VN3C IAB VN2B npnv 3
QN4 VP3B INN VN3C npnv 3
QN5 VP6B INP VN3C npnv 3
QN6 LIN LIN INN npnv 3
QN7 LIN LIN INP npnv 3
QN8 VN10B VN9B VSS npnv 3
QN9 VN9B VN9B VSS npnv 3
QN10 OUT VN10B VN9B npnv 3
QN11 VCC BIN VN12B npnv 15
QN12 VN12B VN12B BUF npnv 3
QN13 VCC VN12B BUF npnv 150
QP1 VP3B VP2B VCC pnpl 3
QP2 VP2B VP2B VCC pnpl 3
QP3 VN10B VP3B VP2B pnpl 3
QP4 VP6B VP5B VCC pnpl 3
QP5 VP5B VP5B VCC pnpl 3
QP6 OUT VP6B VP5B pnpl 3
.ends
Your .subckt has a syntax issue with double .ends; I’m not sure how that occurred. Here is the correct syntax to use and run with the transient analysis. Have you checked your LTspice netlist to see if the .subckt you used has an extra .ends?
thanks a lot, KSKelvin. This model is from Don Sauer, one of the LM13700 designers. Unfortunately his homepage is down. The LM13700 is available here, with the .end and ends. statements
Okay, your observation is indeed accurate. LTspice (and also Qspice) can actually read the .sub file (rename to .lib for forum upload) from the link you provided, with using .lib directive instead of embedded subckt into the symbol.
But if you copy and paste and auto-generate a symbol directly without any modifications, you will encounter an error because the auto-generated content includes .end in it. This error is specific to Qspice because only Qspice offers this embedded subcircuit feature for symbols.
It is uncommon to write a subcircuit in this manner, as the .model should typically be written into the .subckt.
I created a symbol and replicated the circuit in the archived website. It netlist included a R5 between OUT and BIN but not shown in circuit diagram, and therefore, this example with this R5 included.
This example and symbol can be download from this Github link Qspice/Symbols-KSKelvin/community/idea2ic · KSKelvin-Github/Qspice