File format:pwl

From sigrok
Revision as of 18:49, 7 December 2014 by Jst (talk | contribs)
Jump to navigation Jump to search
pwl
Pwl source.png
A voltage source using values from a PWL file.
Name Piecewise linear function
Status unsupported
Common extension(s) .txt
ASCII format yes
Compression none

pwl is a file format that can be used to define the signal of voltage/current sources in a SPICE simulation.

Format

The file consists of multiple time/value pairs. The individual values are separated by whitespace, therefore all values can be in one long line, or on multiple lines (much more convenient). The time values have to be in increasing order. SI prefixes are supported for both the time and the value.

The content in the file is then accessed with the PWL file=… statement from the simulation.

PWL in different SPICE implementations

LTspice

Observations

  • A space (0x20) or different newline indicators (CR (0x0D), LF (0x0A) and CR+LF) can be used to separate the times/values.
  • When editing the properties of a voltage/current source in the LTspice editor and choosing the PWL file, the "Open File" dialog uses "ASCII File (*.txt)" as the default filter (but the simulation can use every other file extension too).

Screenshots

Resources