Maker Pro
Maker Pro

LTSpice: importing netlists

T

Terry Pinnell

I've been trying to get a bit more familiar with LTSpice, after
several years using CircuitMaker. One aspect I'm playing with is
exporting a Spice netlist from CircuitMaker and then running it in
LTSpice. For example, I drew this trivial circuit in CM (copied from
Rashid's 'Spice for Circuits and Electronics Using PSpice'):
http://www.terrypin.dial.pipex.com/Images/CM1.gif

Using CM's graphical interface, I can display up to 24 Operating Point
results.

Then I exported the netlist from CM, which gave me this file,
Rash2-1.NET:

*Spice netlist for Circuit: C:\My Documents\Electronics\CIRCUIT
DIAGRAMS\My Experiments\LearnSPICE.ckt
Is 0 3 50mA
V2 6 3 DC 0V
V1 4 0 DC 0V
Vs 7 0 20V
R4 0 3 200
R3 4 5 1k
R2 5 6 800
R1 7 5 500
..SAVE V(3) V(4) V(5) V(6) V(7) @is[p] @is[v] @v2[p] v2#branch @v2[z]
@v1[p]
..SAVE v1#branch @v1[z] @vs[p] vs#branch @vs[z] @r4[p] @r4 @r3[p]
@r3
..SAVE @r2[p] @r2 @r1[p] @r1
*BKGND=RGB 0 0 0
*BINARY RAW FILE

* Selected Circuit Analyses :
..OP
..END

As a check, I first ran CM and imported and simulated the netlist
file. As expected, I got the same 24 results offered for optional
display:

GND is1[p] is1_2 r1 r1[p] r2 r2[p] r3 r3[p] r3_2 r4 r4[p]
vs1#branch vs1[p] vs1[z] vs1_1 vx#branch vx[p] vx[z] vx_1 vy#branch
vy[p] vy[z] vy_1

Then I opened the same Spice netlist in LTSpice, and used
Simulate>Run. But only these 8 results were displayed:

V(vy_1) V(is1_2) V(vx_1) V(vs1_1) V(r3_2) I(Vs1) I(Vx) I(Vy)

Could an LTSpice user advise if I can get all 24 nodes, or whatever
subset of interest I select please.
 
M

Mike Engelhardt

Terry,

I think you're having trouble receiving posts from the Yahoo
LTspice users' group. Maybe you set your membership to elect
not to receive emails. You can browse the postings directly
at the URL http://groups.yahoo.com/group/LTspice for answers
to the all the questions you posted there.

For your reference, below is what I posted there yesterday
w.r.t. to your current question:
I simulated a simple circuit in CircuitMaker, and then ran
Export>Spice Netlist, which created this file:

*Spice netlist for Circuit:
D:\Docs\Electronics\CIRCUITS\CM\LearnSPICE\CurrentDirection2.ckt
Vs2 Vs2_1 0 20V
R4 Vs2_1 R6_1 500
R5 R6_1 0 1k
R6 R6_1 0 1k
.SAVE R6_1 Vs2_1 @vs2[p] vs2#branch @vs2[z] @r4[p] @r4 @r5[p]
+ @r5 @r6[p]
.SAVE @r6

* Selected Circuit Analyses :
.OP
.END

In CM I can then use Import>Simulate Spice Netlist and open
that file,and then select from any or all of the following
11 nodes for which I can show the result:

GND r4 r5 r5[p] r6 r6[p] r6_1 vs2#branch vs2[p] vs2[z] vs2_1

But if I run LTSpice and open that same netlist and use Run to
simulate, I am shown only these 3:

V(vs2_1): 20 voltage
V(r6_1): 10 voltage
I(Vs2): -0.02 device_current

What can I do to get the full results in LTSpice please?


Remove the .save statement. LTspice uses different cleaner
syntax there. For example, instead of "vs2#branch" it's
I(vs2). So remove the .save statement so that all nodes
are saved. Also, you might go to Tools=>Control Panel=>
Save Defaults and check the top three. This is used if
there are no .save statements.

Alterntively, you can use wildcard matching in LTspice.
E.g., add ".save V(*) I(*)" to save all currents
and voltages.

--Mike

Terry Pinnell said:
I've been trying to get a bit more familiar with LTSpice, after
several years using CircuitMaker. One aspect I'm playing with is
exporting a Spice netlist from CircuitMaker and then running it in
LTSpice. For example, I drew this trivial circuit in CM (copied from
Rashid's 'Spice for Circuits and Electronics Using PSpice'):
http://www.terrypin.dial.pipex.com/Images/CM1.gif

Using CM's graphical interface, I can display up to 24 Operating Point
results.

Then I exported the netlist from CM, which gave me this file,
Rash2-1.NET:

*Spice netlist for Circuit: C:\My Documents\Electronics\CIRCUIT
DIAGRAMS\My Experiments\LearnSPICE.ckt
Is 0 3 50mA
V2 6 3 DC 0V
V1 4 0 DC 0V
Vs 7 0 20V
R4 0 3 200
R3 4 5 1k
R2 5 6 800
R1 7 5 500
.SAVE V(3) V(4) V(5) V(6) V(7) @is[p] @is[v] @v2[p] v2#branch @v2[z]
@v1[p]
.SAVE v1#branch @v1[z] @vs[p] vs#branch @vs[z] @r4[p] @r4 @r3[p]
@r3
.SAVE @r2[p] @r2 @r1[p] @r1
*BKGND=RGB 0 0 0
*BINARY RAW FILE

* Selected Circuit Analyses :
.OP
.END

As a check, I first ran CM and imported and simulated the netlist
file. As expected, I got the same 24 results offered for optional
display:

GND is1[p] is1_2 r1 r1[p] r2 r2[p] r3 r3[p] r3_2 r4 r4[p]
vs1#branch vs1[p] vs1[z] vs1_1 vx#branch vx[p] vx[z] vx_1 vy#branch
vy[p] vy[z] vy_1

Then I opened the same Spice netlist in LTSpice, and used
Simulate>Run. But only these 8 results were displayed:

V(vy_1) V(is1_2) V(vx_1) V(vs1_1) V(r3_2) I(Vs1) I(Vx) I(Vy)

Could an LTSpice user advise if I can get all 24 nodes, or whatever
subset of interest I select please.
 
T

Terry Pinnell

Mike Engelhardt said:
Terry,

I think you're having trouble receiving posts from the Yahoo
LTspice users' group. Maybe you set your membership to elect
not to receive emails. You can browse the postings directly
at the URL http://groups.yahoo.com/group/LTspice for answers
to the all the questions you posted there.

For your reference, below is what I posted there yesterday
w.r.t. to your current question:
I simulated a simple circuit in CircuitMaker, and then ran
Export>Spice Netlist, which created this file:

*Spice netlist for Circuit:
D:\Docs\Electronics\CIRCUITS\CM\LearnSPICE\CurrentDirection2.ckt
Vs2 Vs2_1 0 20V
R4 Vs2_1 R6_1 500
R5 R6_1 0 1k
R6 R6_1 0 1k
.SAVE R6_1 Vs2_1 @vs2[p] vs2#branch @vs2[z] @r4[p] @r4 @r5[p]
+ @r5 @r6[p]
.SAVE @r6

* Selected Circuit Analyses :
.OP
.END

In CM I can then use Import>Simulate Spice Netlist and open
that file,and then select from any or all of the following
11 nodes for which I can show the result:

GND r4 r5 r5[p] r6 r6[p] r6_1 vs2#branch vs2[p] vs2[z] vs2_1

But if I run LTSpice and open that same netlist and use Run to
simulate, I am shown only these 3:

V(vs2_1): 20 voltage
V(r6_1): 10 voltage
I(Vs2): -0.02 device_current

What can I do to get the full results in LTSpice please?


Remove the .save statement. LTspice uses different cleaner
syntax there. For example, instead of "vs2#branch" it's
I(vs2). So remove the .save statement so that all nodes
are saved. Also, you might go to Tools=>Control Panel=>
Save Defaults and check the top three. This is used if
there are no .save statements.

Alterntively, you can use wildcard matching in LTspice.
E.g., add ".save V(*) I(*)" to save all currents
and voltages.

--Mike

Terry Pinnell said:
I've been trying to get a bit more familiar with LTSpice, after
several years using CircuitMaker. One aspect I'm playing with is
exporting a Spice netlist from CircuitMaker and then running it in
LTSpice. For example, I drew this trivial circuit in CM (copied from
Rashid's 'Spice for Circuits and Electronics Using PSpice'):
http://www.terrypin.dial.pipex.com/Images/CM1.gif

Using CM's graphical interface, I can display up to 24 Operating Point
results.

Then I exported the netlist from CM, which gave me this file,
Rash2-1.NET:

*Spice netlist for Circuit: C:\My Documents\Electronics\CIRCUIT
DIAGRAMS\My Experiments\LearnSPICE.ckt
Is 0 3 50mA
V2 6 3 DC 0V
V1 4 0 DC 0V
Vs 7 0 20V
R4 0 3 200
R3 4 5 1k
R2 5 6 800
R1 7 5 500
.SAVE V(3) V(4) V(5) V(6) V(7) @is[p] @is[v] @v2[p] v2#branch @v2[z]
@v1[p]
.SAVE v1#branch @v1[z] @vs[p] vs#branch @vs[z] @r4[p] @r4 @r3[p]
@r3
.SAVE @r2[p] @r2 @r1[p] @r1
*BKGND=RGB 0 0 0
*BINARY RAW FILE

* Selected Circuit Analyses :
.OP
.END

As a check, I first ran CM and imported and simulated the netlist
file. As expected, I got the same 24 results offered for optional
display:

GND is1[p] is1_2 r1 r1[p] r2 r2[p] r3 r3[p] r3_2 r4 r4[p]
vs1#branch vs1[p] vs1[z] vs1_1 vx#branch vx[p] vx[z] vx_1 vy#branch
vy[p] vy[z] vy_1

Then I opened the same Spice netlist in LTSpice, and used
Simulate>Run. But only these 8 results were displayed:

V(vy_1) V(is1_2) V(vx_1) V(vs1_1) V(r3_2) I(Vs1) I(Vx) I(Vy)

Could an LTSpice user advise if I can get all 24 nodes, or whatever
subset of interest I select please.

Thanks Mike. Will study that. Definitely must be a problem with my
mail then, because I see my original posts but no replies.
 
J

Joerg

Hello Terry,
Thanks Mike. Will study that. Definitely must be a problem with my
mail then, because I see my original posts but no replies.

Consider using the gmane server via your newsreader to read Yahoo
groups. That gets around the clumsy web interface and I use it to read
while posting through the Yahoo site.

Regards, Joerg
 
H

Helmut Sennewald

Terry Pinnell said:
Thanks Mike. Will study that. Definitely must be a problem with my
mail then, because I see my original posts but no replies.

Hello Terry,

please go to the Yahoo group and read the replies.
Don't wonder that you have have got a little fire there
in one of my replies.

Why do you exepect that the replies come to you?
If I answer a question there than I expect that the person who
asked the question knows how to login to the Yahoo group.

Go to that address and read the answers.

http://groups.yahoo.com/group/LTspice/messages


Best regards,
Helmut
 
J

Joerg

Hello Helmut,
Why do you exepect that the replies come to you?
If I answer a question there than I expect that the person who
asked the question knows how to login to the Yahoo group.

Take it easy. It does happen that technology fails. With Yahoo (MSP430
group) I have experienced "vanished posts" myself. Later they pop back
up. I found that out because I could read posts on the gmane server and
when I wanted to reply to them via the Yahoo interface I couldn't find
them there. For my taste that message window is, well, a bit pathetic.

It's the same with newsgroups. Messages proliferate to other servers but
sometimes a whole bunch of them falls off the truck. So while folks in
one part of the world can see them, folks in another with another ISP
can't. Just a couple days ago I had that right here. Only quotations in
people's answers allowed me to partially piece together what had been
discussed so far.

Anyway, I wish that groups including the LTSpice group would be on
usenet instead of some glitzy web interface. Keeping it simple.

Regards, Joerg
 
T

Terry Pinnell

Helmut Sennewald said:
Hello Terry,

please go to the Yahoo group and read the replies.
Don't wonder that you have have got a little fire there
in one of my replies.

Why do you exepect that the replies come to you?
If I answer a question there than I expect that the person who
asked the question knows how to login to the Yahoo group.

Go to that address and read the answers.

http://groups.yahoo.com/group/LTspice/messages


Best regards,
Helmut

Helmut: First, thanks very much for your thorough replies to my posts
- much appreciated. I have yet to study them properly, but hope to do
that tomorrow. I'd begun to think that the group was just very quiet,
and that you in particular were on your vacation <g>.

I'm used to seeing all discussion from other similar groups (including
another via Yahoo Groups) here in my newsreader. I had long ago
subscribed to the LTSpice mailing list, and until recently I'd seen
hundreds of discussions here in my Agent newsreader (all filtered to
my 'LTSpice' folder). So I was looking out especially for any replies
to my own thread! Still not sure why I didn't see them, so I will
investigate.

Meanwhile, the Yahoo environment offers some clear benefits -
especially file access. I reckon I still prefer the less glitzy and
more 'sober' atmosphere of Usenet though!

Joerg: Thanks for your posts. I'm very curious about this 'gmane
server' and intend to follow up.

Glad I decided to post here in cad; I may never have discovered the
problem otherwise!
 
H

Helmut Sennewald

Joerg said:
Hello Terry,


Consider using the gmane server via your newsreader to read Yahoo groups.
That gets around the clumsy web interface and I use it to read while
posting through the Yahoo site.

Regards, Joerg


Hello Joerg,
this gmane server will not(no more) provide the messages of the LTSpice
group.
A week ago I stopped that gmane copies the LTspice group messages.
The members of the LTspice group have the right, that messages
posted in the group are privately kept in the Yahoo group.

Best regards,
Helmut

Acting moderator of the LTspice Yahoo group
 
J

Joerg

Hello Helmut,
this gmane server will not(no more) provide the messages of the LTSpice
group.
A week ago I stopped that gmane copies the LTspice group messages.
The members of the LTspice group have the right, that messages
posted in the group are privately kept in the Yahoo group.

Yes, that's a point. One concern I always had with gmane is that they
don't allow or at least used to not allow "munged" email, and Yahoo
doesn't either. That opens the door to spambots.

Well, that would only leave email. Overall I believe that usenet is much
more lively than any of the web-based forums. If it has to be protected
it would be best if someone who has enough web space could host the
group, like Cadsoft does for their Eagle support.

Regards, Joerg
 
Top