From dfc268e0863c913a1b8726cd54eea3b40caf7c67 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Tue, 3 Mar 2020 05:31:58 +0530 Subject: upgrade ngspice to v31 --- .../examples/control_structs/if-batchmode.cir | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Windows/spice/examples/control_structs/if-batchmode.cir (limited to 'Windows/spice/examples/control_structs/if-batchmode.cir') diff --git a/Windows/spice/examples/control_structs/if-batchmode.cir b/Windows/spice/examples/control_structs/if-batchmode.cir new file mode 100644 index 00000000..b26b345c --- /dev/null +++ b/Windows/spice/examples/control_structs/if-batchmode.cir @@ -0,0 +1,31 @@ +use $batchmode + +* use $batchmode variable to steer control flow +* +* start either with +* ngspice -b -r rawfile.raw if-batchmode.cir +* or with +* ngspice if-batchmode.cir + +v0 1 0 dc 1 +R1 1 2 1k +C1 2 0 1u + +.tran 100u 10m uic +.print tran all + +.control + +if $?batchmode + echo "Info: batchmode has been set by command line option -b" + echo +else + echo "Info: batchmode has not been set" + echo + unset ngdebug + tran 100u 10m uic + plot v(2) +end + +.endc +.end -- cgit