I wonder why the meas command in the following control section put as text in
in my schematic fails to work:
.control
set controlswait
meas tran vrptp pp v("/out") from 10m to 40m
set wr_singlescale
set wr_vecnames
wrdata ‘vb1ngspicekicad.dat’ v("/in") @d1[id] v("/out")
.endc
When running the simulation (a transient analysis) I get the following message:
No. of Data Rows : 812
bad syntax of ??
meas tran vrptp pp v("/out") from 10m to 40m failed!
the file vb1ngspicekicad.dat is created correctly however
Thanks a lot for pointing out my mistake. I also noticed I have to remove the double quotes around /out i.e. v(/out) in stead of v("/out"), the reason I did it like this was because I tried to be consistent with the statement: wrdata ‘vb1ngspicekicad.dat’ v("/out") …
One has to be careful with the ‘/’ token.
KiCad has decided to use it to denote hierarchical node labels. So if you place a local ‘out’ node label, you will get a ‘/out’ as ngspice input.
ngspice has several commands (I guess including wrdata) that allow not only to place vectors (simulation results) for specific nodes, e.g. like V(out), but also equations of results (e.g. like V(out)/2) as their arguments. You even might give only out/2 as an argument (instead of V(out)/2).
Now what to do with V(/out)? /out as a node name is o.k. for ngspice, as a command argument it may be not. So we have to use V("/out") to survive the equation parser.
This is unfortunate, has been discussed with the KiCad devs, but for the moment there is not a really good solution at hand.