Including subcircuits as a model in another subcircuit

I wanted to create a model of two zener diodes connected back-to-back with common anodes. I found a model of the zener diode and tested OK. this was placed in file 1N4735A.CIR.

.SUBCKT DI_1N4735A  1 2
*        Terminals    A   K
D1 1 2 DF
DZ 3 1 DR
VZ 2 3 5.33
.MODEL DF D ( IS=66.5p RS=0.620 N=1.10
+ CJO=141p VJ=0.750 M=0.330 TT=50.1n )
.MODEL DR D ( IS=13.3f RS=0.218 N=1.16 )
.ENDS

To create the dual version I wrote this:

* Dual DI_1N4735A zener diodes (6.2V) with common anode
* GJB 03/08/2025

subckt 1N4735A_DUAL 1 2 3
.include 1N4735A.CIR
D1 1 3 DI_1N4735A
D2 3 2 DI_1N4735A
.ENDS

This fails with error “no valid model”. I know this strategy works if the included file is a MODEL but it doesn’t work if it contains a subcircuit. Is this correct? I solved the immediate problem by writing the complete subcircuit in the first file, i.e. not including a single-device subcircuit:

* Dual DI_1N4735A zener diodes (6.2V) with common anode
* GJB 03/08/2025
 
.subckt 1N4735A_DUAL 1 2 3
D1A 3 2 DF
DZA 4 3 DR
VZA 2 4 5.33
 
D1B 3 1 DF
DZB 5 3 DR
VZB 1 5 5.33

.MODEL DF D ( IS=66.5p RS=0.620 N=1.10
+ CJO=141p VJ=0.750 M=0.330 TT=50.1n )
.MODEL DR D ( IS=13.3f RS=0.218 N=1.16 )
.ENDS

Although this works, I’m still wondering if there is a way for a subcircuit to be recognised as a model.

of course there is a way:
to call a subcircuit model, you will need an X line.

subckt 1N4735A_DUAL 1 2 3
.include 1N4735A.CIR
XD1 1 3 DI_1N4735A
XD2 3 2 DI_1N4735A
.ENDS

D1 1 3 DI_1N4735A
would require a .model line similar to
.model DI_1N4735A D (<parameter list>)

1 Like