There are a few commands which can be performed after measurement, which will run whether or not any measurements are actually made.
The script can be used for additional processing or testing of whatever sort. If the script returns 1, the current simulation will pause immediately (no waiting for other measures) however a calling analysis, such as Monto Carlo, will continue. If 2 is returned, this indicates a fatal global error and any calling analysis will be stopped too. Any other return value allows the run to continue normally.
When a .measure is included in an iterative analysis (Monte Carlo, loop, etc.), data are saved as follows. Before each iteration, the previous result vector and its scale are saved to the end of a ``history'' vector and scale, and are then deleted. The result vector and scale are recreated when the measurement is completed during the iteration. Thus, at the end of the analysis, for a measurement named ``example'', one would have the following vectors:
|example||the result from the final trial|
|example_scale||the measurement interval or point in the last trial|
|example_hist||results from the prior trials|
|example_hist_scale||intervals from the prior trials|
Thus, during each trial, the result vector will have the same properties as in a standard run. It can be used in the .control block of a Monte Carlo or operating range file (recall that $?vector can be used to query existence, and that if there is no checkPNTS vector defined, the .control block is called once at the end of each trial).
Multiple .measure lines can be ``chained'' in the following manner. The vector name following the from, to, trig, or targ keywords can be the name of another measure. In this case, the effective start time is the measure time of the referenced measure. The measure time is the end of the interval or the measure point. The td, rise, and other keywords can be used in the referencing measure. The td will be added to the imported time, and the other keywords operate in the normal way. If there are no keywords other than td specified, the time is the delay time plus the imported time.
.measure tran t1 trig v(5) val=.4m rise=3
.measure tran t2 trig v(5) val=.4m rise=4
.measure tran pw trig t1 td=20p targ t2 td=20p pw v(5) max v(5)
In this case, the measures t1 and t2 ``frame'' a period of an (assumed) repeating signal v(5). Note that no actual measurement is performed for these lines. Their purpose is to be referenced in the third line, which takes as its interval the t1-t2 interval delayed by 20 pS, and measures the pulse width and peak value.