Cicode Programming Reference > Cicode Function Categories > Trend Functions Introduction > TrnComparePlot

TrnComparePlot

Prints two trends, one overlaid on the other. Each trend can have up to four tags configured on it. The significance of this type of plot is that the two trends show different times and display periods. It is possible to compare a trend tag or tags over different time slots. Each trend line is drawn with a different pen style and marker as appropriate. The trend plot includes a comment and a legend, and you can specify the vertical high and low scales.

For more advanced trend plotting, you can use the low-level plot functions.

Syntax

TrnComparePlot(sPort, sTitle, sComment, AN, iMode, nSamples, iTime1, rPeriod1, iTime2, rPeriod2, Tag1......Tag8, rLoScale1, rHiScale1,......rLoScale8, rHiScale8)

sPort:

The name of the printer port to which the plot will be printed. This name needs to be enclosed within quotation marks. For example LPT1:, to print to the local printer, or \\Pserver\canon1 using UNC to print to a network printer.

sTitle:

The title of the trend plot.

sComment:

The comment that is to display beneath the title of the trend plot. You do not have to enter a comment.

AN:

Sets the display mode. A value of 0 causes the default display mode to be used. Otherwise, the display mode of the specified AN is set.

iMode:

The color mode of the printer.

0 - black and white (default)

1 - Color

nSamples:

The number of data points on the plot.

iTime1:

The end point in time (the most recent point) for the first trend.

rPeriod1:

The period (in seconds) of the first trend. This can differ from the actual trend period. If you do not enter a period, it defaults to the sample period of Tag1.

iTime2:

The end point in time (the most recent point) for the second trend.

rPeriod2:

The period (in seconds) of the second trend. This can differ from the actual trend period. If you do not enter a period, it defaults to the sample period of Tag5.

Tag1. . .Tag8:

The trend tags for the plot. Tags 1 to 4 needs to be for the first trend, and tags 5 to 8 needs to be for the second.

rLoScale1, HiScale1,....LoScale8, HiScale8


The minimum and maximum on the vertical scale for the trend line of each of the tags (Tag1. . . Tag8)

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

TrnPlot, TrnPrint, PlotOpen SPCPlot

Example

/* Prints two black and white trends (one overlaid on the other) 
to LPT1, comparing the trend lines of one trend tag (Feed_Flow) at 
different times. The first trend line has a starting time of 
12 noon, on 11/12/96, and the second has a starting time of 9am, on 
11/10/96. Both contain 200 sample points, and have a period of 2 
seconds. Both trend lines will be on a vertical scale of 10-100. 
*/
INT Time;
INT RefTime;
Time = StrToDate("11/12/96") + StrToTime("12:00:00");
RefTime = StrToDate("11/10/96") + StrToTime("09:00:00");
TrnComparePlot("LPT1:","Citect Flow Comparison Plot","Comparison with Reference",0, 0,200,Time,2,RefTime,2,"Feed_Flow","","","","Feed_Flow","","","", 10,100,0,0,0,0,0,0,10,100);

See Also

Trend Functions