Loading files from command line on Windows

Help
Anonymous
2012-03-05
2013-06-12

  • Anonymous
    2012-03-05

    I'm having trouble getting the -c flag to work on Windows.

    If run ngspice with the command:

      ngspice -c src.net

    I get a blank window that echos what I type, but does nothing else.

    Adding the -a and -i flags makes no difference.

    The same file runs ok if I launch ngspice and run it manually, although the print commands are ignored.

    File is just

    ac r-c circuit
    v1 1 0 ac 10 sin
    r1 1 2 5
    c1 2 0 100u
    .save  v(1) v(2) i(v1)
    .ac lin 1 60 60
    .print v(1,2) v(2) i(v1)
    .end

    I originally had:

       .print ac v(1,2) v(2) i(v1)

    as per the example I'm working from, but that didn't work, either.

    BTW, is there a way to get it to save the current values without explicitly requesting them?

     
  • Holger Vogt
    Holger Vogt
    2012-03-06

    Paul,

    the -c option is not very useful. It maybe required if you run ngspice as an application compiled for console in server mode.
    ngspice_c -s -c input.net
    I am not aware of any other useful application! Please have a look at page 249 of the actual manual for options supported.

    As chapter 15 states, the  dot commands (like .ac, .save) are used in ngspice batch mode. Please see also chapt. 16.4 for ngspice starting options.

    Your input file:
    ac r-c circuit
    v1 1 0 ac 1
    r1 1 2 5
    c1 2 0 100u
    *.save  v(1) v(2) i(v1)
    .ac lin 1 60 60
    .print ac v(1,2) v(2) i(v1)
    .end

    runs in batch mode with
    $ ngspice_c -b  ../../various/120306starting-ac.cir
    with output to the console (msys Window).
    It will save current through the independent voltage source v1 as v1#branch.

    Using ngspice GUI from the distribution, you need to specify an output file:
    $ ngspice -b -o 1203test.log  ../../various/120306starting-ac.cir

    Holger

     

  • Anonymous
    2012-03-08

    Ah.  I was looking at list of options from ngspice -help