- Terminology and typography
- PS2APWIN user dialog
- PSpice setup
- Reading the PSpice file
- Using PS2APWIN
- Related files
- Hardware requirements
- Program errors
IntroductionPS2APWIN is an APWIN macro that extracts AC, DC, Noise, Transient, Monte Carlo or Worst Case data for up to 6 variables from the .PRINT listing in a PSpice output file. This data can then be imported into APWIN memory, allowing you to use simulation data as a reference for measurements or as data for limit files.
The use of PS2APWIN assumes that you are familiar with the operation of APWIN and PSPice.
LicenseThe use of the PS2APWIN utility programs is subject to Poul Petersen's Software license agreement.
Terminology and typographyThis style is used for filenames and for output examples from the programs.
A "meter" is one of the APWIN meter selections Source 1, Source 2 and Data 1 to Data 6. "Meter" can also refer to the data measured by the meter.
A "trace" is the data resulting from a single sweep with one source variable, for example an amplitude versus frequency sweep from 20 Hz to 20 KHz. A meter can contain several traces.
A nested sweep is data resulting from a sweep with two source variables, for example an amplitude versus frequency sweep from 20 Hz to 20 KHz versus generator amplitude from 1 mV to 1 V. A nested sweep contains several traces, all with the same X-axis values.
Nested sweep data refers to the traces beyond the 1st. trace resulting from a nested sweep.
An appended sweep is data resulting from a number of sweeps with one source variable. An appended sweep contains several traces, that may have different X-axis values. Appended sweep data refers to the traces beyond the 1st. trace.
InstallationCopy the files to a directory on your harddisk. This can be a separate directory, or the directory where you have your other APWIN macros. If you decide to include PS2APWIN in your Quick Launch list, note that APWIN will change the Working directory to the directory where PS2APWIN is located each time you run it.
To uninstall PS2APWIN, just delete its files.
PS2APWIN user dialog
The upper box shows the PSpice output file currently loaded into PS2APWIN.
The "Select PSpice data traces to load into APWIN" box is where you select which traces to load into APWIN.
"Source 1" is a list of the available simulation sections in the PSpice file. This can be AC, DC or TRAN.
"Data 1" to "Data 6" allows selection of which traces go into which meters in APWIN. It is important that these traces are selected in such a way so that they can be displayed by APWIN. You must select a trace for "Data 1" or "Data 2" to be able to use the "Data 3" to "Data 6" fields, and you must ensure that the proper selections are made for "Data 1" and "Data 2" so you have a valid Y-axis for "Data 3" to "Data 6". PS2APWIN does not check this, so if you make the wrong selections you will get useless data in APWIN.
The "Conversion options" box :
"Create appended sweeps from multiple runs" checkbox :
If this box is marked, all data traces in the PSpice file with the same node name and same X-data points will be loaded into the same APWIN meter as appended sweeps. In the above example, there are 16 traces for VDB(2), so this selection will load a total of 16 PSpice simulation traces (3280 data points) into APWIN.
"Unfold phase data traces" checkbox :
This option will unfold phase data traces from PSpice before loading them into APWIN. If the difference between 2 adjacent phase values exceeds 270 deg, an offset of (n*) ±360 deg. is added to the following data points.
"Open File" will load a PSpice output file into PS2APWIN. While a file is loading, a line number counter is displayed in the upper box.
"Copy data to APWIN" will copy data selected into APWIN memory. While data is being copied, a message is shown in the upper box. There is no progress indicator, as the time to calculate a meaningful message will almost double the time for the copy function.
"Quit" exits PS2APWIN.
PSpice setupYou must include a .PRINT statement in the PSpice circuit file for the traces you want to be able to read with PS2APWIN. See ps2ap001.cir for an example.
Reading the PSpice filePS2APWIN reads the ASCII output file from PSpice by searching for:
_AC_ANALYSIS_TEMP_ : Initiates AC data block read in.
_DC_TRANSFER_CURVES_TEMP_ : Initiates DC data block read in.
_TRANSIENT_ANALYSIS_TEMP_ : Initiates TRAN data block read in.
"_" represents any number of "*" or " ".
First part of the read in is to search for subheaders (these are only used for display in dropdown boxes) :
_SENSITIVITY_, _WORST_CASE_, _MONTE_CARLO_
The following non blank line is interpreted as a list of trace names.
Depending on simulation type, different meters are selected in APWIN:
AC: Source 1 = Gen.Freq A, Data n =Anlr.Level A or Anlr.Phase.
DC: Source 1 = Dcx.DC Out 1, Data n = Dcx.DMM volts.
Tran: Source 1 = Time.External Sweep Time, Data n = Dcx.DMM volts.
AC trace names are divided into 3 groups depending on their name:
If the name contains "P(", the trace is read as phase data.
If the name contains "DB(", the trace is read as logarithmic voltage or current data.
Otherwise the trace is read as linear voltage or current data.
In PSpice, "DB(" can also mean Drain Body for a Mosfet device. PS2APWIN does not read the device list and will erroneously interpret this as a logarithmic voltage or current unit, so do not use it for AC simulation outputs to be read by PS2APWIN.
PS2APWIN reads the data values from the PSpice output files and transfers them to directly into APWIN (except for log/lin conversion if required), so current data are read as if it was voltage data (1A=1V).
The PSpice output files can have multiple AC, DC or TRAN sections, allowing you to import the simulated data from multiple circuits within the same file.
The number of traces for each of AC, DC and TRAN is limited to app. 1000.
Using PS2APWINThis example demonstrates how to use PS2APWIN for prototype development. The circuit is a 10th. order high pass filter, where the desired transfer function is simulated in PSpice, and is then transferred to APWIN for measurement on the prototype circuit. The circuit for the simulation is in the ps2ap002.cir file, and the magnitude and phase data resulting from the simulation is in ps2ap002.out.
In order to compare simulated and measured data, the data from ps2ap002.out must be transferred to APWIN and saved as a test. This test can then be used as a template for the measurement, or it can be used as a reference for a "Compute, Delta" calculation on the measured data. As this filter has a phase characteristic with more than 360 deg. phase response, the measurement must sweep from low to high frequency to obtain valid phase data.
Select: "File, Open, Procedure..": ps2apwin.apb
Select: "Procedure, Run".
In the PS2APWIN dialog:
Select: "Open File": ps2ap002.out, wait for the file to load.
Select: "Source 1": AC FREQ
Select: "Data 1": AC VDB(51) 405 pts
Select: "Data 2": AC VP(51) 405 pts
Select: "Unfold phase data traces"
Select: "Copy data to APWIN".
Select: "Quit" to exit PS2APWIN.
This has loaded magnitude and phase data with each 405 data points into APWIN memory in Data 1 and Data 2. The resulting test is ps2ap002.at1 which can be used as described above.
Another example on the use of PS2APWIN can be found in the Using APDEDIT section of the APDEDIT user's manual.
|ppaplib.apb||:||Some functions and routines required by PS2APWIN.|
|pputlib.apb||:||Some functions and routines required by PS2APWIN.|
|ps2apwin.cfg||:||Configuration file for PS2APWIN. This file is written by PS2APWIN and is located in the same directory as PS2APWIN.|
|ps2apwin.htm||:||User manual (this file) in HTML format.|
|ps2apwin.txt||:||User manual in ASCII format if you can not read HTML.|
|00000000.p2a||:||Temporary PS2APWIN file.|
|ps2ap002.cir||:||Example Spice circuit file.|
|ps2ap002.out||:||Example Spice output file.|
|ps2ap002.at1||:||Example APWIN file.|
|swlicens.htm||:||Software license agreement in HTML format.|
|swlicens.txt||:||Software license agreement in ASCII format.|
CompatibilityPS2APWIN has been tested with output files from:
- PSpice 5.2, MS-DOS 5.00.
- PSpice 8.0 Eval, Windows 95.
- PSpice 9.0 Eval, Windows 95.
- System One Demo mode.
- System Two Demo mode.
- System Two mode with hardware.
- System Two Cascade Demo mode.
- System Two Cascade in System Two Compatibility Demo mode.