saving . . . saved Error when converting spice to ngspice has been deleted. Error when converting spice to ngspice has been hidden .
Error when converting spice to ngspice
Title
Question
Hi,
I'm now following your spoken video tutorials and trying to do what is being shown in the video.
I have done exactly what is being said/shown in the video twice and still get the same result both times, the following msg comes up in the cmd window when I click the spice->ngspice converter (icon 3).

Traceback (most recent call last):
File "c:/oscad/oscad/kicadtoNgspice/KicadtoNgspice.py", line 1258, in <module>
finalNetlist=int(sys.argv[2])
ValueError: invalid literal for int() with base 10: 'circ.cir'

What do I do now?

Oscad Schematic-Creation-and-Simulation 08-09 min 20-30 sec 02-04-14, 4:12 p.m. Jmannings118

Answers:

Also to note that I have just opened an example circuit
and the error does not come when I click the same icon...
02-04-14, 4:32 p.m. Jmannings118


Can you let us know more about the circuit that you are building?
You can just copy paste the "circ.cir" netlist that you have generated, as a reply to this post. This would help in troubleshooting.
02-04-14, 8:10 p.m. rakhiwarriar


It may or may not be a netlist issue. The kicadtongspice python file is getting called in OSCAD>>forntEnd>>newProject.py.
<span style="line-height: 1.428571429;">kicadtongspice python file, when called,</span> somehow gets "circ.cir" as the second argument. And when an int() operation is done on it, python complains that it is an invalid input. But how did it get this as the second argument? Can you check <span style="line-height: 1.428571429;">OSCAD>>forntEnd>>newProject.py, for this statement - </span><span style="line-height: 1.428571429;">command="python "+self.OSCAD_HOME+"/kicadtoNgspice/KicadtoNgspice.py "+self.projectName+".cir 1"</span>
<span style="line-height: 1.428571429;"> ?</span>
03-04-14, 12:55 a.m. rakhiwarriar


Hi rakhi,
I can confirm the following line is present in <span style="line-height: 1.428571429;">OSCAD>>forntEnd>>newProject.py </span><span style="line-height: 1.428571429;">:</span>
<span style="line-height: 1.428571429;"> </span><span style="line-height: 1.428571429;">command="python "+self.OSCAD_HOME+"/kicadtoNgspice/KicadtoNgspice.py "+self.projectName+".cir 1"</span>
<span style="line-height: 1.428571429;">
</span>
<span style="line-height: 1.428571429;">The circuit is a simple circuit. netlist generated as below:</span>

* EESchema Netlist Version 1.1 (Spice format) creation date: 02/04/2014 16:42:58

* To exclude a component from the Spice Netlist add [Spice_Netlist_Enabled] user FIELD set to: N
* To reorder the component spice node sequence add [Spice_Node_Sequence] user FIELD and define sequence: 2,1,0

*Sheet Name:/
1n4007 3 2 DIODE<span class="Apple-tab-span" style="white-space:pre"> </span>
U1 2 1 VPLOT8<span class="Apple-tab-span" style="white-space:pre"> </span>
v1 3 0 SINE<span class="Apple-tab-span" style="white-space:pre"> </span>
R1 2 0 10K<span class="Apple-tab-span" style="white-space:pre"> </span>
R2 1 0 10M<span class="Apple-tab-span" style="white-space:pre"> </span>

.end

Awaiting your help.

03-04-14, 10:37 a.m. Jmannings118


<span style="line-height: 1.428571429;">Hi rakhi,</span>
<span style="line-height: 1.428571429;">any luck so far... some help is needed here for me to move forward!!</span>
Just sitting and waiting for some advice..

Strange how the examples work but when starting a new circuit from scratch...
things don't work in the middle and we get stuck and have to wait.

is there any other info that you require?
03-04-14, 2:09 p.m. Jmannings118


<span style="line-height: 1.428571429;">Hi rakhi,</span>
<span style="line-height: 1.428571429;">any luck so far... some help is needed here for me to move forward!!</span>
Just sitting and waiting for some advice..

Strange how the examples work but when starting a new circuit from scratch...
things don't work in the middle and we get stuck and have to wait.

is there any other info that you require?
03-04-14, 2:10 p.m. Jmannings118


To confirm if the kicadtongspice python file is doing its job properly, you can copy circ.cir and the `analysis' file in OSCAD>>kicadtoNgspice folder and try the following from the terminal
cd OSCAD/kicadtoNgspice
python KicadtoNgspice.py circ.cir 1
Can you let me know the output of this?
03-04-14, 4:22 p.m. rakhiwarriar


Hi,
<span style="line-height: 1.428571429;">I noticed although creating a folder called test circ the s/w doesn't seem to like circ. </span>
although the error says circ there is no circ.cir file rather test.cir and all other files are test instead of circ.
I re-did the project with project name trial and it seems to work now!!
so the error is somehow because of the file name mismatch.
Thanks for the help.
So far so good all working with windows 8.1 !!
03-04-14, 5:35 p.m. Jmannings118


Glad to know the problem is solved!
03-04-14, 5:51 p.m. rakhiwarriar


Oh was that because there was a space between 'test' and 'circ'?
03-04-14, 5:52 p.m. rakhiwarriar


not sure but its working now so moving forward.
04-04-14, 10:37 a.m. Jmannings118


hey, I found out that the issue was there is a space between the two words in the file name. We encountered the same issue here at a workshop here in VIT, Wadala. And we just solved the issue by removing the space.
04-04-14, 2:59 p.m. rakhiwarriar


Log-in to answer to this question.