Difference between revisions of "File format:Pwl"
Jump to navigation
Jump to search
(Created page with "{{Infobox file format | image = | id = pwl | name = Piecewise linear function | status = unsupported | extensions = '''.t...") |
|||
Line 17: | Line 17: | ||
== Format == | == Format == | ||
The file consists of multiple lines, where each line contains one time/value pair. The time values have to be in increasing order. | The file consists of multiple lines, where each line contains one time/value pair. 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 <tt>PWL file=…</tt> statement from the simulation. | The content in the file is then accessed with the <tt>PWL file=…</tt> statement from the simulation. | ||
Line 28: | Line 28: | ||
* [http://ltwiki.org/?title=Undocumented_LTspice#Piecewise_Linear_Sources_.28PWL.29 Additional information on LTwiki.] | * [http://ltwiki.org/?title=Undocumented_LTspice#Piecewise_Linear_Sources_.28PWL.29 Additional information on LTwiki.] | ||
LTspice recognizes CR (0x0D), LF (0x0A) and CR+LF as newline indicator.<br> | ==== Observations ==== | ||
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). | * LTspice recognizes CR (0x0D), LF (0x0A) and CR+LF as newline indicator.<br> | ||
* 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 ==== | |||
<gallery> | <gallery> | ||
File:Pwl ltspice example.png|<small>green: AM signal imported using the <tt>PWL file=…</tt> statement.<br>blue: Demodulated signal.</small> | File:Pwl ltspice example.png|<small>green: AM signal imported using the <tt>PWL file=…</tt> statement.<br>blue: Demodulated signal.</small> | ||
Line 36: | Line 38: | ||
File:Pwl ltspice time error.png|Error during the simulation if the timestamps are not increasing. | File:Pwl ltspice time error.png|Error during the simulation if the timestamps are not increasing. | ||
</gallery> | </gallery> | ||
== Resources == | |||
* [https://bitbucket.org/jenste/pwl-test Files used to test the LTspice implementation.] | |||
[[Category:File format]] |
Revision as of 18:11, 7 December 2014
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 lines, where each line contains one time/value pair. 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
- LTspice recognizes CR (0x0D), LF (0x0A) and CR+LF as newline indicator.
- 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).