Passing a text string to a .SUBCKT in Spice

Status
Not open for further replies.

kkeeley

Member level 3
Joined
Jul 29, 2009
Messages
59
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Australia
Activity points
2,881
Hi,

I am still learning how to use LTspice for simulation. I wish to create my own sub circuit for a diode brdge created by using 4 seperate diodes . I can do this with the following Spice commads. This is then saved as a .lib file and referenced from my main scchematic via my own symbol.

.SUBCKT DiodeBridge 1 2 3 4
D1 1 3 1N4001
D2 3 2 1N4001
D3 1 4 1N4001
D4 4 2 1N4001
.ENDS

I have been able to create and use other SUBCKT's that allow me to pass a numerical value that is then used to set something like a resistor value.

What I would like to do is be able to pass a string to the SUBCKT that will allow me to change the type of Diodes being used without having to create multiply subckts.

Can this be done in LTspice and if so how.

Thanks
Kenneth
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…