9. Import, export and LaTeX figures
Voltecx reads and writes its own file, and it exchanges circuits with other simulators.
| Format | Read | Write | Status |
|---|---|---|---|
Voltecx .voltecx |
yes | yes | Plain JSON text. Everything is saved |
SPICE netlist (.cir, .net, .sp, .spice) |
yes | yes | Works. Things that have no SPICE equivalent are listed as warnings |
LTspice schematic (.asc) |
yes | yes, back into the same file | (beta) |
PLECS (.plecs) |
yes | yes, back into the same file | (beta) |
PSIM (.psimsch) |
yes | no | (beta) Opened with File > Open; needs sign-in to Voltecx Cloud. C blocks become running C blocks; parts Voltecx does not map are listed in a warning |
The native file
File > Save (Cmd+S) writes a .voltecx file. It holds the parts, the wiring, the layout, the simulation settings, the scopes and the variables. It is JSON, so it works with version control (a diff shows what changed) and you can read it in a text editor. The file keeps numbers exactly, bit for bit.
powercraft-cli info buck.voltecx prints a summary of a file without opening the app.
SPICE netlists
Import. Convert a netlist to a Voltecx file in the terminal, then open it:
powercraft-cli convert design.cir design.voltecx
powercraft design.voltecx
In the app, File > Import > Circuit opens a file dialog with filters for LTspice, PLECS, SPICE and PSIM, and imports the file by its path. File > Open also takes .asc, .plecs, .cir, .net, .sp, .spice and .ckt files, and PSIM .psimsch files (see PSIM schematics). Includes and .asy symbols beside the file are read. From a script or an assistant, call file.import with a path, or with the netlist as text: {"text": "<the whole netlist>", "format": "spice"}. The reply lists warnings. A new circuit opens with an automatic layout.
After Import, the window shows the import as it runs: the file, a bar with the percentage and about how long is left, and its stages (reading the file, converting it, on Voltecx Cloud for a PSIM schematic, and opening the circuit). Cancel import stops it and opens nothing. Close the window and the import keeps going: the status bar shows it with its own Cancel. When it ends, the circuit opens in a new tab and the Review step follows.
- Import: a circuit, a measurement or a load trace.
- Export: SPICE netlist, LTspice or PLECS file, waveforms (CSV), schematic as PDF and measurement comparison.
- Pack for Sharing.
- Print.
- Protection: save protected, remove protection, verify signature.
Export. Write a circuit as a SPICE netlist:
powercraft-cli convert buck.voltecx buck.cir
In the app, File > Export > SPICE Netlist returns the text, and Circuit > Show Netlist shows it on screen.
Warnings. A power-electronics simulator has parts that SPICE does not, such as control blocks, thermal networks and machines. Those cannot become netlist lines. The converter prints each one to the standard error output (and the app returns them as warnings). Nothing is dropped silently. A circuit that uses only R, L, C, sources, diodes, switches and the usual SPICE parts goes through cleanly. Read the warnings before you trust the result of a round trip. docs/formats/spice.md lists what is supported.
Includes. .include, .inc and .lib lines are followed when you import a file with path (powercraft-cli convert, or file.import with {"path": "design.cir"}). A path is relative to the folder of the file that names it, and a nested include is relative to its own file. Voltecx reads every .param of an included file and the .model and .subckt definitions that the netlist uses. The text of the definitions is kept inside the circuit, so an LTspice file still writes back byte for byte. Cycles, nesting deeper than 8, more than 64 files and files over 8 MB each give a warning and are skipped. A missing file gives a warning that names it. If variables stay undefined, an error says they are probably defined in that missing file. Where files cannot be read (the browser build), includes are not followed and a warning says so.
Directives. These lines are read, not ignored:
| Directive | What Voltecx does |
|---|---|
.step (param, list, lin, oct, dec) |
Kept as a parameter step. .step temp and a step of a source give a precise warning |
.ac dec, oct, lin |
Kept as an AC sweep. lin converts to the log sweep of analysis.acSweep with a warning |
.op |
Kept. It runs analysis.op, the DC operating point |
.dc |
Kept. It runs analysis.dcSweep on its first source. A second swept source is ignored with a warning |
.tf |
Kept. It runs analysis.transfer from the source to the output |
.meas (TRAN, AC, OP, DC) |
Translated: AVG, RMS, MAX, MIN, PP, INTEG with FROM and TO, FIND ... AT, FIND ... WHEN, WHEN, TRIG ... TARG and PARAM. Functions such as ph() are refused with a warning |
.options |
reltol, abstol, vntol, maxstep and method become simulation settings. The rest is listed as ignored |
Run what the file asked for. analysis.runImported runs the imported directives and never edits the circuit:
{"what": "all"}
what is all, tran, step, ac, op, dc or tf. source, output and solver are optional. The stepped runs go in parallel, a single transient serves the transient .meas lines, .op and .dc run the DC solver, and .ac runs through the AC sweep. The .meas DC lines read the signals of the sweep, and sweep stands for the swept value in their expressions. Each measurement is evaluated, and an error in one does not stop the others. If the DC solver cannot solve the circuit, the reply says why. For .op it then gives the values at the end of the transient.
More parts are mapped. BJTs and level-1 MOSFETs (chapter 10), LTspice control-library symbols (gain, integrator, delay, limiter and so on), op-amps, Misc\battery and behavioural B sources import as Voltecx parts. A B source whose expression reads node voltages only is solved with the circuit, as SPICE does; one that reads an element current I(...) follows its expression one step late, and the import says so. A named op-amp such as LT1001 becomes a generic op-amp, and a warning says that the part's own model is not used. Other parts stay "not supported" until their pins are known.
LTspice symbol files. A symbol that LTspice does not build in is described by its own .asy file. Like LTspice, Voltecx looks for it next to the schematic and then in the folders of a symbol search path: powercraft-cli convert design.asc design.voltecx --sym ~/LTspicePowerSim/sym/PowerSim (repeat --sym for more folders), or file.import with {"path": "design.asc", "symbolPaths": ["lib/sym"]} (at most 32 folders). SYMBOL PowerSim\\GAIN is looked for as PowerSim/GAIN.asy, then as GAIN.asy. A symbol file whose Prefix is a primitive (R, C, L, D, V, I, MN, MP) imports as that part. The blocks of the LTspicePowerSim library (iNMOS, PWM, DEADTIME, TYPE2, zPI, PHASESHIFT and about 60 more) are recognised by the pin names in their symbol files and import as Voltecx parts and control blocks. The table in docs/formats/ltspice.md lists what each one becomes and what is approximated. The symbol files that were read are kept inside the circuit, so the write-back opens no file. A symbol whose file is not found is named in one warning.
LTspice details. Rser, Lser and Rpar on an inductor or capacitor become its winding resistance, ESR, ESL, core-loss or leakage resistance. .ic I(L1)= sets an inductor's starting current. A .tran without a maximum step gets a step that keeps the run between 50 and a million steps. LTspice's quoted .options method="gear" and modtrap are read.
Sources given as a list of points (PWL)
A voltage or current source with a pwl parameter follows a list of points joined by straight lines (chapter 10). SPICE and LTspice PWL(...) sources import as that. r=0 sets repeat. A PWL FILE= source and other forms stay DC, with a warning. A SPICE export writes PWL(...) again. In an LTspice file, an edited list is reported as not written back.
Files saved in the Windows code page or as UTF-16
LTspice saves schematics in the Windows code page unless you tell it to save UTF-8, so the micro sign and accented letters in comments are single bytes that are not UTF-8. Voltecx reads UTF-16 (little endian), UTF-8, and otherwise Windows-1252. file.import and powercraft-cli convert keep the encoding, and the write-back uses the same one, so a file you did not edit comes back byte for byte. The reply has an encoding field when it is not UTF-8. A character the code page cannot hold (the ohm sign, for example) makes the write-back UTF-8, with a warning. A file with NUL bytes or other control characters is refused as not a text file.
LTspice and PLECS (beta)
The beta build reads LTspice .asc schematics and PLECS .plecs files, and it can write changes back into the same file.
powercraft-cli convert design.asc design.voltecx
or file.import with {"path": "design.asc", "format": "auto"}. The format is detected from the file.
Import maps what it understands and lists everything else in
warnings. Runcircuit.explainon the imported circuit to check that the topology is what you expected.Write-back is the unusual part. The imported file is kept inside the circuit. When you edit the circuit and export it (
file.exportNative, orconvert design.voltecx design.asc), Voltecx changes only the lines of the original that your edits touch. A file you did not edit comes back byte for byte. Changing one value changes one line. This keeps your LTspice or PLECS project clean in version control.C-Script code in files. A PLECS C-Script block may
#include "x.c"or#include "x.h", code kept beside the model. When you import the model by its path, Voltecx reads those files from the model's folder and puts their text into the block, so the block carries all its code and runs. A file may include others (8 deep at most), and a name is read relative to the file that names it. Absolute paths are refused, and so are paths that leave the model's folder (../x.c) unless you allow a folder that contains the model (below); the block keeps its#includeline. A missing file, or an import that has no access to files (the browser build, or text imported without a path), gives a warning that names the file; the block then reports the include as an error, as before. A block never reads files while it simulates. Voltecx keeps the files it read inside the circuit, so an unchanged model still writes back byte for byte.Shared C files one folder up. When a C-Script includes a file with
..(#include "../common/x.c"), Voltecx first imports the model without it and asks, naming the C-Script block and the include. Under Allow includes from this folder it offers the smallest folder that holds the model and the file (Choose picks another, such as the project folder). Allow and import again imports the model again and reads the files inside that folder; nothing outside it is read. Keep without it (or Esc) keeps the circuit as imported, and the block reports the include as an error. The same choice from the command line:powercraft-cli sim model.plecs --include-root DIRorconvert model.plecs out.voltecx --include-root DIR, and in a commandfile.importwith{"path": "work/m/model.plecs", "includeRoot": "work"}(the folder must contain the model).Net labels. Voltecx draws a net label as a flag instead of a wire (Edit > Draw Tools > Net Label, key
Nin the Classic keymap,Lin Default). Import maps LTspiceFLAGnames and PLECSGotoandFromblocks to labels. LTspice flags that name a supply rail (VCC,VDD,VEE,VSS,V+,V-,+5V,-12V,3.3Vand similar) become rail labels.0andGNDstay ground, and anIOPINflag stays a port.Label write-back. When you add, rename or remove a label and export, Voltecx writes the change into the original file. Untouched flags and blocks keep their bytes. What each program gets:
LTspice PLECS Add a label A new FLAGline, for every label kindOn an output pin, a Gotoblock with the net name as its tag. On an input pin, aFromblock, and aGotoat the net's output if noGotohas that tag yetRename a net Every flag on the net is renamed. A net the file did not name gets one flag at a pin The tag of the blocks on the labelled pins Remove a label Its FLAGis removed only when the pin stays on the net and the net keeps its name. Otherwise the change is reportedThe pin stays on its net. A Gotois removed unless aFromblock still reads its tag. Then it stays, and a warning says so. Tag blocks left with no connection are removedLabels on electrical pins and the rail and port kinds are reported but not written to a PLECS file, because the format notes in
docs/formats/plecs.mddo not document a block for them.Vector signals in PLECS files. PLECS carries a three-phase set or a group of gate signals as one vector. When every vector in the model fits a bus (chapter 3), import keeps it as one: a
SignalMuxbecomes a Bus Mux, aSignalDemuxa Bus Demux (or a Bus Selector for an output wider than one element), and aSignalSelectora Bus Selector whoseindexkeeps the PLECS order (3 1becomes3, 1). A gain, sum, PI or logic gate on a vector stays one block that acts on every element, and the bus net takes the name of its PLECSGototag when it has one (otherwises1,s2…). A pin that reads or drives one element (a Function block'su[2], one phase of a three-phase meter) reaches it through an added demux or mux named after the bus (s4_demux). The reply then warns, for example, "3 vector signal(s) kept as buses: the PLECS muxes, demuxes and selectors became bus blocks, and element-wise blocks act on every element". A model of three constants (1, 2, 3) muxed into a gain of 2, a selector3 1and a demux imports asM(busMux,n3),G(gain),Sel(busSelect,index3, 1) andD(busDemux,n2), and its outputs read 6 and 2, as in PLECS. The circuit simulates exactly as it did split into scalar nets, an unedited file still writes back byte for byte, and editing a gain on a bus changes the one line of its PLECS block.When the vectors do not fit (widths that disagree around a mux or selector, a vector with no driver or two, more than 8 elements reached one by one, a mux of more than 8 inputs, a block that does not work element by element on a vector, or a vector wider than 64), the whole model is split into one net per element, as before. Only the PLECS importer keeps vectors.
Limits. In an LTspice file, rewiring an existing symbol and changing its orientation are reported, but not written. In a PLECS file, an edited connection is rewritten without its drawn
Points. Nothing was ever opened in LTspice or PLECS to test: the guarantees come from the file format rules and from tests on public sample files. The formats are described indocs/formats/ltspice.mdanddocs/formats/plecs.md.
PSIM schematics
Needs sign-in to Voltecx Cloud: the desktop app sends the PSIM file to Voltecx Cloud's converter and opens the circuit that comes back (sign in under Help > Licence). Without a sign-in, or offline, opening a .psimsch file (File > Open, a drop, or File > Import) shows a Voltecx Cloud notice with Sign in and Retry; Retry opens the same file again. In File > Import, a PSIM file chosen while signed out shows Sign in to convert in place of Import.
File > Open (or powercraft-cli convert x.psimsch x.voltecx) reads a PSIM schematic saved by PSIM 8, 9, 11 or 2022 and later (seen up to 2026). The parts Voltecx has are placed where they were, with their values, and the wiring is rebuilt from the drawing: wires, junctions, parts touching each other and net labels. The ideal 3-phase inverter becomes six MOSFETs drawn as a bridge (three legs, drains up, gates to the left), with PSIM's switch resistance and an ideal body diode as the antiparallel diode. Resistor, capacitor, inductor, diode and MOSFET modules (whatever language PSIM ran in) become the matching Voltecx part with their values, and a flipped part keeps its pins where PSIM drew them. PSIM's ideal transistors become gated one-way switches (Voltecx's IGBT, with the saturation voltage as its drop), a Zener diode becomes two antiparallel diodes (the forward drop one way, the breakdown voltage the other), and a two-winding transformer becomes a transformer with PSIM's turns ratio, winding resistances, leakage and magnetizing inductances. A three-winding transformer becomes two transformers whose primaries are in parallel behind the primary's resistance and leakage, which is the same ideal transformer, with each winding's turns ratio, resistance and leakage and the magnetizing inductance across the primary. A D flip-flop with set and reset inputs becomes Voltecx's D flip-flop, whose optional s and r inputs force the output at once while they are high (reset wins). An op-amp whose inputs are circuit nodes and whose output feeds only control blocks (a comparator, for example) becomes control blocks: a voltage meter across its inputs and, for PSIM's ideal op-amp, a switch between the two supply values, or, for the level-1 op-amp, a single pole with PSIM's DC gain and unity-gain frequency whose output stays between the supply values. An optocoupler, a TL431 and a UC3842, UC3843, UC3844 or UC3845 controller module become Voltecx's behavioural ICs (the same ones ic.place puts in): the optocoupler with PSIM's LED values and current transfer ratio, the TL431 with the TL431C data sheet's values, and the controller with its part's data sheet values, its oscillator set by the timing resistor and capacitor on PSIM's RT/CT pin. Voltecx's controller has no VREF pin, so what that pin fed is left without its 5 V reference, and a warning says so. Everything that was not imported exactly is listed in Problems, in groups with the most important first (chapter 8), and the status line says how many there were (for example Opened closed_loop.psimsch: 10 import warnings — see Problems):
- C blocks. Each becomes a Voltecx C block (PSIM dialect) with the same name, its inputs
x1…and outputsy1…on the nets the drawing put them on, and it runs its code in Voltecx's C interpreter at every solver step. The interpreter supports a subset of C, so a note lists every C block and asks you to compare its outputs with PSIM. Double-click the block, or use Circuit > C Code or Edit Code on the right-click menu, to open the code editor: it checks the code as you type, and Save keeps your change as one undo step (Revert drops it). The code starts with a comment that lists the net each pin touched in the drawing (// x1 = net Id_ref,// y1 = net Vduty_A2); PSIM's standard#includelines are left out. A block without code (none in the file, or over the circuit's limit for kept code) is warned and does not run until you add some. When a C block could not be added, a "Signal has no source" problem on a net it drove names that block. - Module parts whose model Voltecx does not map (a level-2 MOSFET, for example), and other part types Voltecx does not map, each with the reason: a random source (the file does not say how often it draws a value), an op-amp whose output drives parts of the circuit, such as its own feedback network (place Voltecx's
opAmpIC by hand; the warning says which pin is which), and a UC384x controller whose timing resistor is below the data sheet's 5 kΩ minimum. - Subcircuits. A PSIM 9 subcircuit block becomes a subsystem made from the file it calls, read from the same folder (Circuit > Subsystems shows the inside). Each of its pins sits where PSIM's symbol puts that port and joins the wires drawn there; a pin with nothing drawn at it is left open, and a warning names it (a schematic wired for an older version of the called file has such pins).
- Variables that the file uses but does not define. A file that another PSIM schematic calls as a subcircuit takes these values from that schematic: open the calling schematic with this file in its folder, or define the variables in this circuit before simulating.
- Voltage probes that watch control signals: they are not imported, but the net a probe was on alone takes its name (
Vduty_A2), so you can put it on a scope. - Settings Voltecx does not model (a carrier's start time, for example), then text boxes and file records that were not read. The PSIM file is never changed: File > Save asks for a new
.voltecxfile. The format notes are indocs/formats/psim.md.
Trademarks
PSIM is a trademark of Altair Engineering, Inc. (a Siemens company); PLECS of Plexim GmbH; LTspice of Analog Devices, Inc. Voltecx is not affiliated with, sponsored by or endorsed by them; their names are used only to describe file compatibility. Their files are read for interoperability. Voltecx writes LTspice and PLECS files only back to the format a circuit was imported from (File > Export > LTspice or PLECS File), and never writes PSIM files. The same notice is in Help > About Voltecx and under an import's notes in Problems.
Comparing two versions
file.diff tells you what changed between two versions of a circuit. Each side can be a file (a .voltecx file, or an LTspice, PLECS, SPICE or PSIM file), a circuit you have open (its number in session.list), or .voltecx or netlist text: {"a": "buck-v1.voltecx", "b": "buck-v2.voltecx"}. Leave out b to compare with the active circuit. Nothing is opened or changed.
The reply lists each change once:
- parts added, removed and renamed. A part that has another name in the new version is one rename, not a removal and an addition. In the same file the part's id gives it away; across files, a part of the same kind with the same values or the same wiring;
- parameters that differ, with their unit (
C1.c: 1 µF → 2.2 µF); - wiring per net: the pins attached to and detached from each net, and nets that were only renamed. The pins of an added or removed part are not repeated here;
- circuit variables, simulation settings and subsystem definitions. For a definition that changed,
subsystems.detailssays what changed inside it (its parts, parameters and wiring, and whether its pins changed), andlinesreadsfilter: C1.c: 1 µF → 2.2 µF.
summary counts the changes, and lines gives one sentence per change, both in English and in Traditional Chinese.
A side can also be a checkpoint (checkpoint.create): {"a": {"checkpoint": "c3"}} compares checkpoint c3 of the active circuit with the circuit now. A checkpoint's label works as a version tag: {"checkpoint": "sent to layout"} names the newest checkpoint with that label. Add "index" to take the checkpoint of another open circuit.
A side can also be a run of the Runs list: {"a": {"run": "r3"}} compares the circuit run 3 was computed from with the circuit now, and {"a": {"run": "r2"}, "b": {"run": "r5"}} two runs with each other (ids from runs.list). A run read from a bundle keeps its waveforms but not its circuit, so it cannot be compared this way.
Side by side in the window
File > Compare With File picks a circuit file and opens Compare Circuits on it and the circuit now. The two schematics are drawn side by side: parts added are green, parts removed red, and parts, nets and subsystems that changed amber, with the rest faded. Under them, the same table as a Runs card lists every change, Before and After. In Runs, Compare with now on a card compares that run's circuit with the circuit now, and Compare circuits compares the circuits of the two runs picked with Compare.
In git
A .voltecx file is pretty JSON written the same way every time: saving a file you opened writes the same bytes, maps (parameters, variables, subsystem definitions, positions) are written in key order, and changing one value changes one line. So plain git diff already stays small. To see what a change means for the circuit instead of the JSON lines, make powercraft-cli diff git's diff driver for circuit files (Preferences and saving > Circuits in git).
To compare the design results of two versions, run bom.export or spec.verify on each and pass both replies:
bom.diff {"a": <bom.export reply>, "b": <bom.export reply>}lists the BOM lines added and removed and, per reference designator, a changed status, part number, manufacturer, value, quantity, footprint or unit price, with the change in total cost, pieces and board area;spec.diff {"a": <spec.verify reply>, "b": <spec.verify reply>}matches the rows by requirement and corner, and lists the rows that now fail, now pass, measure differently, or were only checked in one run, with the overall verdict before and after.
The bill of materials in the app
View › Bill of Materials shows the open circuit's bill of materials as a table: one line per part with its designators, value, the rating the last run asks of it (for example ≥ 60V, ≥ 2.1A rms), part number, manufacturer, pieces and a DNP mark. Equal parts share one line with all their designators. Parts no catalogue part fits say so, with the reason on hover, and have no part number: Voltecx never makes one up. DNP parts come last. Meters, control blocks and probes are not on a board and are left out, as in the exported list. The lines are the rows bom.export writes to its CSV (bom.list returns them to scripts), read again after every run, so the view needs a simulation result. Click a line to select its parts on the schematic and zoom to them; click Designators, Value or Qty to sort, and again to reverse.
When the project has a board, a Fitting column says how each line's parts are fitted, in the order the steps run: reflow, wave or selective solder, hand solder, press fit, or inserted into a socket, marked by hand or removable where the board's fitting plan (board.fittingPlan) says so. A drilled part with no mount data reads Unknown, never a guessed step. Hover the cell, or select the line, for the fitting note; Copy table adds the column too.
Bill of materials and KiCad project
File > Export > Bill of materials (bom.export) picks a catalogue part for every component from the stress of the last run and writes the list as CSV, with the KiCad BOM columns first. File > Export > KiCad project (file.exportKicad) writes a KiCad 8 schematic with those parts, a project with net classes and a design-rules file. Both open a form first, and both are also in Design > Manufacturing, beside Manufacturing Outputs for the files an assembly house needs once the board is routed. Chapter 16 gives their parameters.
Open a Voltecx board in another PCB tool
The KiCad project is also the way to take a Voltecx design into a PCB tool other than KiCad: many tools have an importer that reads a KiCad 8 project. Export with a path, then point the other tool's KiCad importer at the .kicad_pro; the .kicad_sch and the .kicad_dru beside it go along.
- The folder stands on its own. Every symbol is defined inside the
.kicad_sch, so the importer needs no KiCad library, and no file names a path on your computer, so the folder can be zipped and sent. - Each board part carries its reference, value and footprint as a
Library:Nameid from the KiCad standard library. The other tool maps that id to its own footprint, or asks you to; a part listed inmissingFootprintshas no id yet, so give it one first. - Net classes and clearance rules are in the
.kicad_proand the.kicad_dru. Not every importer reads custom rules: check the high-voltage clearances in the other tool before routing. - To come back the other way, export IPC-2581 or ODB++ from the other tool; reading those files is on the roadmap.
The test fixture crates/io/tests/data/kicad_exchange is such a project, for the synchronous buck.
Open a KiCad schematic
file.importKicad {path} (from the command line or the assistant) opens a .kicad_sch from KiCad 6 to 9 as a new circuit. Resistors, capacitors, inductors, diodes, sources, batteries, fuses and test points come in by their reference letters, transistors by NPN, PNP, NMOS or PMOS in the symbol's name, and anything a Voltecx export wrote by its library id. Each part keeps its place, turn and mirror. With a path, the hierarchical sheets beside or below the file come in too, each on a Voltecx sheet of its own name. A sheet file drawn twice is read once per drawing, with the references KiCad keeps for each.
Buses come back as bus wires on the sheet they are drawn on, with their labels (D[0..7], USB{DP DM}). A bus wired into a sheet pin carries its members into the sheet below, as KiCad joins them. A vector bus pairs members by position from the lowest index, so X[2..3] into D[0..1] joins X2 to D0. A group bus pairs them by member name. A bus sheet pin with no bus on it carries the members its own name gives. The net labels you drew in Voltecx come back on the same pins with the same kinds (net, goto, from, rail, port, ground): the export still puts a global label on every pin, so KiCad joins the nets, and marks the drawn ones with a hidden voltecx_label field that changes no net. A schematic drawn in KiCad brings no drawn labels; its labels only join nets. Symbols of no known kind (connectors, ICs) are left out and listed in the warnings. A KiCad schematic holds no device models or simulation settings, so parts start on their defaults.
A circuit drawn over several sheets goes to KiCad as a hierarchy. Sheet 1 is the top .kicad_sch, with a sheet box for each other sheet, named after it. Each other sheet is its own file beside it, <name>-2.kicad_sch, <name>-3.kicad_sch and so on. The pins still carry global labels, so the nets join across the files. Opening the top file with file.importKicad {path} puts every part back on its sheet. KiCad's top sheet has no name of its own, so a renamed sheet 1 keeps its name in the top file's title block, as comment 4 Voltecx sheet: <name>. KiCad shows it there, and file.importKicad reads it back as the name of sheet 1.
Keeping a KiCad project in step
After the circuit changes, File › Sync with KiCad (pcb.sync {path}) compares the project's .kicad_sch with a fresh export and lists what a sync would change: parts added and removed, field changes (Reference, Value, Footprint, MPN, Manufacturer, on board, do not populate) and the net on each pin. Parts are matched by the hidden voltecx_id field, never by position or reference. Apply writes the export over the project; run Update PCB from Schematic in KiCad afterwards, and every footprint keeps its place and tracks.
Every symbol also carries a hidden voltecx_base field: the values Voltecx last wrote. Each field change says where it happened (origin):
| Origin | Meaning | Apply |
|---|---|---|
| circuit | You changed the circuit; KiCad still has the last synced value | Writes the circuit's value |
| kicad | Someone edited the field in KiCad; the circuit did not change | Refused, so the edit is not lost |
| both | The field changed on both sides to different values (a conflict); base is the last synced value |
Refused |
To keep KiCad's value, change the circuit to match and sync again. To keep the circuit's value, apply with overwriteKicad: true. In the window each field row shows its origin as Changed in the circuit, Edited in KiCad or Changed on both sides; hover a KiCad edit for the value to set in the circuit, and a conflict for the last synced value and both new ones. While KiCad edits are listed, Apply stays greyed out until you tick Overwrite KiCad edits. A project exported before the base field existed has none: every difference counts as the circuit's until the next apply writes one.
The other way, the window's KiCad to circuit switch (pcb.sync {path, direction: "fromKicad"}) lists what was changed in KiCad. Each row says whether it comes back: a reference KiCad's annotation changed (labels, probes and expressions follow the new name) and a do-not-populate flag. Every other difference (a value, footprint or part number typed in KiCad, a wire, a part added or deleted there) stays, and its tooltip says why and where to make the change instead. A value, footprint or part number edited in KiCad (or changed on both sides) has a box in its row: tick it to pick KiCad's side, and the row then says it comes back. From the command line or the assistant, each such change has an accept name such as C1.Value, and pcb.sync {path, direction: "fromKicad", acceptFields: ["C1.Value"], apply: true} sets the part's value parameter (KiCad's 4k7 and 1M read as 4.7 k and 1 M), its Footprint field (a library footprint Library:Name) or its part number, in the same undoable step. A value an expression sets, or one the bill of materials gives, stays. Apply to circuit makes the edits that come back as one step that Edit › Undo restores, and writes no file. It is greyed out when nothing comes back, inside a subsystem, or when KiCad gives two parts one reference or a name another part keeps.
The routed board can come back too, from the command line or the assistant: pcb.sync {path, direction: "fromKicad", boardPath: "out/buck.kicad_pcb"} also reads the board's layout parasitics, as Sync Simulation with Board (layout.syncBoard) reads them: each power loop's series inductor Lpcb<n> and each switching node's capacitor Cpcb_<node>_<plane>. They are listed under parasitics with the circuit's value before, the board's value after and whether each is new, changed or unchanged. Nothing goes into the circuit until you accept it: acceptParasitics: ["Lpcb1"] (or true for all) with apply: true puts the accepted ones in as named stray parts, drawn beside their capacitor, in the same Sync from KiCad step that Edit › Undo restores.
While the board is still open in KiCad, the parasitics can come from the routing on KiCad's screen, saved or not: add liveKicad: true to layout.extract or layout.syncBoard with path to the .kicad_pcb KiCad has open. The tracks, arcs, vias and zone fills come from the running editor over KiCad's API (KiCad 9 or later, with its API server turned on in its preferences); the board file still gives the stackup and the footprints, and nothing changes in KiCad. The reply's board.copperFrom says kicadEditor. A zone KiCad has not filled adds no copper and is named in the warnings: fill the zones in KiCad (B) and read again. When KiCad has another board open, or cannot be reached, the file's copper is used and a warning says why. To take only some nets from the editor, add liveNets with their names as the board gives them (for example ["GND", "SW"]): those nets' copper comes from KiCad, every other net keeps the file's, and KiCad 10.0.1 or later reads just those nets. A name with no copper in KiCad is named in the warnings, as is an unfilled zone on those nets.
In the window, KiCad to circuit has a Routed board field for the same .kicad_pcb (or a .vxpcb); the last one is offered next time. Layout parasitics then lists each stray part with its loop or node, the circuit's value and the board's, and a box. Only new or moved stray parts can be ticked, and nothing is ticked at first: tick the ones you accept and Apply to circuit puts them in, with the references that come back, as one step. Stray parts the circuit has but the board no longer gives are listed apart; they stay until you delete them. With a .kicad_pcb, Read the routing open in KiCad takes the copper from the board open in KiCad's PCB editor, unsaved routing included (liveKicad: true, as above); the list's heading says whether the routing came from KiCad's open editor or the saved file, and a note says why when KiCad could not be read.
To keep a project in step without opening the window each time, tick Sync on every save (pcb.watch {path}). The setting is saved in the circuit file and Edit › Undo takes it back. From then on every save writes the circuit's changes to that project, as Apply does, and the status bar says how many changes went over. A sync that would overwrite fields edited in KiCad, or drop parts drawn there, writes nothing and says why; the circuit itself is always saved. Untick the box (pcb.watch {off: true}) to stop.
When Apply runs, the board follows too. If Voltecx can reach a KiCad that has the project's board open in its PCB editor, the changed references, values and part numbers go straight into that board as one step that KiCad's Undo takes back, matched by voltecx_id; every footprint keeps its place, side, lock and tracks. The board is then changed but not saved: save it in KiCad. A changed footprint, a part added or removed and a net change still reach the board through Update PCB from Schematic. In every other case (KiCad not running, another board open, or a build that cannot reach KiCad) the reply's kicadBoard says why the board takes the file route, and Update PCB from Schematic brings it in step as before. If KiCad refuses a change, nothing changes in its editor and the schematic files stay written. The desktop app and the command line reach KiCad 9 or later on macOS and Linux when KiCad's API server is turned on in its preferences; on Windows and in the browser the board always takes the file route.
Fabrication files from a Voltecx board
A board drawn in Voltecx (the project's .vxpcb) gives its own fabrication files with board.exportFab, with no outside program. It fills the zones first, then writes into a fab folder beside the board (or the folder you give):
| File | What it is |
|---|---|
<board>-L1-top.gbr … -L<n>-bottom.gbr |
one Gerber X2 file per copper layer: zone fills, tracks, vias and pads, each with its net |
-mask-top.gbr, -mask-bottom.gbr |
solder mask openings (pads at copper size; vias are covered) |
-paste-top.gbr, -paste-bottom.gbr |
paste stencil (fitted surface-mount pads only) |
-silk-top.gbr, -silk-bottom.gbr |
legend |
-profile.gbr |
the board outline; a board without one is refused |
-PTH-<from>-<to>.drl, -NPTH-<from>-<to>.drl |
Excellon drill files, plated and non-plated apart, one per via span |
-pos.csv, -cpl.csv |
pick-and-place: the position file (Ref,Val,Package,PosX,PosY,Rot,Side, mm, y up) and JLCPCB's CPL; parts not fitted are left out, values come from the open circuit |
-component-top.gbr, -component-bottom.gbr |
Gerber X3 component layers of the same parts: reference point, rotation, value, footprint, mount type, maker and part number, footprint library, LCSC supplier part (when given), body height (when cited), courtyard and pins (number, net and port) |
-bom.csv, -bom-jlcpcb.csv |
bill of materials: Designator,Qty,Value,Footprint,MPN,Manufacturer, and JLCPCB's Comment,Designator,Footprint,LCSC Part #,MPN,Manufacturer (LCSC number empty); one line per value, package and part number, of the same fitted parts |
What to upload to a fab: the Gerber and drill files, zipped together. For assembly, send the position file and the BOM (-cpl.csv and -bom-jlcpcb.csv for JLCPCB); the notes name BOM lines without a part number. The Gerber X2 attributes say which layer each file is, so the fab's viewer sorts them itself. Text on the board is not drawn yet; the reply's notes say how many text items were left out. IPC-2581 from the board follows.
Hand an IC block to the IC team
ic.exportHandoff {"dir": "handoff"} writes the bundle an architect hands to the IC team into a folder, through the file service (so the folder must be one the automation was granted):
handoff.jsonhas one block per top-level library IC instance (ic.place): instance, definition, template, title, data sheetsourceand preset part, every parameter with its value, unit, range, default, the data sheet row it came from, andoverriddenwhenic.placeparams changed it, the pins and the nets on them, andnotModelled, what the model leaves out.skippedlists definitions edited after placing, which no longer match their data sheet.waveforms.csvhas theprobesof the last run (default: the circuit's probes) betweent0andt1, every sample, with the run conditions (solver, end time, step, window) inhandoff.json.circuit.pcraftis the circuit itself.
Without a simulation result the bundle holds the block specs and the circuit only, and warnings says so. The command changes nothing and records no history step.
Waveforms
The Scope menu has the CSV exports as well: Export CSV (Visible Window) writes what the plot shows, Export CSV (Full Run) the whole run, and Copy CSV (Visible Window) puts the visible part on the clipboard. They are grey until a run has finished.
- Export CSV (Visible Window).
- Export CSV (Full Run).
- Copy CSV (Visible Window).
- File > Export > Waveforms (CSV) or
scope.exportwith"format": "csv"writes signals to CSV;"format": "mat"writes a MATLAB MAT-file and"raw"an LTspice binary.raw(docs/formats/waveform-files.md). waveform.comparereads a CSV from a bench scope or another simulator and compares it with your simulation (chapter 5).- Open a waveform file on its own. File > Import > Waveform File opens a scope CSV or any file Import Measurement
reads (
.raw,.mat,.sr,.vcd,.isf,.bin,.trc) as a dataset of its own, in a new tab named after the file, with no circuit and no run. The scope shows its traces at once, and the cursors, the measurements and the FFT read them as they read a run. A column in volts reads asv(CH1)and one in amperes asi(CH2), so it goes on the voltage or current axis;V(out)andI(L1)from a.rawfile becomev(out)andi(L1). A file dropped on the window before any run opens the same way. The command isfile.openWaveforms(csv,bytesorpath, as Import Measurement takes them). - Merge a waveform file into the result. File > Import > Merge Waveforms adds every trace of a file to the
result on screen (a run, or a file opened as above), named after the file:
v(CH1)_(bench)frombench.csv. The traces are read at the result's own times, so the cursors, the measurements, math signals and the FFT read them beside the run's; where the file has no samples they are not drawn. Merging the same file again adds_2. The merged traces stay until the next run. The command isfile.mergeWaveforms(csv,bytesorpath, plustagfor another name andtimeOffsetto move the file in time). - Waveforms from LTspice or MATLAB. File > Import > Measurement also opens an LTspice
.rawfile (binary or ASCII, from LTspice or ngspice) or a MATLAB MAT-file, so a run you trust in another simulator can be laid over a Voltecx run. A.rawfile's columns keep their names (V(out),I(L1)) and units (V, A from the variable type). A MAT-file gives its time vector (time,tortout;timeVariablenames another) and every vector or matrix column of the same length (x(:,2)); MATLAB's default compressed-v7files are read, a-v7.3file is refused (save it with-v7). A stepped.rawrun gives its first step, with a note. An AC sweep is refused: only a transient run compares with the scope. For automation, pass the file asbytes(base64) or as apathending in.rawor.mat;waveform.comparetakes the same. A file written by File > Export > Waveforms (CSV) reads back with zero error (docs/formats/waveform-files.md). - Logic analyser and USB scope captures (sigrok). File > Import > Measurement also opens a sigrok session
(
.sr), the file PulseView andsigrok-clisave from cheap logic analysers and USB scopes (fx2lafw boards, Hantek 6022, and Rigol or Siglent scopes through sigrok). Each named logic probe becomes a 0/1 column (a gate signal, a fault flag) and each analog channel a column, timed by the file's sample rate. A capture longer than 5,000,000 samples keeps one sample in a whole stride, and a note says which. Analog channels carry no unit in the file, so give one in the window or withunits. For automation, pass apathending in.srorbyteswith"format": "sr". - Digital dumps (VCD). File > Import > Measurement also opens a Value Change Dump (
.vcd, IEEE 1364 clause 18), the text format of GTKWave and Surfer that sigrok, PulseView and every HDL simulator write. Use it to lay an MCU's PWM, gate signals and fault flags, or an FPGA controller's simulation, over the circuit. Each variable becomes a column named by its scopes (top.ctrl.pwm), held between its changes on the union of all change times, in seconds from$timescale. A vector reads as its unsigned value, arealas its value, andxorzas a gap. A dump past 5,000,000 time steps is refused: cut it to a window first. Pass apathending in.vcd, orbyteswith"format": "vcd". - Binary scope captures. File > Import > Measurement also opens a scope's own binary file, which keeps the full
resolution, the vertical scale and the trigger position that a CSV export may round or drop: Tektronix
.isf(TDS, DPO, MSO and MDO reference waveforms), Keysight or Agilent.bin(InfiniiVision and Infiniium; every waveform in the file with the same time axis, a peak-detect record as its max and min) and Teledyne LeCroy.trc(the first segment of a sequence). Each column carries the unit the header names (V, A) and is scaled as the header says; the time is 0 at the trigger, and a note gives the trigger's sample and the sample interval. Tektronix.wfmfiles are not read yet: save the waveform as.isfor CSV. Pass apathending in.isf,.binor.trc, orbyteswith"format": "isf","bin"or"trc". - File > Import > Measurement does the same from the menu, after a run. Pick the CSV; the window lists its columns
with the simulated signal each one seems to be (by name, then by unit) and lets you change the pairs. Compare
finds the time shift and shows, per signal, the RMS error, how well it matches and what the difference suggests.
Each measured trace is then drawn dashed on its signal's plot, marked "(measured)"; its Measured row in the
scope toolbar's References list hides or drops it. A file written by File > Export > Waveforms (CSV) reads back
and matches its own run. The command behind it is
file.importMeasurement. - From a script, name the file with
path:powercraft-cli run --in pol.pcraft --root w --cmd simulation.run --cmd file.importMeasurement --params '{"path":"scope.csv","map":{"v(out)":"CH1"}}'readsw/scope.csv(a.rawor.matis read as bytes).waveform.compare,debug.fitToMeasurementand the other commands that take a scope file readpaththe same way wherever a folder is allowed:--rooton the command line, the automation folders ofserveand the app. A path outside the allowed folder is refused. - The reader knows the CSV layouts of Tektronix (the legacy TDS/TBS/DPO2000 files with the data in fields 4 and 5,
and the MSO 4/5/6 files with a
Vertical Unitsline), Keysight InfiniiVision (x-axis, then asecond,Voltunits row), Rigol (X,CH1, including the Start/Increment files that number the samples) and any plain time/value table. Units in the headers (Time (ms),CH1 [mV]) are converted to seconds, volts and amps.units({"CH2": "A"}) says what a column's numbers are in when the file does not,decimatekeeps one sample in n of a long record, andtimeOffsetadds seconds to the measured time before the alignment. - A measured loop gain from a network analyser (a Bode 100, an AP300 or a scope's frequency response analysis) is a
CSV with
Frequency (Hz)(orkHz),Gain (dB)andPhase (deg)(orrad) columns, in any order. The same command reads it as a frequency response, not a waveform, with no run needed: the reply haskind: "bode", the points, and the crossover, phase margin and gain margin read the same way asanalysis.loopGainreads its own. Pass that reply toanalysis.loopGainascompareTo; itscomparisongives the crossover and margin differences (simulated minus measured) and the largest gain and phase gaps where the two sweeps overlap. - Alignment:
"timeShift": "auto"(the default) finds the shift by cross-correlation;"trigger"puts the first rising edge ("triggerEdge": "falling"for a falling one) of the first measured column on the simulated one's, as the scope's trigger did; a number is a fixed shift. Tick Align on the first rising edge (trigger) in the window for the same. - Per signal the comparison gives the RMS error, the peak error and, for a step response, the 10–90 % rise time and the 2 % settling time of both traces with their difference (shown in the window as two more columns).
- File > Export > Measurement Comparison (
file.exportComparison) writes what a report or thesis needs: the overlay figure ("figure": "svg"or"png"), the error table ("table": "latex","markdown"or"csv", with"lang": "zh-Hant"for Chinese headings) and the aligned traces as CSV (time,sim:…,meas:…) to replot with your own plot style. With"out": "results/c1"it writesresults/c1.svg,results/c1-table.texandresults/c1-data.csv. Voltecx makes no measured data: the numbers come only from your scope's file. - Share this validation with Voltecx appears in the Import Measurement window once a comparison has run. It
is optional and sends nothing until you say so. The dialog lists what is sent (the version and solver, the
component kinds and counts, a fingerprint of the circuit, and the summary numbers per signal, never the
waveforms), lets you pick the topology and add the operating point and instrument, and shows the exact
payload. Send stays grey until you tick the consent box; the circuit itself goes only if you also tick
Also send the circuit. Offline, the upload waits and is retried every hour. We review each upload and
publish only per-model accuracy over at least 3 accepted uploads. The command is
validation.share; the Privacy Notice (section 6) has the details.
Design report as PDF or HTML
Needs sign-in to Voltecx Cloud: the design report is made with Auto Design, which runs there (chapter 16).
report.export writes the design report of the active circuit as one file:
powercraft-cli run --root out --new '{}' \
--cmd design.auto --params '{"spec":{"vin":12,"vout":3.3,"iout":5}}' \
--cmd simulation.run --params '{}' \
--cmd report.export --params '{"path":"report.pdf","lang":"en"}'
- What is in it. The latest
design.autorun on this circuit in this session: the verdict, spec, topology, gates, values with their formulas, magnetics, verification, the loop with its Bode plot and margins, efficiency and losses, thermal, stress, worst case, gate drive, sense network, protection, firmware, conducted emission, layout checklist, bill of materials, the stages of the run, open items and what was not checked. Then the schematic of the circuit as it is now and the key waveforms of its latest simulation: one plot per scope, or, without scopes, the output voltage, the switch node and the inductor and switch currents. - After reopening the file.
design.autokeeps a record of its report with the circuit, saved in the file (the same undo step that keeps its spec). Open the file in a later session, or on another computer, andreport.exportwrites the same report from it:powercraft-cli run --in pol.pcraft --root out --cmd report.export --params '{"path":"report.pdf"}'. The record leaves out the schematic picture (the report draws the circuit as it is then) and keeps at most 200 points of each plot. - Without a design.auto run (and no record in the file) the report has the schematic and the waveforms only. You can also pass a saved
design.autoreply asreport. - Out of date. When the circuit changed after the run, or after the simulation, the report says so.
- Formats.
pdf(the default) is written by Voltecx itself, with no other program, and is read back before it is written.htmlis one page with the schematic and the plots inline. - Fonts. The PDF uses the standard fonts every PDF reader has, so no font is embedded. Chinese text uses the reader's own Traditional Chinese font (Adobe-CNS1): Acrobat, Preview on macOS and browsers have one. On Linux, poppler-based readers need the
poppler-datapackage.
Schematic figures for reports and theses (beta)
file.exportSchematic writes the schematic as a picture you can put in a document:
powercraft-cli run --root figs \
--cmd file.openExample --params '{"name":"buck"}' \
--cmd file.exportSchematic --params '{"format":"tex","path":"fig-buck.tex"}'
format |
What you get |
|---|---|
svg |
A vector picture. Every drawn item carries a data-part, data-net or data-pin attribute, so you can pick parts by name in Inkscape. Text uses IBM Plex, and falls back to a system font |
png |
A raster picture, with every designator, value, pin name, label and note lettered in a small pixel font: paste it into a chat, an issue or a review. Use SVG or PDF where the text must be typeset |
tex |
A circuitikz fragment in the style of a thesis kit. It holds only the content, so you \input it into a figure |
Other keys: theme is light, dark or print (black on white). scheme is classic (textbook colours) or ink (all ink, blue control signals). The tex output ignores the theme, because your LaTeX package sets the colours.
file.print writes a black-and-white svg, png or pdf for printing: {"path": "buck.svg", "format": "svg"}. The command itself does not open a print dialog. In the desktop app, File > Print (Cmd+P) writes the sheet as an A4 PDF, with a page for each subsystem, in the temporary folder and opens the system's print dialog on it: Preview's on macOS, the PDF viewer's on Linux (or the default printer through lp when there is no viewer), and the print action of the PDF program on Windows. In the browser, Print downloads the sheet instead.
parts draws only the parts you name, with the nets between them and the labels on their pins ({"path": "stage.svg", "parts": ["Q1", "D1", "L1"]}), so one stage of a converter can be a figure of its own. The circuit keeps every part.
Edit > Copy Schematic as Image and Edit > Copy Schematic as SVG put the drawing on the clipboard, to paste into a report, a slide or a mail. The image is the PNG above in light colours; the SVG is its text, which drawing programs and office suites paste as a vector figure. Neither depends on the zoom or the grid. With parts selected, only they are copied. File > Print Selected prints the selected parts alone on one A4 sheet, through the same print dialog as Print (file.print {"parts": [...]}).
File > Export > Schematic asks where to save and writes the same A4 sheets as a PDF (file.exportSchematic {"path": "buck.pdf", "format": "pdf", "page": "a4"}).
Every sheet (page a4, letter or fit, and file.print) has zone references around its frame, as KiCad and Altium draw them: rows A, B, C… from the top (no I or O, which read like 1 and 0) and columns 1, 2, 3… from the left, in 50 mm fields measured from the sheet's centre lines (ISO 5457). An A4 or Letter sheet has rows A to D and columns 1 to 6, so a review can say "Q1 in B3".
File > Export > Scope image opens the same Export window on its Scope image page: PNG or SVG at the width and height you pick, with the scope's plots stacked as the scope shows them (voltages and currents each on their own range, scope.export {"axes": [...]}). The preview is drawn at the size it is shown, so its traces and labels stay readable. File > Export lists the same items, in the same order and under the same names, as the window's left column; a greyed item says why when you point at it.
All three formats use the same drawing data as the canvas, so the file matches what you see. The paths are always checked against the folder you allow (--root on the command line). Without an allowed folder the command writes nothing.
The tex output was checked against the thesis package's conventions and by unit tests, but it has not been typeset on a machine with LaTeX. Compile your first figure and look at it. Parts that the package has no symbol for appear as boxes, and the reply lists their names under unsupported. The details are in docs/workflows/schematic-export.md, which arrives with this feature.

