Analysis - General
How can I import a waveform from one circuit into the analysis of another circuit?
There are three ways to do this.
The first method is to use the Waveform Buffer. The following example imports the output waveform, V(Out), of the circuit, WAVEOUT.CIR, into the analysis of the circuit, WAVEIN.CIR. Run WAVEOUT.CIR. Once the simulation is finished. Right click on the V(Out) waveform in the plot window. Select Add to Buffer from the menu that appears. Edit the Label field if desired. For this example, it will be left as V(Out) vs. T. Exit the analysis. Load the WAVEIN.CIR file and enter the appropriate analysis. Select Waveform Buffer from the Waveform Buffer section of the Scope menu. Highlight the V(Out) vs. T waveform from the WAVEOUT.CIR file that was just saved. Click on Add to Limits. Close the Waveform Buffer. Run the simulation and the V(Out) waveform from WAVEOUT.CIR will also be plotted in the run. You can edit the plot group that this waveform is in through the Analysis Limits dialog box.
The second method is to use the User file to import a waveform. We will assume the same two circuits as the first example. Run WAVEOUT.CIR. After the analysis is finished, go to the Properties dialog box of the plot. Click on the Save Curves tab. Highlight and enable the checkbox of the waveform to be saved in the Curves list. Change the name and file as desired. In this case we define the As (New Name) field as V(Out) and the In File field as WAVEOUT.USR. Click the Save command button. Close the dialog box and the WAVEOUT.CIR file. Load the WAVEIN.CIR file and enter the appropriate analysis. On a new waveform line in the analysis limits, right click in the Y Expression field. Go to Curve, then CurveY, then WAVEOUT.USR. Select the CurveY("WAVEOUT","V(Out)") option. Run the simulation and the waveform will appear along with any other plotted waveforms.
The third method is to use the Import operator. The Import operator can import a waveform from an output text file that has been created by Micro-Cap or by another SPICE program. We will assume the same two circuits as the other examples. The example will be done in transient analysis, but this procedure can be used in AC and DC analysis as well.
Load the file WAVEOUT.CIR. Go to the Analysis menu and click on Transient Analysis. The Transient Analysis Limits dialog box will appear. For each waveform, there is a set of icons for the waveform options. Click on the numeric output icon for the waveform V(Out). When enabled, this will write the results of the waveform into the numeric output file. Set the value in the Number of Points field. This value determines the number of data points that are to be written in the text file. The number of data points in the text file controls the accuracy of the imported waveform. Setting this field to 1001 should cover most waveforms. Run the analysis, and then click on the Transient menu and choose Numeric Output. This will load up the file, WAVEOUT.TNO, which is the numeric output file that was just created. In this file will be operating point information, and two columns of tabular data that represent time and V(Out). Go to the File menu and choose Save As. Save this file to a different name such as WAVEOUT.OUT. This doesn't have to be done, but it prevents the file from being overwritten if you run the transient analysis again. Load the file WAVEIN.CIR. Go to the Analysis menu and click on Transient Analysis. On a new waveform line, place the following into the Y Expression field:
The syntax of the Import operator is:
where f is the file name, and y is the waveform that is to be imported from the file f. The X expression must be T. Run the analysis, and the waveform V(Out) will be plotted along with any other waveforms that have been defined.
There are two other things that the user needs to be aware of in using the Import operator. First of all, the X expression for the Import operator is limited. For transient analysis, the X expression must be T. For AC analysis, the X expression must be F. For DC analysis, the X expression must be the voltage or current of the Variable 1 source being swept. Also, the waveform name in the Import operator must match exactly with the waveform header, and the parentheses must match.